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
mcmaniac/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
castVars :: [(LlvmVar, LlvmType)] -> UniqSM ([LlvmVar], LlvmStatements) castVars vars = do done <- mapM (uncurry castVar) vars let (vars', stmts) = unzip done return (vars', toOL stmts) -- | Cast an LLVM variable to a specific type, panicing if it can't be done.
320
castVars :: [(LlvmVar, LlvmType)] -> UniqSM ([LlvmVar], LlvmStatements) castVars vars = do done <- mapM (uncurry castVar) vars let (vars', stmts) = unzip done return (vars', toOL stmts) -- | Cast an LLVM variable to a specific type, panicing if it can't be done.
320
castVars vars = do done <- mapM (uncurry castVar) vars let (vars', stmts) = unzip done return (vars', toOL stmts) -- | Cast an LLVM variable to a specific type, panicing if it can't be done.
239
false
true
0
10
101
92
47
45
null
null
noughtmare/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs
gpl-2.0
-- HIRAGANA LETTER DO switch 'n' 'a' = '\x306A'
47
switch 'n' 'a' = '\x306A'
25
switch 'n' 'a' = '\x306A'
25
true
false
0
5
8
12
6
6
null
null
mbakke/ganeti
src/Ganeti/Hs2Py/OpDoc.hs
bsd-2-clause
opNetworkConnect :: String opNetworkConnect = "Connect a Network to a specific Nodegroup with the defined netparams\n\ \ (mode, link). Nics in this Network will inherit those params.\n\ \ Produce errors if a NIC (that its not already assigned to a network)\n\ \ has an IP that is contained in the Network this will produce error\ \ unless\n\ \ --no-conflicts-check is passed."
394
opNetworkConnect :: String opNetworkConnect = "Connect a Network to a specific Nodegroup with the defined netparams\n\ \ (mode, link). Nics in this Network will inherit those params.\n\ \ Produce errors if a NIC (that its not already assigned to a network)\n\ \ has an IP that is contained in the Network this will produce error\ \ unless\n\ \ --no-conflicts-check is passed."
394
opNetworkConnect = "Connect a Network to a specific Nodegroup with the defined netparams\n\ \ (mode, link). Nics in this Network will inherit those params.\n\ \ Produce errors if a NIC (that its not already assigned to a network)\n\ \ has an IP that is contained in the Network this will produce error\ \ unless\n\ \ --no-conflicts-check is passed."
367
false
true
0
4
78
11
6
5
null
null
meditans/hint
src/Hint/Base.hs
bsd-3-clause
showGHC :: (MonadInterpreter m, GHC.Outputable a) => a -> m String showGHC a = do unqual <- runGhc GHC.getPrintUnqual withDynFlags $ \df -> return $ GHC.showSDocForUser df unqual (GHC.ppr a) -- ================ Misc =================================== -- this type ought to go in Hint.Context, but ghc dislikes cyclic imports...
345
showGHC :: (MonadInterpreter m, GHC.Outputable a) => a -> m String showGHC a = do unqual <- runGhc GHC.getPrintUnqual withDynFlags $ \df -> return $ GHC.showSDocForUser df unqual (GHC.ppr a) -- ================ Misc =================================== -- this type ought to go in Hint.Context, but ghc dislikes cyclic imports...
345
showGHC a = do unqual <- runGhc GHC.getPrintUnqual withDynFlags $ \df -> return $ GHC.showSDocForUser df unqual (GHC.ppr a) -- ================ Misc =================================== -- this type ought to go in Hint.Context, but ghc dislikes cyclic imports...
278
false
true
0
13
63
85
42
43
null
null
ezyang/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
mapOccEnv f (A x) = A $ mapUFM f x
41
mapOccEnv f (A x) = A $ mapUFM f x
41
mapOccEnv f (A x) = A $ mapUFM f x
41
false
false
0
7
16
26
12
14
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpHasSideEffects MaskStatus = True
38
primOpHasSideEffects MaskStatus = True
38
primOpHasSideEffects MaskStatus = True
38
false
false
0
5
3
9
4
5
null
null
shlevy/ghc
compiler/main/TidyPgm.hs
bsd-3-clause
dffvExpr (Case e b _ as) = dffvExpr e >> extendScope b (mapM_ dffvAlt as)
78
dffvExpr (Case e b _ as) = dffvExpr e >> extendScope b (mapM_ dffvAlt as)
78
dffvExpr (Case e b _ as) = dffvExpr e >> extendScope b (mapM_ dffvAlt as)
78
false
false
0
8
19
41
19
22
null
null
mbakke/ganeti
src/Ganeti/Runtime.hs
bsd-2-clause
-- | Returns the configured group for a daemon. daemonGroup :: GanetiGroup -> String daemonGroup (DaemonGroup GanetiMasterd) = AutoConf.masterdGroup
148
daemonGroup :: GanetiGroup -> String daemonGroup (DaemonGroup GanetiMasterd) = AutoConf.masterdGroup
100
daemonGroup (DaemonGroup GanetiMasterd) = AutoConf.masterdGroup
63
true
true
0
7
18
27
14
13
null
null
mcmaniac/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
x86_complex_amode :: CmmExpr -> CmmExpr -> Integer -> Integer -> NatM Amode x86_complex_amode base index shift offset = do (x_reg, x_code) <- getNonClobberedReg base -- x must be in a temp, because it has to stay live over y_code -- we could compre x_reg and y_reg and do something better here... (y_reg, y_code) <- getSomeReg index let code = x_code `appOL` y_code base = case shift of 0 -> 1; 1 -> 2; 2 -> 4; 3 -> 8; n -> panic $ "x86_complex_amode: unhandled shift! (" ++ show n ++ ")" return (Amode (AddrBaseIndex (EABaseReg x_reg) (EAIndex y_reg base) (ImmInt (fromIntegral offset))) code) -- ----------------------------------------------------------------------------- -- getOperand: sometimes any operand will do. -- getNonClobberedOperand: the value of the operand will remain valid across -- the computation of an arbitrary expression, unless the expression -- is computed directly into a register which the operand refers to -- (see trivialCode where this function is used for an example).
1,113
x86_complex_amode :: CmmExpr -> CmmExpr -> Integer -> Integer -> NatM Amode x86_complex_amode base index shift offset = do (x_reg, x_code) <- getNonClobberedReg base -- x must be in a temp, because it has to stay live over y_code -- we could compre x_reg and y_reg and do something better here... (y_reg, y_code) <- getSomeReg index let code = x_code `appOL` y_code base = case shift of 0 -> 1; 1 -> 2; 2 -> 4; 3 -> 8; n -> panic $ "x86_complex_amode: unhandled shift! (" ++ show n ++ ")" return (Amode (AddrBaseIndex (EABaseReg x_reg) (EAIndex y_reg base) (ImmInt (fromIntegral offset))) code) -- ----------------------------------------------------------------------------- -- getOperand: sometimes any operand will do. -- getNonClobberedOperand: the value of the operand will remain valid across -- the computation of an arbitrary expression, unless the expression -- is computed directly into a register which the operand refers to -- (see trivialCode where this function is used for an example).
1,113
x86_complex_amode base index shift offset = do (x_reg, x_code) <- getNonClobberedReg base -- x must be in a temp, because it has to stay live over y_code -- we could compre x_reg and y_reg and do something better here... (y_reg, y_code) <- getSomeReg index let code = x_code `appOL` y_code base = case shift of 0 -> 1; 1 -> 2; 2 -> 4; 3 -> 8; n -> panic $ "x86_complex_amode: unhandled shift! (" ++ show n ++ ")" return (Amode (AddrBaseIndex (EABaseReg x_reg) (EAIndex y_reg base) (ImmInt (fromIntegral offset))) code) -- ----------------------------------------------------------------------------- -- getOperand: sometimes any operand will do. -- getNonClobberedOperand: the value of the operand will remain valid across -- the computation of an arbitrary expression, unless the expression -- is computed directly into a register which the operand refers to -- (see trivialCode where this function is used for an example).
1,037
false
true
0
15
269
202
106
96
null
null
manuchandel/Academics
Principles-Of-Programming-Languages/binaryTree.hs
mit
myTree= Node 1 (Node 2 (Node 3 (Node 4 Nil Nil) (Node 5 Nil Nil) ) (Node 6 (Node 7 Nil Nil) (Node 8 Nil Nil) ) ) (Node 9 (Node 10 (Node 11 Nil Nil) (Node 12 Nil Nil) ) (Node 13 (Node 14 Nil Nil) (Node 15 Nil Nil) ) )
510
myTree= Node 1 (Node 2 (Node 3 (Node 4 Nil Nil) (Node 5 Nil Nil) ) (Node 6 (Node 7 Nil Nil) (Node 8 Nil Nil) ) ) (Node 9 (Node 10 (Node 11 Nil Nil) (Node 12 Nil Nil) ) (Node 13 (Node 14 Nil Nil) (Node 15 Nil Nil) ) )
510
myTree= Node 1 (Node 2 (Node 3 (Node 4 Nil Nil) (Node 5 Nil Nil) ) (Node 6 (Node 7 Nil Nil) (Node 8 Nil Nil) ) ) (Node 9 (Node 10 (Node 11 Nil Nil) (Node 12 Nil Nil) ) (Node 13 (Node 14 Nil Nil) (Node 15 Nil Nil) ) )
510
false
false
1
11
346
157
76
81
null
null
ekmett/ghc
compiler/utils/BooleanFormula.hs
bsd-3-clause
isTrue :: BooleanFormula a -> Bool isTrue (And []) = True
57
isTrue :: BooleanFormula a -> Bool isTrue (And []) = True
57
isTrue (And []) = True
22
false
true
0
8
10
29
14
15
null
null
janherich/learning-haskell
Datatypes.hs
epl-1.0
vectMult :: (Num t) => Vector t -> t -> Vector t (Vector i j k) `vectMult` m = Vector (i*m) (j*m) (k*m)
103
vectMult :: (Num t) => Vector t -> t -> Vector t (Vector i j k) `vectMult` m = Vector (i*m) (j*m) (k*m)
103
(Vector i j k) `vectMult` m = Vector (i*m) (j*m) (k*m)
54
false
true
0
8
22
80
41
39
null
null
da-x/Algorithm-W-Step-By-Step
Lamdu/Infer.hs
gpl-3.0
nomTypes :: SkolemScope -> Map T.NominalId Nominal -> T.NominalId -> M.Infer (Type, Scheme) nomTypes outerSkolemsScope nominals name = do nominal <- getNominal nominals name p1_paramVals <- nParams nominal & Map.keysSet & Map.fromSet (const (M.freshInferredVar outerSkolemsScope "n")) & sequenceA return (T.TInst name p1_paramVals, Nominal.apply p1_paramVals nominal)
433
nomTypes :: SkolemScope -> Map T.NominalId Nominal -> T.NominalId -> M.Infer (Type, Scheme) nomTypes outerSkolemsScope nominals name = do nominal <- getNominal nominals name p1_paramVals <- nParams nominal & Map.keysSet & Map.fromSet (const (M.freshInferredVar outerSkolemsScope "n")) & sequenceA return (T.TInst name p1_paramVals, Nominal.apply p1_paramVals nominal)
433
nomTypes outerSkolemsScope nominals name = do nominal <- getNominal nominals name p1_paramVals <- nParams nominal & Map.keysSet & Map.fromSet (const (M.freshInferredVar outerSkolemsScope "n")) & sequenceA return (T.TInst name p1_paramVals, Nominal.apply p1_paramVals nominal)
341
false
true
0
15
110
133
63
70
null
null
madebyjeffrey/socrsite
Settings.hs
bsd-2-clause
-- Static setting below. Changing these requires a recompile -- | The location of static files on your system. This is a file system -- path. The default value works properly with your scaffolded site. staticDir :: FilePath staticDir = "static"
245
staticDir :: FilePath staticDir = "static"
42
staticDir = "static"
20
true
true
0
6
41
21
10
11
null
null
ricardopenyamari/ir2haskell
clir-parser-haskell-master/lib/sexp-grammar/src/Data/InvertibleGrammar/TH.hs
gpl-2.0
constructors :: Dec -> Maybe (Bool, [Con]) constructors (DataD _ _ _ cs _) = Just (length cs == 1, cs)
104
constructors :: Dec -> Maybe (Bool, [Con]) constructors (DataD _ _ _ cs _) = Just (length cs == 1, cs)
104
constructors (DataD _ _ _ cs _) = Just (length cs == 1, cs)
61
false
true
0
8
22
60
31
29
null
null
dcousens/RayTracer
Vec.hs
mit
vreflect v n = vscale (n + v) ((-2) * (vdot v n))
49
vreflect v n = vscale (n + v) ((-2) * (vdot v n))
49
vreflect v n = vscale (n + v) ((-2) * (vdot v n))
49
false
false
1
9
12
48
22
26
null
null
achirkin/BuildWrapper
src/Language/Haskell/BuildWrapper/Base.hs
bsd-3-clause
-- | constructs an OutlineDef with no children and no type signature mkOutlineDef :: T.Text -- ^ name -> [OutlineDefType] -- ^ types: can have several to combine -> InFileSpan -- ^ span in source -> OutlineDef mkOutlineDef n t l= mkOutlineDefWithChildren n t l []
300
mkOutlineDef :: T.Text -- ^ name -> [OutlineDefType] -- ^ types: can have several to combine -> InFileSpan -- ^ span in source -> OutlineDef mkOutlineDef n t l= mkOutlineDefWithChildren n t l []
224
mkOutlineDef n t l= mkOutlineDefWithChildren n t l []
54
true
true
0
9
82
55
28
27
null
null
rueshyna/gogol
gogol-android-enterprise/gen/Network/Google/AndroidEnterprise/Types/Product.hs
mpl-2.0
-- | The user\'s primary email address, for example, \"jsmith\'example.com\". -- Will always be set for Google managed users and not set for EMM managed -- users. uPrimaryEmail :: Lens' User (Maybe Text) uPrimaryEmail = lens _uPrimaryEmail (\ s a -> s{_uPrimaryEmail = a})
280
uPrimaryEmail :: Lens' User (Maybe Text) uPrimaryEmail = lens _uPrimaryEmail (\ s a -> s{_uPrimaryEmail = a})
117
uPrimaryEmail = lens _uPrimaryEmail (\ s a -> s{_uPrimaryEmail = a})
76
true
true
1
9
51
53
27
26
null
null
nlinker/haskell-you-could
src/Main.hs
mit
decodeAll _ = []
25
decodeAll _ = []
25
decodeAll _ = []
25
false
false
0
5
12
11
5
6
null
null
kovach/ecstatic
Development/Ecstatic/Utils.hs
bsd-2-clause
-- TODO remove this!! -- it will cause bugs subAllNames :: CExpr -> CExpr -> CExpr subAllNames e = transformBi f where f :: CExpr -> CExpr f x | Just _ <- isCond x = x f x@(CBinary _ _ _ _) = x f x | Just _ <- isMaxCall x = x f x@(CVar (Ident "_max" _ _) _) = x f x | Just _ <- isAtom x = e -- trace ("\nsee: " ++ show x++"\n") $ e f x = x -- Reduces 'MAX' instances
390
subAllNames :: CExpr -> CExpr -> CExpr subAllNames e = transformBi f where f :: CExpr -> CExpr f x | Just _ <- isCond x = x f x@(CBinary _ _ _ _) = x f x | Just _ <- isMaxCall x = x f x@(CVar (Ident "_max" _ _) _) = x f x | Just _ <- isAtom x = e -- trace ("\nsee: " ++ show x++"\n") $ e f x = x -- Reduces 'MAX' instances
346
subAllNames e = transformBi f where f :: CExpr -> CExpr f x | Just _ <- isCond x = x f x@(CBinary _ _ _ _) = x f x | Just _ <- isMaxCall x = x f x@(CVar (Ident "_max" _ _) _) = x f x | Just _ <- isAtom x = e -- trace ("\nsee: " ++ show x++"\n") $ e f x = x -- Reduces 'MAX' instances
307
true
true
2
10
114
187
84
103
null
null
tpsinnem/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
showEnv :: (Eq n, Show n) => EnvTT n -> TT n -> String showEnv env t = showEnv' env t False
91
showEnv :: (Eq n, Show n) => EnvTT n -> TT n -> String showEnv env t = showEnv' env t False
91
showEnv env t = showEnv' env t False
36
false
true
0
9
21
57
26
31
null
null
srank/regexp
ParseRegexp.hs
gpl-3.0
buildRegexp rs (OpenBracket:ts) | r == CloseBracket = buildRegexp (sequenceIt rs matched) remains | otherwise = error "mismatched brackets" where (matched, r:remains) = buildRegexp Nothing ts
206
buildRegexp rs (OpenBracket:ts) | r == CloseBracket = buildRegexp (sequenceIt rs matched) remains | otherwise = error "mismatched brackets" where (matched, r:remains) = buildRegexp Nothing ts
206
buildRegexp rs (OpenBracket:ts) | r == CloseBracket = buildRegexp (sequenceIt rs matched) remains | otherwise = error "mismatched brackets" where (matched, r:remains) = buildRegexp Nothing ts
206
false
false
1
8
40
74
36
38
null
null
nushio3/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
lookupHsSig :: HsSigFun -> Name -> Maybe (LHsSigType Name) lookupHsSig = lookupNameEnv
86
lookupHsSig :: HsSigFun -> Name -> Maybe (LHsSigType Name) lookupHsSig = lookupNameEnv
86
lookupHsSig = lookupNameEnv
27
false
true
0
10
11
34
15
19
null
null
mikeplus64/plissken
src/Save.hs
gpl-3.0
natT c = Key c TN
18
natT c = Key c TN
18
natT c = Key c TN
18
false
false
0
5
6
14
6
8
null
null
dag/path
src/System/PathName/Internal.hs
bsd-3-clause
-- ^ 'Backend.removeLink' removeFile = unsafeCoerce Backend.removeLink
70
removeFile = unsafeCoerce Backend.removeLink
44
removeFile = unsafeCoerce Backend.removeLink
44
true
false
0
6
6
12
6
6
null
null
DunderRoffe/sjolind.se
src/AcidDatabase.hs
gpl-3.0
getVerificationUris :: Query Database [Verification] getVerificationUris = do (Database _ _ _ v) <- ask return v
123
getVerificationUris :: Query Database [Verification] getVerificationUris = do (Database _ _ _ v) <- ask return v
123
getVerificationUris = do (Database _ _ _ v) <- ask return v
70
false
true
1
9
27
48
21
27
null
null
Helium4Haskell/helium
src/Helium/Parser/Lexer.hs
gpl-3.0
mainLexer :: Lexer mainLexer a = do useTutor <- elem UseTutor `liftM` getOpts mainLexer' useTutor a
106
mainLexer :: Lexer mainLexer a = do useTutor <- elem UseTutor `liftM` getOpts mainLexer' useTutor a
106
mainLexer a = do useTutor <- elem UseTutor `liftM` getOpts mainLexer' useTutor a
87
false
true
0
9
22
38
18
20
null
null
janschulz/pandoc
src/Text/Pandoc/Readers/Docx/Parse.hs
gpl-2.0
elemToParPart ns element | isElem ns "w" "r" element , Just _ <- findChild (elemName ns "w" "pict") element = let drawing = findElement (elemName ns "v" "imagedata") element >>= findAttr (elemName ns "r" "id") in case drawing of Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp bs Nothing) Nothing -> throwError WrongElem
387
elemToParPart ns element | isElem ns "w" "r" element , Just _ <- findChild (elemName ns "w" "pict") element = let drawing = findElement (elemName ns "v" "imagedata") element >>= findAttr (elemName ns "r" "id") in case drawing of Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp bs Nothing) Nothing -> throwError WrongElem
387
elemToParPart ns element | isElem ns "w" "r" element , Just _ <- findChild (elemName ns "w" "pict") element = let drawing = findElement (elemName ns "v" "imagedata") element >>= findAttr (elemName ns "r" "id") in case drawing of Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp bs Nothing) Nothing -> throwError WrongElem
387
false
false
0
15
106
149
70
79
null
null
phischu/fragnix
builtins/base/Control.Concurrent.Chan.hs
bsd-3-clause
dupChan :: Chan a -> IO (Chan a) dupChan (Chan _ writeVar) = do hole <- readMVar writeVar newReadVar <- newMVar hole return (Chan newReadVar writeVar) -- |Put a data item back onto a channel, where it will be the next item read.
244
dupChan :: Chan a -> IO (Chan a) dupChan (Chan _ writeVar) = do hole <- readMVar writeVar newReadVar <- newMVar hole return (Chan newReadVar writeVar) -- |Put a data item back onto a channel, where it will be the next item read.
244
dupChan (Chan _ writeVar) = do hole <- readMVar writeVar newReadVar <- newMVar hole return (Chan newReadVar writeVar) -- |Put a data item back onto a channel, where it will be the next item read.
211
false
true
0
9
58
77
34
43
null
null
gcross/PauliQSC
Data/Quantum/Small/Operator.hs
bsd-2-clause
hasZBitAt column (Operator _ z) = testBit z column
50
hasZBitAt column (Operator _ z) = testBit z column
50
hasZBitAt column (Operator _ z) = testBit z column
50
false
false
0
7
8
24
11
13
null
null
haslab/SecreC
src/Language/SecreC/Transformation/Dafny.hs
gpl-3.0
dafnyIdModuleTyVarId :: DafnyId -> ModuleTyVarId dafnyIdModuleTyVarId (PId _ tid) = tid
87
dafnyIdModuleTyVarId :: DafnyId -> ModuleTyVarId dafnyIdModuleTyVarId (PId _ tid) = tid
87
dafnyIdModuleTyVarId (PId _ tid) = tid
38
false
true
0
7
10
26
13
13
null
null
kajigor/uKanren_transformations
test/resources/Program/PropEval.hs
bsd-3-clause
plainLastQuery = Program plainLast $ fresh ["fm", "st"] (call "evalo" [V "st", V "fm", trueo])
96
plainLastQuery = Program plainLast $ fresh ["fm", "st"] (call "evalo" [V "st", V "fm", trueo])
96
plainLastQuery = Program plainLast $ fresh ["fm", "st"] (call "evalo" [V "st", V "fm", trueo])
96
false
false
0
10
16
47
24
23
null
null
jhedev/google-maps
src/Web/Google/Maps/Util.hs
mit
dropToLower :: Int -> Options dropToLower n = defaultOptions{fieldLabelModifier = map toLower . drop n}
103
dropToLower :: Int -> Options dropToLower n = defaultOptions{fieldLabelModifier = map toLower . drop n}
103
dropToLower n = defaultOptions{fieldLabelModifier = map toLower . drop n}
73
false
true
0
8
14
36
18
18
null
null
alexisVallet/deep-banana
src/DeepBanana/Layer/Parallel.hs
bsd-3-clause
ltransfer :: forall m t1 t2 a d1 d2 . (MonadCuda m, Device d1, Device d2, DeviceTransfer t1 d2, Transferred t1 d2 ~ t2, DeviceTransfer t2 d1, Transferred t2 d1 ~ t1, FixShape t1, FixShape t2, FixScalar t1 ~ FixScalar t2) => d1 -> d2 -> Layer m (FixScalar t1) '[] t1 t2 ltransfer dev1 dev2 = combinePasses' fwdTransfer bwdTransfer where fwdTransfer x = transfer dev2 x bwdTransfer _ _ = return $ \dy -> transfer' dev1 dy
488
ltransfer :: forall m t1 t2 a d1 d2 . (MonadCuda m, Device d1, Device d2, DeviceTransfer t1 d2, Transferred t1 d2 ~ t2, DeviceTransfer t2 d1, Transferred t2 d1 ~ t1, FixShape t1, FixShape t2, FixScalar t1 ~ FixScalar t2) => d1 -> d2 -> Layer m (FixScalar t1) '[] t1 t2 ltransfer dev1 dev2 = combinePasses' fwdTransfer bwdTransfer where fwdTransfer x = transfer dev2 x bwdTransfer _ _ = return $ \dy -> transfer' dev1 dy
488
ltransfer dev1 dev2 = combinePasses' fwdTransfer bwdTransfer where fwdTransfer x = transfer dev2 x bwdTransfer _ _ = return $ \dy -> transfer' dev1 dy
160
false
true
1
11
146
188
94
94
null
null
TomMD/ghc
compiler/types/Type.hs
bsd-3-clause
isForAllTy :: Type -> Bool isForAllTy (ForAllTy _ _) = True
59
isForAllTy :: Type -> Bool isForAllTy (ForAllTy _ _) = True
59
isForAllTy (ForAllTy _ _) = True
32
false
true
0
9
10
32
14
18
null
null
svalaskevicius/hob
src/lib/Hob/Command/FocusSidebar.hs
gpl-3.0
syncActiveEditorPathToSidebar :: App() syncActiveEditorPathToSidebar = do ctx <- ask editor <- liftIO $ getActiveEditor ctx maybeDo syncToEditor editor where syncToEditor editor = maybeDo syncPathToSidebar =<< liftIO (getEditorFilePath editor)
259
syncActiveEditorPathToSidebar :: App() syncActiveEditorPathToSidebar = do ctx <- ask editor <- liftIO $ getActiveEditor ctx maybeDo syncToEditor editor where syncToEditor editor = maybeDo syncPathToSidebar =<< liftIO (getEditorFilePath editor)
259
syncActiveEditorPathToSidebar = do ctx <- ask editor <- liftIO $ getActiveEditor ctx maybeDo syncToEditor editor where syncToEditor editor = maybeDo syncPathToSidebar =<< liftIO (getEditorFilePath editor)
220
false
true
0
10
43
71
32
39
null
null
snoyberg/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
lookupOccEnv (A x) y = lookupUFM x y
36
lookupOccEnv (A x) y = lookupUFM x y
36
lookupOccEnv (A x) y = lookupUFM x y
36
false
false
0
7
7
22
10
12
null
null
benweitzman/PhoBuddies-Servant
src/Server/Invitation.hs
mit
createInvitation :: Maybe (Token Authorization) -> InvitationCreation -> ConfigM Invitation createInvitation token (InvitationCreation locId date) = do Authorization authEmail <- requireToken token result <- runNeo $ do [userNode] <- getNodesByLabelAndProperty "User" $ Just ("email" |: fromEmail authEmail) mRestaurant <- getNode (fromIntegral locId :: Integer) case mRestaurant of Nothing -> return $ Left err404 Just restNode -> do inviteNode <- createNode $ HM.fromList [ "date" |: dropAround (== '"') (decodeUtf8 . LB.toStrict $ encode date)] addLabels ["Invitation"] inviteNode createRelationship "CREATED" HM.empty userNode inviteNode createRelationship "AT" HM.empty inviteNode restNode let Just (userId :: Int64) = decodeStrict $ nodeId userNode Just (restId :: Int64) = decodeStrict $ nodeId restNode Just (inviteId :: Int) = decodeStrict $ nodeId inviteNode Just host = decode . encode $ HM.insert "id" (newval userId) (getNodeProperties userNode) Just restaurant = decode . encode $ HM.adjust (\(String hoursString) -> fromJust . decodeStrict . encodeUtf8 $ hoursString) "hours" (fromJust . decode . encode $ HM.insert "id" (newval restId) (getNodeProperties restNode) :: HM.HashMap Text Value) return . Right $ Invitation inviteId host restaurant date Nothing case result of Left err -> errorOf err Right created -> return created
1,692
createInvitation :: Maybe (Token Authorization) -> InvitationCreation -> ConfigM Invitation createInvitation token (InvitationCreation locId date) = do Authorization authEmail <- requireToken token result <- runNeo $ do [userNode] <- getNodesByLabelAndProperty "User" $ Just ("email" |: fromEmail authEmail) mRestaurant <- getNode (fromIntegral locId :: Integer) case mRestaurant of Nothing -> return $ Left err404 Just restNode -> do inviteNode <- createNode $ HM.fromList [ "date" |: dropAround (== '"') (decodeUtf8 . LB.toStrict $ encode date)] addLabels ["Invitation"] inviteNode createRelationship "CREATED" HM.empty userNode inviteNode createRelationship "AT" HM.empty inviteNode restNode let Just (userId :: Int64) = decodeStrict $ nodeId userNode Just (restId :: Int64) = decodeStrict $ nodeId restNode Just (inviteId :: Int) = decodeStrict $ nodeId inviteNode Just host = decode . encode $ HM.insert "id" (newval userId) (getNodeProperties userNode) Just restaurant = decode . encode $ HM.adjust (\(String hoursString) -> fromJust . decodeStrict . encodeUtf8 $ hoursString) "hours" (fromJust . decode . encode $ HM.insert "id" (newval restId) (getNodeProperties restNode) :: HM.HashMap Text Value) return . Right $ Invitation inviteId host restaurant date Nothing case result of Left err -> errorOf err Right created -> return created
1,692
createInvitation token (InvitationCreation locId date) = do Authorization authEmail <- requireToken token result <- runNeo $ do [userNode] <- getNodesByLabelAndProperty "User" $ Just ("email" |: fromEmail authEmail) mRestaurant <- getNode (fromIntegral locId :: Integer) case mRestaurant of Nothing -> return $ Left err404 Just restNode -> do inviteNode <- createNode $ HM.fromList [ "date" |: dropAround (== '"') (decodeUtf8 . LB.toStrict $ encode date)] addLabels ["Invitation"] inviteNode createRelationship "CREATED" HM.empty userNode inviteNode createRelationship "AT" HM.empty inviteNode restNode let Just (userId :: Int64) = decodeStrict $ nodeId userNode Just (restId :: Int64) = decodeStrict $ nodeId restNode Just (inviteId :: Int) = decodeStrict $ nodeId inviteNode Just host = decode . encode $ HM.insert "id" (newval userId) (getNodeProperties userNode) Just restaurant = decode . encode $ HM.adjust (\(String hoursString) -> fromJust . decodeStrict . encodeUtf8 $ hoursString) "hours" (fromJust . decode . encode $ HM.insert "id" (newval restId) (getNodeProperties restNode) :: HM.HashMap Text Value) return . Right $ Invitation inviteId host restaurant date Nothing case result of Left err -> errorOf err Right created -> return created
1,600
false
true
0
26
534
500
233
267
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/CSSStyleDeclaration.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration.getPropertyPriority Mozilla CSSStyleDeclaration.getPropertyPriority documentation> getPropertyPriority_ :: (MonadDOM m, ToJSString propertyName) => CSSStyleDeclaration -> propertyName -> m () getPropertyPriority_ self propertyName = liftDOM (void (self ^. jsf "getPropertyPriority" [toJSVal propertyName]))
434
getPropertyPriority_ :: (MonadDOM m, ToJSString propertyName) => CSSStyleDeclaration -> propertyName -> m () getPropertyPriority_ self propertyName = liftDOM (void (self ^. jsf "getPropertyPriority" [toJSVal propertyName]))
275
getPropertyPriority_ self propertyName = liftDOM (void (self ^. jsf "getPropertyPriority" [toJSVal propertyName]))
122
true
true
0
12
83
77
37
40
null
null
vladimir-ipatov/ganeti
src/Ganeti/OpParams.hs
gpl-2.0
pRemoteNode :: Field pRemoteNode = withDoc "New secondary node" $ optionalNEStringField "remote_node"
105
pRemoteNode :: Field pRemoteNode = withDoc "New secondary node" $ optionalNEStringField "remote_node"
105
pRemoteNode = withDoc "New secondary node" $ optionalNEStringField "remote_node"
84
false
true
0
6
15
21
10
11
null
null
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110308set1.hs
gpl-3.0
ucut :: UserCut ucut = UserCut { uc_metcut = 15.0 , uc_etacutlep = 1.2 , uc_etcutlep = 18.0 , uc_etacutjet = 2.5 , uc_etcutjet = 15.0 }
156
ucut :: UserCut ucut = UserCut { uc_metcut = 15.0 , uc_etacutlep = 1.2 , uc_etcutlep = 18.0 , uc_etacutjet = 2.5 , uc_etcutjet = 15.0 }
156
ucut = UserCut { uc_metcut = 15.0 , uc_etacutlep = 1.2 , uc_etcutlep = 18.0 , uc_etacutjet = 2.5 , uc_etcutjet = 15.0 }
140
false
true
0
6
47
43
27
16
null
null
mettekou/ghc
compiler/main/ErrUtils.hs
bsd-3-clause
-- ^ A problem, and some indication of why isValid :: Validity -> Bool isValid IsValid = True
100
isValid :: Validity -> Bool isValid IsValid = True
56
isValid IsValid = True
28
true
true
0
5
24
19
10
9
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1E21' = "\x0067\x0304"
39
decomposeChar '\x1E21' = "\x0067\x0304"
39
decomposeChar '\x1E21' = "\x0067\x0304"
39
false
false
0
4
3
10
4
6
null
null
mgsloan/quasi-extras
src/Language/Quasi/Internal/Conversion.hs
bsd-3-clause
patToExp (WildP ) = error "WildP has no expression equivalent."
66
patToExp (WildP ) = error "WildP has no expression equivalent."
66
patToExp (WildP ) = error "WildP has no expression equivalent."
66
false
false
0
6
12
15
7
8
null
null
kim/amazonka
amazonka-ssm/gen/Network/AWS/SSM/DeleteDocument.hs
mpl-2.0
-- | 'DeleteDocument' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dd2Name' @::@ 'Text' -- deleteDocument :: Text -- ^ 'dd2Name' -> DeleteDocument deleteDocument p1 = DeleteDocument { _dd2Name = p1 }
261
deleteDocument :: Text -- ^ 'dd2Name' -> DeleteDocument deleteDocument p1 = DeleteDocument { _dd2Name = p1 }
131
deleteDocument p1 = DeleteDocument { _dd2Name = p1 }
60
true
true
0
6
59
36
22
14
null
null
tolysz/hs-tls
core/Network/TLS/Handshake/Signature.hs
bsd-3-clause
digitallySignECDHParamsVerify :: Context -> ServerECDHParams -> SignatureAlgorithm -> DigitallySigned -> IO Bool digitallySignECDHParamsVerify ctx dhparams sigAlg signature = do expectedData <- withClientAndServerRandom ctx $ encodeSignedECDHParams dhparams signatureVerify ctx signature sigAlg expectedData
435
digitallySignECDHParamsVerify :: Context -> ServerECDHParams -> SignatureAlgorithm -> DigitallySigned -> IO Bool digitallySignECDHParamsVerify ctx dhparams sigAlg signature = do expectedData <- withClientAndServerRandom ctx $ encodeSignedECDHParams dhparams signatureVerify ctx signature sigAlg expectedData
435
digitallySignECDHParamsVerify ctx dhparams sigAlg signature = do expectedData <- withClientAndServerRandom ctx $ encodeSignedECDHParams dhparams signatureVerify ctx signature sigAlg expectedData
202
false
true
0
9
158
68
31
37
null
null
JoeyEremondi/utrecht-apa-p1
src/Elm/Compiler.hs
bsd-3-clause
fromRight (Right x ) = x
24
fromRight (Right x ) = x
24
fromRight (Right x ) = x
24
false
false
0
7
5
15
7
8
null
null
keera-studios/hsQt
Qtc/ClassTypes/Core.hs
bsd-2-clause
qCastList_QAbstractTableModel x = qcl_QAbstractTableModel [] x
62
qCastList_QAbstractTableModel x = qcl_QAbstractTableModel [] x
62
qCastList_QAbstractTableModel x = qcl_QAbstractTableModel [] x
62
false
false
0
6
5
16
7
9
null
null
brendanhay/gogol
gogol-redis/gen/Network/Google/Resource/Redis/Projects/Locations/Instances/Export.hs
mpl-2.0
-- | OAuth access token. plieAccessToken :: Lens' ProjectsLocationsInstancesExport (Maybe Text) plieAccessToken = lens _plieAccessToken (\ s a -> s{_plieAccessToken = a})
178
plieAccessToken :: Lens' ProjectsLocationsInstancesExport (Maybe Text) plieAccessToken = lens _plieAccessToken (\ s a -> s{_plieAccessToken = a})
153
plieAccessToken = lens _plieAccessToken (\ s a -> s{_plieAccessToken = a})
82
true
true
1
9
29
51
25
26
null
null
tpsinnem/Idris-dev
src/Idris/Core/Typecheck.hs
bsd-3-clause
isHole (n, Hole _) = True
25
isHole (n, Hole _) = True
25
isHole (n, Hole _) = True
25
false
false
0
6
5
19
9
10
null
null
fgaz/shine-varying
tests/misc.hs
mit
time :: Var ShineInput Float time = accumulate (\t (btnDown,td) -> if btnDown then 0 else t+td) --reset if clicked 0 . ((,) <$> isDownButton BtnLeft <*> timeDeltaNumeric)
199
time :: Var ShineInput Float time = accumulate (\t (btnDown,td) -> if btnDown then 0 else t+td) --reset if clicked 0 . ((,) <$> isDownButton BtnLeft <*> timeDeltaNumeric)
199
time = accumulate (\t (btnDown,td) -> if btnDown then 0 else t+td) --reset if clicked 0 . ((,) <$> isDownButton BtnLeft <*> timeDeltaNumeric)
170
false
true
0
10
56
71
39
32
null
null
zcesur/h99
src/Problems21thru28.hs
gpl-3.0
lsort (x:xs) = lsort smaller ++ [x] ++ lsort larger where smaller = [e | e <- xs, length e < length x] larger = [e | e <- xs, length e >= length x] -- Problem 28b -- Again, we suppose that a list contains elements that are lists themselves. -- But this time the objective is to sort the elements of this list according -- to their length frequency; i.e., in the default, where sorting is done -- ascendingly, lists with rare lengths are placed first, others with a more -- frequent length come later.
511
lsort (x:xs) = lsort smaller ++ [x] ++ lsort larger where smaller = [e | e <- xs, length e < length x] larger = [e | e <- xs, length e >= length x] -- Problem 28b -- Again, we suppose that a list contains elements that are lists themselves. -- But this time the objective is to sort the elements of this list according -- to their length frequency; i.e., in the default, where sorting is done -- ascendingly, lists with rare lengths are placed first, others with a more -- frequent length come later.
511
lsort (x:xs) = lsort smaller ++ [x] ++ lsort larger where smaller = [e | e <- xs, length e < length x] larger = [e | e <- xs, length e >= length x] -- Problem 28b -- Again, we suppose that a list contains elements that are lists themselves. -- But this time the objective is to sort the elements of this list according -- to their length frequency; i.e., in the default, where sorting is done -- ascendingly, lists with rare lengths are placed first, others with a more -- frequent length come later.
511
false
false
0
8
107
102
53
49
null
null
AoiKuiyuyou/AoikWinWhich-Haskell
src/aoikwinwhich/aoikwinwhich.hs
mit
-- getEnvOrEmpty :: String -> IO String getEnvOrEmpty name = getEnv name `catch` -- "(e :: IOException)" is for hinting exception type (\e -> let _ = (e :: IOException) in return "")
202
getEnvOrEmpty :: String -> IO String getEnvOrEmpty name = getEnv name `catch` -- "(e :: IOException)" is for hinting exception type (\e -> let _ = (e :: IOException) in return "")
199
getEnvOrEmpty name = getEnv name `catch` -- "(e :: IOException)" is for hinting exception type (\e -> let _ = (e :: IOException) in return "")
162
true
true
0
12
52
61
32
29
null
null
quyse/flaw
flaw-math/Flaw/Math/Internal.hs
mit
vecComponents :: String vecComponents = "xyzw"
46
vecComponents :: String vecComponents = "xyzw"
46
vecComponents = "xyzw"
22
false
true
0
4
5
11
6
5
null
null
keithodulaigh/Hets
CASL/Freeness.hs
gpl-2.0
homomorphy_form f = f
21
homomorphy_form f = f
21
homomorphy_form f = f
21
false
false
0
5
3
9
4
5
null
null
AyaMorisawa/aya-script
src/AyaScript/Parser.hs
mit
parens = P.parens lexer
28
parens = P.parens lexer
28
parens = P.parens lexer
28
false
false
0
6
8
11
5
6
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Elements.hs
bsd-3-clause
-- | A short-hand notion for @ el\' \"address\" ... @ addressN' ∷ forall t m a. DomBuilder t m ⇒ m a → m (Element EventResult (DomBuilderSpace m) t, a) addressN' = el' "address"
177
addressN' ∷ forall t m a. DomBuilder t m ⇒ m a → m (Element EventResult (DomBuilderSpace m) t, a) addressN' = el' "address"
123
addressN' = el' "address"
25
true
true
0
13
34
65
32
33
null
null
grnet/snf-ganeti
src/Ganeti/Types.hs
bsd-2-clause
fmtSubmitPriority OpPrioHigh = "high"
39
fmtSubmitPriority OpPrioHigh = "high"
39
fmtSubmitPriority OpPrioHigh = "high"
39
false
false
0
4
5
10
4
6
null
null
narurien/ganeti-ceph
src/Ganeti/Curl/Multi.hs
gpl-2.0
performMulti :: CurlMH -> HandleMap -> CInt -> IO () performMulti mh hmap expected = do (mcode, running) <- curlMultiPerform mh delay <- case mcode of CurlmCallMultiPerform -> return $ return () CurlmOK -> return $ threadDelay pollDelayInterval code -> error $ "Received bad return code from" ++ "'curl_multi_perform': " ++ show code logDebug $ "mcode: " ++ show mcode ++ ", remaining: " ++ show running -- check if any handles are done and then retrieve their messages when (expected /= running) $ readMessages mh hmap -- and if we still have handles running, loop when (running > 0) $ delay >> performMulti mh hmap running -- | Template for the Curl error buffer.
740
performMulti :: CurlMH -> HandleMap -> CInt -> IO () performMulti mh hmap expected = do (mcode, running) <- curlMultiPerform mh delay <- case mcode of CurlmCallMultiPerform -> return $ return () CurlmOK -> return $ threadDelay pollDelayInterval code -> error $ "Received bad return code from" ++ "'curl_multi_perform': " ++ show code logDebug $ "mcode: " ++ show mcode ++ ", remaining: " ++ show running -- check if any handles are done and then retrieve their messages when (expected /= running) $ readMessages mh hmap -- and if we still have handles running, loop when (running > 0) $ delay >> performMulti mh hmap running -- | Template for the Curl error buffer.
740
performMulti mh hmap expected = do (mcode, running) <- curlMultiPerform mh delay <- case mcode of CurlmCallMultiPerform -> return $ return () CurlmOK -> return $ threadDelay pollDelayInterval code -> error $ "Received bad return code from" ++ "'curl_multi_perform': " ++ show code logDebug $ "mcode: " ++ show mcode ++ ", remaining: " ++ show running -- check if any handles are done and then retrieve their messages when (expected /= running) $ readMessages mh hmap -- and if we still have handles running, loop when (running > 0) $ delay >> performMulti mh hmap running -- | Template for the Curl error buffer.
687
false
true
0
13
189
189
90
99
null
null
Fuuzetsu/haddock
haddock-api/src/Haddock/Backends/Xhtml.hs
bsd-2-clause
processExport summary _ _ qual (ExportNoDecl y subs) = processDeclOneLiner summary $ ppDocName qual Prefix True y +++ parenList (map (ppDocName qual Prefix True) subs)
181
processExport summary _ _ qual (ExportNoDecl y subs) = processDeclOneLiner summary $ ppDocName qual Prefix True y +++ parenList (map (ppDocName qual Prefix True) subs)
181
processExport summary _ _ qual (ExportNoDecl y subs) = processDeclOneLiner summary $ ppDocName qual Prefix True y +++ parenList (map (ppDocName qual Prefix True) subs)
181
false
false
0
10
38
66
31
35
null
null
jkpl/tagenerator
src/TaGenerator/AstParser.hs
mit
mapFromValueMap :: FromAst v => ValueMap -> Maybe (M.Map String v) mapFromValueMap vm = M.fromList <$> mapM pairFromAst (M.toList vm) where pairFromAst (k,v) = (,) <$> Just k <*> fromAst v
190
mapFromValueMap :: FromAst v => ValueMap -> Maybe (M.Map String v) mapFromValueMap vm = M.fromList <$> mapM pairFromAst (M.toList vm) where pairFromAst (k,v) = (,) <$> Just k <*> fromAst v
190
mapFromValueMap vm = M.fromList <$> mapM pairFromAst (M.toList vm) where pairFromAst (k,v) = (,) <$> Just k <*> fromAst v
123
false
true
0
11
32
96
45
51
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | Creates a value of 'CollectionStatusDestinationStatus' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'csdsDestination' -- -- * 'csdsStatus' collectionStatusDestinationStatus :: CollectionStatusDestinationStatus collectionStatusDestinationStatus = CollectionStatusDestinationStatus' {_csdsDestination = Nothing, _csdsStatus = Nothing}
435
collectionStatusDestinationStatus :: CollectionStatusDestinationStatus collectionStatusDestinationStatus = CollectionStatusDestinationStatus' {_csdsDestination = Nothing, _csdsStatus = Nothing}
203
collectionStatusDestinationStatus = CollectionStatusDestinationStatus' {_csdsDestination = Nothing, _csdsStatus = Nothing}
128
true
true
1
7
59
39
23
16
null
null
keithduncan/chatterbox
src/web/Action/Topics.hs
mit
jsonError :: String -> ActionT T.Text ConfigM () jsonError t = let err = Map.fromList [("message", t)] :: Map.Map String String in json err
154
jsonError :: String -> ActionT T.Text ConfigM () jsonError t = let err = Map.fromList [("message", t)] :: Map.Map String String in json err
154
jsonError t = let err = Map.fromList [("message", t)] :: Map.Map String String in json err
105
false
true
0
11
38
67
33
34
null
null
nevrenato/HetsAlloy
Common/Lexer.hs
gpl-2.0
placeS :: CharParser st String placeS = tryString place
55
placeS :: CharParser st String placeS = tryString place
55
placeS = tryString place
24
false
true
0
6
8
25
10
15
null
null
unclechu/xmonadrc
xmobar/indicators-cmd/test/Spec.hs
gpl-3.0
withAppAndTerminate :: (Client -> BusName -> Handle -> IO ()) -> IO () withAppAndTerminate m = withApp $ \client pHandle pOut -> do xDpyName <- do dpy <- openDisplay "" let name = getXDpyName dpy name `seq` name <$ closeDisplay dpy let busName = busName_ $ "com.github.unclechu.xmonadrc." ++ xDpyName m client busName pOut `finally` do terminateProcess pHandle waitForProcess pHandle >>= assertEqual "Application terminated successfully" ExitSuccess
506
withAppAndTerminate :: (Client -> BusName -> Handle -> IO ()) -> IO () withAppAndTerminate m = withApp $ \client pHandle pOut -> do xDpyName <- do dpy <- openDisplay "" let name = getXDpyName dpy name `seq` name <$ closeDisplay dpy let busName = busName_ $ "com.github.unclechu.xmonadrc." ++ xDpyName m client busName pOut `finally` do terminateProcess pHandle waitForProcess pHandle >>= assertEqual "Application terminated successfully" ExitSuccess
506
withAppAndTerminate m = withApp $ \client pHandle pOut -> do xDpyName <- do dpy <- openDisplay "" let name = getXDpyName dpy name `seq` name <$ closeDisplay dpy let busName = busName_ $ "com.github.unclechu.xmonadrc." ++ xDpyName m client busName pOut `finally` do terminateProcess pHandle waitForProcess pHandle >>= assertEqual "Application terminated successfully" ExitSuccess
435
false
true
0
15
121
155
72
83
null
null
sdiehl/ghc
compiler/basicTypes/Literal.hs
bsd-3-clause
int2CharLit l = pprPanic "int2CharLit" (ppr l)
62
int2CharLit l = pprPanic "int2CharLit" (ppr l)
62
int2CharLit l = pprPanic "int2CharLit" (ppr l)
62
false
false
0
7
22
20
9
11
null
null
apyrgio/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
nicModeBridged :: String nicModeBridged = Types.nICModeToRaw NMBridged
70
nicModeBridged :: String nicModeBridged = Types.nICModeToRaw NMBridged
70
nicModeBridged = Types.nICModeToRaw NMBridged
45
false
true
0
6
6
16
8
8
null
null
kojiromike/Idris-dev
src/IRTS/JavaScript/Codegen.hs
bsd-3-clause
cgForeignRes (FCon (UN "JS_Ptr")) x = pure x
44
cgForeignRes (FCon (UN "JS_Ptr")) x = pure x
44
cgForeignRes (FCon (UN "JS_Ptr")) x = pure x
44
false
false
0
9
7
26
12
14
null
null
leshchevds/ganeti
src/Ganeti/HTools/Tags.hs
bsd-2-clause
splitAtColons _ = Nothing
25
splitAtColons _ = Nothing
25
splitAtColons _ = Nothing
25
false
false
0
5
3
9
4
5
null
null
balodja/sesyrel
tests/Main.hs
bsd-3-clause
fingers :: [a] -> [(a, [a])] fingers = go id where go :: ([a] -> [a]) -> [a] -> [(a, [a])] go diff (x : xs) = (x, diff xs) : go (diff . (x :)) xs go diff [] = []
175
fingers :: [a] -> [(a, [a])] fingers = go id where go :: ([a] -> [a]) -> [a] -> [(a, [a])] go diff (x : xs) = (x, diff xs) : go (diff . (x :)) xs go diff [] = []
175
fingers = go id where go :: ([a] -> [a]) -> [a] -> [(a, [a])] go diff (x : xs) = (x, diff xs) : go (diff . (x :)) xs go diff [] = []
146
false
true
3
11
55
154
79
75
null
null
apyrgio/snf-ganeti
src/Ganeti/DataCollectors/InstStatus.hs
bsd-2-clause
-- * Command line options options :: IO [OptType] options = return [ oConfdAddr , oConfdPort ]
101
options :: IO [OptType] options = return [ oConfdAddr , oConfdPort ]
74
options = return [ oConfdAddr , oConfdPort ]
50
true
true
0
6
23
27
15
12
null
null
conal/DeepArrow
src/Language/Haskell/Parens.hs
bsd-3-clause
getName (Special HsCons) = HsSymbol ":"
39
getName (Special HsCons) = HsSymbol ":"
39
getName (Special HsCons) = HsSymbol ":"
39
false
false
0
6
5
19
8
11
null
null
thomaslecointre/Distributed-Haskell
slave/PorterStemmer.hs
mit
cvc :: String -> Bool cvc word | length word < 3 = False | otherwise = isConsonant word lastIndex && isVowel word (lastIndex - 1) && isConsonant word (lastIndex - 2) && last word `notElem` "wxy" where lastIndex = length word - 1 -- |
350
cvc :: String -> Bool cvc word | length word < 3 = False | otherwise = isConsonant word lastIndex && isVowel word (lastIndex - 1) && isConsonant word (lastIndex - 2) && last word `notElem` "wxy" where lastIndex = length word - 1 -- |
350
cvc word | length word < 3 = False | otherwise = isConsonant word lastIndex && isVowel word (lastIndex - 1) && isConsonant word (lastIndex - 2) && last word `notElem` "wxy" where lastIndex = length word - 1 -- |
328
false
true
0
12
162
105
51
54
null
null
fujiyan/toriaezuzakki
haskell/opengl/texture/Rectangle.hs
bsd-2-clause
-- | The error handler to be called when a GLFW error occurs. errorHandler :: GLFW.ErrorCallback errorHandler error description = do hPutStrLn stderr $ (show error) ++ ": " ++ description -- | The rendering loop.
218
errorHandler :: GLFW.ErrorCallback errorHandler error description = do hPutStrLn stderr $ (show error) ++ ": " ++ description -- | The rendering loop.
156
errorHandler error description = do hPutStrLn stderr $ (show error) ++ ": " ++ description -- | The rendering loop.
121
true
true
1
11
41
49
22
27
null
null
mbakke/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | Timeout for queue draining in upgrades upgradeQueueDrainTimeout :: Int upgradeQueueDrainTimeout = 36 * 60 * 60
115
upgradeQueueDrainTimeout :: Int upgradeQueueDrainTimeout = 36 * 60 * 60
71
upgradeQueueDrainTimeout = 36 * 60 * 60
39
true
true
0
6
17
20
11
9
null
null
erochest/gh-weekly
src/GhWeekly/Network.hs
apache-2.0
_Int :: Prism' C.ByteString Int _Int = prism' fint tint where fint = C.pack . show tint s = case C.readInt s of Just (n, "") -> Just n Just _ -> Nothing Nothing -> Nothing -- throttle by waiting 0.5 of the time -- or by waiting the length to the reset time / remaining count
371
_Int :: Prism' C.ByteString Int _Int = prism' fint tint where fint = C.pack . show tint s = case C.readInt s of Just (n, "") -> Just n Just _ -> Nothing Nothing -> Nothing -- throttle by waiting 0.5 of the time -- or by waiting the length to the reset time / remaining count
371
_Int = prism' fint tint where fint = C.pack . show tint s = case C.readInt s of Just (n, "") -> Just n Just _ -> Nothing Nothing -> Nothing -- throttle by waiting 0.5 of the time -- or by waiting the length to the reset time / remaining count
339
false
true
1
11
153
91
44
47
null
null
gcross/habit-of-fate
sources/library/HabitOfFate/Data/Repeated.hs
agpl-3.0
previousDeadlines ∷ Repeated → LocalTime → [LocalTime] previousDeadlines (Daily period) = previousDailies period
112
previousDeadlines ∷ Repeated → LocalTime → [LocalTime] previousDeadlines (Daily period) = previousDailies period
112
previousDeadlines (Daily period) = previousDailies period
57
false
true
0
7
12
34
17
17
null
null
lambda-llama/timeout
src/Control/Timeout/Unique.hs
mit
uniqSource :: IORef Int64 uniqSource = unsafePerformIO (newIORef 0)
67
uniqSource :: IORef Int64 uniqSource = unsafePerformIO (newIORef 0)
67
uniqSource = unsafePerformIO (newIORef 0)
41
false
true
0
7
8
28
12
16
null
null
vTurbine/ghc
ghc/Main.hs
bsd-3-clause
isDoInteractiveMode :: Mode -> Bool isDoInteractiveMode (Right (Right DoInteractive)) = True
92
isDoInteractiveMode :: Mode -> Bool isDoInteractiveMode (Right (Right DoInteractive)) = True
92
isDoInteractiveMode (Right (Right DoInteractive)) = True
56
false
true
0
9
10
30
15
15
null
null
ExNexu/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
nativeTyWidth IT32 = 32
23
nativeTyWidth IT32 = 32
23
nativeTyWidth IT32 = 32
23
false
false
0
5
3
9
4
5
null
null
mfpi/OpenGL
Graphics/Rendering/OpenGL/GL/QueryObjects.hs
bsd-3-clause
marshalGetQueryObjectPName :: GetQueryObjectPName -> GLenum marshalGetQueryObjectPName x = case x of QueryResultAvailable -> gl_QUERY_RESULT_AVAILABLE QueryResult -> gl_QUERY_RESULT --------------------------------------------------------------------------------
269
marshalGetQueryObjectPName :: GetQueryObjectPName -> GLenum marshalGetQueryObjectPName x = case x of QueryResultAvailable -> gl_QUERY_RESULT_AVAILABLE QueryResult -> gl_QUERY_RESULT --------------------------------------------------------------------------------
269
marshalGetQueryObjectPName x = case x of QueryResultAvailable -> gl_QUERY_RESULT_AVAILABLE QueryResult -> gl_QUERY_RESULT --------------------------------------------------------------------------------
209
false
true
2
5
24
38
18
20
null
null
matklad/mu
src/Main.hs
mit
toListVal _ = Nothing
21
toListVal _ = Nothing
21
toListVal _ = Nothing
21
false
false
0
5
3
9
4
5
null
null
alios/iho-s57
library/Data/IHO/S57/Parser.hs
bsd-3-clause
ddrLookupChildren :: Text -> DDR -> [Text] ddrLookupChildren fn ddr = let fcf = ddr ^. ddrFileControlField in fmap snd $ filter (\(p, _) -> fn == p) fcf
160
ddrLookupChildren :: Text -> DDR -> [Text] ddrLookupChildren fn ddr = let fcf = ddr ^. ddrFileControlField in fmap snd $ filter (\(p, _) -> fn == p) fcf
160
ddrLookupChildren fn ddr = let fcf = ddr ^. ddrFileControlField in fmap snd $ filter (\(p, _) -> fn == p) fcf
117
false
true
0
11
36
72
37
35
null
null
weiningl/replay
test/Test.hs
bsd-3-clause
-- | Running a program. runProgram :: Program -> Input -> IO Result runProgram p inp = do counter <- newIORef 0 let tick = (putStrLn "inc tick") >> modifyIORef counter (+1) x <- play (p tick) emptyTrace inp n <- readIORef counter return (x, n) where play prog t inp = do r <- run prog t case r of Right x -> return x Left (_, t') -> case inp of [] -> error "too few inputs" a : inp' -> play prog (addAnswer t' a) inp' -- | Checking a test case. Compares expected and actual results.
568
runProgram :: Program -> Input -> IO Result runProgram p inp = do counter <- newIORef 0 let tick = (putStrLn "inc tick") >> modifyIORef counter (+1) x <- play (p tick) emptyTrace inp n <- readIORef counter return (x, n) where play prog t inp = do r <- run prog t case r of Right x -> return x Left (_, t') -> case inp of [] -> error "too few inputs" a : inp' -> play prog (addAnswer t' a) inp' -- | Checking a test case. Compares expected and actual results.
544
runProgram p inp = do counter <- newIORef 0 let tick = (putStrLn "inc tick") >> modifyIORef counter (+1) x <- play (p tick) emptyTrace inp n <- readIORef counter return (x, n) where play prog t inp = do r <- run prog t case r of Right x -> return x Left (_, t') -> case inp of [] -> error "too few inputs" a : inp' -> play prog (addAnswer t' a) inp' -- | Checking a test case. Compares expected and actual results.
500
true
true
0
15
185
209
99
110
null
null
schnecki/HaskellMachineLearning
src/Data/ML/DecisionTree/Ops.hs
gpl-3.0
decide (Decision att _ _ branches) a = case att of Attr{} -> decide (branches M.! test att a) a AttrNr _ (Just v) _ -> decide (branches M.! nr) a where nr = if testNr att a <= v then 0 else 1 AttrNr {} -> error "this should not happen!!!"
258
decide (Decision att _ _ branches) a = case att of Attr{} -> decide (branches M.! test att a) a AttrNr _ (Just v) _ -> decide (branches M.! nr) a where nr = if testNr att a <= v then 0 else 1 AttrNr {} -> error "this should not happen!!!"
258
decide (Decision att _ _ branches) a = case att of Attr{} -> decide (branches M.! test att a) a AttrNr _ (Just v) _ -> decide (branches M.! nr) a where nr = if testNr att a <= v then 0 else 1 AttrNr {} -> error "this should not happen!!!"
258
false
false
0
12
71
127
62
65
null
null
roberth/uu-helium
src/Helium/Utils/Texts.hs
gpl-3.0
parserUnexpected :: String parserUnexpected = select language [ English :-> "unexpected" , Dutch :-> "onverwacht: " ]
131
parserUnexpected :: String parserUnexpected = select language [ English :-> "unexpected" , Dutch :-> "onverwacht: " ]
131
parserUnexpected = select language [ English :-> "unexpected" , Dutch :-> "onverwacht: " ]
104
false
true
0
6
30
37
17
20
null
null
BlairArchibald/bones
apps/maxclique/src/DIMACParser.hs
bsd-3-clause
parseDIMACS2PLine :: [String] -> Int parseDIMACS2PLine ("p":"edge":s:_) = n where n = case reads s of [(i,"")] -> if i > 0 then i else error outOfBoundError _ -> error lineReadError outOfBoundError = "parseDIMACS2: \"p\" line out of bounds (vertices)" lineReadError = "parseDIMACS2: \"p\" line read error"
396
parseDIMACS2PLine :: [String] -> Int parseDIMACS2PLine ("p":"edge":s:_) = n where n = case reads s of [(i,"")] -> if i > 0 then i else error outOfBoundError _ -> error lineReadError outOfBoundError = "parseDIMACS2: \"p\" line out of bounds (vertices)" lineReadError = "parseDIMACS2: \"p\" line read error"
396
parseDIMACS2PLine ("p":"edge":s:_) = n where n = case reads s of [(i,"")] -> if i > 0 then i else error outOfBoundError _ -> error lineReadError outOfBoundError = "parseDIMACS2: \"p\" line out of bounds (vertices)" lineReadError = "parseDIMACS2: \"p\" line read error"
359
false
true
0
9
137
100
53
47
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Misc.hs
bsd-3-clause
safeFromJust _ (Just x) = x
28
safeFromJust _ (Just x) = x
28
safeFromJust _ (Just x) = x
28
false
false
0
7
6
17
8
9
null
null
romanb/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/DeleteEnvironmentConfiguration.hs
mpl-2.0
-- | The name of the environment to delete the draft configuration from. decEnvironmentName :: Lens' DeleteEnvironmentConfiguration Text decEnvironmentName = lens _decEnvironmentName (\s a -> s { _decEnvironmentName = a })
226
decEnvironmentName :: Lens' DeleteEnvironmentConfiguration Text decEnvironmentName = lens _decEnvironmentName (\s a -> s { _decEnvironmentName = a })
153
decEnvironmentName = lens _decEnvironmentName (\s a -> s { _decEnvironmentName = a })
89
true
true
0
9
34
40
22
18
null
null
olsner/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
lookupCoVar :: TCvSubst -> Var -> Maybe Coercion lookupCoVar (TCvSubst _ _ cenv) v = lookupVarEnv cenv v
105
lookupCoVar :: TCvSubst -> Var -> Maybe Coercion lookupCoVar (TCvSubst _ _ cenv) v = lookupVarEnv cenv v
105
lookupCoVar (TCvSubst _ _ cenv) v = lookupVarEnv cenv v
55
false
true
0
7
18
42
20
22
null
null
awakenetworks/gRPC-haskell
core/tests/LowLevelTests.hs
apache-2.0
testCustomUserAgent :: TestTree testCustomUserAgent = csTest' "Server sees custom user agent prefix/suffix" client server where clientArgs = [UserAgentPrefix "prefix!", UserAgentSuffix "suffix!"] client = TestClient (ClientConfig "localhost" 50051 clientArgs Nothing Nothing) $ \c -> do rm <- clientRegisterMethodNormal c "/foo" void $ clientRequest c rm 4 "" mempty server = TestServer (serverConf (["/foo"],[],[],[])) $ \s -> do let rm = head (normalMethods s) serverHandleNormalCall s rm mempty $ \c -> do ua <- case toList $ (unMap $ metadata c) M.! "user-agent" of [] -> fail "user-agent missing from metadata." [ua] -> return ua _ -> fail "multiple user-agent keys." assertBool "User agent prefix is present" $ isPrefixOf "prefix!" ua assertBool "User agent suffix is present" $ isSuffixOf "suffix!" ua return dummyResp return ()
985
testCustomUserAgent :: TestTree testCustomUserAgent = csTest' "Server sees custom user agent prefix/suffix" client server where clientArgs = [UserAgentPrefix "prefix!", UserAgentSuffix "suffix!"] client = TestClient (ClientConfig "localhost" 50051 clientArgs Nothing Nothing) $ \c -> do rm <- clientRegisterMethodNormal c "/foo" void $ clientRequest c rm 4 "" mempty server = TestServer (serverConf (["/foo"],[],[],[])) $ \s -> do let rm = head (normalMethods s) serverHandleNormalCall s rm mempty $ \c -> do ua <- case toList $ (unMap $ metadata c) M.! "user-agent" of [] -> fail "user-agent missing from metadata." [ua] -> return ua _ -> fail "multiple user-agent keys." assertBool "User agent prefix is present" $ isPrefixOf "prefix!" ua assertBool "User agent suffix is present" $ isSuffixOf "suffix!" ua return dummyResp return ()
985
testCustomUserAgent = csTest' "Server sees custom user agent prefix/suffix" client server where clientArgs = [UserAgentPrefix "prefix!", UserAgentSuffix "suffix!"] client = TestClient (ClientConfig "localhost" 50051 clientArgs Nothing Nothing) $ \c -> do rm <- clientRegisterMethodNormal c "/foo" void $ clientRequest c rm 4 "" mempty server = TestServer (serverConf (["/foo"],[],[],[])) $ \s -> do let rm = head (normalMethods s) serverHandleNormalCall s rm mempty $ \c -> do ua <- case toList $ (unMap $ metadata c) M.! "user-agent" of [] -> fail "user-agent missing from metadata." [ua] -> return ua _ -> fail "multiple user-agent keys." assertBool "User agent prefix is present" $ isPrefixOf "prefix!" ua assertBool "User agent suffix is present" $ isSuffixOf "suffix!" ua return dummyResp return ()
953
false
true
2
21
272
289
137
152
null
null
olsner/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprFormatRegReg :: LitString -> Format -> Reg -> Reg -> SDoc pprFormatRegReg name format reg1 reg2 = hcat [ pprMnemonic name format, pprReg format reg1, comma, pprReg format reg2 ]
218
pprFormatRegReg :: LitString -> Format -> Reg -> Reg -> SDoc pprFormatRegReg name format reg1 reg2 = hcat [ pprMnemonic name format, pprReg format reg1, comma, pprReg format reg2 ]
218
pprFormatRegReg name format reg1 reg2 = hcat [ pprMnemonic name format, pprReg format reg1, comma, pprReg format reg2 ]
157
false
true
0
8
67
66
33
33
null
null
joelburget/daily-typecheckers
src/Day4.hs
bsd-3-clause
check (DataFun f :<: DescFun fd) = undefined
44
check (DataFun f :<: DescFun fd) = undefined
44
check (DataFun f :<: DescFun fd) = undefined
44
false
false
0
8
7
22
10
12
null
null
duboisf/dupp
dupp.hs
gpl-3.0
suffixes :: [String] suffixes = ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
88
suffixes :: [String] suffixes = ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
88
suffixes = ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
67
false
true
0
5
12
38
24
14
null
null
uduki/hsQt
Qtc/Gui/QRegion.hs
bsd-2-clause
eor :: QRegion a -> ((QRegion t1)) -> IO (QRegion ()) eor x0 (x1) = withQRegionResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QRegion_eor cobj_x0 cobj_x1
195
eor :: QRegion a -> ((QRegion t1)) -> IO (QRegion ()) eor x0 (x1) = withQRegionResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QRegion_eor cobj_x0 cobj_x1
195
eor x0 (x1) = withQRegionResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QRegion_eor cobj_x0 cobj_x1
141
false
true
0
10
43
83
41
42
null
null
gridaphobe/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
-- | Create a function pointer from a target. getFunPtr :: (LMString -> LlvmType) -> ForeignTarget -> LlvmM ExprData getFunPtr funTy targ = case targ of ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do name <- strCLabel_llvm lbl getHsFunc' name (funTy name) ForeignTarget expr _ -> do (v1, stmts, top) <- exprToVar expr dflags <- getDynFlags let fty = funTy $ fsLit "dynamic" cast = case getVarType v1 of ty | isPointer ty -> LM_Bitcast ty | isInt ty -> LM_Inttoptr ty -> panic $ "genCall: Expr is of bad type for function" ++ " call! (" ++ showSDoc dflags (ppr ty) ++ ")" (v2,s1) <- doExpr (pLift fty) $ Cast cast v1 (pLift fty) return (v2, stmts `snocOL` s1, top) PrimTarget mop -> do name <- cmmPrimOpFunctions mop let fty = funTy name getInstrinct2 name fty -- | Conversion of call arguments.
994
getFunPtr :: (LMString -> LlvmType) -> ForeignTarget -> LlvmM ExprData getFunPtr funTy targ = case targ of ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do name <- strCLabel_llvm lbl getHsFunc' name (funTy name) ForeignTarget expr _ -> do (v1, stmts, top) <- exprToVar expr dflags <- getDynFlags let fty = funTy $ fsLit "dynamic" cast = case getVarType v1 of ty | isPointer ty -> LM_Bitcast ty | isInt ty -> LM_Inttoptr ty -> panic $ "genCall: Expr is of bad type for function" ++ " call! (" ++ showSDoc dflags (ppr ty) ++ ")" (v2,s1) <- doExpr (pLift fty) $ Cast cast v1 (pLift fty) return (v2, stmts `snocOL` s1, top) PrimTarget mop -> do name <- cmmPrimOpFunctions mop let fty = funTy name getInstrinct2 name fty -- | Conversion of call arguments.
948
getFunPtr funTy targ = case targ of ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do name <- strCLabel_llvm lbl getHsFunc' name (funTy name) ForeignTarget expr _ -> do (v1, stmts, top) <- exprToVar expr dflags <- getDynFlags let fty = funTy $ fsLit "dynamic" cast = case getVarType v1 of ty | isPointer ty -> LM_Bitcast ty | isInt ty -> LM_Inttoptr ty -> panic $ "genCall: Expr is of bad type for function" ++ " call! (" ++ showSDoc dflags (ppr ty) ++ ")" (v2,s1) <- doExpr (pLift fty) $ Cast cast v1 (pLift fty) return (v2, stmts `snocOL` s1, top) PrimTarget mop -> do name <- cmmPrimOpFunctions mop let fty = funTy name getInstrinct2 name fty -- | Conversion of call arguments.
867
true
true
0
20
342
319
149
170
null
null
netrium/Netrium
tool/Simulate.hs
mit
testRunContract :: SimEnv -> Time -> Contract -> Maybe String testRunContract simenv startTime contract | simStopReason overallOut /= simStopReason finalStep = Just $ show (simStopReason overallOut, simStopReason finalStep) | simStopTime overallOut /= simStopTime finalStep = Just $ show (simStopTime overallOut, simStopTime finalStep) | simOutputs overallOut /= foldr1 mergeEventsBiased (map simOutputs steps) = Just $ "outputs do not match:\n" ++ show (simOutputs overallOut) ++ "\nvs:\n" ++ show (foldr1 mergeEventsBiased (map simOutputs steps)) | simTrace overallOut /= foldr1 mergeEventsBiased (map simTrace steps) = Just $ "trace does not match:\n" ++ show (simTrace overallOut) ++ "\nvs:\n" ++ show (foldr1 mergeEventsBiased (map simTrace steps)) | not (all checkXmlRoundTrip steps) = Just "xml round trip failure" | otherwise = Nothing where steps = contractWaitSteps simenv startTime contract finalStep = last steps overallOut = runContract simenv startTime Nothing NoStop (Left contract) checkXmlRoundTrip simOut = roundTripProperty (simStopContract simOut) && roundTripProperty (simStopState simOut) roundTripProperty :: (XmlContent a, Eq a) => a -> Bool roundTripProperty x = readXml (showXml False x) == Right x
1,356
testRunContract :: SimEnv -> Time -> Contract -> Maybe String testRunContract simenv startTime contract | simStopReason overallOut /= simStopReason finalStep = Just $ show (simStopReason overallOut, simStopReason finalStep) | simStopTime overallOut /= simStopTime finalStep = Just $ show (simStopTime overallOut, simStopTime finalStep) | simOutputs overallOut /= foldr1 mergeEventsBiased (map simOutputs steps) = Just $ "outputs do not match:\n" ++ show (simOutputs overallOut) ++ "\nvs:\n" ++ show (foldr1 mergeEventsBiased (map simOutputs steps)) | simTrace overallOut /= foldr1 mergeEventsBiased (map simTrace steps) = Just $ "trace does not match:\n" ++ show (simTrace overallOut) ++ "\nvs:\n" ++ show (foldr1 mergeEventsBiased (map simTrace steps)) | not (all checkXmlRoundTrip steps) = Just "xml round trip failure" | otherwise = Nothing where steps = contractWaitSteps simenv startTime contract finalStep = last steps overallOut = runContract simenv startTime Nothing NoStop (Left contract) checkXmlRoundTrip simOut = roundTripProperty (simStopContract simOut) && roundTripProperty (simStopState simOut) roundTripProperty :: (XmlContent a, Eq a) => a -> Bool roundTripProperty x = readXml (showXml False x) == Right x
1,356
testRunContract simenv startTime contract | simStopReason overallOut /= simStopReason finalStep = Just $ show (simStopReason overallOut, simStopReason finalStep) | simStopTime overallOut /= simStopTime finalStep = Just $ show (simStopTime overallOut, simStopTime finalStep) | simOutputs overallOut /= foldr1 mergeEventsBiased (map simOutputs steps) = Just $ "outputs do not match:\n" ++ show (simOutputs overallOut) ++ "\nvs:\n" ++ show (foldr1 mergeEventsBiased (map simOutputs steps)) | simTrace overallOut /= foldr1 mergeEventsBiased (map simTrace steps) = Just $ "trace does not match:\n" ++ show (simTrace overallOut) ++ "\nvs:\n" ++ show (foldr1 mergeEventsBiased (map simTrace steps)) | not (all checkXmlRoundTrip steps) = Just "xml round trip failure" | otherwise = Nothing where steps = contractWaitSteps simenv startTime contract finalStep = last steps overallOut = runContract simenv startTime Nothing NoStop (Left contract) checkXmlRoundTrip simOut = roundTripProperty (simStopContract simOut) && roundTripProperty (simStopState simOut) roundTripProperty :: (XmlContent a, Eq a) => a -> Bool roundTripProperty x = readXml (showXml False x) == Right x
1,294
false
true
7
11
296
414
196
218
null
null
positiondev/periodic
src/System/Periodic.hs
isc
renderUnixTime t = let r = toRational . utcTimeToPOSIXSeconds $ t in encode (numerator r, denominator r)
105
renderUnixTime t = let r = toRational . utcTimeToPOSIXSeconds $ t in encode (numerator r, denominator r)
105
renderUnixTime t = let r = toRational . utcTimeToPOSIXSeconds $ t in encode (numerator r, denominator r)
105
false
false
0
10
17
43
20
23
null
null
fluescher/hastistics
src/Hastistics/Data/CSV.hs
lgpl-3.0
{-| method used to get only one specific type out of the parsing. -} extract :: (Either ParseError CSV) -> CSV extract (Left _) = error "Error on parsing"
154
extract :: (Either ParseError CSV) -> CSV extract (Left _) = error "Error on parsing"
85
extract (Left _) = error "Error on parsing"
43
true
true
0
7
28
36
18
18
null
null
DavidAlphaFox/darcs
hashed-storage/Storage/Hashed/AnchoredPath.hs
gpl-2.0
-- | Append a ByteString to the last Name of an AnchoredPath. appendToName :: AnchoredPath -> String -> AnchoredPath appendToName (AnchoredPath p) s = AnchoredPath (init p++[Name finalname]) where suffix = BS.pack s finalname | suffix `elem` (BS.tails lastname) = lastname | otherwise = BS.append lastname suffix lastname = case last p of Name name -> name
424
appendToName :: AnchoredPath -> String -> AnchoredPath appendToName (AnchoredPath p) s = AnchoredPath (init p++[Name finalname]) where suffix = BS.pack s finalname | suffix `elem` (BS.tails lastname) = lastname | otherwise = BS.append lastname suffix lastname = case last p of Name name -> name
362
appendToName (AnchoredPath p) s = AnchoredPath (init p++[Name finalname]) where suffix = BS.pack s finalname | suffix `elem` (BS.tails lastname) = lastname | otherwise = BS.append lastname suffix lastname = case last p of Name name -> name
307
true
true
0
13
124
124
61
63
null
null