code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
module HERMIT.Set.Life where
import Data.Set as Set
import Data.List as List (nub,(\\))
import Life.Types
-- Standard implementation
type Board = LifeBoard Config [Pos]
-- The new data structure to be used in the implementation
type Board' = LifeBoard Config (Set Pos)
-- Transformations required by hermit for work... | ku-fpg/better-life | HERMIT/Set/Life.hs | Haskell | bsd-2-clause | 2,793 |
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | Computations in logarithmic scale.
module NLP.Nerf2.LogReal
( LogReal
, fromLogReal
, logToLogReal
, logFromLogReal
) where
import Prelude hiding (sum, product)
import Data.Vector.Generic.Base
import Data.Vector.Generic.Mutabl... | kawu/nerf-proto | src/NLP/Nerf2/LogReal.hs | Haskell | bsd-2-clause | 2,300 |
-----------------------------------------------------------------------------
-- |
-- Module : ByteFields
-- Copyright : (c) Conrad Parker 2006
-- License : BSD-style
--
-- Maintainer : conradp@cse.unsw.edu.au
-- Stability : experimental
-- Portability : portable
--
-- Utilities for handling byte-a... | kfish/hogg | Codec/Container/Ogg/ByteFields.hs | Haskell | bsd-3-clause | 2,417 |
{-# LANGUAGE CPP #-}
{- Copyright (c) 2008 David Roundy
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditi... | droundy/franchise | Distribution/Franchise/Buildable.hs | Haskell | bsd-3-clause | 26,012 |
-- | Defines various function in the context of user interaction,
-- most importantly the verbosity settings and logging mechanism
module Language.Java.Paragon.Interaction
(setVerbosity, getVerbosity, verbosePrint,
--enableXmlOutput, getXmlOutput, -- Not used right now
setCheckNull, checkNull,
normal... | bvdelft/parac2 | src/Language/Java/Paragon/Interaction.hs | Haskell | bsd-3-clause | 4,416 |
module Sexy.Instances.Cons () where
import Sexy.Instances.Cons.List ()
| DanBurton/sexy | src/Sexy/Instances/Cons.hs | Haskell | bsd-3-clause | 72 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Duration.FR.Rules
( rules ) where
i... | facebookincubator/duckling | Duckling/Duration/FR/Rules.hs | Haskell | bsd-3-clause | 2,562 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Main where
import Control.Monad.Trans.Either (EitherT)
import Network.Wai (Application)
import Network.Wai.Handler.Warp (run)
import Network.Wai.Middleware.RequestLogger (logStdoutDev)
import Servant
( (:>), Get, Capture, JSON, Proxy(..), ServantErr... | zekna/toy-haskell | echo.hs | Haskell | bsd-3-clause | 683 |
{-# LANGUAGE OverloadedStrings #-}
module Xlsx.SimpleSpec (main, spec) where
import Test.Hspec
import Xlsx.Simple
import Codec.Xlsx
import Xlsx.Simple.Internal
import Codec.Xlsx.Writer
import Data.Time
import Data.Time.LocalTime
import Control.Applicative
testFileName = "testD.xlsx"
testSheetName = "testSheet"
t... | plow-technologies/xlsx-simple | test/Xlsx/SimpleSpec.hs | Haskell | bsd-3-clause | 4,502 |
module WhileAS where
type VarIdent = String
type Label = Int
-- type Selector = String
type Prog = Stat
-- type Prog = Prog [Dec] [Stat]
-- Contains name, a list of input vars, output var, body respectively and of course
-- the two labels ln and lx
data Dec = Proc [VarIdent] VarIdent VarIdent Label Stat Label
... | FranklinChen/hugs98-plus-Sep2006 | packages/parsec/examples/while/WhileAS.hs | Haskell | bsd-3-clause | 871 |
{-# LANGUAGE TemplateHaskell, TypeOperators #-}
-- | For more information: http://www.ietf.org/rfc/rfc2109.txt
module Network.Protocol.Cookie {- todo: test please -}
(
-- * Cookie datatype.
Cookie (Cookie)
, empty
, cookie
, setCookie
-- * Accessing cookies.
, name
, value
, comment
, commentURL
, discard
, domain
... | sebastiaanvisser/salvia-protocol | src/Network/Protocol/Cookie.hs | Haskell | bsd-3-clause | 6,411 |
module MonadLoopsExample where
import Control.Monad (liftM)
import Control.Monad.Loops (whileM_, unfoldM)
-- | Print prompt and read lines with retry prompts until the password
-- is correctly entered, then print congratulations.
logIn :: IO ()
logIn = do
putStrLn "% Enter password:"
go
putStrLn "$ Congratulati... | FranklinChen/twenty-four-days2015-of-hackage | src/MonadLoopsExample.hs | Haskell | bsd-3-clause | 2,428 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE DataKinds #-}
module Lib where
import Types
import Network.Label
import Text.Read as T
import System.FilePath.Posix
import Numeric
import Data.List
divs :: Integral a => a -> a -> Bool
a `divs` b = b `mod` a == 0
count :: (a -> Bool) -> [a] -> Int
count p = length . filter... | jonascarpay/visor | src/Lib.hs | Haskell | bsd-3-clause | 1,638 |
-- | Accessors (lenses and functions) to operate on the 'PostFiltset' of a
-- clatch-like type.
module Penny.Clatch.Access.PostFiltset where
import Control.Lens (Lens', _2, _1)
import Penny.Clatch.Types
-- | Operate on the 'PostFiltset'.
--
-- @
-- 'postFiltset' :: 'Lens'' 'Clatch' 'PostFiltset'
-- @
postFiltset :: ... | massysett/penny | penny/lib/Penny/Clatch/Access/PostFiltset.hs | Haskell | bsd-3-clause | 433 |
-- | A pure implementation of the emulator
{-# LANGUAGE GeneralizedNewtypeDeriving, Rank2Types #-}
module Emulator.Monad.ST
( STEmulator
, runSTEmulator
) where
import Control.Monad.Reader (ReaderT, ask, runReaderT)
import Control.Monad.ST (ST, runST)
import Control.Monad.Trans (lift)
import Emulator.Mona... | jaspervdj/dcpu16-hs | src/Emulator/Monad/ST.hs | Haskell | bsd-3-clause | 1,033 |
{-# language CPP #-}
-- | = Name
--
-- VK_KHR_swapchain - device extension
--
-- == VK_KHR_swapchain
--
-- [__Name String__]
-- @VK_KHR_swapchain@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 2
--
-- [__Revision__]
-- 70
--
-- [__Extension and Version Depende... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_KHR_swapchain.hs | Haskell | bsd-3-clause | 179,999 |
module Text.Highlighter.Lexers.Boo (lexer) where
import Text.Regex.PCRE.Light
import Text.Highlighter.Types
lexer :: Lexer
lexer = Lexer
{ lName = "Boo"
, lAliases = ["boo"]
, lExtensions = [".boo"]
, lMimetypes = ["text/x-boo"]
, lStart = root'
, lFlags = [multiline]
}
comment' :: TokenM... | chemist/highlighter | src/Text/Highlighter/Lexers/Boo.hs | Haskell | bsd-3-clause | 3,659 |
{-# LANGUAGE ForeignFunctionInterface #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Elem.LAPACK.Double
-- Copyright : Copyright (c) , Patrick Perry <patperry@stanford.edu>
-- License : BSD3
-- Maintainer : Patrick Perry <patperry@stanford.edu>
-- Stabili... | patperry/lapack | lib/Data/Elem/LAPACK/Double.hs | Haskell | bsd-3-clause | 1,270 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
--
-- Copyright (c) 200... | emwap/feldspar-language | src/Feldspar/Core/Constructs/Integral.hs | Haskell | bsd-3-clause | 7,822 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE Rank2Types #-}
module Hmlk.DataSet where
import Debug.Trace
import Data.IntMap (IntMap, fromList, elems, size, toList)
import Data.Monoid
import Data.MultiSet (findMax, insert, empty)
import Data.List (maximumBy, elemIndex)
import Data.Function (on)
import Control.Lens hi... | rednum/hmlk | Hmlk/DataSet.hs | Haskell | bsd-3-clause | 4,739 |
{-# LANGUAGE CPP, ScopedTypeVariables, MagicHash, UnboxedTuples #-}
-----------------------------------------------------------------------------
--
-- GHC Interactive support for inspecting arbitrary closures at runtime
--
-- Pepe Iborra (supported by Google SoC) 2006
--
----------------------------------------------... | spacekitteh/smcghc | compiler/ghci/RtClosureInspect.hs | Haskell | bsd-3-clause | 52,399 |
module Math.Misc.Parity where
import Prelude hiding (fromIntegral)
import Math.Algebra.Monoid
import Math.Algebra.AbelianMonoid
import Data.List
import Data.Hashable
data Parity = Odd | Even
deriving (Eq, Show)
instance Hashable Parity where
hash Even = 0
hash Odd = 1
opposite :: Parity -> Par... | michiexile/hplex | pershom/src/Math/Misc/Parity.hs | Haskell | bsd-3-clause | 949 |
----------------------------------------------------------------------------
-- |
-- Module : ModuleWithoutImportList
-- Copyright : (c) Sergey Vinokurov 2016
-- License : BSD3-style (see LICENSE)
-- Maintainer : serg.foo@gmail.com
-- Created : Thursday, 20 October 2016
----------------------------... | sergv/tags-server | test-data/0006export_pattern_with_type_ghc8.0/ModuleWithoutImportList.hs | Haskell | bsd-3-clause | 440 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
module ML.Vec where
import ML.Nat
import Control.Applicative ((<$>))
data Vec (n :: Nat) (a :: *) where
Nil :: Vec Z a
(:-) :: a -> Vec n a -> Vec (S n) a
instance Functor (Vec n) where
... | ralphmorton/ml | src/ML/Vec.hs | Haskell | bsd-3-clause | 1,319 |
module Data.Torrent.Types
( BEncodedT(..)
, mkBString
, beList
, beDictUTF8L
, beDictUTF8
, beDict
, beDictLookup
, parseBencoded
, ClientHandshake(..)
, parseClientHandshake
, randomPeerId
, PeerMessage(..)
, parseW8RunLength
... | alios/lcars2 | Data/Torrent/Types.hs | Haskell | bsd-3-clause | 8,746 |
module YampaSDL where
import Data.IORef
import FRP.Yampa as Yampa
import Graphics.UI.SDL as SDL
type TimeRef = IORef Int
yampaSDLTimeInit :: IO TimeRef
yampaSDLTimeInit = do
timeRef <- newIORef (0 :: Int)
_ <- yampaSDLTimeSense timeRef
_ <- yampaSDLTimeSense timeRef
_ <- yampaSDLTimeS... | ivanperez-keera/Yampa | yampa/examples/yampa-game/YampaSDL.hs | Haskell | bsd-3-clause | 907 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE EmptyDataDecls #-}
-- TODO: This is a hot-spot for generating user-unfriendly error messages. It
... | spinda/liquidhaskell | src/Language/Haskell/Liquid/Spec/CoreToLogic.hs | Haskell | bsd-3-clause | 13,772 |
{-
let s = "s"
createSparkSessionDef $ defaultConf { confRequestedSessionName = Data.Text.pack s }
execStateDef (checkDataStamps [HdfsPath (Data.Text.pack "/tmp/")])
-}
module Spark.IO.StampSpec where
import Test.Hspec
-- import Spark.Core.Context
-- import Spark.Core.Types
-- import Spark.Core.Row
-- import Spar... | krapsh/kraps-haskell | test-integration/Spark/IO/StampSpec.hs | Haskell | apache-2.0 | 600 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
-- | Provides functions for manipulating parts.
module Music.Score.Part (
-- ** Articulation type functions
Part,
SetPart,
-- ** Accessing parts
H... | music-suite/music-score | src/Music/Score/Part.hs | Haskell | bsd-3-clause | 9,902 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANG... | AndreasPK/stack | src/Stack/Fetch.hs | Haskell | bsd-3-clause | 31,472 |
{-# LANGUAGE CPP, QuasiQuotes, TemplateHaskell, TypeFamilies #-}
module Settings.StaticFiles where
import Yesod.Static
import qualified Yesod.Static as Static
static :: FilePath -> IO Static
#ifdef PRODUCTION
static = Static.static
#else
static = Static.staticDevel
#endif
-- | This generates easy references to file... | samstokes/yesodoro | Settings/StaticFiles.hs | Haskell | bsd-2-clause | 644 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module T15437A where
import Language.Haskell.TH.Syntax (Q, TExp)
get :: forall a. Int
get = 1
foo :: forall a. Q (TExp Int)
foo = [|| get @a ||]
| sdiehl/ghc | testsuite/tests/th/T15437A.hs | Haskell | bsd-3-clause | 252 |
{-
Copyright 2016 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | nomeata/codeworld | codeworld-server/Setup.hs | Haskell | apache-2.0 | 657 |
{-# LANGUAGE QuasiQuotes #-}
module Lib where
import QQ
val = [myq|hello|]
| themoritz/cabal | cabal-testsuite/PackageTests/QuasiQuotes/vanilla/Lib.hs | Haskell | bsd-3-clause | 77 |
{-# LANGUAGE RankNTypes #-}
module Rx.Scheduler.SingleThread where
import Control.Monad (join, forever)
import Control.Concurrent (ThreadId, forkIO, forkOS, killThread, threadDelay, yield)
import Control.Concurrent.STM (atomically)
import qualified Control.Concurrent.STM.TChan as TChan
import Tiempo (toMicroSeconds)
... | roman/Haskell-Reactive-Extensions | rx-scheduler/src/Rx/Scheduler/SingleThread.hs | Haskell | mit | 2,507 |
-- Arithmetic List!
-- http://www.codewars.com/kata/541da001259d9ca85d000688
module SeqList where
seqlist :: Int -> Int -> Int -> [Int]
seqlist f c l = take l [f, f+c ..]
| gafiatulin/codewars | src/7 kyu/SeqList.hs | Haskell | mit | 173 |
module Web.Twitter.LtxBot.Types where
import Control.Monad.Reader (ReaderT)
import Network.HTTP.Conduit (Manager)
import Web.Twitter.Conduit (TWInfo)
import Web.Twitter.Types (UserId)
data LtxbotEnv = LtxbotEnv { envUserId :: UserId
, envTwInfo :: TWInfo
, envMana... | passy/ltxbot | src/Web/Twitter/LtxBot/Types.hs | Haskell | mit | 372 |
{-# LANGUAGE FlexibleInstances #-}
{-|
Module : Hate.Math
Description : Hate mathematical utilities
License : MIT
Maintainer : bananu7@o2.pl
Stability : provisional
Portability : full
This module mostly works with primitives from @Data.Vect@,
adding some utilities useful in rendering and OpenGL... | maque/Hate | src/Hate/Math.hs | Haskell | mit | 580 |
module ParserSpec where
import Test.Hspec
import Control.Arrow (left)
import Text.ParserCombinators.Parsec (Parser)
import Parser
import VM
spec :: Spec
spec = describe "instructionsParser" $ do
context "with normalInstructionsString" $
it "parses" $
parseTest instruct... | taiki45/hs-vm | test/ParserSpec.hs | Haskell | mit | 1,209 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.Notification (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.Notification
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.Generat... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/Notification.hs | Haskell | mit | 349 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Risk where
import Control.Monad.Random
import Control.Monad
import Data.List (sort)
------------------------------------------------------------
-- Die values
newtype DieValue = DV { unDV :: Int }
deriving (Eq, Ord, Show, Num)
first :: (a -> b) -> (a, c) -> (b,... | tomwadeson/cis194 | week12/Risk.hs | Haskell | mit | 2,137 |
{-# LANGUAGE Strict #-}
{-# LANGUAGE RecordWildCards #-}
module WordEmbedding.HasText.Internal.Strict.Model
( binaryLogistic
, computeHidden
, getmWI
) where
import Control.Monad.Reader
import Control.Concurrent
import qualified Data.Text as T
import ... | Nnwww/hastext | src/WordEmbedding/HasText/Internal/Strict/Model.hs | Haskell | mit | 2,464 |
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-}
module HCraft.World.Camera
( module HCraft.World.Camera.Camera
, updateCamera
, getCameraVolume
) where
import Control.Applicative
import Control.Monad
import Control.Monad.Error
import Control.Monad.Reader
import Data.Bits
import Data.List
import Graphics.UI.GL... | nandor/hcraft | HCraft/World/Camera.hs | Haskell | mit | 4,295 |
module Main where
import Test.DocTest
import System.Process
main :: IO ()
main = do
files <- lines <$> readProcess "find" ["src", "-type", "f", "-name", "*.hs"] []
doctest $ [] ++ files
| namikingsoft/nlp100knock | test/DocTest.hs | Haskell | mit | 192 |
data Fruit = Apple | Orange
apple :: String
apple = "apple"
orange :: String
orange = "orange"
whichFrucit :: String -> Fruit
--whichFrucit f = case f of
-- apple -> Apple
-- orange -> Orange
--
--whichFrucit apple = Apple
--whichFrucit orange = Orange
whichFrucit "apple" = Appl... | EricYT/real-world | src/chapter-3/BogusPattern.hs | Haskell | apache-2.0 | 352 |
-- This is the main configuration file for Propellor, and is used to build
-- the propellor program.
import Propellor
import Propellor.CmdLine
import Propellor.Property.Scheduled
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Network ... | sjfloat/propellor | config-simple.hs | Haskell | bsd-2-clause | 1,630 |
{-# LANGUAGE DeriveDataTypeable #-}
module HEP.Parser.StdHep.ProgType where
import System.Console.CmdArgs
data HsStdHep = Test
deriving (Show,Data,Typeable)
test :: HsStdHep
test = Test
mode = modes [test]
| wavewave/HsStdHep | lib/HEP/Parser/StdHep/ProgType.hs | Haskell | bsd-2-clause | 229 |
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
module Propellor.Types.Core where
import Propellor.Types.Info
import Propellor.Types.OS
import Propellor.Types.Result
import Data.Monoid
import "mtl" Control.Monad.RWS.St... | ArchiveTeam/glowing-computing-machine | src/Propellor/Types/Core.hs | Haskell | bsd-2-clause | 3,285 |
{-# LANGUAGE DeriveGeneric #-}
module App.Roster.Types (
TeamRoster(..)
, current
, next
, addPersonToRoster
, increaseRosterIndex
, decreaseRosterIndex
, replaceInCurrent
, replaceInNext) where
import App.Roster.RosterGeneration (genera... | afcastano/cafe-duty | src/App/Roster/Types.hs | Haskell | bsd-3-clause | 6,268 |
{-# LANGUAGE TemplateHaskell #-}
import Data.Angle
import Debug.Trace
import Lib
import Object
(Point(..), Vector(..), Ray(..), march, distanceFrom', Form(..))
import qualified Params
import qualified System.Random as Random
import Test.QuickCheck (quickCheck, quickCheckAll, (==>))
import qualified Test.QuickCh... | lobachevzky/pathtracer | test/Spec.hs | Haskell | bsd-3-clause | 6,754 |
module Sexy.Classes.Functor (Functor(..)) where
class Functor f where
(<$>) :: (a -> b) -> f a -> f b
(<$) :: a -> f b -> f a
a <$ fb = (\_ -> a) <$> fb
| DanBurton/sexy | src/Sexy/Classes/Functor.hs | Haskell | bsd-3-clause | 161 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE GADTs #-}
module GDAL.Plugin.Compiler (
CompilerConfig (..)
, Compiler
, Result (..)
, startCompilerWith
, startCompiler
, stopCompiler
, compile
--... | meteogrid/gdal-plugin-hs | src/GDAL/Plugin/Compiler.hs | Haskell | bsd-3-clause | 7,293 |
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Main where
import Control.Applicative hiding (empty)
import Control.Monad.Reader
-- import Data.Generics.PlateData
import System.Console.CmdArgs
import System.Environment
import System.IO
import Text.Keepalived
main :: IO ()
main = do
n <- getPro... | maoe/kc | Kc.hs | Haskell | bsd-3-clause | 4,460 |
module HVX.Internal.Matrix
( Mat
, allMat
, anyMat
, diagMat
, ei
, fpequalsMat
, lpnorm
, matrixPow
, reduceMat
, scalarMat
, zeroMat
, zeroVec
) where
import Numeric.LinearAlgebra
import HVX.Internal.Util
type Mat = Matrix Double
allMat :: (Double -> Bool) -> Mat -> Bool
allMat f x = all... | chrisnc/hvx | src/HVX/Internal/Matrix.hs | Haskell | bsd-3-clause | 1,333 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-|
Module : Stack.Sig.Sign
Description : Signing Packages
Copyright : (c) FPComplete.com, 2015
License : BSD3
Maintainer : Tim Dysinger <tim@fpco... | martin-kolinek/stack | src/Stack/Sig/Sign.hs | Haskell | bsd-3-clause | 4,811 |
{-# LANGUAGE OverloadedStrings #-}
import RSSBuffer
import Database.Redis -- hedis
import Network.Curl.Download -- download-curl, sudo apt-get libcurl4-openssl-dev
import Text.XML.Light -- xml
import qualified Data.List as L
import Control.Monad.IO.Class
import Data.Maybe
import Data.Monoid
import Debug.Trace
import... | mxswd/rss-buffer | job.hs | Haskell | bsd-3-clause | 2,294 |
module Ghazan(
module Ghazan.Area
, module Ghazan.Length
, module Ghazan.Liquid
, module Ghazan.Numerics
, module Ghazan.Speed
, module Ghazan.Temperature
, module Ghazan.Volume
, module Ghazan.Weight
, module Ghazan.Time
) where
-- Source Imports
import Ghazan.Area
import Ghazan... | Cortlandd/ConversionFormulas | src/Ghazan.hs | Haskell | bsd-3-clause | 479 |
module Main
where
import Control.Concurrent (forkIO)
import Control.Concurrent.STM
import Control.Concurrent.STM.TVar
import Control.Monad.Trans (liftIO)
import Data.Time
import System.Environment (getArgs)
import System.Process.Monitor
main = do
args <- getArgs
putStrLn "Monitoring beginning..."
time <... | stormont/vg-process-monitor | DefaultIntervalMonitor.hs | Haskell | bsd-3-clause | 872 |
{-
(c) The GRASP Project, Glasgow University, 1994-1998
\section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
-}
{-# LANGUAGE CPP #-}
-- | This module is about types that can be defined in Haskell, but which
-- must be wired into the compiler nonetheless. C.f module TysPrim
module TysWiredIn (
... | urbanslug/ghc | compiler/prelude/TysWiredIn.hs | Haskell | bsd-3-clause | 34,151 |
module Compile.Types.AbstractAssembly where
import Compile.Types.Ops
data AAsm = AAsm {aAssign :: [ALoc]
,aOp :: Op
,aArgs :: [AVal]
}
| ACtrl COp AVal
| AComment String deriving Show
data AVal = ALoc ALoc
| AImm Int deriving Show... | maurer/15-411-Haskell-Base-Code | src/Compile/Types/AbstractAssembly.hs | Haskell | bsd-3-clause | 379 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Dimensions.AF
( allDimensions
) where
import Duckling.Dimensions.Types
allDimensions :: [Se... | facebookincubator/duckling | Duckling/Dimensions/AF.hs | Haskell | bsd-3-clause | 371 |
{-# LANGUAGE OverloadedStrings #-}
module Bead.View.Content.Assignment.View where
import Prelude hiding (min)
import Control.Arrow ((&&&))
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy.Char8 as BsLazy
import Data.Maybe (fromMaybe)
import Data.Monoid... | andorp/bead | src/Bead/View/Content/Assignment/View.hs | Haskell | bsd-3-clause | 32,216 |
{-#LANGUAGE OverloadedStrings#-}
{-
Project name: Merge XLS files
Min Zhang
Date: Oct 13, 2015
Version: v.0.1.0
README: Merge columns from excel files.
This program aims for more general file merging situations.
However, for the time being, only merge files with exact same first column (row names), ha... | Min-/fourseq | src/utils/MergeXls.hs | Haskell | bsd-3-clause | 3,324 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, DeriveFunctor #-}
{-| TT is the core language of Idris. The language has:
* Full dependent types
* A hierarchy of universes, with cumulativity: Type : Type1, Type1 : Type2, ...
* Pattern matching letrec binding
* (primitive types defined exter... | andyarvanitis/Idris-dev | src/Idris/Core/TT.hs | Haskell | bsd-3-clause | 54,225 |
-- | Simple but usefull functions, those match no specific module.
module Youtan.Utils where
-- | Applies a function while the condition are met.
while :: ( a -> a -> Bool ) -> ( a -> a ) -> a -> a
while con f v = let step x y = if x `con` y then step ( f x ) x else x
in step ( f v ) v
| triplepointfive/Youtan | src/Youtan/Utils.hs | Haskell | bsd-3-clause | 304 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
modu... | isovector/category-theory | src/Functor.hs | Haskell | bsd-3-clause | 2,249 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
This module defines interface types and binders
-}
{-# LANGUAGE CPP, FlexibleInstances, BangPatterns #-}
{-# LANGUAGE MultiWayIf #-}
-- FlexibleInstances for Binary (DefMethSpec IfaceType)
module IfaceType (
... | ezyang/ghc | compiler/iface/IfaceType.hs | Haskell | bsd-3-clause | 54,462 |
module Lab3 where
-----------------------------------------------------------------------------------------------------------------------------
-- LIST COMPREHENSIONS
------------------------------------------------------------------------------------------------------------------------------
-- =====================... | javier-alvarez/myhaskell | lab3.hs | Haskell | bsd-3-clause | 1,282 |
module Core.Pretty where
import Text.PrettyPrint
import Core.AST
import Core.Parser
prettyProgram :: CoreProgram -> String
prettyProgram = render . semiSep . map prettyDefn
semiSep :: [Doc] -> Doc
semiSep = vcat . punctuate semi
spaceSep :: [String] -> Doc
spaceSep = sep . map text
prettyDefn :: CoreDefn -> Doc
p... | WraithM/CoreCompiler | src/Core/Pretty.hs | Haskell | bsd-3-clause | 1,463 |
-- | Addable
------------------------------------------------------------------------------
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
module Constraint.Addable where
--------------------------------------------------------... | Conflagrationator/HMath | src/Constraint/Addable.hs | Haskell | bsd-3-clause | 1,356 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
module Games.Melee (
Melee (..),
PlayerState (..),
) where
import Lib
import Vector
im... | jonascarpay/visor | src/Games/Melee.hs | Haskell | bsd-3-clause | 5,931 |
{-# LANGUAGE DataKinds, NegativeLiterals #-}
module GibbsOptBucket where
import Data.Number.LogFloat hiding (product)
import Prelude hiding (product, exp, log, (**))
import Language.Hakaru.Runtime.LogFloatPrelude
import Language.Hakaru.Types.Sing
import qualified S... | zaxtax/naive_bayes | GibbsOptBucket.hs | Haskell | bsd-3-clause | 13,002 |
{-# LANGUAGE OverloadedStrings #-}
-- | Module : Network.MPD.Util
-- Copyright : (c) Ben Sinclair 2005-2009, Joachim Fasting 2010
-- License : MIT (see LICENSE)
-- Maintainer : Joachim Fasting <joachim.fasting@gmail.com>
-- Stability : alpha
--
-- Utilities.
module Network.MPD.Util (
parseDate, parseIs... | beni55/libmpd-haskell | src/Network/MPD/Util.hs | Haskell | mit | 4,001 |
module Spark.Core.ContextSpec where
import Test.Hspec
import Spark.Core.Functions
spec :: Spec
spec = do
describe "Basic routines to get something out" $ do
it "should print a node" $ do
let x = dataset ([1 ,2, 3, 4]::[Int])
x `shouldBe` x
-- b = nodeToBundle (untyped x) in
-- t... | krapsh/kraps-haskell | test/Spark/Core/ContextSpec.hs | Haskell | apache-2.0 | 366 |
{-# LANGUAGE TransformListComp #-}
oldest :: [Int] -> [String]
oldest tbl = [ "str"
| n <- tbl
, then id
]
| mpickering/ghc-exactprint | tests/examples/ghc710/TransformListComp.hs | Haskell | bsd-3-clause | 147 |
module Blockchain.Mining (
nonceIsValid'
) where
import Control.Monad.IO.Class
import Control.Monad.Trans.State
import qualified Data.Array.IO as A
import qualified Data.Binary as Bin
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Data.Word
import Blockchain.Context
imp... | jamshidh/ethereum-client-haskell | src/Blockchain/Mining.hs | Haskell | bsd-3-clause | 1,605 |
module Utils where
-- |
--
-- >>> split "foo bar baz"
-- ["foo","bar baz"]
-- >>> split "foo bar baz"
-- ["foo","bar baz"]
split :: String -> [String]
split xs = [ys, dropWhile isSpace zs]
where
isSpace = (== ' ')
(ys,zs) = break isSpace xs
-- |
--
-- >>> splitN 0 "foo bar baz"
-- ["foo","bar baz"]
--... | cabrera/ghc-mod | src/Utils.hs | Haskell | bsd-3-clause | 581 |
module Bead.Persistence.SQL.FileSystem where
import Control.Applicative ((<$>))
import Control.DeepSeq (deepseq)
import Control.Monad
import Control.Monad.IO.Class
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as BS
import ... | pgj/bead | src/Bead/Persistence/SQL/FileSystem.hs | Haskell | bsd-3-clause | 8,847 |
-- | Support for basic table drawing.
module Brick.Widgets.Table
(
-- * Types
Table
, ColumnAlignment(..)
, RowAlignment(..)
, TableException(..)
-- * Construction
, table
-- * Configuration
, alignLeft
, alignRight
, alignCenter
, alignTop
, alignMiddle
, alignBottom
, setColAlignme... | sjakobi/brick | src/Brick/Widgets/Table.hs | Haskell | bsd-3-clause | 8,997 |
-----------------------------------------------------------------------------
-- |
-- Module : Plugins.StdinReader
-- Copyright : (c) Andrea Rossato
-- License : BSD-style (see LICENSE)
--
-- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org>
-- Stability : unstable
-- Portability : unportable
--
-- A p... | dragosboca/xmobar | src/Plugins/StdinReader.hs | Haskell | bsd-3-clause | 1,286 |
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Mezzo.Compose.Harmony
-- Description : Harmony composition units
-- Copyright : (c) Dima Szamozvancev
-- License : MIT
--
-- Maintainer : ds709@cam.ac.uk... | DimaSamoz/mezzo | src/Mezzo/Compose/Harmony.hs | Haskell | mit | 5,690 |
module Mockups.Parsers.Element where
import Control.Applicative
import Data.Attoparsec.Char8
import Mockups.Elements.Element
import Mockups.Parsers.Common
import Mockups.Parsers.Img
import Mockups.Parsers.Txt
import Mockups.Parsers.Box
eltParser ... | ostapneko/tiny-mockups | src/main/Mockups/Parsers/Element.hs | Haskell | mit | 863 |
module Foundation where
import Import.NoFoundation
import Database.Persist.Sql (ConnectionPool, runSqlPool)
import Text.Hamlet (hamletFile)
import Text.Jasmine (minifym)
import Yesod.Auth.OAuth2.Github (oauth2Github)
import Yesod.Default.Util (addStaticContentExternal)
import Yesod.C... | ruHaskell/ruhaskell-yesod | Foundation.hs | Haskell | mit | 6,464 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Hacking | HackerRank/Mathematics/Probability/bdayGift.hs | Haskell | mit | 804 |
import Data.Char
import Data.List
digitize :: Int -> [Int]
digitize x = map digitToInt $ show x
palindrome :: Eq a => [a] -> Bool
palindrome xs = xs == (reverse xs)
numdrome :: Int -> Bool
numdrome = palindrome . digitize
list = [x |a <- [1..999], b <- [1..999], let x = a*b]
largestDrome = last $ sort $ filter nu... | johnprock/euler | p4.hs | Haskell | mit | 332 |
module Main where
import Data.ByteString.Char8 as C8 (ByteString(..),readFile,unpack)
import Data.List (intercalate)
import System.Console.GetOpt (OptDescr(..),ArgDescr(..),ArgOrder(..),getOpt,usageInfo)
import System.Environment (getArgs)
import System.Exit (ExitCode(..),exitSuccess,exitWith)
import Debug.Trace... | horia141/bachelor-thesis | dev/SeqAsm/Main.hs | Haskell | mit | 2,850 |
module GHCJS.DOM.CSSValueList (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/CSSValueList.hs | Haskell | mit | 42 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE
PatternGuards, MultiParamTypeClasses, FunctionalDependencies,
FlexibleContexts, FlexibleInstances, TypeSynonymInstances,
UndecidableInstances, OverloadedStrings, MultiWayIf #-}
module Basic.Eval
(run, runProg, Eval(..)
)where
import Basic.Doub hiding (D)
import Basic.AST... | dmringo/pure-basic | src/Basic/Eval.hs | Haskell | mit | 21,557 |
import Data.Maybe (Maybe (..))
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (path)
import Test.HUnit.Base (Assertion)
-- modules we will test
import M3U.Common ... | siddharthist/m3u-convert | test/Main.hs | Haskell | mit | 1,796 |
module Handler.Home where
import Data.Maybe (fromJust)
import Import
import qualified GitHub as GH
getHomeR :: Handler Html
getHomeR = maybeAuthId >>= homeHandler
_repository :: GH.Repository -> Widget
_repository repo = $(widgetFile "_repository")
homeHandler :: Maybe UserId -> Handler Html
homeHandler Nothing =
... | jspahrsummers/ScrumBut | Handler/Home.hs | Haskell | mit | 790 |
module Antiqua.Graphics.Colors(
module Antiqua.Graphics.Colors,
Color,
rgb,
dim,
mult,
mix
) where
import Antiqua.Graphics.Color
black :: Color
black = rgb 0 0 0
white :: Color
white = rgb 255 255 255
grey :: Color
grey = rgb 128 128 128
darkGrey :: Color
darkGrey = rgb 64 64 64
brown :: C... | olive/antiqua-prime | src/Antiqua/Graphics/Colors.hs | Haskell | mit | 614 |
module Sing2 where
fstString :: [Char] -> [Char]
fstString x = x ++ " river"
sndString :: [Char] -> [Char]
sndString x = x ++ " than a mile"
sing = if (x > y) then fstString x
else sndString y
where x = "Moon"
y = "wider"
| Numberartificial/workflow | haskell-first-principles/haskell-from-first-principles-master/05/05.08.08-fix-it-2.hs | Haskell | mit | 241 |
{-
Advent of Code: Day 1
Santa is trying to deliver presents in a large apartment building, but he can't find the right floor.
The directions he got are a little confusing. He starts on the ground floor (floor 0) and then follows the instructions
one character at a time.
An opening parenthesis, (, means he should g... | samueljackson92/advent-of-code | day1/day1.hs | Haskell | mit | 2,109 |
module Control.Process(
idP,
(<.>),
next,
recursively,
module Control.Process.Show,
module Control.Process.Update,
module Control.Process.Class
) where
import Control.Process.Show
import Control.Process.Update
import Control.Process.Class
import Types.Synonyms
import Types.TextlunkyCommand
import Types... | 5outh/textlunky | src/Control/Process.hs | Haskell | mit | 1,980 |
-----------------------------------------------------------------------
--
-- Haskell: The Craft of Functional Programming, 3e
-- Simon Thompson
-- (c) Addison-Wesley, 1996-2011.
--
-- PicturesSVG
--
-- The Pictures functionality implemented by translation
-- SVG (Scalable Vector Graphics)
--
-- T... | PavelClaudiuStefan/FMI | An_3_Semestru_1/ProgramareDeclarativa/Laboratoare/Laborator2/PicturesSVG.hs | Haskell | cc0-1.0 | 7,699 |
squaresList n = [i ^ 2 | i <- [1..n]]
pairsList x y = [(a, b) | a <- [1..x], b <- [10..y]]
-- nested two loop
concat xss = [x | xs <- xss, x <- xs]
-- loop with guard
evens n = [x | x <- [1..n], even x]
factors n = [x | x <- [1..n], n `mod` x == 0]
prime n = factors n == [1, n]
primes n = [x | x <- [1..n], prime ... | dongarerahul/edx-haskell | chapter4.hs | Haskell | apache-2.0 | 1,242 |
ans :: [Int] -> [String]
ans (x:y:xs) =
replicate x $ replicate y '#'
printRec :: [[String]] -> IO()
printRec [] = return ()
printRec (s:sx) = do
mapM_ putStrLn s
putStrLn ""
printRec sx
main = do
c <- getContents
let t = map (map read) $ map words $ lines c :: [[Int]]
i = takeWhile (/= [0,0]) t
... | a143753/AOJ | ITP1_5_A.hs | Haskell | apache-2.0 | 352 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-
BoardTest.hs
Copyright (c) 2014 by Sebastien Soudan.
Apache License Version 2.0, January 2004
-}
module BoardTest where
import Board
import Data.Maybe (isNothing)
import Test.QuickCheck (Arbitrary (..))
import Test.QuickCheck.G... | ssoudan/hsChess | test/BoardTest.hs | Haskell | apache-2.0 | 1,746 |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... | facebook/fbthrift | thrift/test/hs/Server.hs | Haskell | apache-2.0 | 2,531 |
-- |
-- Module : Statistics.Matrix.Mutable
-- Copyright : (c) 2014 Bryan O'Sullivan
-- License : BSD3
--
-- Basic mutable matrix operations.
module Statistics.Matrix.Mutable
(
MMatrix(..)
, MVector
, replicate
, thaw
, bounds
, unsafeFreeze
, unsafeRead
, unsafeWrite
, un... | fpco/statistics | Statistics/Matrix/Mutable.hs | Haskell | bsd-2-clause | 2,298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.