Search is not available for this dataset
repo_name
string
path
string
license
string
full_code
string
full_size
int64
uncommented_code
string
uncommented_size
int64
function_only_code
string
function_only_size
int64
is_commented
bool
is_signatured
bool
n_ast_errors
int64
ast_max_depth
int64
n_whitespaces
int64
n_ast_nodes
int64
n_ast_terminals
int64
n_ast_nonterminals
int64
loc
int64
cycloplexity
int64
OS2World/DEV-UTIL-HUGS
libraries/Graphics/UI/GLUT/Overlay.hs
bsd-3-clause
setLayerInUse :: Layer -> IO () setLayerInUse = glutUseLayer . marshalLayer
75
setLayerInUse :: Layer -> IO () setLayerInUse = glutUseLayer . marshalLayer
75
setLayerInUse = glutUseLayer . marshalLayer
43
false
true
0
8
10
30
13
17
null
null
co-dan/warm_fuzzy_things
src/Control/Monad/Replay.hs
bsd-3-clause
emptyTrace :: Trace r emptyTrace = []
37
emptyTrace :: Trace r emptyTrace = []
37
emptyTrace = []
15
false
true
0
5
6
16
8
8
null
null
GaloisInc/saw-script
src/SAWScript/AutoMatch/ArgMapping.hs
bsd-3-clause
lookupName :: Name -> ArgMapping -> Maybe (Int, Type) lookupName name (ArgMapping _ nls) = Map.lookup name nls
110
lookupName :: Name -> ArgMapping -> Maybe (Int, Type) lookupName name (ArgMapping _ nls) = Map.lookup name nls
110
lookupName name (ArgMapping _ nls) = Map.lookup name nls
56
false
true
0
8
17
48
24
24
null
null
wujf/yesod
yesod-websockets/Yesod/WebSockets.hs
mit
-- | A @Sink@ for sending textual data to the user. -- -- Since 0.1.0 sinkWSText :: (MonadIO m, WS.WebSocketsData a) => C.Consumer a (WebSocketsT m) () sinkWSText = CL.mapM_ sendTextData
186
sinkWSText :: (MonadIO m, WS.WebSocketsData a) => C.Consumer a (WebSocketsT m) () sinkWSText = CL.mapM_ sendTextData
116
sinkWSText = CL.mapM_ sendTextData
34
true
true
0
8
30
53
28
25
null
null
bernstein/ircfs
tests/Tests.hs
bsd-3-clause
lnss :: Gen B.ByteString lnss = foldr BS.cons mempty <$> listOf lns
67
lnss :: Gen B.ByteString lnss = foldr BS.cons mempty <$> listOf lns
67
lnss = foldr BS.cons mempty <$> listOf lns
42
false
true
0
7
11
30
14
16
null
null
Baranowski/SourceGraph
Parsing/ParseModule.hs
gpl-3.0
getExp (EnumFromThenTo e1 e2 e3) = liftM2 MS.union (getExp e1) $ liftM2 MS.union (getExp e2) (getExp e3)
139
getExp (EnumFromThenTo e1 e2 e3) = liftM2 MS.union (getExp e1) $ liftM2 MS.union (getExp e2) (getExp e3)
139
getExp (EnumFromThenTo e1 e2 e3) = liftM2 MS.union (getExp e1) $ liftM2 MS.union (getExp e2) (getExp e3)
139
false
false
2
7
51
59
27
32
null
null
rueshyna/gogol
gogol-debugger/gen/Network/Google/Debugger/Types/Product.hs
mpl-2.0
-- | A revision (commit) ID. gscRevisionId :: Lens' GerritSourceContext (Maybe Text) gscRevisionId = lens _gscRevisionId (\ s a -> s{_gscRevisionId = a})
161
gscRevisionId :: Lens' GerritSourceContext (Maybe Text) gscRevisionId = lens _gscRevisionId (\ s a -> s{_gscRevisionId = a})
132
gscRevisionId = lens _gscRevisionId (\ s a -> s{_gscRevisionId = a})
76
true
true
1
9
30
51
25
26
null
null
cbrghostrider/Hacking
HackerRank/Mathematics/Geometry/rectangularGame.hs
mit
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0a"' -- ------------------------------------------------------------------------------------- solveProblem :: [[Int]] -> Int solveProblem = (\[vx, vy] -> vx * vy) . foldl1 (\[accx, accy] [x, y] -> [min accx x, min accy y])
543
solveProblem :: [[Int]] -> Int solveProblem = (\[vx, vy] -> vx * vy) . foldl1 (\[accx, accy] [x, y] -> [min accx x, min accy y])
129
solveProblem = (\[vx, vy] -> vx * vy) . foldl1 (\[accx, accy] [x, y] -> [min accx x, min accy y])
98
true
true
0
10
88
89
53
36
null
null
TomMD/ghc
compiler/types/TypeRep.hs
bsd-3-clause
isKindVar :: Var -> Bool isKindVar v = isTKVar v && isSuperKind (varType v)
75
isKindVar :: Var -> Bool isKindVar v = isTKVar v && isSuperKind (varType v)
75
isKindVar v = isTKVar v && isSuperKind (varType v)
50
false
true
0
8
13
34
16
18
null
null
bergmark/clay
src/Clay/Border.hs
bsd-3-clause
dotted = Stroke "dotted"
24
dotted = Stroke "dotted"
24
dotted = Stroke "dotted"
24
false
false
0
5
3
9
4
5
null
null
cpettitt/haskell-ptree
test/qc/Main.hs
mit
prop_modelElems = P.elems `eq1` M.elems
63
prop_modelElems = P.elems `eq1` M.elems
63
prop_modelElems = P.elems `eq1` M.elems
63
false
false
0
6
28
16
9
7
null
null
hvr/lens
examples/Pong.hs
bsd-3-clause
windowWidth = 800
21
windowWidth = 800
21
windowWidth = 800
21
false
false
1
5
6
10
3
7
null
null
capitanbatata/functional-systems-in-haskell
fsh-exercises/src/PWPipes.hs
mit
-- When you run this, the first name you input will get bound and only the -- second will change. -- -- Entering quit one time will allow to re-bind the first name. -- -- Entering quit twice will quit the whole program. -- -- What is happening? -- -- Maybe this can be explained by the way @printPairs@ works: -- -- > >>> printPairs -- > x = 0 -- > y = 'a' -- > (0,'a') -- > y = 'b' -- > (0,'b') -- > x = 1 -- > y = 'a' -- > (1,'a') -- > y = 'b' -- > (1,'b') -- > x = 2 -- > y = 'a' -- > (2,'a') -- > y = 'b' -- > (2,'b') -- -- Here you can see that to produce a new element, the inner index (@y@) varies -- faster, which seems to indicate that the first element is "reused". Only -- after the elements of @Select $ each ['a', 'b']@ are exhausted, the next -- element in @Select $ each [0, 1, 2]@ is bound -- > loop :: Monad m => (a -> ListT m b) -> Pipe a b m r -- ** Combining computations on @ListT@ -- ** Mix ListT with Pipes -- * Tricks mapPipe :: Monad m => (a -> b) -> Pipe a b m r mapPipe f = for cat $ \x -> yield (f x)
1,033
mapPipe :: Monad m => (a -> b) -> Pipe a b m r mapPipe f = for cat $ \x -> yield (f x)
86
mapPipe f = for cat $ \x -> yield (f x)
39
true
true
0
9
245
98
66
32
null
null
banacorn/agda-language-server
src/Options.hs
mit
usageMessage :: String usageMessage = usageInfo usage options ++ usageAboutAgdaOptions
86
usageMessage :: String usageMessage = usageInfo usage options ++ usageAboutAgdaOptions
86
usageMessage = usageInfo usage options ++ usageAboutAgdaOptions
63
false
true
0
6
9
27
11
16
null
null
chreekat/snowdrift
tests/NotifyTest.hs
agpl-3.0
errUnlessUniqueProjectWebsiteNotif' = errWebsiteNotif' errUnlessUniqueProjectWebsiteNotif
89
errUnlessUniqueProjectWebsiteNotif' = errWebsiteNotif' errUnlessUniqueProjectWebsiteNotif
89
errUnlessUniqueProjectWebsiteNotif' = errWebsiteNotif' errUnlessUniqueProjectWebsiteNotif
89
false
false
0
5
3
9
4
5
null
null
cohitt/cs2-adts-logging
LogAnalysis.hs
bsd-3-clause
inOrder (Node mt1 lm mt2) = inOrder mt1 ++ [lm] ++ inOrder mt2
62
inOrder (Node mt1 lm mt2) = inOrder mt1 ++ [lm] ++ inOrder mt2
62
inOrder (Node mt1 lm mt2) = inOrder mt1 ++ [lm] ++ inOrder mt2
62
false
false
0
7
12
36
17
19
null
null
ladinu/cs457
src/MatchingOnLists.hs
mit
inserts e (x:xs) = -- 3 ---------------------------------------- -- Write a function that enumerates all of the -- permutations of a given input list. For -- example: -- -- perms [0,1] -- --> [[0,1],[1,0]] -- perms [0,1,2] -- --> [[0,1,2],[1,0,2],[1,2,0],[0,2,1],[2,0,1],[2,1,0]] -- perms [0,0,0] -- --> [[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]] -- perms "fun" -- --> ["fun","ufn","unf","fnu","nfu","nuf"] perms :: [a] -> [[a]]
451
inserts e (x:xs) = -- 3 ---------------------------------------- -- Write a function that enumerates all of the -- permutations of a given input list. For -- example: -- -- perms [0,1] -- --> [[0,1],[1,0]] -- perms [0,1,2] -- --> [[0,1,2],[1,0,2],[1,2,0],[0,2,1],[2,0,1],[2,1,0]] -- perms [0,0,0] -- --> [[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]] -- perms "fun" -- --> ["fun","ufn","unf","fnu","nfu","nuf"] perms :: [a] -> [[a]]
451
inserts e (x:xs) = -- 3 ---------------------------------------- -- Write a function that enumerates all of the -- permutations of a given input list. For -- example: -- -- perms [0,1] -- --> [[0,1],[1,0]] -- perms [0,1,2] -- --> [[0,1,2],[1,0,2],[1,2,0],[0,2,1],[2,0,1],[2,1,0]] -- perms [0,0,0] -- --> [[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]] -- perms "fun" -- --> ["fun","ufn","unf","fnu","nfu","nuf"] perms :: [a] -> [[a]]
451
false
false
0
7
71
51
33
18
null
null
vdweegen/UvA-Software_Testing
Lab5/Final/Lecture5'.hs
gpl-3.0
sameLen :: Constraint -> Constraint -> Bool sameLen (_,_,xs) (_,_,ys) = length xs == length ys
94
sameLen :: Constraint -> Constraint -> Bool sameLen (_,_,xs) (_,_,ys) = length xs == length ys
94
sameLen (_,_,xs) (_,_,ys) = length xs == length ys
50
false
true
0
9
15
57
29
28
null
null
pparkkin/eta
compiler/ETA/BasicTypes/Literal.hs
bsd-3-clause
hashLiteral (LitInteger i _) = hashInteger i
47
hashLiteral (LitInteger i _) = hashInteger i
47
hashLiteral (LitInteger i _) = hashInteger i
47
false
false
0
7
9
20
9
11
null
null
JacquesCarette/literate-scientific-software
code/drasil-gool/GOOL/Drasil/CodeInfo.hs
bsd-2-clause
addCurrModConstructorCall :: VS (CodeInfo (Type CodeInfo)) -> VS (CodeInfo (Value CodeInfo)) addCurrModConstructorCall ot = do t <- ot let tp = getTypeString t addCurrModCall tp
186
addCurrModConstructorCall :: VS (CodeInfo (Type CodeInfo)) -> VS (CodeInfo (Value CodeInfo)) addCurrModConstructorCall ot = do t <- ot let tp = getTypeString t addCurrModCall tp
186
addCurrModConstructorCall ot = do t <- ot let tp = getTypeString t addCurrModCall tp
90
false
true
0
10
33
73
33
40
null
null
dbp/hs-stripe
src/Web/Stripe/Coupon.hs
bsd-3-clause
toCpnDuration d (Just ms) = case T.map toLower d of "repeating" -> Repeating ms _ -> UnknownDuration d -- | Attempts to parse JSON into a 'Coupon'.
166
toCpnDuration d (Just ms) = case T.map toLower d of "repeating" -> Repeating ms _ -> UnknownDuration d -- | Attempts to parse JSON into a 'Coupon'.
166
toCpnDuration d (Just ms) = case T.map toLower d of "repeating" -> Repeating ms _ -> UnknownDuration d -- | Attempts to parse JSON into a 'Coupon'.
166
false
false
0
8
45
47
22
25
null
null
magnusjonsson/unitc
app/Type.hs
bsd-2-clause
abs :: Type -> Maybe Type abs = applyMathFn id
46
abs :: Type -> Maybe Type abs = applyMathFn id
46
abs = applyMathFn id
20
false
true
0
7
9
26
11
15
null
null
iliastsi/gac
src/main/SysTools.hs
mit
removeTmpFiles :: DynFlags -> [FilePath] -> IO Bool removeTmpFiles dflags fs = traceCmd dflags "Deleting temp files" ("Deleting: " ++ unwords deletees) (do mapM_ (removeWith dflags removeFile) deletees return True) where (_non_deletees, deletees) = partition isAlanUserSrcFilename fs isAlanUserSrcFilename str = (drop 1 $ takeExtension str) == "alan"
414
removeTmpFiles :: DynFlags -> [FilePath] -> IO Bool removeTmpFiles dflags fs = traceCmd dflags "Deleting temp files" ("Deleting: " ++ unwords deletees) (do mapM_ (removeWith dflags removeFile) deletees return True) where (_non_deletees, deletees) = partition isAlanUserSrcFilename fs isAlanUserSrcFilename str = (drop 1 $ takeExtension str) == "alan"
414
removeTmpFiles dflags fs = traceCmd dflags "Deleting temp files" ("Deleting: " ++ unwords deletees) (do mapM_ (removeWith dflags removeFile) deletees return True) where (_non_deletees, deletees) = partition isAlanUserSrcFilename fs isAlanUserSrcFilename str = (drop 1 $ takeExtension str) == "alan"
362
false
true
1
11
110
118
57
61
null
null
elitak/frag
src/BitSet.hs
gpl-2.0
clearBS :: BitSet -> Int -> IO () clearBS (BitSet bs) i = writeArray bs i False
79
clearBS :: BitSet -> Int -> IO () clearBS (BitSet bs) i = writeArray bs i False
79
clearBS (BitSet bs) i = writeArray bs i False
45
false
true
0
10
16
47
21
26
null
null
copland/cmdargs
System/Console/CmdArgs/Implicit/Local.hs
bsd-3-clause
builtinAnn (GroupName a) (Just x) = Just x{builtinGroup=Just a}
63
builtinAnn (GroupName a) (Just x) = Just x{builtinGroup=Just a}
63
builtinAnn (GroupName a) (Just x) = Just x{builtinGroup=Just a}
63
false
false
0
8
8
37
18
19
null
null
ghc-android/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
voidPrimTyCon :: TyCon voidPrimTyCon = pcPrimTyCon voidPrimTyConName [] VoidRep
82
voidPrimTyCon :: TyCon voidPrimTyCon = pcPrimTyCon voidPrimTyConName [] VoidRep
82
voidPrimTyCon = pcPrimTyCon voidPrimTyConName [] VoidRep
59
false
true
0
6
11
20
10
10
null
null
Chouffe/hlisp
src/Evaluator.hs
bsd-3-clause
eqv [Number arg1, Number arg2] = return $ Bool $ arg1 == arg2
69
eqv [Number arg1, Number arg2] = return $ Bool $ arg1 == arg2
69
eqv [Number arg1, Number arg2] = return $ Bool $ arg1 == arg2
69
false
false
0
7
20
33
16
17
null
null
acfoltzer/bit-vector
test/Data/Vector/Bit/Tests.hs
bsd-3-clause
prop_orSet :: BitVector -> NonNegative Int -> Bool prop_orSet v nn = testBit (v .|. bit n) n where n = getNonNegative nn
122
prop_orSet :: BitVector -> NonNegative Int -> Bool prop_orSet v nn = testBit (v .|. bit n) n where n = getNonNegative nn
122
prop_orSet v nn = testBit (v .|. bit n) n where n = getNonNegative nn
71
false
true
0
8
24
53
25
28
null
null
emk/haskell-probability-monads
examples/Probability.hs
bsd-3-clause
applyClassifier (Classifier _ probs) = applyProbs probs
57
applyClassifier (Classifier _ probs) = applyProbs probs
57
applyClassifier (Classifier _ probs) = applyProbs probs
57
false
false
0
7
8
20
9
11
null
null
roelvandijk/aeson
Data/Aeson/TH.hs
bsd-3-clause
-- | Is the given type a variable? isTyVar :: Type -> Bool isTyVar (VarT _) = True
84
isTyVar :: Type -> Bool isTyVar (VarT _) = True
49
isTyVar (VarT _) = True
25
true
true
0
7
19
25
13
12
null
null
et4te/zero
server/src/Zero/Bitfinex/Handlers.hs
bsd-3-clause
------------------------------------------------------------------------------ getPublicTicker :: Text -> Handler (Ticker) getPublicTicker market = do manager <- liftIO $ newManager tlsManagerSettings res <- liftIO $ runClientM (publicTicker market) (ClientEnv manager (BaseUrl Https "api.bitfinex.com" 443 "")) case res of Left err -> error $ show err Right ms -> return ms
401
getPublicTicker :: Text -> Handler (Ticker) getPublicTicker market = do manager <- liftIO $ newManager tlsManagerSettings res <- liftIO $ runClientM (publicTicker market) (ClientEnv manager (BaseUrl Https "api.bitfinex.com" 443 "")) case res of Left err -> error $ show err Right ms -> return ms
321
getPublicTicker market = do manager <- liftIO $ newManager tlsManagerSettings res <- liftIO $ runClientM (publicTicker market) (ClientEnv manager (BaseUrl Https "api.bitfinex.com" 443 "")) case res of Left err -> error $ show err Right ms -> return ms
277
true
true
0
14
72
120
55
65
null
null
keithodulaigh/Hets
OWL2/Propositional2OWL2.hs
gpl-2.0
mkOWLDeclaration :: ClassExpression -> Axiom mkOWLDeclaration ex = PlainAxiom (ClassEntity $ Expression $ setPrefix "owl" $ mkQName thingS) $ ListFrameBit (Just SubClass) $ ExpressionBit [([], ex)]
201
mkOWLDeclaration :: ClassExpression -> Axiom mkOWLDeclaration ex = PlainAxiom (ClassEntity $ Expression $ setPrefix "owl" $ mkQName thingS) $ ListFrameBit (Just SubClass) $ ExpressionBit [([], ex)]
201
mkOWLDeclaration ex = PlainAxiom (ClassEntity $ Expression $ setPrefix "owl" $ mkQName thingS) $ ListFrameBit (Just SubClass) $ ExpressionBit [([], ex)]
156
false
true
0
11
29
73
36
37
null
null
ygale/yesod
yesod-core/Yesod/Core/Content.hs
mit
typeHtml :: ContentType typeHtml = "text/html; charset=utf-8"
61
typeHtml :: ContentType typeHtml = "text/html; charset=utf-8"
61
typeHtml = "text/html; charset=utf-8"
37
false
true
0
6
6
18
7
11
null
null
svenssonjoel/ObsidianGFX
Obsidian/CodeGen/CompileIM.hs
bsd-3-clause
compileForAll PlatformCUDA c (SForAll Block (IWord32 n) im) = goQ ++ goR where cim = compileIM PlatformCUDA c im nt = configThreadsPerBlock c q = n `quot` nt r = n `rem` nt -- q is the number full "passes" needed to cover the iteration -- space given we have nt threads. goQ = case q of 0 -> [] 1 -> cim -- [cstm|$id:loopVar = threadIdx.x; |]:cim --do -- stm <- updateTid [cexp| threadIdx.x |] -- return $ [cstm| $id:loopVar = threadIdx.x; |] : cim n -> [[cstm| for ( int i = 0; i < $int:q; ++i) { $stms:body } |], [cstm| $id:("tid") = threadIdx.x; |]] where body = [cstm|$id:("tid") = i*$int:nt + threadIdx.x; |] : cim -- r is the number of elements left. -- This generates code for when fewer threads are -- needed than available. (some threads shut down due to the conditional). goR = case (r,q) of (0,_) -> [] --(n,0) -> [[cstm| if (threadIdx.x < $int:n) { -- $stms:cim } |]] (n,m) -> [[cstm| if (threadIdx.x < $int:n) { $id:("tid") = $int:(q*nt) + threadIdx.x; $stms:cim } |], [cstm| $id:("tid") = threadIdx.x; |]]
1,339
compileForAll PlatformCUDA c (SForAll Block (IWord32 n) im) = goQ ++ goR where cim = compileIM PlatformCUDA c im nt = configThreadsPerBlock c q = n `quot` nt r = n `rem` nt -- q is the number full "passes" needed to cover the iteration -- space given we have nt threads. goQ = case q of 0 -> [] 1 -> cim -- [cstm|$id:loopVar = threadIdx.x; |]:cim --do -- stm <- updateTid [cexp| threadIdx.x |] -- return $ [cstm| $id:loopVar = threadIdx.x; |] : cim n -> [[cstm| for ( int i = 0; i < $int:q; ++i) { $stms:body } |], [cstm| $id:("tid") = threadIdx.x; |]] where body = [cstm|$id:("tid") = i*$int:nt + threadIdx.x; |] : cim -- r is the number of elements left. -- This generates code for when fewer threads are -- needed than available. (some threads shut down due to the conditional). goR = case (r,q) of (0,_) -> [] --(n,0) -> [[cstm| if (threadIdx.x < $int:n) { -- $stms:cim } |]] (n,m) -> [[cstm| if (threadIdx.x < $int:n) { $id:("tid") = $int:(q*nt) + threadIdx.x; $stms:cim } |], [cstm| $id:("tid") = threadIdx.x; |]]
1,339
compileForAll PlatformCUDA c (SForAll Block (IWord32 n) im) = goQ ++ goR where cim = compileIM PlatformCUDA c im nt = configThreadsPerBlock c q = n `quot` nt r = n `rem` nt -- q is the number full "passes" needed to cover the iteration -- space given we have nt threads. goQ = case q of 0 -> [] 1 -> cim -- [cstm|$id:loopVar = threadIdx.x; |]:cim --do -- stm <- updateTid [cexp| threadIdx.x |] -- return $ [cstm| $id:loopVar = threadIdx.x; |] : cim n -> [[cstm| for ( int i = 0; i < $int:q; ++i) { $stms:body } |], [cstm| $id:("tid") = threadIdx.x; |]] where body = [cstm|$id:("tid") = i*$int:nt + threadIdx.x; |] : cim -- r is the number of elements left. -- This generates code for when fewer threads are -- needed than available. (some threads shut down due to the conditional). goR = case (r,q) of (0,_) -> [] --(n,0) -> [[cstm| if (threadIdx.x < $int:n) { -- $stms:cim } |]] (n,m) -> [[cstm| if (threadIdx.x < $int:n) { $id:("tid") = $int:(q*nt) + threadIdx.x; $stms:cim } |], [cstm| $id:("tid") = threadIdx.x; |]]
1,339
false
false
0
10
508
202
125
77
null
null
divipp/lgtk
src/LGtk.hs
bsd-3-clause
lookupEnv :: String -> RefCreator (Maybe String) lookupEnv = Eff.lookupEnv
74
lookupEnv :: String -> RefCreator (Maybe String) lookupEnv = Eff.lookupEnv
74
lookupEnv = Eff.lookupEnv
25
false
true
0
8
9
26
13
13
null
null
ijks/hexagons
tests/Hexagon/Tests.hs
mit
tests :: TestTree tests = testGroup "Hexagon" [ testProperty "conversion to and then from cube is idempotent" (cubeIdentity :: Hex Int -> Bool) , testProperty "conversion to and then from axial is idempotent" (axialIdentity :: Hex Int -> Bool) , testProperty "conversion to and then from offset is idempotent" (offsetIdentity :: Parity -> Hex Int -> Bool) , testProperty "conversion to and then from pixel is idempotent" (pixelIdentity :: Hex Float -> Bool) , testProperty "cube coords are always in the same plane" (cubePlanar :: Hex Int -> Bool) , testProperty "a hexagon has exactly 6 neighbors" (neighborsCount :: Hex Int -> Bool) ]
712
tests :: TestTree tests = testGroup "Hexagon" [ testProperty "conversion to and then from cube is idempotent" (cubeIdentity :: Hex Int -> Bool) , testProperty "conversion to and then from axial is idempotent" (axialIdentity :: Hex Int -> Bool) , testProperty "conversion to and then from offset is idempotent" (offsetIdentity :: Parity -> Hex Int -> Bool) , testProperty "conversion to and then from pixel is idempotent" (pixelIdentity :: Hex Float -> Bool) , testProperty "cube coords are always in the same plane" (cubePlanar :: Hex Int -> Bool) , testProperty "a hexagon has exactly 6 neighbors" (neighborsCount :: Hex Int -> Bool) ]
712
tests = testGroup "Hexagon" [ testProperty "conversion to and then from cube is idempotent" (cubeIdentity :: Hex Int -> Bool) , testProperty "conversion to and then from axial is idempotent" (axialIdentity :: Hex Int -> Bool) , testProperty "conversion to and then from offset is idempotent" (offsetIdentity :: Parity -> Hex Int -> Bool) , testProperty "conversion to and then from pixel is idempotent" (pixelIdentity :: Hex Float -> Bool) , testProperty "cube coords are always in the same plane" (cubePlanar :: Hex Int -> Bool) , testProperty "a hexagon has exactly 6 neighbors" (neighborsCount :: Hex Int -> Bool) ]
694
false
true
0
11
179
146
76
70
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeCustomerGateways.hs
mpl-2.0
-- | 'DescribeCustomerGateways' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dcgCustomerGatewayIds' @::@ ['Text'] -- -- * 'dcgDryRun' @::@ 'Maybe' 'Bool' -- -- * 'dcgFilters' @::@ ['Filter'] -- describeCustomerGateways :: DescribeCustomerGateways describeCustomerGateways = DescribeCustomerGateways { _dcgDryRun = Nothing , _dcgCustomerGatewayIds = mempty , _dcgFilters = mempty }
458
describeCustomerGateways :: DescribeCustomerGateways describeCustomerGateways = DescribeCustomerGateways { _dcgDryRun = Nothing , _dcgCustomerGatewayIds = mempty , _dcgFilters = mempty }
225
describeCustomerGateways = DescribeCustomerGateways { _dcgDryRun = Nothing , _dcgCustomerGatewayIds = mempty , _dcgFilters = mempty }
172
true
true
0
7
90
51
31
20
null
null
supki/directory-layout
src/System/Directory/Layout/Internal.hs
bsd-3-clause
-- | Binary contents -- -- >>> let layout = file "foo" & contents ?~ binary (ByteString.pack [1..10]) binary :: ByteString -> Contents binary = Binary
150
binary :: ByteString -> Contents binary = Binary
48
binary = Binary
15
true
true
0
5
25
18
11
7
null
null
EdisonAlgorithms/HackerRank
practice/fp/recursion/functional-programming-the-sums-of-powers/functional-programming-the-sums-of-powers.hs
mit
main :: IO() main = do x <- getLine n <- getLine print $ solve (read x :: Int) (read n :: Int) 1
108
main :: IO() main = do x <- getLine n <- getLine print $ solve (read x :: Int) (read n :: Int) 1
108
main = do x <- getLine n <- getLine print $ solve (read x :: Int) (read n :: Int) 1
95
false
true
0
11
35
68
31
37
null
null
shlevy/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprExp i (AppTypeE e t) = parensIf (i >= appPrec) $ pprExp opPrec e <+> char '@' <> pprParendType t
100
pprExp i (AppTypeE e t) = parensIf (i >= appPrec) $ pprExp opPrec e <+> char '@' <> pprParendType t
100
pprExp i (AppTypeE e t) = parensIf (i >= appPrec) $ pprExp opPrec e <+> char '@' <> pprParendType t
100
false
false
0
10
20
52
24
28
null
null
vTurbine/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
56
eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
56
eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
56
false
false
0
5
14
9
4
5
null
null
rethab/habi
test/CryptoTest.hs
mit
sym_decr_wrong_keylen :: Assertion sym_decr_wrong_keylen = do res <- runT $ symDecr "key" newIV "plain" assertBool "should fail" (isLeft res) let err = fromLeft res let expected = CryptoError undefined assertBool "should be CryptoError" (err ~=~ expected)
288
sym_decr_wrong_keylen :: Assertion sym_decr_wrong_keylen = do res <- runT $ symDecr "key" newIV "plain" assertBool "should fail" (isLeft res) let err = fromLeft res let expected = CryptoError undefined assertBool "should be CryptoError" (err ~=~ expected)
288
sym_decr_wrong_keylen = do res <- runT $ symDecr "key" newIV "plain" assertBool "should fail" (isLeft res) let err = fromLeft res let expected = CryptoError undefined assertBool "should be CryptoError" (err ~=~ expected)
253
false
true
0
10
68
82
37
45
null
null
s9gf4ult/yesod
yesod-form/Yesod/Form/I18n/Portuguese.hs
mit
portugueseFormMessage MsgInvalidTimeFormat = "Hora inválida, deve estar no formato HH:MM[:SS]"
94
portugueseFormMessage MsgInvalidTimeFormat = "Hora inválida, deve estar no formato HH:MM[:SS]"
94
portugueseFormMessage MsgInvalidTimeFormat = "Hora inválida, deve estar no formato HH:MM[:SS]"
94
false
false
0
5
9
9
4
5
null
null
urbanslug/ghc
testsuite/tests/perf/compiler/T783.hs
bsd-3-clause
foo x | x == 325 = 325
22
foo x | x == 325 = 325
22
foo x | x == 325 = 325
22
false
false
0
8
7
23
9
14
null
null
ctford/Idris-Elba-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v (LGt ITChar) [l, r] = doOp v (LGt ITNative) [l, r]
57
doOp v (LGt ITChar) [l, r] = doOp v (LGt ITNative) [l, r]
57
doOp v (LGt ITChar) [l, r] = doOp v (LGt ITNative) [l, r]
57
false
false
0
7
12
44
23
21
null
null
nathyong/microghc-ghc
ghc/Main.hs
bsd-3-clause
showSupportedExtensions :: IO () showSupportedExtensions = mapM_ putStrLn supportedLanguagesAndExtensions
105
showSupportedExtensions :: IO () showSupportedExtensions = mapM_ putStrLn supportedLanguagesAndExtensions
105
showSupportedExtensions = mapM_ putStrLn supportedLanguagesAndExtensions
72
false
true
0
6
8
21
10
11
null
null
ulricha/dsh
src/Database/DSH/VSL/Construct.hs
bsd-3-clause
lit :: Ordish r e => (PType, VecSegs) -> VSLBuild r e DVec lit i = bindOp $ VSL $ NullaryOp $ VSL.Lit i
103
lit :: Ordish r e => (PType, VecSegs) -> VSLBuild r e DVec lit i = bindOp $ VSL $ NullaryOp $ VSL.Lit i
103
lit i = bindOp $ VSL $ NullaryOp $ VSL.Lit i
44
false
true
0
7
23
57
28
29
null
null
GallagherCommaJack/scheming-machine
ParserEvaluator.hs
gpl-3.0
readProc [Port port] = (liftIO $ hGetLine port) >>= liftThrows . readExpr
73
readProc [Port port] = (liftIO $ hGetLine port) >>= liftThrows . readExpr
73
readProc [Port port] = (liftIO $ hGetLine port) >>= liftThrows . readExpr
73
false
false
0
9
11
34
16
18
null
null
comonoidial/ALFIN
Backend/OptimizeAsm.hs
mit
optimAlt _ _ (t, xs, me, (AsmBlock [] (NodeReturn (ConTag c) ys))) | t == c && (map rv $ lefts xs) == lefts ys && (map pv $ rights xs) == rights ys = (t, xs, me, AsmBlock [] TopReturn)
187
optimAlt _ _ (t, xs, me, (AsmBlock [] (NodeReturn (ConTag c) ys))) | t == c && (map rv $ lefts xs) == lefts ys && (map pv $ rights xs) == rights ys = (t, xs, me, AsmBlock [] TopReturn)
187
optimAlt _ _ (t, xs, me, (AsmBlock [] (NodeReturn (ConTag c) ys))) | t == c && (map rv $ lefts xs) == lefts ys && (map pv $ rights xs) == rights ys = (t, xs, me, AsmBlock [] TopReturn)
187
false
false
1
14
43
127
62
65
null
null
facebookincubator/duckling
Duckling/AmountOfMoney/HE/Rules.hs
bsd-3-clause
ruleIntervalMax :: Rule ruleIntervalMax = Rule { name = "under/less/lower/no more than <amount-of-money>" , pattern = [ regex "פחות מ|עד|לא יותר מ|מתחת ל?|לא מעל" , Predicate isSimpleAmountOfMoney ] , prod = \case (_: Token AmountOfMoney AmountOfMoneyData { TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c }: _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c _ -> Nothing }
468
ruleIntervalMax :: Rule ruleIntervalMax = Rule { name = "under/less/lower/no more than <amount-of-money>" , pattern = [ regex "פחות מ|עד|לא יותר מ|מתחת ל?|לא מעל" , Predicate isSimpleAmountOfMoney ] , prod = \case (_: Token AmountOfMoney AmountOfMoneyData { TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c }: _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c _ -> Nothing }
468
ruleIntervalMax = Rule { name = "under/less/lower/no more than <amount-of-money>" , pattern = [ regex "פחות מ|עד|לא יותר מ|מתחת ל?|לא מעל" , Predicate isSimpleAmountOfMoney ] , prod = \case (_: Token AmountOfMoney AmountOfMoneyData { TAmountOfMoney.value = Just to, TAmountOfMoney.currency = c }: _) -> Just . Token AmountOfMoney . withMax to $ currencyOnly c _ -> Nothing }
444
false
true
0
18
130
126
63
63
null
null
liamoc/hilbert
Display.hs
bsd-3-clause
displayViewSchema sk@(DS {..}) m (Variable s : rest) = char (variableAttr m) s <|> displayViewSchema sk m rest
163
displayViewSchema sk@(DS {..}) m (Variable s : rest) = char (variableAttr m) s <|> displayViewSchema sk m rest
163
displayViewSchema sk@(DS {..}) m (Variable s : rest) = char (variableAttr m) s <|> displayViewSchema sk m rest
163
false
false
0
9
70
57
28
29
null
null
cheng81/schemish
src/Env.hs
bsd-3-clause
nullEnv :: IO Env nullEnv = newIORef []
39
nullEnv :: IO Env nullEnv = newIORef []
39
nullEnv = newIORef []
21
false
true
0
6
7
19
9
10
null
null
spyked/writer-monkey
src/Markov/Chain.hs
bsd-3-clause
-- build a Markov chain from a key-value list fromList :: Ord a => [(a, [(a, Int)])] -> Chain a fromList = Chain . M.fromList . map (second M.fromList)
151
fromList :: Ord a => [(a, [(a, Int)])] -> Chain a fromList = Chain . M.fromList . map (second M.fromList)
105
fromList = Chain . M.fromList . map (second M.fromList)
55
true
true
0
10
28
65
35
30
null
null
brendanhay/gogol
gogol-adsense/gen/Network/Google/AdSense/Types/Product.hs
mpl-2.0
-- | Continuation token used to page through url channels. To retrieve the -- next page of the results, set the next request\'s \"page_token\" value -- to this. lucrNextPageToken :: Lens' ListURLChannelsResponse (Maybe Text) lucrNextPageToken = lens _lucrNextPageToken (\ s a -> s{_lucrNextPageToken = a})
313
lucrNextPageToken :: Lens' ListURLChannelsResponse (Maybe Text) lucrNextPageToken = lens _lucrNextPageToken (\ s a -> s{_lucrNextPageToken = a})
152
lucrNextPageToken = lens _lucrNextPageToken (\ s a -> s{_lucrNextPageToken = a})
88
true
true
0
8
52
51
27
24
null
null
GaloisInc/halvm-ghc
compiler/basicTypes/PatSyn.hs
bsd-3-clause
mkPatSyn :: Name -> Bool -- ^ Is the pattern synonym declared infix? -> ([TyVar], [TyBinder], ThetaType) -- ^ Universially-quantified type variables -- and required dicts -> ([TyVar], [TyBinder], ThetaType) -- ^ Existentially-quantified type variables -- and provided dicts -> [Type] -- ^ Original arguments -> Type -- ^ Original result type -> (Id, Bool) -- ^ Name of matcher -> Maybe (Id, Bool) -- ^ Name of builder -> [FieldLabel] -- ^ Names of fields for -- a record pattern synonym -> PatSyn -- NB: The univ and ex vars are both in TyBinder form and TyVar form for -- convenience. All the TyBinders should be Named! mkPatSyn name declared_infix (univ_tvs, univ_bndrs, req_theta) (ex_tvs, ex_bndrs, prov_theta) orig_args orig_res_ty matcher builder field_labels = MkPatSyn {psName = name, psUnique = getUnique name, psUnivTyVars = univ_tvs, psUnivTyBinders = univ_bndrs, psExTyVars = ex_tvs, psExTyBinders = ex_bndrs, psProvTheta = prov_theta, psReqTheta = req_theta, psInfix = declared_infix, psArgs = orig_args, psArity = length orig_args, psOrigResTy = orig_res_ty, psMatcher = matcher, psBuilder = builder, psFieldLabels = field_labels }
1,692
mkPatSyn :: Name -> Bool -- ^ Is the pattern synonym declared infix? -> ([TyVar], [TyBinder], ThetaType) -- ^ Universially-quantified type variables -- and required dicts -> ([TyVar], [TyBinder], ThetaType) -- ^ Existentially-quantified type variables -- and provided dicts -> [Type] -- ^ Original arguments -> Type -- ^ Original result type -> (Id, Bool) -- ^ Name of matcher -> Maybe (Id, Bool) -- ^ Name of builder -> [FieldLabel] -- ^ Names of fields for -- a record pattern synonym -> PatSyn mkPatSyn name declared_infix (univ_tvs, univ_bndrs, req_theta) (ex_tvs, ex_bndrs, prov_theta) orig_args orig_res_ty matcher builder field_labels = MkPatSyn {psName = name, psUnique = getUnique name, psUnivTyVars = univ_tvs, psUnivTyBinders = univ_bndrs, psExTyVars = ex_tvs, psExTyBinders = ex_bndrs, psProvTheta = prov_theta, psReqTheta = req_theta, psInfix = declared_infix, psArgs = orig_args, psArity = length orig_args, psOrigResTy = orig_res_ty, psMatcher = matcher, psBuilder = builder, psFieldLabels = field_labels }
1,566
mkPatSyn name declared_infix (univ_tvs, univ_bndrs, req_theta) (ex_tvs, ex_bndrs, prov_theta) orig_args orig_res_ty matcher builder field_labels = MkPatSyn {psName = name, psUnique = getUnique name, psUnivTyVars = univ_tvs, psUnivTyBinders = univ_bndrs, psExTyVars = ex_tvs, psExTyBinders = ex_bndrs, psProvTheta = prov_theta, psReqTheta = req_theta, psInfix = declared_infix, psArgs = orig_args, psArity = length orig_args, psOrigResTy = orig_res_ty, psMatcher = matcher, psBuilder = builder, psFieldLabels = field_labels }
749
true
true
0
14
718
246
154
92
null
null
spinda/glyph-editor
app/Model.hs
gpl-3.0
selectedStroke (PointSelector sn _) = Just sn
47
selectedStroke (PointSelector sn _) = Just sn
47
selectedStroke (PointSelector sn _) = Just sn
47
false
false
0
7
8
20
9
11
null
null
FranklinChen/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
isTypeConst _ = False
21
isTypeConst _ = False
21
isTypeConst _ = False
21
false
false
0
4
3
10
4
6
null
null
free2tedy/PP
Tema2PP/IOManager.hs
mit
-- | Appends text to the standard output. No newline is printed at the end, -- the caller must handle it. Returns a new @Output@ value, containing the -- appended text. writeStdOut :: Output -> String -> Output writeStdOut o@Output{..} s = o { stdout = stdout ++ s }
266
writeStdOut :: Output -> String -> Output writeStdOut o@Output{..} s = o { stdout = stdout ++ s }
97
writeStdOut o@Output{..} s = o { stdout = stdout ++ s }
55
true
true
0
8
49
48
27
21
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F06.hs
bsd-3-clause
ptr_glDepthBoundsEXT :: FunPtr (GLclampd -> GLclampd -> IO ()) ptr_glDepthBoundsEXT = unsafePerformIO $ getCommand "glDepthBoundsEXT"
133
ptr_glDepthBoundsEXT :: FunPtr (GLclampd -> GLclampd -> IO ()) ptr_glDepthBoundsEXT = unsafePerformIO $ getCommand "glDepthBoundsEXT"
133
ptr_glDepthBoundsEXT = unsafePerformIO $ getCommand "glDepthBoundsEXT"
70
false
true
0
10
14
37
18
19
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'VU.unzip5' vu_unzip5 = VU.unzip5
37
vu_unzip5 = VU.unzip5
21
vu_unzip5 = VU.unzip5
21
true
false
0
5
4
9
5
4
null
null
ppenzin/junta
src/main/haskell/Junta/Workflow/Test.hs
bsd-2-clause
-- | Perform Test action doTest :: BuildContext -> IO BuildContext doTest c = print "TODO Test" >> return c
107
doTest :: BuildContext -> IO BuildContext doTest c = print "TODO Test" >> return c
82
doTest c = print "TODO Test" >> return c
40
true
true
0
6
19
32
15
17
null
null
oden-lang/oden
src/Oden/Parser.hs
mit
slice :: Parser Expr slice = do si <- currentSourceInfo emptyBrackets exprs <- braces (expr `sepBy` comma) return (Slice si exprs)
138
slice :: Parser Expr slice = do si <- currentSourceInfo emptyBrackets exprs <- braces (expr `sepBy` comma) return (Slice si exprs)
138
slice = do si <- currentSourceInfo emptyBrackets exprs <- braces (expr `sepBy` comma) return (Slice si exprs)
117
false
true
0
11
28
63
28
35
null
null
Alasdair/Mella
Lang/Term.hs
bsd-3-clause
numberMetas x = pure x
39
numberMetas x = pure x
39
numberMetas x = pure x
39
false
false
0
5
21
12
5
7
null
null
arnizamani/SeqSolver
Amath/Proofs.hs
gpl-2.0
export' _ "wm" = ""
20
export' _ "wm" = ""
20
export' _ "wm" = ""
20
false
false
1
5
5
13
5
8
null
null
DanielRS/marquee
src/Text/Marquee/Parser/Common.hs
mit
noneOf :: [Char] -> Parser Char noneOf cs = satisfy (\c -> c `notElem` cs)
74
noneOf :: [Char] -> Parser Char noneOf cs = satisfy (\c -> c `notElem` cs)
74
noneOf cs = satisfy (\c -> c `notElem` cs)
42
false
true
0
8
14
46
23
23
null
null
BenedictEggers/99problems
src/Arithmetic.hs
mit
-- Problem 34 totient :: Int -> Int totient n = length [x | x <- [1..n], coprime x n]
85
totient :: Int -> Int totient n = length [x | x <- [1..n], coprime x n]
71
totient n = length [x | x <- [1..n], coprime x n]
49
true
true
0
9
19
50
25
25
null
null
Lythimus/lptv
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Biblio.hs
gpl-2.0
pLocator :: GenParser Inline st String pLocator = try $ do optional $ pMatch (== Str ",") optional pSpace f <- many1 (notFollowedBy pSpace >> anyToken) gs <- many1 pWordWithDigits return $ stringify f ++ (' ' : unwords gs)
233
pLocator :: GenParser Inline st String pLocator = try $ do optional $ pMatch (== Str ",") optional pSpace f <- many1 (notFollowedBy pSpace >> anyToken) gs <- many1 pWordWithDigits return $ stringify f ++ (' ' : unwords gs)
233
pLocator = try $ do optional $ pMatch (== Str ",") optional pSpace f <- many1 (notFollowedBy pSpace >> anyToken) gs <- many1 pWordWithDigits return $ stringify f ++ (' ' : unwords gs)
194
false
true
1
12
50
103
45
58
null
null
ramaciotti/dependent-types
src/lib/DependentTypes/Semantic.hs
gpl-3.0
-- | Checks if a symbol is being called with the wrong number/type of arguments -- according to the signature of a function being defined. checkIdSigs :: [(String, Signature)] -> String -> Either String () checkIdSigs ss expId = forM_ ss checkIdSigs' where checkIdSigs' (name, (Signature sig)) = do when (name == expId && length sig /= 1) $ Left expId -- | Checks if a call is being made with the wrong number/type of arguments -- according to the environment.
473
checkIdSigs :: [(String, Signature)] -> String -> Either String () checkIdSigs ss expId = forM_ ss checkIdSigs' where checkIdSigs' (name, (Signature sig)) = do when (name == expId && length sig /= 1) $ Left expId -- | Checks if a call is being made with the wrong number/type of arguments -- according to the environment.
334
checkIdSigs ss expId = forM_ ss checkIdSigs' where checkIdSigs' (name, (Signature sig)) = do when (name == expId && length sig /= 1) $ Left expId -- | Checks if a call is being made with the wrong number/type of arguments -- according to the environment.
267
true
true
0
12
93
102
53
49
null
null
ssaavedra/liquidhaskell
benchmarks/vector-0.10.0.1/Data/Vector.hs
bsd-3-clause
all = G.all
11
all = G.all
11
all = G.all
11
false
false
0
5
2
8
4
4
null
null
nushio3/ghc
compiler/main/GhcMake.hs
bsd-3-clause
home_imps :: [(Maybe FastString, Located ModuleName)] -> [Located ModuleName] home_imps imps = [ lmodname | (mb_pkg, lmodname) <- imps, isLocal mb_pkg ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False
321
home_imps :: [(Maybe FastString, Located ModuleName)] -> [Located ModuleName] home_imps imps = [ lmodname | (mb_pkg, lmodname) <- imps, isLocal mb_pkg ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False
321
home_imps imps = [ lmodname | (mb_pkg, lmodname) <- imps, isLocal mb_pkg ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False
243
false
true
3
8
97
108
55
53
null
null
erithion/duo-memo
doc/drafts/GithubUpdate.hs
mit
getContents :: String -> ExceptT String (ListT IO) (String, String) getContents gitPath = do -- TODO: Find out why the semantics for auth below returning auth::Auth is not equivalent to the simple liftIO $ maybeToEither which returns Either String Auth (auth::Auth) <- -- ::ExceptT String (ListT IO) Auth ExceptT . ListT $ -- ::IO [Either String Auth] (:[]) <$> -- maybeToEither :: IO (Either String Auth) maybeToEither ("Failed to find GIT access token.\nCheck the sytem environment variables and make sure " ++ tokenName ++ " variable contains a valid token. Otherwise generate it here https://github.com/settings/tokens/new") <$> getAuth (content::Github.Content) -- TODO: Why can't i use monadic return or lift. -- TODO: Study lift again. Search for the possibility of monad decomposition <- ExceptT . ListT $ -- (:[]) :: IO [Either String Github.Content] (:[]) <$> -- fmapL :: IO (Either String Github.Content) fmapL (show :: Github.Error -> String) <$> Github.contentsFor' (Just auth) "erithion" "temp_test" gitPath Nothing readItem content
1,348
getContents :: String -> ExceptT String (ListT IO) (String, String) getContents gitPath = do -- TODO: Find out why the semantics for auth below returning auth::Auth is not equivalent to the simple liftIO $ maybeToEither which returns Either String Auth (auth::Auth) <- -- ::ExceptT String (ListT IO) Auth ExceptT . ListT $ -- ::IO [Either String Auth] (:[]) <$> -- maybeToEither :: IO (Either String Auth) maybeToEither ("Failed to find GIT access token.\nCheck the sytem environment variables and make sure " ++ tokenName ++ " variable contains a valid token. Otherwise generate it here https://github.com/settings/tokens/new") <$> getAuth (content::Github.Content) -- TODO: Why can't i use monadic return or lift. -- TODO: Study lift again. Search for the possibility of monad decomposition <- ExceptT . ListT $ -- (:[]) :: IO [Either String Github.Content] (:[]) <$> -- fmapL :: IO (Either String Github.Content) fmapL (show :: Github.Error -> String) <$> Github.contentsFor' (Just auth) "erithion" "temp_test" gitPath Nothing readItem content
1,347
getContents gitPath = do -- TODO: Find out why the semantics for auth below returning auth::Auth is not equivalent to the simple liftIO $ maybeToEither which returns Either String Auth (auth::Auth) <- -- ::ExceptT String (ListT IO) Auth ExceptT . ListT $ -- ::IO [Either String Auth] (:[]) <$> -- maybeToEither :: IO (Either String Auth) maybeToEither ("Failed to find GIT access token.\nCheck the sytem environment variables and make sure " ++ tokenName ++ " variable contains a valid token. Otherwise generate it here https://github.com/settings/tokens/new") <$> getAuth (content::Github.Content) -- TODO: Why can't i use monadic return or lift. -- TODO: Study lift again. Search for the possibility of monad decomposition <- ExceptT . ListT $ -- (:[]) :: IO [Either String Github.Content] (:[]) <$> -- fmapL :: IO (Either String Github.Content) fmapL (show :: Github.Error -> String) <$> Github.contentsFor' (Just auth) "erithion" "temp_test" gitPath Nothing readItem content
1,279
false
true
0
13
458
173
92
81
null
null
takano-akio/ordrea
FRP/Ordrea/Base.hs
cc0-1.0
mkAccumCount n ac f = networkToList n $ do evt <- eventFromList $ map pure $ repeat 1 eventToBehavior <$> ac 0 ((\i s -> f (i + s, i + s :: Int)) <$> evt)
158
mkAccumCount n ac f = networkToList n $ do evt <- eventFromList $ map pure $ repeat 1 eventToBehavior <$> ac 0 ((\i s -> f (i + s, i + s :: Int)) <$> evt)
158
mkAccumCount n ac f = networkToList n $ do evt <- eventFromList $ map pure $ repeat 1 eventToBehavior <$> ac 0 ((\i s -> f (i + s, i + s :: Int)) <$> evt)
158
false
false
0
16
39
90
44
46
null
null
haskell/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
ppFamDecl :: Bool -- ^ is a summary -> Bool -- ^ is an associated type -> LinksInfo -> [DocInstance DocNameI] -- ^ relevant instances -> [(DocName, Fixity)] -- ^ relevant fixities -> SrcSpan -> Documentation DocName -- ^ this decl's documentation -> FamilyDecl DocNameI -- ^ this decl -> Splice -> Unicode -> Maybe Package -> Qualification -> Html ppFamDecl summary associated links instances fixities loc doc decl splice unicode pkg qual | summary = ppFamHeader True associated decl unicode qual | otherwise = header_ +++ docSection curname pkg qual doc +++ instancesBit where docname = unLoc $ fdLName decl curname = Just $ getName docname header_ = topDeclElem links loc splice [docname] $ ppFamHeader summary associated decl unicode qual <+> ppFixities fixities qual instancesBit | FamilyDecl { fdInfo = ClosedTypeFamily mb_eqns } <- decl , not summary = subEquations pkg qual $ map (ppFamDeclEqn . unLoc) $ fromMaybe [] mb_eqns | otherwise = ppInstances links (OriginFamily docname) instances splice unicode pkg qual -- Individual equation of a closed type family ppFamDeclEqn :: TyFamInstEqn DocNameI -> SubDecl ppFamDeclEqn (FamEqn { feqn_tycon = L _ n , feqn_rhs = rhs , feqn_pats = ts }) = ( ppAppNameTypeArgs n ts unicode qual <+> equals <+> ppType unicode qual HideEmptyContexts (unLoc rhs) , Nothing , [] ) -- | Print a pseudo family declaration
1,662
ppFamDecl :: Bool -- ^ is a summary -> Bool -- ^ is an associated type -> LinksInfo -> [DocInstance DocNameI] -- ^ relevant instances -> [(DocName, Fixity)] -- ^ relevant fixities -> SrcSpan -> Documentation DocName -- ^ this decl's documentation -> FamilyDecl DocNameI -- ^ this decl -> Splice -> Unicode -> Maybe Package -> Qualification -> Html ppFamDecl summary associated links instances fixities loc doc decl splice unicode pkg qual | summary = ppFamHeader True associated decl unicode qual | otherwise = header_ +++ docSection curname pkg qual doc +++ instancesBit where docname = unLoc $ fdLName decl curname = Just $ getName docname header_ = topDeclElem links loc splice [docname] $ ppFamHeader summary associated decl unicode qual <+> ppFixities fixities qual instancesBit | FamilyDecl { fdInfo = ClosedTypeFamily mb_eqns } <- decl , not summary = subEquations pkg qual $ map (ppFamDeclEqn . unLoc) $ fromMaybe [] mb_eqns | otherwise = ppInstances links (OriginFamily docname) instances splice unicode pkg qual -- Individual equation of a closed type family ppFamDeclEqn :: TyFamInstEqn DocNameI -> SubDecl ppFamDeclEqn (FamEqn { feqn_tycon = L _ n , feqn_rhs = rhs , feqn_pats = ts }) = ( ppAppNameTypeArgs n ts unicode qual <+> equals <+> ppType unicode qual HideEmptyContexts (unLoc rhs) , Nothing , [] ) -- | Print a pseudo family declaration
1,662
ppFamDecl summary associated links instances fixities loc doc decl splice unicode pkg qual | summary = ppFamHeader True associated decl unicode qual | otherwise = header_ +++ docSection curname pkg qual doc +++ instancesBit where docname = unLoc $ fdLName decl curname = Just $ getName docname header_ = topDeclElem links loc splice [docname] $ ppFamHeader summary associated decl unicode qual <+> ppFixities fixities qual instancesBit | FamilyDecl { fdInfo = ClosedTypeFamily mb_eqns } <- decl , not summary = subEquations pkg qual $ map (ppFamDeclEqn . unLoc) $ fromMaybe [] mb_eqns | otherwise = ppInstances links (OriginFamily docname) instances splice unicode pkg qual -- Individual equation of a closed type family ppFamDeclEqn :: TyFamInstEqn DocNameI -> SubDecl ppFamDeclEqn (FamEqn { feqn_tycon = L _ n , feqn_rhs = rhs , feqn_pats = ts }) = ( ppAppNameTypeArgs n ts unicode qual <+> equals <+> ppType unicode qual HideEmptyContexts (unLoc rhs) , Nothing , [] ) -- | Print a pseudo family declaration
1,179
false
true
5
18
527
436
212
224
null
null
peterokagey/haskellOEIS
src/HelperSequences/A061017.hs
apache-2.0
a061017_list :: [Integer] a061017_list = r 1 where r k = replicate (length $ divisors k) k ++ r (k + 1)
105
a061017_list :: [Integer] a061017_list = r 1 where r k = replicate (length $ divisors k) k ++ r (k + 1)
105
a061017_list = r 1 where r k = replicate (length $ divisors k) k ++ r (k + 1)
79
false
true
1
9
23
67
29
38
null
null
spechub/Hets
OWL2/Keywords.hs
gpl-2.0
nameS :: String nameS = "Name"
30
nameS :: String nameS = "Name"
30
nameS = "Name"
14
false
true
0
4
5
11
6
5
null
null
christiaanb/Idris-dev
src/IRTS/CLaSH/Show.hs
bsd-3-clause
showBinder b = "showBinder: " ++ show b
45
showBinder b = "showBinder: " ++ show b
45
showBinder b = "showBinder: " ++ show b
45
false
false
0
6
13
16
7
9
null
null
justinethier/husk-scheme
hs-src/Language/Scheme/Libraries.hs
mit
findModuleFile _ = return $ Bool False
38
findModuleFile _ = return $ Bool False
38
findModuleFile _ = return $ Bool False
38
false
false
0
6
6
16
7
9
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR :: GLenum gl_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR = 0x82FC
94
gl_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR :: GLenum gl_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR = 0x82FC
94
gl_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR = 0x82FC
46
false
true
0
4
5
11
6
5
null
null
svenkeidel/gnome-citadel
test/TilesSpec.hs
gpl-3.0
main :: IO () main = hspec spec
31
main :: IO () main = hspec spec
31
main = hspec spec
17
false
true
0
6
7
19
9
10
null
null
dhaneshkk/haskell-programming
.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen/Paths_haskell_programming.hs
bsd-3-clause
libexecdir = "/Users/rakeshkasinathan/code/haskell-programming/.stack-work/install/x86_64-osx/lts-3.17/7.10.2/libexec"
118
libexecdir = "/Users/rakeshkasinathan/code/haskell-programming/.stack-work/install/x86_64-osx/lts-3.17/7.10.2/libexec"
118
libexecdir = "/Users/rakeshkasinathan/code/haskell-programming/.stack-work/install/x86_64-osx/lts-3.17/7.10.2/libexec"
118
false
false
0
4
2
6
3
3
null
null
linearray/mealstrom
src/Mealstrom/FSMApi.hs
mit
get :: forall st wal k s e a . FSMStore st k s e a => FSMHandle st wal k s e a -> k -> IO(Maybe s) get FSMHandle{..} k = fsmRead fsmStore k (Proxy :: Proxy k s e a)
164
get :: forall st wal k s e a . FSMStore st k s e a => FSMHandle st wal k s e a -> k -> IO(Maybe s) get FSMHandle{..} k = fsmRead fsmStore k (Proxy :: Proxy k s e a)
164
get FSMHandle{..} k = fsmRead fsmStore k (Proxy :: Proxy k s e a)
65
false
true
1
11
42
103
52
51
null
null
rpglover64/lens
src/Language/Haskell/TH/Lens.hs
bsd-3-clause
_TyConI :: Prism' Info Dec _TyConI = prism remitter reviewer where remitter = TyConI reviewer (TyConI x) = Right x reviewer x = Left x #if MIN_VERSION_template_haskell(2,8,0)
197
_TyConI :: Prism' Info Dec _TyConI = prism remitter reviewer where remitter = TyConI reviewer (TyConI x) = Right x reviewer x = Left x #if MIN_VERSION_template_haskell(2,8,0)
197
_TyConI = prism remitter reviewer where remitter = TyConI reviewer (TyConI x) = Right x reviewer x = Left x #if MIN_VERSION_template_haskell(2,8,0)
170
false
true
2
7
49
59
28
31
null
null
crazymaik/ard-haskell
app/Main.hs
mit
main :: IO () main = getArgs >>= handle
39
main :: IO () main = getArgs >>= handle
39
main = getArgs >>= handle
25
false
true
0
6
8
20
10
10
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F15.hs
bsd-3-clause
glIsProgramPipelineEXT :: MonadIO m => GLuint -- ^ @pipeline@. -> m GLboolean -- ^ of type [Boolean](Graphics-GL-Groups.html#Boolean). glIsProgramPipelineEXT v1 = liftIO $ dyn284 ptr_glIsProgramPipelineEXT v1
214
glIsProgramPipelineEXT :: MonadIO m => GLuint -- ^ @pipeline@. -> m GLboolean glIsProgramPipelineEXT v1 = liftIO $ dyn284 ptr_glIsProgramPipelineEXT v1
157
glIsProgramPipelineEXT v1 = liftIO $ dyn284 ptr_glIsProgramPipelineEXT v1
73
true
true
0
8
30
43
20
23
null
null
andreagenso/java2scala
src/J2s/Parser.hs
apache-2.0
pDefaultValue = AGS.sem_DefaultValue_DefaultValue <$ pKeyWord "default" <*> pElementValue <|> pSucceed AGS.sem_DefaultValue_NilDefaultValue
164
pDefaultValue = AGS.sem_DefaultValue_DefaultValue <$ pKeyWord "default" <*> pElementValue <|> pSucceed AGS.sem_DefaultValue_NilDefaultValue
164
pDefaultValue = AGS.sem_DefaultValue_DefaultValue <$ pKeyWord "default" <*> pElementValue <|> pSucceed AGS.sem_DefaultValue_NilDefaultValue
164
false
false
4
7
35
34
15
19
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs
mpl-2.0
-- | The resources that this policy applies to. A resource is a match if it -- matches all the attributes listed here. If empty, this policy applies to -- all User data mappings for the given user. gchvcpResourceAttributes :: Lens' GoogleCloudHealthcareV1ConsentPolicy [Attribute] gchvcpResourceAttributes = lens _gchvcpResourceAttributes (\ s a -> s{_gchvcpResourceAttributes = a}) . _Default . _Coerce
423
gchvcpResourceAttributes :: Lens' GoogleCloudHealthcareV1ConsentPolicy [Attribute] gchvcpResourceAttributes = lens _gchvcpResourceAttributes (\ s a -> s{_gchvcpResourceAttributes = a}) . _Default . _Coerce
225
gchvcpResourceAttributes = lens _gchvcpResourceAttributes (\ s a -> s{_gchvcpResourceAttributes = a}) . _Default . _Coerce
142
true
true
3
8
77
61
30
31
null
null
seereason/wl-pprint-text
Text/PrettyPrint/Leijen/Text.hs
bsd-3-clause
-- | The document @comma@ contains a comma, \",\". comma :: Doc comma = char ','
80
comma :: Doc comma = char ','
29
comma = char ','
16
true
true
0
6
15
21
9
12
null
null
sproctor/dirtywater
src/Roll.hs
gpl-2.0
getSwingDice 10 = (1, 0)
24
getSwingDice 10 = (1, 0)
24
getSwingDice 10 = (1, 0)
24
false
false
0
5
4
15
8
7
null
null
dwb/koenigsrufen-haskell
src/KRBot/Game.hs
lgpl-3.0
testShowCallKingSuit = do (botSuit, _) <- runPlayerActionWithState callKingSuit $ BotPlayer.initialPlayerState Player1 [] (humanSuit, _) <- runPlayerActionWithState callKingSuit PromptPlayer.PlayerState {PromptPlayer._player = Player2, PromptPlayer._name = "Bob"} putStr "Bot chose: " print botSuit putStr "Human chose: " print humanSuit
389
testShowCallKingSuit = do (botSuit, _) <- runPlayerActionWithState callKingSuit $ BotPlayer.initialPlayerState Player1 [] (humanSuit, _) <- runPlayerActionWithState callKingSuit PromptPlayer.PlayerState {PromptPlayer._player = Player2, PromptPlayer._name = "Bob"} putStr "Bot chose: " print botSuit putStr "Human chose: " print humanSuit
389
testShowCallKingSuit = do (botSuit, _) <- runPlayerActionWithState callKingSuit $ BotPlayer.initialPlayerState Player1 [] (humanSuit, _) <- runPlayerActionWithState callKingSuit PromptPlayer.PlayerState {PromptPlayer._player = Player2, PromptPlayer._name = "Bob"} putStr "Bot chose: " print botSuit putStr "Human chose: " print humanSuit
389
false
false
0
10
87
97
46
51
null
null
thalerjonathan/phd
coding/prototyping/haskell/declarativeABM/haskell/SpatialGameABS/src/SpacialGameMsg/SGModelMsg.hs
gpl-3.0
sgMsg a (NeighbourPayoff p) = sgPayoffMsg a p
45
sgMsg a (NeighbourPayoff p) = sgPayoffMsg a p
45
sgMsg a (NeighbourPayoff p) = sgPayoffMsg a p
45
false
false
0
6
7
24
10
14
null
null
kim/kafka-protocol
src/Network/Kafka/Protocol/Universe.hs
mpl-2.0
messageSet :: Proxy FMessageSet messageSet = Proxy
50
messageSet :: Proxy FMessageSet messageSet = Proxy
50
messageSet = Proxy
18
false
true
0
5
6
14
7
7
null
null
pikajude/explain
src/Main.hs
mit
explainDec :: Decl -> Doc explainDec (TypeSig _ ns t) = fillSep [cat $ punctuate comma (map (\n -> unName False n empty) ns), "::", explainT t]
147
explainDec :: Decl -> Doc explainDec (TypeSig _ ns t) = fillSep [cat $ punctuate comma (map (\n -> unName False n empty) ns), "::", explainT t]
147
explainDec (TypeSig _ ns t) = fillSep [cat $ punctuate comma (map (\n -> unName False n empty) ns), "::", explainT t]
121
false
true
0
13
30
75
38
37
null
null
scslab/iterio-server
Examples/MongoBlog/Main.hs
bsd-3-clause
mimes "js" = "text/javascript"
30
mimes "js" = "text/javascript"
30
mimes "js" = "text/javascript"
30
false
false
0
4
3
10
4
6
null
null
fizruk/impossible-geometry-sample
isometry.hs
bsd-3-clause
testWorld :: WorldBuilder () testWorld = do let wall' = wall 0.9 blue lx <- wall' (Pos 0 4 0 ) (5, 1, 1) lx' <- wall' (Pos 0 0 0 ) (5, 1, 1) ly <- wall' (Pos 0 1 0 ) (1, 3, 1) ly' <- wall' (Pos 4 1 0 ) (1, 3, 1) lz <- wall' (Pos 0 0 (-1)) (1, 1, (-2)) lz' <- wall' (Pos 4 4 1) (1, 1, 1) lz' `behind` lz
325
testWorld :: WorldBuilder () testWorld = do let wall' = wall 0.9 blue lx <- wall' (Pos 0 4 0 ) (5, 1, 1) lx' <- wall' (Pos 0 0 0 ) (5, 1, 1) ly <- wall' (Pos 0 1 0 ) (1, 3, 1) ly' <- wall' (Pos 4 1 0 ) (1, 3, 1) lz <- wall' (Pos 0 0 (-1)) (1, 1, (-2)) lz' <- wall' (Pos 4 4 1) (1, 1, 1) lz' `behind` lz
325
testWorld = do let wall' = wall 0.9 blue lx <- wall' (Pos 0 4 0 ) (5, 1, 1) lx' <- wall' (Pos 0 0 0 ) (5, 1, 1) ly <- wall' (Pos 0 1 0 ) (1, 3, 1) ly' <- wall' (Pos 4 1 0 ) (1, 3, 1) lz <- wall' (Pos 0 0 (-1)) (1, 1, (-2)) lz' <- wall' (Pos 4 4 1) (1, 1, 1) lz' `behind` lz
296
false
true
6
10
102
235
121
114
null
null
darcykimball/lambda
src/Lambda.hs
bsd-3-clause
parseTerm :: LambdaParser s (Term VarName) parseTerm = chainl1 parseNonApp (pure App)
85
parseTerm :: LambdaParser s (Term VarName) parseTerm = chainl1 parseNonApp (pure App)
85
parseTerm = chainl1 parseNonApp (pure App)
42
false
true
2
7
11
42
16
26
null
null
tpsinnem/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
getConsts (_ : xs) = getConsts xs
52
getConsts (_ : xs) = getConsts xs
52
getConsts (_ : xs) = getConsts xs
52
false
false
0
7
25
19
9
10
null
null
markwright/antlrc-examples
src/tapl/arith/Semantic.hs
bsd-3-clause
eval1Ex (TmPred fi t1) = let t1' = eval1Ex t1 in TmPred fi t1'
67
eval1Ex (TmPred fi t1) = let t1' = eval1Ex t1 in TmPred fi t1'
67
eval1Ex (TmPred fi t1) = let t1' = eval1Ex t1 in TmPred fi t1'
67
false
false
0
9
18
36
16
20
null
null
petermarks/FDL
src/Graphics/FDL/Lang.hs
bsd-3-clause
lambdaToCL i (A f v) = A (A S (lambdaToCL i f)) (lambdaToCL i v)
64
lambdaToCL i (A f v) = A (A S (lambdaToCL i f)) (lambdaToCL i v)
64
lambdaToCL i (A f v) = A (A S (lambdaToCL i f)) (lambdaToCL i v)
64
false
false
0
9
14
51
23
28
null
null
robstewart57/ripl
src/Inference/BitWidth.hs
bsd-3-clause
-- | for the given constructor, return an integer to be -- used in the type signature for the corresponding actor. maxValue :: CalBitWidth -> Int maxValue bw = case bw of CalUInt8 -> fromIntegral (maxBound :: Word8) CalUInt16 -> fromIntegral (maxBound :: Word16) CalUInt32 -> fromIntegral (maxBound :: Word32)
325
maxValue :: CalBitWidth -> Int maxValue bw = case bw of CalUInt8 -> fromIntegral (maxBound :: Word8) CalUInt16 -> fromIntegral (maxBound :: Word16) CalUInt32 -> fromIntegral (maxBound :: Word32)
208
maxValue bw = case bw of CalUInt8 -> fromIntegral (maxBound :: Word8) CalUInt16 -> fromIntegral (maxBound :: Word16) CalUInt32 -> fromIntegral (maxBound :: Word32)
177
true
true
0
9
65
69
37
32
null
null
mettekou/ghc
libraries/compact/tests/compact_serialize.hs
bsd-3-clause
main = do let val = ("hello", 1, 42, 42, Just 42) :: (String, Int, Int, Integer, Maybe Int) (sc, bytestrs) <- serialize val performMajorGC mcnf <- importCompactByteStrings sc bytestrs case mcnf of Nothing -> assertFail "import failed" Just cnf -> assertEquals val (getCompact cnf)
308
main = do let val = ("hello", 1, 42, 42, Just 42) :: (String, Int, Int, Integer, Maybe Int) (sc, bytestrs) <- serialize val performMajorGC mcnf <- importCompactByteStrings sc bytestrs case mcnf of Nothing -> assertFail "import failed" Just cnf -> assertEquals val (getCompact cnf)
308
main = do let val = ("hello", 1, 42, 42, Just 42) :: (String, Int, Int, Integer, Maybe Int) (sc, bytestrs) <- serialize val performMajorGC mcnf <- importCompactByteStrings sc bytestrs case mcnf of Nothing -> assertFail "import failed" Just cnf -> assertEquals val (getCompact cnf)
308
false
false
0
12
72
121
61
60
null
null