code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE OverloadedStrings, UnicodeSyntax, DataKinds, FlexibleContexts #-} -- | Various useful functions and type definitions. module Magicbane.Util where import RIO (MonadThrow, throwM, MonadIO, liftIO) import Control.Arrow import Control.Monad import Control.Error (hush) ...
myfreeweb/magicbane
library/Magicbane/Util.hs
unlicense
4,547
0
21
1,002
1,351
729
622
75
6
module Main where import Control.Monad import Data.Word import System.Environment import Crypto.GarbledCircuits import Crypto.GarbledCircuits.Util (word2Bits, bits2Word) import Example.Classifier main :: IO () main = do (port:args) <- getArgs let input = concat [ word2Bits (read w :: Word8) | w <- args ] ...
spaceships/garbled-circuits
examples/classifier/Garbler.hs
apache-2.0
436
0
14
77
152
80
72
13
1
module Parser where import Common (NamedObject (..)) import Creatures (Creature) import Items (Item) import Rooms (Room (..), RoomExit) import Data.Char (toLower) import Data.List (find) import Data.Maybe (catMaybes, fromJust) typ...
tr00per/adventure
src/main/haskell/Parser.hs
bsd-2-clause
1,788
0
10
589
607
313
294
40
5
module Zero.KeyFetchToken.State ( KeyFetchTokenState(..) ) where import Data.Maybe (Maybe) import Data.ByteString.Lazy (ByteString) import Zero.Token.Internal (Token) ------------------------------------------------------------------------------ type Payload = ByteString data KeyFetch...
et4te/zero
src-shared/Zero/KeyFetchToken/State.hs
bsd-3-clause
409
0
10
68
88
54
34
7
0
{-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Foundation where import Prelude import Blaze.ByteString.Builder.Char.Utf8 (fromText, fromString) import Control.Applicative ((<$>)) import Control.Monad import qualified Data.List as L import ...
SimSaladin/rnfssp
Foundation.hs
bsd-3-clause
9,339
4
15
2,397
2,054
1,093
961
-1
-1
module TranslationExtractor where import Text.XML.HXT.DOM.TypeDefs ( XmlTree, XNode(..) ) import Data.Tree.NTree.TypeDefs ( NTree(..) ) import Text.XML.HXT.DOM.QualifiedName ( localPart ) type XmlFilter = XmlTree -> [XmlTree] isA :: (a -> Bool) -> (a -> [a]) isA p x | p x = [x] | otherwise = [] isXTex...
sebug/TranslationLister
TranslationExtractor.hs
bsd-3-clause
827
0
10
159
325
178
147
24
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} module Highlight where import qualified Data.Map as M import qualified Data.Text.Lazy as T import Data.Foldable as F import Data.Char import Control.Monad import Control.Applicative import TextBuffer -- TODO ...
polygonhell/textEditor
src/Highlight.hs
bsd-3-clause
7,587
2
16
1,538
2,926
1,536
1,390
177
3
module Skype.Entry where import Data.List as DL import Data.Word import Data.ByteString import Data.ByteString.UTF8 as U import Data.Time import Data.Time.Calendar (fromGregorian) import Skype.Util data SkypeEntry = SEntry { recSize :: Word32, sessionId :: ByteString, timeStamp :: UTCTime, senderId ::...
jdevelop/skypelogr
Skype/Entry.hs
bsd-3-clause
2,359
0
13
816
706
392
314
77
1
{-# LANGUAGE OverloadedStrings, RecordWildCards, NamedFieldPuns #-} {-# OPTIONS -Wall -fno-warn-missing-signatures #-} import Language.LaTeX import qualified Language.LaTeX.Builder as B import qualified Language.LaTeX.Builder.Babel as B import qualified Language.LaTeX.Length as L import qualified Language.LaTeX.Builder...
np/hlatex
examples/csv-addresses-to-tex.hs
bsd-3-clause
5,065
0
18
1,419
1,461
755
706
101
2
{-# OPTIONS -fno-warn-unused-imports #-} #include "HsConfigure.h" -- #hide module Data.Time.Clock.Scale ( -- * Universal Time -- | Time as measured by the earth. UniversalTime(..), -- * Absolute intervals DiffTime (..), secondsToDiffTime, picosecondsToDiffTime ) where import Control.DeepSeq import Data.R...
takano-akio/time
Data/Time/Clock/Scale.hs
bsd-3-clause
3,739
4
10
615
955
498
457
54
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module RequestsSpec (spec) where import Data.Aeson import qualified Data.ByteString.Lazy as BSL import System.FilePath import System.IO.Unsafe impor...
mseri/fbmessenger-api-hs
test/RequestsSpec.hs
bsd-3-clause
4,899
0
15
1,164
1,084
519
565
73
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Base.Singletons -- Copyright : (C) 2014 Jan Stolarek -- License : BSD-style (s...
goldfirere/singletons
singletons-base/src/GHC/Base/Singletons.hs
bsd-3-clause
3,512
0
7
1,118
343
245
98
-1
-1
module Main where import Control.Monad (when) import Matrix import System.Exit (exitFailure) import Test.HUnit main = do Counts c t e f <- runTestTT tests when (e > 0 || f > 0) exitFailure tests = TestList [ TestLabel "nextValue_lastRowEmptySln" $ TestCase nextValue_lastRowEmptySln , TestL...
bobgru/conifer
test/unit-tests/matrixTests.hs
bsd-3-clause
16,628
0
12
2,690
6,443
3,788
2,655
275
1
module Database.TokyoCabinet.Associative where import Data.Maybe import Foreign.Ptr import Foreign.ForeignPtr import Database.TokyoCabinet.Map import Database.TokyoCabinet.Map.C import Database.TokyoCabinet.Storable class Associative a where withMap :: (Storable k, Storable v) => a k v -> (Ptr MAP -> IO b) -> ...
tom-lpsd/tokyocabinet-haskell
Database/TokyoCabinet/Associative.hs
bsd-3-clause
1,432
0
17
491
487
245
242
32
0
module TestImport ( module Yesod.Test , module Model , module Foundation , module Database.Persist , module Prelude , runDB , Spec , Example ) where import Yesod.Test import Database.Persist hiding (get) import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool) import Control.Mo...
SimSaladin/hajong
hajong-site/test/TestImport.hs
mit
584
0
8
123
155
91
64
22
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE BangPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Utils -- Copyrigh...
mydaum/cabal
Cabal/Distribution/Utils/Generic.hs
bsd-3-clause
13,828
0
17
3,326
3,146
1,717
1,429
221
5
#!/usr/bin/env runhaskell {-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} {-# OPTIONS -Wall #-} import Data.Tensor.TypeLevel import qualified Data.Text.IO as T import Language.Paraiso.Annotation (Annotation) import Language.Paraiso.Generator (generateIO) import qualified Language.Pa...
drmaruyama/Paraiso
examples/HelloWorld/Generator.hs
bsd-3-clause
2,006
0
11
418
533
297
236
46
1
import Vector -- Disabled: see Vectorised --import Vectorised import Vector1 import Vectorised1 import Timing import Points2D.Generate import Points2D.Types import System.Environment import Data.Array.Parallel.PArray as P main :: IO () main = do args <- getArgs case args of [alg,pointCount] -> run alg (re...
mainland/dph
dph-examples/examples/spectral/ClosestPairs/dph/Main.hs
bsd-3-clause
2,120
43
13
494
507
262
245
54
2
{- | Module : $Header$ Description : Taxonomy extraction for OWL Copyright : (c) Dominik Luecke, Uni Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : luecke@informatik.uni-bremen.de Stability : provisional Portability : portabl Taxonomy extraction for OWL -} module OWL2.Taxono...
nevrenato/HetsAlloy
OWL2/Taxonomy.hs
gpl-2.0
3,189
0
16
783
956
490
466
72
3
{-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and -- detab the module (please do the detabbing in a separate patch). See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces -- fo...
nomeata/ghc
compiler/nativeGen/X86/RegInfo.hs
bsd-3-clause
2,115
10
11
697
531
313
218
51
4
module MediaWiki.API.Query.Search.Import where import MediaWiki.API.Types import MediaWiki.API.Utils import MediaWiki.API.Query.Search import Text.XML.Light.Types import Control.Monad import Data.Maybe stringXml :: String -> Either (String,[{-Error msg-}String]) SearchResponse stringXml s = parseDoc xml s xml :: E...
neobrain/neobot
mediawiki/MediaWiki/API/Query/Search/Import.hs
bsd-3-clause
940
0
11
172
354
177
177
25
1
import Sound.Tidal.Tempo (Tempo, logicalTime, clocked, clockedTick, bps) import Sound.OSC.FD import Sound.OSC.Datum --import Sound.OpenSoundControl --import Sound.OSC.FD import System.IO mykip = "10.0.1.10"; mykport = 4000 main :: IO () main = do myk <- openUDP mykip mykport clockedTick 4 $ onTick myk wav...
lennart/Tidal
sync/Leafcutter.hs
gpl-3.0
687
0
16
151
262
135
127
18
1
module Case4 where data T = C2 Int {- g (C1 x y) = 56 -} caseIt x = case x of 42 -> 1 + f ((error "C1 no longer defined for T at line: 3") 1 2) where {- f (C1 x y) = x + y -} f x = error "g (C1 1 2) no longer defined for T at line: 3"
SAdams601/HaRe
old/testing/removeCon/Case4_TokOut.hs
bsd-3-clause
313
0
13
144
67
35
32
5
1
module A5 where data Data1 a = C1 a Int Char | C2 Int | C3 Float f :: Data1 a -> Int f (C1 a b c) = b -- errorData "b" "Data.C1" "f" f (C2 a) = a f (C3 a) = 42 g (C1 (C1 x y z) b c) = y
kmate/HaRe
old/testing/removeField/A5.hs
bsd-3-clause
217
2
9
86
117
62
55
9
1
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE ScopedTypeVariables #-} -- --------------------------------------------------------------------------- -- | -- Module : Data.Vector.Algorithms.Heap -- Copyright : (c) 2008-2011 Dan Doel -- Maintainer : Dan Doel <dan.doel@gmail.com> -- Stability : Experimental -- Por...
mightymoose/liquidhaskell
benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Heap.hs
bsd-3-clause
12,818
0
18
4,516
2,923
1,497
1,426
161
12
module Test0 () where import Language.Haskell.Liquid.Prelude x = choose 0 prop_abs = if x `gt` 0 then baz x else False baz :: Int -> Bool baz z = liquidAssertB (z `geq` 0)
mightymoose/liquidhaskell
tests/pos/test00.old.hs
bsd-3-clause
179
0
7
40
73
43
30
6
2
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.Ar -- Copyright : Duncan Coutts 2009 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides an library inter...
thoughtpolice/cabal
Cabal/Distribution/Simple/Program/Ar.hs
bsd-3-clause
6,573
0
21
1,845
1,328
702
626
-1
-1
{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} -- Test Trac #2433 module T2433 where import Data.Typeable(Typeable) import T2433_Help( T ) deriving instance Typeable T
urbanslug/ghc
testsuite/tests/typecheck/should_compile/T2433.hs
bsd-3-clause
200
0
5
32
33
21
12
6
0
module TIM.Types where import Common import qualified Data.Heap as H import qualified Data.Map as M data Instr = Take Int Int -- allocation, arity | Move Int AddrMode | Enter AddrMode | Push AddrMode | PushValue ValueAddrMode | PushMarker Int | UpdateMarkers Int | Return | ReturnConstr Int | Op O...
meimisaki/Rin
src/TIM/Types.hs
mit
1,941
0
11
452
675
391
284
71
1
module Step3 where -- # Лямбдочки -- Синоним для термина "анонимная функция" test1 :: IO () test1 = do let xs = [1, 2, 3] let ys = map double xs print ys where double x = 2 * x test2 :: IO () test2 = do let xs = [1, 2, 3] let ys = map double xs print ys where double = \x -> 2 * x -- <- Разли...
nlinker/haskell-you-could
src/Step3.hs
mit
1,228
0
10
224
244
136
108
18
1
----------------------------------------------------------------------------- -- -- Module : Language.TypeScript.Lexer -- Copyright : (c) DICOM Grid Inc. 2013 -- License : MIT -- -- Maintainer : Phillip Freeman <paf31@cantab.net> -- Stability : experimental -- Portability : -- -- | -- ---------------...
mgsloan/language-typescript
src/Language/TypeScript/Lexer.hs
mit
2,312
2
11
627
487
292
195
52
1
module SingleLists where cons' :: a -> [a] -> [a] cons' val lst = val : lst snoc' :: a -> [a] -> [a] snoc' val lst = lst ++ [val]
iduhetonas/haskell-projects
HelloWorld/singleLists.hs
mit
132
0
7
33
73
41
32
5
1
module Network.Campfire.Search where import Network.Campfire.Common -- | Request type for searching messages for 'Text' term. See -- <https://github.com/37signals/campfire-api/blob/master/sections/search.md> -- for additional information. data Search = Search Text deriving (Show, Eq) instance Requestable...
joshmcgrath08/campfire-lib
Network/Campfire/Search.hs
mit
440
0
8
68
82
46
36
-1
-1
module Cenary.Codegen.TcM where import Cenary.Codegen.CodegenError import Cenary.Codegen.Evm import Cenary.Syntax import Control.Monad.Except -- | Class of monads that can perform typechecking class TcM m where checkTyEq :: Name -> PrimType -> PrimType -> m () instance TcM E...
yigitozkavci/ivy
src/Cenary/Codegen/TcM.hs
mit
421
0
11
105
107
58
49
10
0
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.XMLHttpRequestEventTarget (loadStart, progress, abortEvent, error, load, timeout, loadEnd, XMLHttpRequest...
ghcjs/jsaddle-dom
src/JSDOM/Generated/XMLHttpRequestEventTarget.hs
mit
3,487
0
7
429
599
361
238
48
1
module Data.Changeable where -- | Changeable is used to tag whether something has changed or not. This -- is used to prevent unneccessary writes to disk. data Changeable a = Same a | Changed a deriving (Show)
werbitt/ip-to-file
src/Data/Changeable.hs
mit
211
0
6
39
30
19
11
2
0
-- module module RCL.Config where -- imports import RCL.Types -- exported types data Config = Config { restURL :: URL, authURL :: URL, apiKey :: APIKey, secret :: Secret }
nicuveo/RCL
src/RCL/Config.hs
mit
203
0
8
61
47
31
16
7
0
{-- Copyright (c) 2014 Gorka Suárez García Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
gorkinovich/Haskell
Problems/Problem0013.hs
mit
13,439
0
10
1,968
403
254
149
107
1
-- Maybe - concat 2 maybe's -- https://www.codewars.com/kata/57da675dfa96908b16000040 module MaybeConcat where import Control.Monad(liftM2) concatMaybe :: Maybe String -> Maybe String -> Maybe String concatMaybe = liftM2 (\a b -> a ++ " " ++ b)
gafiatulin/codewars
src/Beta/MaybeConcat.hs
mit
248
0
9
38
64
35
29
4
1
import Haste.Foreign(ffi) main::IO() main = test "Hello World"; test::String->IO() test = ffi "(function(s) {console.log(s);})"
madmaw/grunt-haste-compiler
test/fixtures/HelloWorld.hs
mit
129
0
7
15
52
27
25
5
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.WebKitCSSViewportRule ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.WebKitCSSViewportRule #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/WebKitCSSViewportRule.hs
mit
376
0
5
33
33
26
7
4
0
module Handler.Class where import Import import DB import Utils import qualified Text.Blaze as TB import qualified Auth.Account as Auth import qualified Data.Text.Encoding as T import Text.Read (readMaybe) import Handler.Common import Handler.Wi...
ranjitjhala/gradr
Handler/Class.hs
mit
19,049
0
24
4,139
4,612
2,291
2,321
-1
-1
module Redis ( module Redis.Base, module Redis.Commands ) where import Redis.Base import qualified Redis.Commands
aconbere/redis
Redis.hs
mit
127
0
5
27
29
19
10
5
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} import System.Random import System.Cmd import System.Environment import Data.Functor import Data.List import Data.Monoid import Control.Monad import Control.Exception import Types import Latex import Test import Utils (showT) import qualified Dat...
michaelbeaumont/kirchhoff-generator
src/kirchhoff-generator.hs
mit
4,082
0
14
1,133
1,020
531
489
82
4
{-| Module : Dvx.Tokens Description : DVX tokens -} module Dvx.Tokens ( token , DvxToken(..) ) where -- |DVX Tokens (derived from code, used in AST building) data DvxToken = TBraceOpen | TBraceClose | TBool Bool | TColon | TComma | TDefn ...
Hamcha/dvx
Dvx/Tokens.hs
mit
1,650
0
6
731
349
191
158
55
1
-- Spec.hs import Test.Hspec main :: IO () main = hspec $ do describe "Prelude" $ do describe "reverse" $ do it "reverses a list" False describe "show" $ do it "shows its argument" True
hspec/hspec
doc/_includes/match/Spec.hs
mit
219
0
14
68
72
32
40
8
1
{-# htermination foldFM_LE :: (Ordering -> b -> c -> c) -> c -> Ordering -> FiniteMap Ordering b -> c #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_foldFM_LE_11.hs
mit
123
0
3
24
5
3
2
1
0
{-# LANGUAGE CPP #-} module GHCJS.DOM.SVGFEDiffuseLightingElement ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.SVGFEDiffuseLightingElement #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/SVGFEDiffuseLightingElement.hs
mit
394
0
5
33
33
26
7
4
0
module Disease.Vaccine where import Control.Comonad import Data.List import Disease.Disease import Disease.Universe -- |Vaccinate one cell. We choose an alive cell close to the -- current position vaccinate :: Universe DiseaseCell -> Universe DiseaseCell vaccinate u = case closestAlive u of Nothing -> u Just...
sgillespie/ca-disease-simulator
src/Disease/Vaccine.hs
mit
3,777
0
14
955
1,305
660
645
63
5
main = do print (sum [ x | x <- [1..999], (x `mod` 5 == 0) || (x `mod` 3 == 0)])
tibbon/multi_language_euler_challenge
1_multiples_of_3_and_5/haskell/3_and_5.hs
mit
83
0
15
24
68
37
31
2
1
module Foundation where import Import.NoFoundation import Database.Persist.Sql (ConnectionPool, runSqlPool) import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) import Yesod.Auth.Message import Yesod.Default.Util (addStaticContentExternal) import Yesod.Core.Types (Logger) import qualifi...
haBuu/tfs-website
Foundation.hs
mit
8,643
0
15
1,680
1,458
762
696
-1
-1
----------------------------------------------------------------------------------------------------------------------- module System.Filesystem ( listDir, textFindInFile, Result(..), printResult, printCompare, compDirs ) where import qualified Data.ByteString as B import Control.Monad.Trans.Resou...
thomkoehler/MiscTools
src/System/Filesystem.hs
gpl-2.0
10,298
0
20
3,272
2,452
1,241
1,211
192
18
{-# LANGUAGE DuplicateRecordFields #-} module Philosophers.Snapshot where import Control.Concurrent import Control.Concurrent.MVar (MVar, newMVar, putMVar, takeMVar) import Control.Concurrent.STM import Control.Monad import Philosophers.Log import Philosophe...
graninas/Haskell-Algorithms
Tests/STM/philosopers/src/Philosophers/Snapshot.hs
gpl-3.0
1,140
0
12
296
394
205
189
32
1
{-# LANGUAGE DataKinds, TypeFamilies #-} module Modernator.APIAuth where import Modernator.Cookies import Servant import Servant.Server.Experimental.Auth type instance AuthServerData (AuthProtect "user-auth") = ModernatorCookie
mojotech/modernator-haskell
src/Modernator/APIAuth.hs
gpl-3.0
230
0
6
23
38
24
14
6
0
module Pretty (Pretty(..), TokenKind(..), Token(..), pretty) where import Common import Pretty.Internal class (TokenKind b) => Pretty a b | a -> b where tokens :: a -> Writer [Token b] () class TokenKind a where space :: a -> a -> Bool data Token a = Word String a | LineBreak Int | Depth Int deriving (Eq, Or...
ktvoelker/FLang
src/Pretty.hs
gpl-3.0
2,268
0
15
540
1,066
543
523
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/OperatingSystems/Get.hs
mpl-2.0
3,404
0
14
778
421
249
172
65
1
-- -- Copyright 2017-2018 Azad Bolour -- Licensed under GNU Affero General Public License v3.0 - -- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md -- {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE DisambiguateRecordFields #-} module Main where import System.Exit (die) import System.Environment (getAr...
azadbolour/boardgame
haskell-server/app/SeedDataPopulator.hs
agpl-3.0
1,549
0
15
272
282
153
129
27
3
module Data.ByteString.Builder.Escape ( escapeLazyByteStringCharsWith , escapeTextWith ) where -- import qualified Data.ByteString as S import qualified Data.ByteString.Lazy as L import Data.ByteString.Builder (Builder) import Data.ByteString.Builder.Prim import Data.ByteString.Internal (c2w) import Data.Text (T...
databrary/databrary
src/Data/ByteString/Builder/Escape.hs
agpl-3.0
1,473
0
11
190
296
166
130
18
1
{-# LANGUAGE ScopedTypeVariables #-} data MyStruct = forall a b . ( Loooooooooooooooooooooooooooooooong a , Loooooooooooooooooooooooooooooooong b ) => MyConstructor (ToBriDocM BriDocNumbered) (ToBriDocM BriDocNumbered) (ToBriDocM BriDocNumbered)
lspitzner/brittany
data/Test55.hs
agpl-3.0
298
0
8
78
54
29
25
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module NonEmpty ( NonEmpty(..) ) where import GHC.Show infixr 5 :| data NonEmpty a = a :| [a] deriving (Show)
seckcoder/lang-learn
haskell/lambda-calculus/src/NonEmpty.hs
unlicense
154
0
7
33
45
29
16
5
0
-- -- Copyright 2017 Andrew Dawson -- -- 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 applicable law or agreed t...
aopp-pred/fp-truncate
app/Bin64.hs
apache-2.0
826
0
6
151
64
42
22
6
1
module Numeric.Unum where import Data.Bits ((.|.), shiftL) import qualified Data.BitVector as BV data BitArray = BitArray esizesize :: Int esizesize = 3 fsizesize :: Int fsizesize = 2 -- |A general bound. -- -- This is a helper data structure that stores various -- low-level bi...
jtapolczai/unum
Numeric/Unum.hs
apache-2.0
5,316
0
10
1,277
925
540
385
77
2
{-# LANGUAGE TypeFamilies, FlexibleInstances, FlexibleContexts, DeriveDataTypeable, StandaloneDeriving #-} module HEP.Automation.MadGraph.Model.SChanC8V where import Data.Typeable import Data.Data import Text.Printf import Text.Parsec import Control.Monad.Identity import Text.StringTemplate import Te...
wavewave/madgraph-auto-model
src/HEP/Automation/MadGraph/Model/SChanC8V.hs
bsd-2-clause
3,906
0
26
1,380
1,187
618
569
87
1
{-# LANGUAGE FlexibleInstances, DataKinds, GADTs, KindSignatures, ExistentialQuantification, QuasiQuotes, TemplateHaskell, StandaloneDeriving, TypeOperators, ImpredicativeTypes, TypeFamilies, ScopedTypeVariables, QuasiQuotes, OverloadedStrings #-} module RCL where import Language.C.Quote.ObjC import Language.C.Quote....
mxswd/language-objc-edsl
src/RCL.hs
bsd-2-clause
4,814
0
17
1,054
1,102
591
511
67
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-| @pipes-group@ builds upon @pipes@ to establish idioms for grouping streams into sub-streams without collecting elements into memory. This tutorial assumes familiarity with @pipes@ and @pipes-parse@. -} module Pipes.Group.Tutorial ( -- * Motivation -- $...
FranklinChen/Haskell-Pipes-Group-Library
src/Pipes/Group/Tutorial.hs
bsd-3-clause
11,336
0
4
2,746
32
26
6
4
0
module Main where import System.Environment import System.Directory import Text.Regex.Posix import Evaluator import Syntax import Test.Hspec import Test.HUnit main :: IO () main = findPrograms ["tests\\programs\\"] findPrograms :: [String] -> IO () findPrograms [] = putStrLn "Testing is done" findPrograms ("." : ps)...
OliverFlecke/Funci
tests/ProgramTests.hs
bsd-3-clause
2,280
0
16
509
763
395
368
50
3
-- | This module re-exports things needed to use 'Object's, -- and adds a few utility functions. module Data.Object.Dynamic (Object, empty, insert, MemberLens, module Data.Object.Dynamic.Underlying ) where import Control.Lens import Data.Object.Dynamic.Type import ...
nushio3/dynamic-object
Data/Object/Dynamic.hs
bsd-3-clause
472
0
7
113
88
56
32
9
1
-- | This module defines 'TriggerEvent', which describes actions that may create -- new 'Event's that can be triggered from 'IO'. {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} module Reflex.TriggerEvent.Class ( TriggerEvent (..) ) where import Refl...
Saulzar/reflex
src/Reflex/TriggerEvent/Class.hs
bsd-3-clause
2,538
0
14
398
370
203
167
-1
-1
-- | An attempt at writing QuickHull in quintessential Haskell. -- | I am just writing the simple 2D version for now. module QuickHull (qhull2D) where import Control.Arrow import Control.Monad import Data.DList (DList) import qualified Data.DList as D ...
emmanueldenloye/QuickHull
src/QuickHull.hs
bsd-3-clause
7,381
0
14
2,139
3,021
1,568
1,453
-1
-1
{-# LANGUAGE RecordWildCards #-} module Debug.CodeWin(MBID(..), mbidChild, mbidParent, mbidFile, MBDescr(..), MBActive(..), MBInactive(..), isMBICurrent, mbiGetRegionText, mbEpoch, ...
termite2/debug
Debug/CodeWin.hs
bsd-3-clause
20,983
0
26
6,990
6,710
3,349
3,361
391
3
module Parser ( parse ) where import Ast import Text.ParserCombinators.Parsec hiding (parse) import qualified Text.ParserCombinators.Parsec as P import Control.Monad expr :: Parser Expr expr = try (builtin2 "+" Plus) <|> try (builtin2 "-" Minus) <|> try (builtin2 "*" Times) <|> try (builtin2 "<...
davidpdrsn/alisp
src/Parser.hs
bsd-3-clause
2,684
0
27
868
1,026
490
536
92
1
{-# LANGUAGE GADTs , TypeFamilies , KindSignatures , DataKinds , ConstraintKinds , TypeOperators , MultiParamTypeClasses , FunctionalDependencies , PolyKinds , FlexibleInstances , UndecidableInstances , UndecidableSuperClasses #-} module Data.Function.Poly where import Data.Constraint -- ...
athanclark/poly-arity
src/Data/Function/Poly.hs
bsd-3-clause
3,376
0
10
737
953
551
402
-1
-1
-- © 2002 Peter Thiemann module WASH.Utility.IntToString where import Data.Char intToString ndigits i = let g x = h $ divMod x 10 h (q,r) = chr (ord '0' + fromInteger r) : g q in reverse $ take ndigits $ g i
nh2/WashNGo
WASH/Utility/IntToString.hs
bsd-3-clause
222
0
13
57
97
48
49
6
1
{-# LANGUAGE PackageImports #-} module System.Mem.StableName (module M) where import "base" System.Mem.StableName as M
silkapp/base-noprelude
src/System/Mem/StableName.hs
bsd-3-clause
124
0
4
18
23
17
6
3
0
import Test.Tasty import Test_1_Parser -- -- The following command runs all the tests for part 1: -- -- stack test diy-lang-haskell:test-1 -- main :: IO () main = defaultMain $ testGroup "\nDIY Lang: Testing Part 1" [ parsingTests ]
joelchelliah/diy-lang-haskell
test/Test_only_1.hs
bsd-3-clause
267
0
7
73
41
24
17
6
1
{-# LANGUAGE OverloadedStrings #-} module Network.HTTPMultiplexer.Config where import Control.Applicative import Data.Aeson import Data.Yaml import System.IO import System.Exit withConfigFile :: FilePath -> (Config -> IO a) -> IO a withConfigFile configFile action = do c <- decodeFileEither configFile case c of...
BrandKarma/http-multiplexer
src/Network/HTTPMultiplexer/Config.hs
bsd-3-clause
737
0
16
153
217
112
105
24
2
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} module Gifter.Daemon.ConfigWatcherTask ( startConfigWatcherTask ) where import Control.Monad import Control.Monad.Trans import Control.Monad.Reader import Control.Concurrent.Chan import Control.Concurrent.STM import Control.Concurrent.STM.TEVar import Control...
arjantop/gifter
src/Gifter/Daemon/ConfigWatcherTask.hs
bsd-3-clause
2,287
0
14
532
630
311
319
69
2
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} module Andromeda.Types.UI.GraphTransition where import Control.Monad.State (execState, runState, evalState, get, put, State(..)) import qualified Control.Monad.Trans.State as ST import Control.Monad.Free (Free(..)...
graninas/Andromeda
src/Andromeda/Types/UI/GraphTransition.hs
bsd-3-clause
4,606
0
18
1,005
1,909
980
929
110
4
module GHCJS.FFI.TypeScript where import GHCJS.Types (JSRef) data Function_ type Function = JSRef Function_
fpco/ghcjs-from-typescript
ghcjs-ace/GHCJS/FFI/TypeScript.hs
bsd-3-clause
108
0
5
13
29
18
11
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[TcMovectle]{Typechecking a whole module} -} {-# LANGUAGE CPP, NondecreasingIndentation #-} module TcRnDriver ( #ifdef GHCI tcRnStmt, tcRnExpr, tcRnType, tcRnImportDecls, tcRnLookupRdrName,...
green-haskell/ghc
compiler/typecheck/TcRnDriver.hs
bsd-3-clause
91,110
17
29
31,115
16,121
8,416
7,705
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 201...
nwf/trifecta
src/Text/Trifecta/Rendering.hs
bsd-3-clause
13,261
0
20
3,549
5,348
2,787
2,561
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Utils.SBVTestFramework -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Various goodies for testing SBV ----------------------------------...
josefs/sbv
SBVTestSuite/Utils/SBVTestFramework.hs
bsd-3-clause
7,208
0
14
2,540
1,631
854
777
111
8
/*Owner & Copyrights: Vance King Saxbe. A.*//* Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxbe...
VanceKingSaxbeA/GoldSaxMachineStore
GoldSaxMachineModule10/src/Args.hs
mit
1,218
23
16
213
382
192
190
12
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
olorin/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/SwapEnvironmentCNAMEs.hs
mpl-2.0
5,882
0
11
1,003
621
379
242
80
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Test.AWS.Gen.EMR -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay...
fmapfmapfmap/amazonka
amazonka-emr/test/Test/AWS/Gen/EMR.hs
mpl-2.0
9,123
0
7
1,874
979
581
398
169
1
module Language.Pads.Quote (pads) where import Prelude hiding (exp, init) import System.IO.Unsafe (unsafePerformIO) import qualified Language.Haskell.TH as TH import Language.Haskell.TH.Quote (QuasiQuoter(..)) import Language.Pads.CodeGen (make_pads_declarations) import qualified Language.Pads.Parser as P ...
GaloisInc/pads-haskell
Language/Pads/Quote.hs
bsd-3-clause
937
0
11
219
239
131
108
21
2
{-# OPTIONS -Wall #-} module NPP ( Expr(..), optimize, gen, SSE2v2r8(..) ) where data Expr = Term String | Add Expr Expr | Mul Expr Expr | Sub Expr Expr | Div Expr Expr | Inv Expr | Neg Expr | Madd Expr Expr Expr -- a*b+c | Msub Expr Expr Expr -- a*b-c | Nmadd Expr Expr Expr -...
nushio3/Paraiso
attic/npp/NPP.hs
bsd-3-clause
2,864
0
15
1,057
1,586
769
817
90
19
{-# LANGUAGE OverloadedStrings #-} module Bead.View.Content.CourseAdmin.Page ( courseAdmin , createGroup , assignGroupAdmin ) where import Control.Monad import Control.Arrow ((***), (&&&)) import Data.Function (on) import Data.List (intersperse, sortBy) import ...
pgj/bead
src/Bead/View/Content/CourseAdmin/Page.hs
bsd-3-clause
5,974
0
30
1,293
1,686
868
818
109
1
{- | Module : $Header$ Description : Interface to the Hexpat Library Copyright : (c) Ewaryst Schulz, DFKI 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : ewaryst.schulz@dfki.de Stability : provisional Portability : portable Provides the Hexpat parsing and transformation facility to X...
mariefarrell/Hets
Common/XmlExpat.hs
gpl-2.0
2,502
0
14
710
631
338
293
43
3
module Paper.Haskell.Haskell.Tweak(tweak) where import Paper.Haskell.Haskell.Provides import Data.List tweak :: String -> String tweak = dummy . unlines . filter (not . isModule) . lines where isModule x = "module " `isPrefixOf` x || "import " `isPrefixOf` x dummy x = unlines (x : map f undef) where ...
saep/neil
src/Paper/Haskell/Haskell/Tweak.hs
bsd-3-clause
450
0
11
114
173
94
79
10
1
-- |This module provides a high-level interface for the rest of this -- library. module Database.Schema.Migrations ( createNewMigration , ensureBootstrappedBackend , migrationsToApply , migrationsToRevert , missingMigrations ) where import qualified Data.Set as Set import Data.Maybe ( catMaybes...
nathankot/dbmigrations
src/Database/Schema/Migrations.hs
bsd-3-clause
3,533
0
15
702
733
381
352
59
2
{-# LANGUAGE ScopedTypeVariables #-} module Network.TLS.Util ( sub , takelast , partition3 , partition6 , fromJust , and' , (&&!) , bytesEq , fmapEither , catchException ) where import Data.List (foldl') import Network.TLS.Struct (...
lancelotsix/hs-tls
core/Network/TLS/Util.hs
bsd-3-clause
2,578
0
11
759
1,027
546
481
63
2
{-# LANGUAGE NoImplicitPrelude #-} module System.Permissions ( setScriptPerms , osIsWindows , setFileExecutable ) where import qualified System.Posix.Files as Posix import RIO -- | True if using Windows OS. osIsWindows :: Bool osIsWindows = False setScriptPerms :: MonadIO m => FilePath -> m () setScriptPerms...
juhp/stack
src/unix/System/Permissions.hs
bsd-3-clause
658
0
13
124
158
87
71
18
1
module FastSort where import Gofer {- list sorting: see L.C.Paulson, ML for the working programmer, Cambidge, p100 -- The list is split into ascending chunks which are then merged in pairs. samsort l = sorting [] 0 l where sorting ls k [] = head(mergepairs ls 0) sorting ls k (x:xs) = sorting (mergepairs (run:ls) ...
OS2World/DEV-UTIL-HUGS
demos/FastSort.hs
bsd-3-clause
1,525
45
9
319
276
194
82
20
8
module Vectorise.Env ( Scope(..), -- * Local Environments LocalEnv(..), emptyLocalEnv, -- * Global Environments GlobalEnv(..), initGlobalEnv, extendImportedVarsEnv, extendFamEnv, setPAFunsEnv, setPRFunsEnv, modVectInfo ) where import GhcPrelude import HscTypes import InstEnv import FamInstEn...
ezyang/ghc
compiler/vectorise/Vectorise/Env.hs
bsd-3-clause
9,514
0
14
2,814
1,294
757
537
121
1
newtype Point = P { getCoords :: (Int, Int) } deriving (Ord, Show, Eq) newtype Direction = D { getComponents :: (Int, Int) } deriving (Ord, Show, Eq) infixl 7 */ (*/) :: Int -> Direction -> Direction k */ (D (u, v)) = D (k*u, k*v) infixl 6 +/ (+/) :: Point -> Direction -> Point (P (x, y)) +/ (D (u, v)) = P (x + u, y ...
arekfu/project_euler
p0091/p0091.hs
mit
1,201
0
12
354
640
346
294
29
1
module Main where import Data.List (maximumBy) import Data.Ord (comparing) main :: IO () main = print solution solution :: (Int, Int) solution = maximumBy (comparing fst) [(length $ collatzSequence i, i) | i <- [1..1000000]] collatzSequence :: Int -> [Int] collatzSequence = generate [] where generate xs 1 = xs ...
jBugman/euler
part1/p014.hs
mit
467
0
9
103
220
118
102
15
2
module Jaml.Types where data Ast = Ast Depth Node [Ast] deriving (Show) type Depth = Int -- FixMe: Make args into [Attr] data Node = TemplateTag TemplateClasses TemplateId TemplateArgs | HtmlComment String | CodeComment String | IeConditionalComment String | SilentJ...
marklar/jaml
Jaml/Types.hs
mit
959
0
8
339
233
140
93
28
0
{-# LANGUAGE OverloadedStrings #-} module Config where import Data.ByteString mumukiUrl :: ByteString mumukiUrl = "http://mumuki.io" runhaskellArgs :: [String] --Local: --runhaskellArgs = ["-package-db=./.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d"] --Heroku: runhaskellArgs = ["-package-db=/app...
mumuki/mumuki-hspec-server
config/prod/Config.hs
mit
377
0
5
41
39
26
13
7
1
{-| Description : Bijection Properties for the EJsonValue datatype Bijection Properties for the EJsonValue datatype -} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} {-#...
sordina/Deadpan-DDP
src/Data/EJson/PropsBijection.hs
mit
1,962
0
11
373
488
274
214
38
1