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
swift-nav/plover
src/Language/Plover/SemCheck.hs
mit
fillStructMembers :: [StructMember] -> SemChecker [StructMember] fillStructMembers members = forM members $ \(v, (pos, exty, inty)) -> do exty' <- fillTermHoles exty inty' <- fillTermHoles inty return (v, (pos, exty', inty'))
231
fillStructMembers :: [StructMember] -> SemChecker [StructMember] fillStructMembers members = forM members $ \(v, (pos, exty, inty)) -> do exty' <- fillTermHoles exty inty' <- fillTermHoles inty return (v, (pos, exty', inty'))
231
fillStructMembers members = forM members $ \(v, (pos, exty, inty)) -> do exty' <- fillTermHoles exty inty' <- fillTermHoles inty return (v, (pos, exty', inty'))
166
false
true
0
11
36
95
50
45
null
null
RoboNickBot/linked-list-web-demo
src/Demo/Links.hs
bsd-2-clause
box :: Step box st (Just (i,val)) = let newst = saw i st -- add box's index to the "seen" list continue = (Box, (show i), val) : parse newst arrow (i + 1) in if val == "" -- if empty, we must check to see if next-addr is empty then case M.lookup (i + 1) (fst st) of -- if it is empty, we don't draw the box Nothing -> [] Just (_,"") -> [] _ -> continue else continue
454
box :: Step box st (Just (i,val)) = let newst = saw i st -- add box's index to the "seen" list continue = (Box, (show i), val) : parse newst arrow (i + 1) in if val == "" -- if empty, we must check to see if next-addr is empty then case M.lookup (i + 1) (fst st) of -- if it is empty, we don't draw the box Nothing -> [] Just (_,"") -> [] _ -> continue else continue
454
box st (Just (i,val)) = let newst = saw i st -- add box's index to the "seen" list continue = (Box, (show i), val) : parse newst arrow (i + 1) in if val == "" -- if empty, we must check to see if next-addr is empty then case M.lookup (i + 1) (fst st) of -- if it is empty, we don't draw the box Nothing -> [] Just (_,"") -> [] _ -> continue else continue
442
false
true
1
12
170
157
81
76
null
null
markflorisson/hpack
testrepo/bytestring-0.10.4.1/Data/ByteString/Unsafe.hs
bsd-3-clause
------------------------------------------------------------------------ -- Packing CStrings into ByteStrings -- | /O(n)/ Build a @ByteString@ from a @CString@. This value will have /no/ -- finalizer associated to it, and will not be garbage collected by -- Haskell. The ByteString length is calculated using /strlen(3)/, -- and thus the complexity is a /O(n)/. -- -- This function is /unsafe/. If the @CString@ is later modified, this -- change will be reflected in the resulting @ByteString@, breaking -- referential transparency. -- unsafePackCString :: CString -> IO ByteString unsafePackCString cstr = do fp <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $! PS fp 0 (fromIntegral l) -- | /O(1)/ Build a @ByteString@ from a @CStringLen@. This value will -- have /no/ finalizer associated with it, and will not be garbage -- collected by Haskell. This operation has /O(1)/ complexity as we -- already know the final size, so no /strlen(3)/ is required. -- -- This function is /unsafe/. If the original @CStringLen@ is later -- modified, this change will be reflected in the resulting @ByteString@, -- breaking referential transparency. --
1,167
unsafePackCString :: CString -> IO ByteString unsafePackCString cstr = do fp <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $! PS fp 0 (fromIntegral l) -- | /O(1)/ Build a @ByteString@ from a @CStringLen@. This value will -- have /no/ finalizer associated with it, and will not be garbage -- collected by Haskell. This operation has /O(1)/ complexity as we -- already know the final size, so no /strlen(3)/ is required. -- -- This function is /unsafe/. If the original @CStringLen@ is later -- modified, this change will be reflected in the resulting @ByteString@, -- breaking referential transparency. --
630
unsafePackCString cstr = do fp <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $! PS fp 0 (fromIntegral l) -- | /O(1)/ Build a @ByteString@ from a @CStringLen@. This value will -- have /no/ finalizer associated with it, and will not be garbage -- collected by Haskell. This operation has /O(1)/ complexity as we -- already know the final size, so no /strlen(3)/ is required. -- -- This function is /unsafe/. If the original @CStringLen@ is later -- modified, this change will be reflected in the resulting @ByteString@, -- breaking referential transparency. --
584
true
true
0
11
189
92
51
41
null
null
holdenlee/fluidity
ParseUtilities.hs
mit
--unsafe --AAAAGGGGHHHH! Bad code! Don't use! getFile::String -> String getFile name = unsafePerformIO (readFile name)
121
getFile::String -> String getFile name = unsafePerformIO (readFile name)
72
getFile name = unsafePerformIO (readFile name)
46
true
true
0
7
17
29
15
14
null
null
icyfork/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkSingleQuotedVariables7 = verifyNot checkSingleQuotedVariables "PS1='$PWD \\$ '"
89
prop_checkSingleQuotedVariables7 = verifyNot checkSingleQuotedVariables "PS1='$PWD \\$ '"
89
prop_checkSingleQuotedVariables7 = verifyNot checkSingleQuotedVariables "PS1='$PWD \\$ '"
89
false
false
0
5
6
11
5
6
null
null
jonaprieto/athena
src/Athena/Utils/PrettyPrint.hs
mit
-- | The document @(x \<$\> y)@ concatenates document @x@ and @y@ with -- a 'line' in between. (infixr 5) (<@>) ∷ Doc → Doc → Doc (<@>) = splitWithLine False
159
(<@>) ∷ Doc → Doc → Doc (<@>) = splitWithLine False
51
(<@>) = splitWithLine False
27
true
true
0
8
32
34
18
16
null
null
cryptica/CodeEval
Challenges/51_ClosestPair/main.hs
gpl-3.0
processInput (x:xs) = let n = read x (pointStrings, xs') = splitAt n xs remaining = processInput xs' in if n == 0 then remaining else let points = map stringToPoint pointStrings closestDistance = closestPairDistance points in closestDistance : remaining
334
processInput (x:xs) = let n = read x (pointStrings, xs') = splitAt n xs remaining = processInput xs' in if n == 0 then remaining else let points = map stringToPoint pointStrings closestDistance = closestPairDistance points in closestDistance : remaining
334
processInput (x:xs) = let n = read x (pointStrings, xs') = splitAt n xs remaining = processInput xs' in if n == 0 then remaining else let points = map stringToPoint pointStrings closestDistance = closestPairDistance points in closestDistance : remaining
334
false
false
0
12
120
96
47
49
null
null
apa512/funk
src/Funk/LastFM.hs
bsd-3-clause
apiSig :: [(B.ByteString, B.ByteString)] -> B.ByteString apiSig args = U.fromString . show . md5 . L.fromStrict $ sig where sig :: B.ByteString sig = B.append (B.concat . map (uncurry B.append) . sort $ args) apiSecret
228
apiSig :: [(B.ByteString, B.ByteString)] -> B.ByteString apiSig args = U.fromString . show . md5 . L.fromStrict $ sig where sig :: B.ByteString sig = B.append (B.concat . map (uncurry B.append) . sort $ args) apiSecret
228
apiSig args = U.fromString . show . md5 . L.fromStrict $ sig where sig :: B.ByteString sig = B.append (B.concat . map (uncurry B.append) . sort $ args) apiSecret
171
false
true
0
13
44
115
55
60
null
null
li-zhirui/EoplLangs
src/ExceptionLang/Evaluator.hs
bsd-3-clause
valueOf (LetRecExpr procs body) env cont = evalLetRecExpr procs body env cont
77
valueOf (LetRecExpr procs body) env cont = evalLetRecExpr procs body env cont
77
valueOf (LetRecExpr procs body) env cont = evalLetRecExpr procs body env cont
77
false
false
0
7
11
30
14
16
null
null
alanz/Blobs
src/Graphics/Blobs/PDDefaults.hs
lgpl-2.1
-- Update the title bar: program name - document name followed by "(modified)" if -- the document is dirty defaultUpdateTitlebar :: Frame () -> String -> Maybe String -> Bool -> IO () defaultUpdateTitlebar theFrame programName theFileName modified = let newTitle = programName ++ " - " ++ (case theFileName of Nothing -> "untitled"; Just name -> name) ++ (if modified then " (modified)" else "") in set theFrame [ text := newTitle ]
494
defaultUpdateTitlebar :: Frame () -> String -> Maybe String -> Bool -> IO () defaultUpdateTitlebar theFrame programName theFileName modified = let newTitle = programName ++ " - " ++ (case theFileName of Nothing -> "untitled"; Just name -> name) ++ (if modified then " (modified)" else "") in set theFrame [ text := newTitle ]
387
defaultUpdateTitlebar theFrame programName theFileName modified = let newTitle = programName ++ " - " ++ (case theFileName of Nothing -> "untitled"; Just name -> name) ++ (if modified then " (modified)" else "") in set theFrame [ text := newTitle ]
310
true
true
0
15
135
125
62
63
null
null
ulikoehler/ProjectEuler
Euler52.hs
apache-2.0
toDigitSet :: Int -> DigitSet toDigitSet n = Set.fromList $ show n
66
toDigitSet :: Int -> DigitSet toDigitSet n = Set.fromList $ show n
66
toDigitSet n = Set.fromList $ show n
36
false
true
0
6
11
27
13
14
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
rsAll :: FrozenSet Int rsAll = ConstantUtils.mkSet [rsNodata, rsNormal, rsOffline, rsUnavail, rsUnknown]
198
rsAll :: FrozenSet Int rsAll = ConstantUtils.mkSet [rsNodata, rsNormal, rsOffline, rsUnavail, rsUnknown]
198
rsAll = ConstantUtils.mkSet [rsNodata, rsNormal, rsOffline, rsUnavail, rsUnknown]
175
false
true
0
6
105
34
19
15
null
null
silky/csound-expression
src/Csound/Air/ModArg.hs
bsd-3-clause
-- oscil lfo rnd phase rndOscArg1 :: (ModArg1 (SE Sig) b) => Sig -> Sig -> b -> ModArgOut1 (SE Sig) b rndOscArg1 depth rate f = modArg1 depth (rndOsc rate) f
158
rndOscArg1 :: (ModArg1 (SE Sig) b) => Sig -> Sig -> b -> ModArgOut1 (SE Sig) b rndOscArg1 depth rate f = modArg1 depth (rndOsc rate) f
134
rndOscArg1 depth rate f = modArg1 depth (rndOsc rate) f
55
true
true
0
11
32
72
36
36
null
null
gilith/hol
src/HOL/Var.hs
mit
renameAvoiding :: Set Name -> Var -> Var renameAvoiding avoid v = if n' == n then v else Var n' ty where Var n ty = v n' = variantAvoiding avoid n
160
renameAvoiding :: Set Name -> Var -> Var renameAvoiding avoid v = if n' == n then v else Var n' ty where Var n ty = v n' = variantAvoiding avoid n
160
renameAvoiding avoid v = if n' == n then v else Var n' ty where Var n ty = v n' = variantAvoiding avoid n
119
false
true
0
6
46
68
33
35
null
null
qpliu/esolang
01_/hs/compiler2/CodeGen.hs
gpl-3.0
writeValueType :: String -> GenLLVM () writeValueType code = -- 0:i32 ref count -- 1:i2 status (0:0,1:1,2:nil,3:unevaluated) -- 2:i8* next/eval param -- 3:{i2,i8*}(i8*,i8*)* eval(eval param,value) -- 4:void(i8*)* free(eval param) writeCode ("{i32,i2,i8*,{i2,i8*}(i8*,i8*)*,void(i8*)*}" ++ code)
318
writeValueType :: String -> GenLLVM () writeValueType code = -- 0:i32 ref count -- 1:i2 status (0:0,1:1,2:nil,3:unevaluated) -- 2:i8* next/eval param -- 3:{i2,i8*}(i8*,i8*)* eval(eval param,value) -- 4:void(i8*)* free(eval param) writeCode ("{i32,i2,i8*,{i2,i8*}(i8*,i8*)*,void(i8*)*}" ++ code)
318
writeValueType code = -- 0:i32 ref count -- 1:i2 status (0:0,1:1,2:nil,3:unevaluated) -- 2:i8* next/eval param -- 3:{i2,i8*}(i8*,i8*)* eval(eval param,value) -- 4:void(i8*)* free(eval param) writeCode ("{i32,i2,i8*,{i2,i8*}(i8*,i8*)*,void(i8*)*}" ++ code)
279
false
true
0
7
56
38
21
17
null
null
kawu/tag-vanilla
src/NLP/TAG/Vanilla/Earley/Pred.hs
bsd-2-clause
-- | Construct the grammar from the set of rules. mkGram :: (Ord n, Ord t) => S.Set (Rule n t) -> Gram n t mkGram rules = M.fromListWith addRule [ ( nonTerm (headR r) , M.singleton (headR r) (S.singleton r) ) | r <- S.toList rules ] where addRule = M.unionWith S.union -------------------------------------------------- -- Earley monad -------------------------------------------------- -- | The state of the earley monad.
447
mkGram :: (Ord n, Ord t) => S.Set (Rule n t) -> Gram n t mkGram rules = M.fromListWith addRule [ ( nonTerm (headR r) , M.singleton (headR r) (S.singleton r) ) | r <- S.toList rules ] where addRule = M.unionWith S.union -------------------------------------------------- -- Earley monad -------------------------------------------------- -- | The state of the earley monad.
397
mkGram rules = M.fromListWith addRule [ ( nonTerm (headR r) , M.singleton (headR r) (S.singleton r) ) | r <- S.toList rules ] where addRule = M.unionWith S.union -------------------------------------------------- -- Earley monad -------------------------------------------------- -- | The state of the earley monad.
340
true
true
1
10
90
138
67
71
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/UI/ScrollView.hs
mit
scrollViewSetAutoDisableChildren :: (Parent ScrollView a, Pointer ptr a, MonadIO m) => ptr -- ^ Pointer to scrollView or ascentor -> Bool -- ^ disable -> m () scrollViewSetAutoDisableChildren p v = liftIO $ do let ptr = parentPointer p v' = fromBool v [C.exp| void {$(ScrollView* ptr)->SetAutoDisableChildren($(int v') != 0)} |] -- | Set how much touch movement is needed to trigger child element disabling. -- void SetAutoDisableThreshold(float amount) { autoDisableThreshold_ = amount; };
507
scrollViewSetAutoDisableChildren :: (Parent ScrollView a, Pointer ptr a, MonadIO m) => ptr -- ^ Pointer to scrollView or ascentor -> Bool -- ^ disable -> m () scrollViewSetAutoDisableChildren p v = liftIO $ do let ptr = parentPointer p v' = fromBool v [C.exp| void {$(ScrollView* ptr)->SetAutoDisableChildren($(int v') != 0)} |] -- | Set how much touch movement is needed to trigger child element disabling. -- void SetAutoDisableThreshold(float amount) { autoDisableThreshold_ = amount; };
507
scrollViewSetAutoDisableChildren p v = liftIO $ do let ptr = parentPointer p v' = fromBool v [C.exp| void {$(ScrollView* ptr)->SetAutoDisableChildren($(int v') != 0)} |] -- | Set how much touch movement is needed to trigger child element disabling. -- void SetAutoDisableThreshold(float amount) { autoDisableThreshold_ = amount; };
342
false
true
0
11
90
92
48
44
null
null
danoctavian/bit-smuggler
BitSmuggler/src/Network/BitSmuggler/Common.hs
gpl-2.0
isUsedUp (CC.Torrent {..}) = progress >= expectedMaxProgress - expectedMaxProgress `div` 10
93
isUsedUp (CC.Torrent {..}) = progress >= expectedMaxProgress - expectedMaxProgress `div` 10
93
isUsedUp (CC.Torrent {..}) = progress >= expectedMaxProgress - expectedMaxProgress `div` 10
93
false
false
0
8
12
34
18
16
null
null
benkio/VRP
src/GraphBuilder.hs
gpl-3.0
node :: Int -> Diagram B node n = (text (show n) # fontSizeL 0.2 # fc white <> circle 0.2 # fc green) # named (toName n)
120
node :: Int -> Diagram B node n = (text (show n) # fontSizeL 0.2 # fc white <> circle 0.2 # fc green) # named (toName n)
120
node n = (text (show n) # fontSizeL 0.2 # fc white <> circle 0.2 # fc green) # named (toName n)
95
false
true
0
13
27
78
35
43
null
null
stackbuilders/dotenv-hs
spec/Configuration/DotenvSpec.hs
mit
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
mkiefel/trueskill
TrueSkill/Test/Autodiff.hs
bsd-2-clause
main :: IO () main = defaultMain tests
38
main :: IO () main = defaultMain tests
38
main = defaultMain tests
24
false
true
0
6
7
19
9
10
null
null
tjakway/ghcjvm
compiler/typecheck/FamInst.hs
bsd-3-clause
listToSet :: [ModulePair] -> ModulePairSet listToSet l = Map.fromList (zip l (repeat ()))
89
listToSet :: [ModulePair] -> ModulePairSet listToSet l = Map.fromList (zip l (repeat ()))
89
listToSet l = Map.fromList (zip l (repeat ()))
46
false
true
0
10
12
42
21
21
null
null
lambdageek/insomnia
src/FOmega/Pretty.hs
bsd-3-clause
withLowestPrec :: PM Doc -> PM Doc withLowestPrec = withPrec 0 AssocNone . Left
79
withLowestPrec :: PM Doc -> PM Doc withLowestPrec = withPrec 0 AssocNone . Left
79
withLowestPrec = withPrec 0 AssocNone . Left
44
false
true
0
6
13
30
14
16
null
null
mwu-tow/cuda
examples/src/multiGPU/multiGPU.hs
bsd-3-clause
withPlans :: Int -> Int -> ([Plan] -> IO ()) -> IO () withPlans n ndevices action = do devStrms' <- forM [0..(ndevices-1)] $ \dev -> do CR.set dev strm <- CR.create return (dev, strm) let devStrms = take n $ cycle devStrms' plans <- forM devStrms $ \(i, stream) -> do let dataN = if (i < data_n `mod` n) then (data_n `div` n) + 1 else data_n `div` n CR.set i -- Allocate memory -- Host v_data <- randomList dataN h_data <- CR.mallocHostArray [] dataN withHostPtr h_data $ \ptr -> pokeArray ptr (U.toList v_data) h_sum_from_device <- CR.mallocHostArray [] accum_n -- Device d_data <- CR.mallocArray (dataN * sizeOf (undefined :: DevicePtr Float)) d_sum <- CR.mallocArray (accum_n * sizeOf (undefined :: DevicePtr Float)) return $ Plan i stream dataN v_data h_data d_data d_sum h_sum_from_device action plans -- clean up forM_ plans $ \plan -> do CR.set (device plan) CR.freeHost (h_data plan) CR.freeHost (h_sum_from_device plan) CR.free (d_data plan) CR.free (d_sum plan) --CR.destroy (stream plan) forM_ devStrms' $ \(_,stream) -> CR.destroy stream
1,165
withPlans :: Int -> Int -> ([Plan] -> IO ()) -> IO () withPlans n ndevices action = do devStrms' <- forM [0..(ndevices-1)] $ \dev -> do CR.set dev strm <- CR.create return (dev, strm) let devStrms = take n $ cycle devStrms' plans <- forM devStrms $ \(i, stream) -> do let dataN = if (i < data_n `mod` n) then (data_n `div` n) + 1 else data_n `div` n CR.set i -- Allocate memory -- Host v_data <- randomList dataN h_data <- CR.mallocHostArray [] dataN withHostPtr h_data $ \ptr -> pokeArray ptr (U.toList v_data) h_sum_from_device <- CR.mallocHostArray [] accum_n -- Device d_data <- CR.mallocArray (dataN * sizeOf (undefined :: DevicePtr Float)) d_sum <- CR.mallocArray (accum_n * sizeOf (undefined :: DevicePtr Float)) return $ Plan i stream dataN v_data h_data d_data d_sum h_sum_from_device action plans -- clean up forM_ plans $ \plan -> do CR.set (device plan) CR.freeHost (h_data plan) CR.freeHost (h_sum_from_device plan) CR.free (d_data plan) CR.free (d_sum plan) --CR.destroy (stream plan) forM_ devStrms' $ \(_,stream) -> CR.destroy stream
1,165
withPlans n ndevices action = do devStrms' <- forM [0..(ndevices-1)] $ \dev -> do CR.set dev strm <- CR.create return (dev, strm) let devStrms = take n $ cycle devStrms' plans <- forM devStrms $ \(i, stream) -> do let dataN = if (i < data_n `mod` n) then (data_n `div` n) + 1 else data_n `div` n CR.set i -- Allocate memory -- Host v_data <- randomList dataN h_data <- CR.mallocHostArray [] dataN withHostPtr h_data $ \ptr -> pokeArray ptr (U.toList v_data) h_sum_from_device <- CR.mallocHostArray [] accum_n -- Device d_data <- CR.mallocArray (dataN * sizeOf (undefined :: DevicePtr Float)) d_sum <- CR.mallocArray (accum_n * sizeOf (undefined :: DevicePtr Float)) return $ Plan i stream dataN v_data h_data d_data d_sum h_sum_from_device action plans -- clean up forM_ plans $ \plan -> do CR.set (device plan) CR.freeHost (h_data plan) CR.freeHost (h_sum_from_device plan) CR.free (d_data plan) CR.free (d_sum plan) --CR.destroy (stream plan) forM_ devStrms' $ \(_,stream) -> CR.destroy stream
1,110
false
true
0
18
285
489
236
253
null
null
danslocombe/music-geometry
src/Lib.hs
bsd-3-clause
pitchDist :: Pitch -> Pitch -> PitchDist pitchDist p p' = abs $ pitchClosestZero p - pitchClosestZero p'
104
pitchDist :: Pitch -> Pitch -> PitchDist pitchDist p p' = abs $ pitchClosestZero p - pitchClosestZero p'
104
pitchDist p p' = abs $ pitchClosestZero p - pitchClosestZero p'
63
false
true
0
7
17
38
18
20
null
null
bobismijnnaam/hywar
Graphviz.hs
mit
saveTree expr = createProcess (shell ("echo " ++ (show graph) ++ " | dot -Tpng > img.png")) where graph = printGraphviz expr -- $ pt2expr $ parse $ ex id
165
saveTree expr = createProcess (shell ("echo " ++ (show graph) ++ " | dot -Tpng > img.png")) where graph = printGraphviz expr -- $ pt2expr $ parse $ ex id
165
saveTree expr = createProcess (shell ("echo " ++ (show graph) ++ " | dot -Tpng > img.png")) where graph = printGraphviz expr -- $ pt2expr $ parse $ ex id
165
false
false
2
12
41
53
23
30
null
null
OS2World/DEV-UTIL-HUGS
libraries/Graphics/Rendering/OpenGL/GL/Capability.hs
bsd-3-clause
setStateVarMaybe :: IO EnableCap -> (a -> IO ()) -> Maybe a -> IO () setStateVarMaybe getCap act val = do capability <- liftM makeCapability getCap maybe (capability $= Disabled) (\x -> capability $= Enabled >> act x) val
227
setStateVarMaybe :: IO EnableCap -> (a -> IO ()) -> Maybe a -> IO () setStateVarMaybe getCap act val = do capability <- liftM makeCapability getCap maybe (capability $= Disabled) (\x -> capability $= Enabled >> act x) val
227
setStateVarMaybe getCap act val = do capability <- liftM makeCapability getCap maybe (capability $= Disabled) (\x -> capability $= Enabled >> act x) val
158
false
true
0
12
44
106
49
57
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/LTEQ_4.hs
mit
primCmpChar :: Char -> Char -> Ordering; primCmpChar (Char x) (Char y) = primCmpInt x y
91
primCmpChar :: Char -> Char -> Ordering primCmpChar (Char x) (Char y) = primCmpInt x y
90
primCmpChar (Char x) (Char y) = primCmpInt x y
46
false
true
1
10
19
48
22
26
null
null
ekr/tamarin-prover
lib/theory/src/Theory/Tools/IntruderRules.hs
gpl-3.0
normRule' :: IntrRuleAC -> WithMaude IntrRuleAC normRule' (Rule i ps cs as) = reader $ \hnd -> let normFactTerms = map (fmap (\t -> norm' t `runReader` hnd)) in Rule i (normFactTerms ps) (normFactTerms cs) (normFactTerms as)
232
normRule' :: IntrRuleAC -> WithMaude IntrRuleAC normRule' (Rule i ps cs as) = reader $ \hnd -> let normFactTerms = map (fmap (\t -> norm' t `runReader` hnd)) in Rule i (normFactTerms ps) (normFactTerms cs) (normFactTerms as)
232
normRule' (Rule i ps cs as) = reader $ \hnd -> let normFactTerms = map (fmap (\t -> norm' t `runReader` hnd)) in Rule i (normFactTerms ps) (normFactTerms cs) (normFactTerms as)
184
false
true
0
17
44
112
54
58
null
null
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/Types/Refinements.hs
bsd-3-clause
isEq :: Brel -> Bool isEq r = r == Eq || r == Ueq
59
isEq :: Brel -> Bool isEq r = r == Eq || r == Ueq
59
isEq r = r == Eq || r == Ueq
37
false
true
0
7
24
36
16
20
null
null
elieux/ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
getGRE_NameQualifier_maybes :: GlobalRdrEnv -> Name -> [Maybe [ModuleName]] -- Returns all the qualifiers by which 'x' is in scope -- Nothing means "the unqualified version is in scope" -- [] means the thing is not in scope at all getGRE_NameQualifier_maybes env = map (qualifier_maybe) . lookupGRE_Name env where qualifier_maybe (GRE { gre_lcl = lcl, gre_imp = iss }) | lcl = Nothing | otherwise = Just $ map (is_as . is_decl) iss
457
getGRE_NameQualifier_maybes :: GlobalRdrEnv -> Name -> [Maybe [ModuleName]] getGRE_NameQualifier_maybes env = map (qualifier_maybe) . lookupGRE_Name env where qualifier_maybe (GRE { gre_lcl = lcl, gre_imp = iss }) | lcl = Nothing | otherwise = Just $ map (is_as . is_decl) iss
302
getGRE_NameQualifier_maybes env = map (qualifier_maybe) . lookupGRE_Name env where qualifier_maybe (GRE { gre_lcl = lcl, gre_imp = iss }) | lcl = Nothing | otherwise = Just $ map (is_as . is_decl) iss
226
true
true
3
11
97
108
54
54
null
null
tjakway/ghcjvm
libraries/base/System/Posix/Internals.hs
bsd-3-clause
fdStat :: FD -> IO (IODeviceType, CDev, CIno) fdStat fd = allocaBytes sizeof_stat $ \ p_stat -> do throwErrnoIfMinus1Retry_ "fdType" $ c_fstat fd p_stat ty <- statGetType p_stat dev <- st_dev p_stat ino <- st_ino p_stat return (ty,dev,ino)
269
fdStat :: FD -> IO (IODeviceType, CDev, CIno) fdStat fd = allocaBytes sizeof_stat $ \ p_stat -> do throwErrnoIfMinus1Retry_ "fdType" $ c_fstat fd p_stat ty <- statGetType p_stat dev <- st_dev p_stat ino <- st_ino p_stat return (ty,dev,ino)
269
fdStat fd = allocaBytes sizeof_stat $ \ p_stat -> do throwErrnoIfMinus1Retry_ "fdType" $ c_fstat fd p_stat ty <- statGetType p_stat dev <- st_dev p_stat ino <- st_ino p_stat return (ty,dev,ino)
223
false
true
0
11
67
107
49
58
null
null
tamaralipowski/courseography
hs/WebParsing/ParsingHelp.hs
gpl-3.0
parseExclusion :: CoursePart -> CoursePart parseExclusion (tags, course) = let (parsed, rest) = tagBreak ["Recommended","Distribution","Breadth"] tags ex = makeEntry parsed (Just ["Exclusion:"]) in (rest, course {exclusions = ex})
246
parseExclusion :: CoursePart -> CoursePart parseExclusion (tags, course) = let (parsed, rest) = tagBreak ["Recommended","Distribution","Breadth"] tags ex = makeEntry parsed (Just ["Exclusion:"]) in (rest, course {exclusions = ex})
246
parseExclusion (tags, course) = let (parsed, rest) = tagBreak ["Recommended","Distribution","Breadth"] tags ex = makeEntry parsed (Just ["Exclusion:"]) in (rest, course {exclusions = ex})
203
false
true
0
12
43
93
50
43
null
null
holzensp/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
toRednCountsLbl :: CLabel -> Maybe CLabel toRednCountsLbl = fmap mkRednCountsLabel . hasHaskellName
99
toRednCountsLbl :: CLabel -> Maybe CLabel toRednCountsLbl = fmap mkRednCountsLabel . hasHaskellName
99
toRednCountsLbl = fmap mkRednCountsLabel . hasHaskellName
57
false
true
0
7
11
31
13
18
null
null
holdenlee/fluidity
GraphUtils.hs
mit
--f v w elab mkBidir :: b -> [LNode a] -> [LEdge b] -> G.Gr a b mkBidir def vs es = let es' = map (\(x,y,z) -> (y,x,def)) es es2 = L.unionBy (\(x,y,_) (x1,y1,_) -> x==x1 && y==y1) es es' in G.mkGraph vs es2
247
mkBidir :: b -> [LNode a] -> [LEdge b] -> G.Gr a b mkBidir def vs es = let es' = map (\(x,y,z) -> (y,x,def)) es es2 = L.unionBy (\(x,y,_) (x1,y1,_) -> x==x1 && y==y1) es es' in G.mkGraph vs es2
230
mkBidir def vs es = let es' = map (\(x,y,z) -> (y,x,def)) es es2 = L.unionBy (\(x,y,_) (x1,y1,_) -> x==x1 && y==y1) es es' in G.mkGraph vs es2
179
true
true
0
14
85
159
84
75
null
null
39aldo39/klfc
src/Layout/Modifier.hs
gpl-3.0
getEqualModifiers modifier = [modifier]
39
getEqualModifiers modifier = [modifier]
39
getEqualModifiers modifier = [modifier]
39
false
false
0
5
3
12
6
6
null
null
rahulmutt/ghcvm
compiler/Eta/Core/CoreSyn.hs
bsd-3-clause
deAnnotate' (AnnCoercion co) = Coercion co
47
deAnnotate' (AnnCoercion co) = Coercion co
47
deAnnotate' (AnnCoercion co) = Coercion co
47
false
false
0
7
10
18
8
10
null
null
ucsd-progsys/nanomaly
src/NanoML/Classify.hs
bsd-3-clause
tcount_con_ctx :: DCon -> Feature tcount_con_ctx c = ( mkContextLabels ("Count-"++c), mkContextFeatures (tcount_con c) )
120
tcount_con_ctx :: DCon -> Feature tcount_con_ctx c = ( mkContextLabels ("Count-"++c), mkContextFeatures (tcount_con c) )
120
tcount_con_ctx c = ( mkContextLabels ("Count-"++c), mkContextFeatures (tcount_con c) )
86
false
true
0
9
14
49
23
26
null
null
bergmark/time
lib/Data/Time/Calendar/WeekDate.hs
bsd-3-clause
fromWeekDate :: Integer -> Int -> Int -> Day fromWeekDate y w d = ModifiedJulianDay (k - (mod k 7) + (toInteger (((clip 1 (if longYear then 53 else 52) w) * 7) + (clip 1 7 d))) - 10) where k = toModifiedJulianDay (fromOrdinalDate y 6) longYear = case toWeekDate (fromOrdinalDate y 365) of (_,53,_) -> True _ -> False -- | convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). -- Invalid week and day values will return Nothing.
561
fromWeekDate :: Integer -> Int -> Int -> Day fromWeekDate y w d = ModifiedJulianDay (k - (mod k 7) + (toInteger (((clip 1 (if longYear then 53 else 52) w) * 7) + (clip 1 7 d))) - 10) where k = toModifiedJulianDay (fromOrdinalDate y 6) longYear = case toWeekDate (fromOrdinalDate y 365) of (_,53,_) -> True _ -> False -- | convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). -- Invalid week and day values will return Nothing.
561
fromWeekDate y w d = ModifiedJulianDay (k - (mod k 7) + (toInteger (((clip 1 (if longYear then 53 else 52) w) * 7) + (clip 1 7 d))) - 10) where k = toModifiedJulianDay (fromOrdinalDate y 6) longYear = case toWeekDate (fromOrdinalDate y 365) of (_,53,_) -> True _ -> False -- | convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). -- Invalid week and day values will return Nothing.
516
false
true
0
18
140
168
89
79
null
null
thiry/DComp
src/Query.hs
gpl-2.0
simple = chr '(' `thn` \_ -> ident `thn` \a -> chr ' ' `thn` \_ -> ident `thn` \b -> chr ' ' `thn` \_ -> ident `thn` \c -> chr ')' `thn` \_ -> ret (a,b,c)
169
simple = chr '(' `thn` \_ -> ident `thn` \a -> chr ' ' `thn` \_ -> ident `thn` \b -> chr ' ' `thn` \_ -> ident `thn` \c -> chr ')' `thn` \_ -> ret (a,b,c)
169
simple = chr '(' `thn` \_ -> ident `thn` \a -> chr ' ' `thn` \_ -> ident `thn` \b -> chr ' ' `thn` \_ -> ident `thn` \c -> chr ')' `thn` \_ -> ret (a,b,c)
169
false
false
1
6
52
131
70
61
null
null
ibabushkin/morgue-server
src/Group.hs
gpl-3.0
-- = Creating new groups -- | provide data needed for group creation groupNewProvider :: GroupNewRequest -> Query Morgue GroupNewData groupNewProvider (GroupNewRequest user gName) = do morgue <- ask return ( getOne $ allUsers morgue @= user , gName , getOne $ allGroups morgue @= groupName ) -- | process all data from a new group request
380
groupNewProvider :: GroupNewRequest -> Query Morgue GroupNewData groupNewProvider (GroupNewRequest user gName) = do morgue <- ask return ( getOne $ allUsers morgue @= user , gName , getOne $ allGroups morgue @= groupName ) -- | process all data from a new group request
311
groupNewProvider (GroupNewRequest user gName) = do morgue <- ask return ( getOne $ allUsers morgue @= user , gName , getOne $ allGroups morgue @= groupName ) -- | process all data from a new group request
246
true
true
0
11
98
78
39
39
null
null
mbakke/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
elogDelayTest :: String elogDelayTest = Types.eLogTypeToRaw ELogDelayTest
73
elogDelayTest :: String elogDelayTest = Types.eLogTypeToRaw ELogDelayTest
73
elogDelayTest = Types.eLogTypeToRaw ELogDelayTest
49
false
true
0
6
6
16
8
8
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp SizeofMutableArrayOp = _ILIT(144)
46
tagOf_PrimOp SizeofMutableArrayOp = _ILIT(144)
46
tagOf_PrimOp SizeofMutableArrayOp = _ILIT(144)
46
false
false
0
6
3
15
7
8
null
null
rueshyna/gogol
gogol-youtube-reporting/gen/Network/Google/Resource/YouTubeReporting/Jobs/Create.hs
mpl-2.0
-- | OAuth bearer token. jcBearerToken :: Lens' JobsCreate (Maybe Text) jcBearerToken = lens _jcBearerToken (\ s a -> s{_jcBearerToken = a})
148
jcBearerToken :: Lens' JobsCreate (Maybe Text) jcBearerToken = lens _jcBearerToken (\ s a -> s{_jcBearerToken = a})
123
jcBearerToken = lens _jcBearerToken (\ s a -> s{_jcBearerToken = a})
76
true
true
0
9
29
48
25
23
null
null
icyfork/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
checkArithmeticBadOctal _ t@(TA_Expansion id _) = potentially $ do str <- getLiteralString t guard $ str `matches` octalRE return $ err id 2080 "Numbers with leading 0 are considered octal." where octalRE = mkRegex "^0[0-7]*[8-9]"
248
checkArithmeticBadOctal _ t@(TA_Expansion id _) = potentially $ do str <- getLiteralString t guard $ str `matches` octalRE return $ err id 2080 "Numbers with leading 0 are considered octal." where octalRE = mkRegex "^0[0-7]*[8-9]"
248
checkArithmeticBadOctal _ t@(TA_Expansion id _) = potentially $ do str <- getLiteralString t guard $ str `matches` octalRE return $ err id 2080 "Numbers with leading 0 are considered octal." where octalRE = mkRegex "^0[0-7]*[8-9]"
248
false
false
1
9
52
81
36
45
null
null
softwaremechanic/Miscellaneous
Haskell/getchar_test.hs
gpl-2.0
main = do c <- getChar when (c /= ' ') $ do putChar c main --main = do -- c <- getChar -- if c /= ' ' -- then do -- putChar c -- main -- else return()
216
main = do c <- getChar when (c /= ' ') $ do putChar c main --main = do -- c <- getChar -- if c /= ' ' -- then do -- putChar c -- main -- else return()
216
main = do c <- getChar when (c /= ' ') $ do putChar c main --main = do -- c <- getChar -- if c /= ' ' -- then do -- putChar c -- main -- else return()
216
false
false
0
10
105
46
24
22
null
null
AlexeyRaga/eta
compiler/ETA/CodeGen/Env.hs
bsd-3-clause
maybeLetNoEscape _ = Nothing
28
maybeLetNoEscape _ = Nothing
28
maybeLetNoEscape _ = Nothing
28
false
false
0
4
3
10
4
6
null
null
agomezl/tstp2agda
test/Test/Main.hs
mit
ain ∷ IO () main = putStrLn "TODO: tests"
42
main ∷ IO () main = putStrLn "TODO: tests"
42
main = putStrLn "TODO: tests"
29
false
true
0
6
9
19
9
10
null
null
krystalcode/docker-hub
src/DockerHub/Pull.hs
bsd-3-clause
pull' tag repository = lazyProcess command "." where command = "docker pull " ++ (name repository) ++ ":" ++ tag
116
pull' tag repository = lazyProcess command "." where command = "docker pull " ++ (name repository) ++ ":" ++ tag
116
pull' tag repository = lazyProcess command "." where command = "docker pull " ++ (name repository) ++ ":" ++ tag
116
false
false
0
9
23
43
20
23
null
null
Peaker/lamdu
src/Lamdu/Sugar/Convert/Composite.hs
gpl-3.0
convertEmpty :: Monad m => (V.RowExtend T.Tag V.Term V.Term # F (IRef m) -> ExprIRef.ValBody m) -> HRef m # V.Term -> ConvertM m (Composite v InternalName (OnceT (T m)) (T m) expr) convertEmpty cons stored = do actions <- ConvertM.postProcessAssert <&> \postProcess -> ClosedCompositeActions { _closedCompositeOpen = DataOps.replaceWithHole stored <* postProcess <&> EntityId.ofValI } addItem <- convertAddItem cons mempty stored pure Composite { _cList = TaggedList { _tlAddFirst = addItem , _tlItems = Nothing } , _cPunnedItems = [] , _cTail = ClosedComposite actions }
831
convertEmpty :: Monad m => (V.RowExtend T.Tag V.Term V.Term # F (IRef m) -> ExprIRef.ValBody m) -> HRef m # V.Term -> ConvertM m (Composite v InternalName (OnceT (T m)) (T m) expr) convertEmpty cons stored = do actions <- ConvertM.postProcessAssert <&> \postProcess -> ClosedCompositeActions { _closedCompositeOpen = DataOps.replaceWithHole stored <* postProcess <&> EntityId.ofValI } addItem <- convertAddItem cons mempty stored pure Composite { _cList = TaggedList { _tlAddFirst = addItem , _tlItems = Nothing } , _cPunnedItems = [] , _cTail = ClosedComposite actions }
831
convertEmpty cons stored = do actions <- ConvertM.postProcessAssert <&> \postProcess -> ClosedCompositeActions { _closedCompositeOpen = DataOps.replaceWithHole stored <* postProcess <&> EntityId.ofValI } addItem <- convertAddItem cons mempty stored pure Composite { _cList = TaggedList { _tlAddFirst = addItem , _tlItems = Nothing } , _cPunnedItems = [] , _cTail = ClosedComposite actions }
634
false
true
0
16
345
222
110
112
null
null
dbueno/funsat
etc/bitset/tests/Properties.hs
bsd-3-clause
prop_insInsIdempotent x s = insert xa s == (insert xa . insert xa) s where xa = abs x :: Int
96
prop_insInsIdempotent x s = insert xa s == (insert xa . insert xa) s where xa = abs x :: Int
96
prop_insInsIdempotent x s = insert xa s == (insert xa . insert xa) s where xa = abs x :: Int
96
false
false
2
9
24
57
23
34
null
null
TinnedTuna/hacksoc-markov-challenge
Markov.hs
bsd-2-clause
buildChain :: (NFData a, Ord a) => [a] -> Chain a buildChain xs = force $ buildChain' xs Map.empty where buildChain' :: (Ord a) => [a] -> Chain a -> Chain a buildChain' [a, b] c = insert a [b] $ c buildChain' (first:xs) c = buildChain' xs $ Map.insertWith (++) first [head xs] c
295
buildChain :: (NFData a, Ord a) => [a] -> Chain a buildChain xs = force $ buildChain' xs Map.empty where buildChain' :: (Ord a) => [a] -> Chain a -> Chain a buildChain' [a, b] c = insert a [b] $ c buildChain' (first:xs) c = buildChain' xs $ Map.insertWith (++) first [head xs] c
295
buildChain xs = force $ buildChain' xs Map.empty where buildChain' :: (Ord a) => [a] -> Chain a -> Chain a buildChain' [a, b] c = insert a [b] $ c buildChain' (first:xs) c = buildChain' xs $ Map.insertWith (++) first [head xs] c
245
false
true
0
8
71
155
79
76
null
null
tcrayford/hafka
Network/Kafka/Bench/Benchmarks.hs
bsd-3-clause
messagesWithPrefix :: B.ByteString -> [Message] messagesWithPrefix prefix = map f . take 15 $ range where f n = Message (prefix `B.append` B.pack (show n)) range :: [Int] range = [0..]
202
messagesWithPrefix :: B.ByteString -> [Message] messagesWithPrefix prefix = map f . take 15 $ range where f n = Message (prefix `B.append` B.pack (show n)) range :: [Int] range = [0..]
202
messagesWithPrefix prefix = map f . take 15 $ range where f n = Message (prefix `B.append` B.pack (show n)) range :: [Int] range = [0..]
154
false
true
1
10
48
88
46
42
null
null
anton-dessiatov/stack
src/Stack/Ls.hs
bsd-3-clause
displaySnapshotData :: Bool -> SnapshotData -> IO () displaySnapshotData term sdata = case L.reverse $ snaps sdata of [] -> return () xs -> let snaps = T.concat $ L.map displaySingleSnap xs in renderData term snaps
258
displaySnapshotData :: Bool -> SnapshotData -> IO () displaySnapshotData term sdata = case L.reverse $ snaps sdata of [] -> return () xs -> let snaps = T.concat $ L.map displaySingleSnap xs in renderData term snaps
258
displaySnapshotData term sdata = case L.reverse $ snaps sdata of [] -> return () xs -> let snaps = T.concat $ L.map displaySingleSnap xs in renderData term snaps
205
false
true
2
12
79
92
42
50
null
null
nevrenato/Hets_Fork
CASL/Freeness.hs
gpl-2.0
getVars (QuantOp _ _ f) = getVars f
35
getVars (QuantOp _ _ f) = getVars f
35
getVars (QuantOp _ _ f) = getVars f
35
false
false
0
7
7
22
10
12
null
null
vikraman/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
addTickHsExpr (ExplicitPArr ty es) = liftM2 ExplicitPArr (return ty) (mapM (addTickLHsExpr) es)
135
addTickHsExpr (ExplicitPArr ty es) = liftM2 ExplicitPArr (return ty) (mapM (addTickLHsExpr) es)
135
addTickHsExpr (ExplicitPArr ty es) = liftM2 ExplicitPArr (return ty) (mapM (addTickLHsExpr) es)
135
false
false
0
8
51
41
20
21
null
null
sopvop/heist
test/suite/Heist/Tests.hs
bsd-3-clause
bindApplyInteractionTest :: IO () bindApplyInteractionTest = do hs <- loadHS "templates" cOut <- cRender hs "bind-apply-interaction/caller" H.assertEqual "compiled failure" cExpected cOut iOut <- iRender hs "bind-apply-interaction/caller" H.assertEqual "interpreted failure" iExpected iOut where cExpected = B.intercalate "\n" ["&#10;This is a test." ,"===bind content===&#10;Another test line." ,"apply content&#10;Last test line." ,"&#10;" ] iExpected = B.unlines ["&#10;This is a test." ,"===bind content===" ,"Another test line." ,"apply content" ,"Last test line." ,"" ] ------------------------------------------------------------------------------ -- | Test backslash escaping in the attribute parser.
814
bindApplyInteractionTest :: IO () bindApplyInteractionTest = do hs <- loadHS "templates" cOut <- cRender hs "bind-apply-interaction/caller" H.assertEqual "compiled failure" cExpected cOut iOut <- iRender hs "bind-apply-interaction/caller" H.assertEqual "interpreted failure" iExpected iOut where cExpected = B.intercalate "\n" ["&#10;This is a test." ,"===bind content===&#10;Another test line." ,"apply content&#10;Last test line." ,"&#10;" ] iExpected = B.unlines ["&#10;This is a test." ,"===bind content===" ,"Another test line." ,"apply content" ,"Last test line." ,"" ] ------------------------------------------------------------------------------ -- | Test backslash escaping in the attribute parser.
814
bindApplyInteractionTest = do hs <- loadHS "templates" cOut <- cRender hs "bind-apply-interaction/caller" H.assertEqual "compiled failure" cExpected cOut iOut <- iRender hs "bind-apply-interaction/caller" H.assertEqual "interpreted failure" iExpected iOut where cExpected = B.intercalate "\n" ["&#10;This is a test." ,"===bind content===&#10;Another test line." ,"apply content&#10;Last test line." ,"&#10;" ] iExpected = B.unlines ["&#10;This is a test." ,"===bind content===" ,"Another test line." ,"apply content" ,"Last test line." ,"" ] ------------------------------------------------------------------------------ -- | Test backslash escaping in the attribute parser.
780
false
true
0
8
184
131
66
65
null
null
jwiegley/ghc-release
utils/haddock/src/Haddock/Backends/LaTeX.hs
gpl-3.0
string_txt (LStr s1 _) s2 = unpackLitString s1 ++ s2
52
string_txt (LStr s1 _) s2 = unpackLitString s1 ++ s2
52
string_txt (LStr s1 _) s2 = unpackLitString s1 ++ s2
52
false
false
0
7
9
26
12
14
null
null
danr/hipspec
examples/old-examples/hip/Streams.hs
gpl-3.0
prop_bin_nat :: Prop (Stream Nat) prop_bin_nat = bin =:= nat
60
prop_bin_nat :: Prop (Stream Nat) prop_bin_nat = bin =:= nat
60
prop_bin_nat = bin =:= nat
26
false
true
3
6
9
34
13
21
null
null
emwap/feldspar-language
src/Feldspar/Core/Frontend/MutableArray.hs
bsd-3-clause
-- | Create a new 'Mutable' Array and initialize with elements from the -- list newListArr :: forall a. Type a => [Data a] -> M (Data (MArr a)) newListArr xs = do arr <- newArr_ (value $ genericLength xs) zipWithM_ (setArr arr . value) [0..] xs return arr -- | Extract the element at index
328
newListArr :: forall a. Type a => [Data a] -> M (Data (MArr a)) newListArr xs = do arr <- newArr_ (value $ genericLength xs) zipWithM_ (setArr arr . value) [0..] xs return arr -- | Extract the element at index
248
newListArr xs = do arr <- newArr_ (value $ genericLength xs) zipWithM_ (setArr arr . value) [0..] xs return arr -- | Extract the element at index
184
true
true
0
13
94
108
51
57
null
null
burz/Feval
FVL/EF.hs
mit
alg (Great x y) = gtTransform x y
33
alg (Great x y) = gtTransform x y
33
alg (Great x y) = gtTransform x y
33
false
false
0
6
7
23
10
13
null
null
sopvop/cabal
cabal-install/Distribution/Client/BuildTarget.hs
bsd-3-clause
matchPackageDir :: [PackageInfo] -> String -> FileStatus -> Match PackageInfo matchPackageDir ps = \str fstatus -> case fstatus of FileStatusExistsDir canondir -> orNoSuchThing "package directory" str (map (snd . fst) dirs) $ increaseConfidenceFor $ fmap snd $ matchExactly (fst . fst) dirs canondir _ -> mzero where dirs = [ ((dabs,drel),p) | p@PackageInfo{ pinfoDirectory = Just (dabs,drel) } <- ps ]
482
matchPackageDir :: [PackageInfo] -> String -> FileStatus -> Match PackageInfo matchPackageDir ps = \str fstatus -> case fstatus of FileStatusExistsDir canondir -> orNoSuchThing "package directory" str (map (snd . fst) dirs) $ increaseConfidenceFor $ fmap snd $ matchExactly (fst . fst) dirs canondir _ -> mzero where dirs = [ ((dabs,drel),p) | p@PackageInfo{ pinfoDirectory = Just (dabs,drel) } <- ps ]
482
matchPackageDir ps = \str fstatus -> case fstatus of FileStatusExistsDir canondir -> orNoSuchThing "package directory" str (map (snd . fst) dirs) $ increaseConfidenceFor $ fmap snd $ matchExactly (fst . fst) dirs canondir _ -> mzero where dirs = [ ((dabs,drel),p) | p@PackageInfo{ pinfoDirectory = Just (dabs,drel) } <- ps ]
388
false
true
0
16
140
161
84
77
null
null
dylanmc/cryptol
sbv/Data/SBV/BitVectors/STree.hs
bsd-3-clause
mkSTree :: forall i e. HasKind i => [SBV e] -> STree i e mkSTree ivals | isReal (undefined :: i) = error "SBV.STree.mkSTree: Cannot build a real-valued sized tree" | not (isBounded (undefined :: i)) = error "SBV.STree.mkSTree: Cannot build an infinitely large tree" | reqd /= given = error $ "SBV.STree.mkSTree: Required " ++ show reqd ++ " elements, received: " ++ show given | True = go ivals where reqd = 2 ^ intSizeOf (undefined :: i) given = length ivals go [] = error "SBV.STree.mkSTree: Impossible happened, ran out of elements" go [l] = SLeaf l go ns = let (l, r) = splitAt (length ns `div` 2) ns in SBin (go l) (go r)
678
mkSTree :: forall i e. HasKind i => [SBV e] -> STree i e mkSTree ivals | isReal (undefined :: i) = error "SBV.STree.mkSTree: Cannot build a real-valued sized tree" | not (isBounded (undefined :: i)) = error "SBV.STree.mkSTree: Cannot build an infinitely large tree" | reqd /= given = error $ "SBV.STree.mkSTree: Required " ++ show reqd ++ " elements, received: " ++ show given | True = go ivals where reqd = 2 ^ intSizeOf (undefined :: i) given = length ivals go [] = error "SBV.STree.mkSTree: Impossible happened, ran out of elements" go [l] = SLeaf l go ns = let (l, r) = splitAt (length ns `div` 2) ns in SBin (go l) (go r)
678
mkSTree ivals | isReal (undefined :: i) = error "SBV.STree.mkSTree: Cannot build a real-valued sized tree" | not (isBounded (undefined :: i)) = error "SBV.STree.mkSTree: Cannot build an infinitely large tree" | reqd /= given = error $ "SBV.STree.mkSTree: Required " ++ show reqd ++ " elements, received: " ++ show given | True = go ivals where reqd = 2 ^ intSizeOf (undefined :: i) given = length ivals go [] = error "SBV.STree.mkSTree: Impossible happened, ran out of elements" go [l] = SLeaf l go ns = let (l, r) = splitAt (length ns `div` 2) ns in SBin (go l) (go r)
621
false
true
5
14
170
252
123
129
null
null
ucsd-progsys/nanomaly
src/NanoML/Classify.hs
bsd-3-clause
diffExprsT :: [Expr] -> [Expr] -> DiffT diffExprsT [] [] = NN end
67
diffExprsT :: [Expr] -> [Expr] -> DiffT diffExprsT [] [] = NN end
67
diffExprsT [] [] = NN end
27
false
true
0
7
14
37
19
18
null
null
ekmett/wxHaskell
wx/src/Graphics/UI/WX/Attributes.hs
lgpl-2.1
-- | Transform the properties based on a style property. withStylePropertyEx :: Attr w Bool -> (Style -> Bool) -> (Bool -> Style -> Style) -> ([Prop w] -> Style -> a) -> [Prop w] -> Style -> a withStylePropertyEx prop def transform cont props style = case filterProperty prop props of (PropValue x, ps) -> cont ps (transform x style) (PropModify f, ps) -> cont ps (transform (f (def style)) style) (PropNone, ps) -> cont ps style
455
withStylePropertyEx :: Attr w Bool -> (Style -> Bool) -> (Bool -> Style -> Style) -> ([Prop w] -> Style -> a) -> [Prop w] -> Style -> a withStylePropertyEx prop def transform cont props style = case filterProperty prop props of (PropValue x, ps) -> cont ps (transform x style) (PropModify f, ps) -> cont ps (transform (f (def style)) style) (PropNone, ps) -> cont ps style
398
withStylePropertyEx prop def transform cont props style = case filterProperty prop props of (PropValue x, ps) -> cont ps (transform x style) (PropModify f, ps) -> cont ps (transform (f (def style)) style) (PropNone, ps) -> cont ps style
262
true
true
0
14
103
189
96
93
null
null
jpbetz/protolang
haskell/Codegen.hs
apache-2.0
getBlock :: Codegen Name getBlock = gets currentBlock
53
getBlock :: Codegen Name getBlock = gets currentBlock
53
getBlock = gets currentBlock
28
false
true
0
6
7
23
9
14
null
null
choener/BiobaseFasta
Tests/Test.hs
gpl-3.0
ff !hdr !dta !sp = [show $ BS.length dta]
41
ff !hdr !dta !sp = [show $ BS.length dta]
41
ff !hdr !dta !sp = [show $ BS.length dta]
41
false
false
2
9
8
31
13
18
null
null
apyrgio/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
ispecsParameterTypes :: Map String VType ispecsParameterTypes = Map.fromList [(ConstantUtils.ispecDiskSize, VTypeInt), (ConstantUtils.ispecCpuCount, VTypeInt), (ConstantUtils.ispecSpindleUse, VTypeInt), (ConstantUtils.ispecMemSize, VTypeInt), (ConstantUtils.ispecNicCount, VTypeInt), (ConstantUtils.ispecDiskCount, VTypeInt)]
344
ispecsParameterTypes :: Map String VType ispecsParameterTypes = Map.fromList [(ConstantUtils.ispecDiskSize, VTypeInt), (ConstantUtils.ispecCpuCount, VTypeInt), (ConstantUtils.ispecSpindleUse, VTypeInt), (ConstantUtils.ispecMemSize, VTypeInt), (ConstantUtils.ispecNicCount, VTypeInt), (ConstantUtils.ispecDiskCount, VTypeInt)]
344
ispecsParameterTypes = Map.fromList [(ConstantUtils.ispecDiskSize, VTypeInt), (ConstantUtils.ispecCpuCount, VTypeInt), (ConstantUtils.ispecSpindleUse, VTypeInt), (ConstantUtils.ispecMemSize, VTypeInt), (ConstantUtils.ispecNicCount, VTypeInt), (ConstantUtils.ispecDiskCount, VTypeInt)]
303
false
true
0
7
38
87
52
35
null
null
glutamate/space
VectorsL.hs
bsd-3-clause
velem :: Vec n a -> a velem = undefined
40
velem :: Vec n a -> a velem = undefined
39
velem = undefined
17
false
true
0
7
10
27
11
16
null
null
glutamate/gnewplot
Graphics/Gnewplot/Panels.hs
bsd-3-clause
subLabSplit (D x) = ("D",x)
27
subLabSplit (D x) = ("D",x)
27
subLabSplit (D x) = ("D",x)
27
false
false
0
7
4
21
11
10
null
null
nablaa/hchesslib
test/Chess/TestUtils.hs
gpl-2.0
coord :: String -> Coordinates coord = fromJust . parseCoordinate
65
coord :: String -> Coordinates coord = fromJust . parseCoordinate
65
coord = fromJust . parseCoordinate
34
false
true
0
7
9
26
11
15
null
null
ion1/shell-dsl
src/System/ShellDSL.hs
mit
apos, bslash, newline, space :: Word8 apos = fromIntegral (ord '\'')
71
apos, bslash, newline, space :: Word8 apos = fromIntegral (ord '\'')
71
apos = fromIntegral (ord '\'')
33
false
true
3
7
13
33
16
17
null
null
haskellbr/missingh
missingh-all/src/System/IO/HVFS/Combinators.hs
mit
newHVFSChroot :: HVFS a => a -- ^ The object to pass requests on to -> FilePath -- ^ The path of the directory to make root -> IO (HVFSChroot a) -- ^ The resulting new object newHVFSChroot fh fp = do full <- getFullPath fh fp isdir <- vDoesDirectoryExist fh full if isdir then do let newobj = (HVFSChroot full fh) vSetCurrentDirectory newobj [pathSeparator] return newobj else vRaiseError fh doesNotExistErrorType ("Attempt to instantiate HVFSChroot over non-directory " ++ full) (Just full) {- | Get the embedded object -}
690
newHVFSChroot :: HVFS a => a -- ^ The object to pass requests on to -> FilePath -- ^ The path of the directory to make root -> IO (HVFSChroot a) newHVFSChroot fh fp = do full <- getFullPath fh fp isdir <- vDoesDirectoryExist fh full if isdir then do let newobj = (HVFSChroot full fh) vSetCurrentDirectory newobj [pathSeparator] return newobj else vRaiseError fh doesNotExistErrorType ("Attempt to instantiate HVFSChroot over non-directory " ++ full) (Just full) {- | Get the embedded object -}
655
newHVFSChroot fh fp = do full <- getFullPath fh fp isdir <- vDoesDirectoryExist fh full if isdir then do let newobj = (HVFSChroot full fh) vSetCurrentDirectory newobj [pathSeparator] return newobj else vRaiseError fh doesNotExistErrorType ("Attempt to instantiate HVFSChroot over non-directory " ++ full) (Just full) {- | Get the embedded object -}
457
true
true
0
15
255
140
66
74
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs
mpl-2.0
-- | Required. User ID to evaluate consents for. eucrUserId :: Lens' EvaluateUserConsentsRequest (Maybe Text) eucrUserId = lens _eucrUserId (\ s a -> s{_eucrUserId = a})
171
eucrUserId :: Lens' EvaluateUserConsentsRequest (Maybe Text) eucrUserId = lens _eucrUserId (\ s a -> s{_eucrUserId = a})
122
eucrUserId = lens _eucrUserId (\ s a -> s{_eucrUserId = a})
61
true
true
1
9
27
52
25
27
null
null
olsner/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
pprStmtContext (TransStmtCtxt c) | opt_PprStyle_Debug = sep [text "transformed branch of", pprAStmtContext c] | otherwise = pprStmtContext c
151
pprStmtContext (TransStmtCtxt c) | opt_PprStyle_Debug = sep [text "transformed branch of", pprAStmtContext c] | otherwise = pprStmtContext c
151
pprStmtContext (TransStmtCtxt c) | opt_PprStyle_Debug = sep [text "transformed branch of", pprAStmtContext c] | otherwise = pprStmtContext c
151
false
false
1
8
28
46
21
25
null
null
jamii/hs-last
src/Web/Last/Parsing.hs
gpl-3.0
track :: JSValTo Types.Track track = objOf $ do -- If they would just make up their minds... (artistName,artistMBID) <- (ll "artist" strJS &&& return Nothing) <|> (inObj "artist" $ (ll "name" strJS <|> ll "#text" strJS) &&& optional (ll "mbid" strJS)) return Types.Track <*> ll "name" strJS <*> ll "mbid" strJS <*> ll "url" strJS <*> return artistName <*> return artistMBID
485
track :: JSValTo Types.Track track = objOf $ do -- If they would just make up their minds... (artistName,artistMBID) <- (ll "artist" strJS &&& return Nothing) <|> (inObj "artist" $ (ll "name" strJS <|> ll "#text" strJS) &&& optional (ll "mbid" strJS)) return Types.Track <*> ll "name" strJS <*> ll "mbid" strJS <*> ll "url" strJS <*> return artistName <*> return artistMBID
485
track = objOf $ do -- If they would just make up their minds... (artistName,artistMBID) <- (ll "artist" strJS &&& return Nothing) <|> (inObj "artist" $ (ll "name" strJS <|> ll "#text" strJS) &&& optional (ll "mbid" strJS)) return Types.Track <*> ll "name" strJS <*> ll "mbid" strJS <*> ll "url" strJS <*> return artistName <*> return artistMBID
456
false
true
2
15
173
151
69
82
null
null
LukaHorvat/Hs2Js
src/Primitive.hs
mit
jzip :: (JArray a ~ ExprType c1 , JArray b ~ ExprType c2) => c1 -> c2 -> Zip c1 c2 jzip = Zip
106
jzip :: (JArray a ~ ExprType c1 , JArray b ~ ExprType c2) => c1 -> c2 -> Zip c1 c2 jzip = Zip
106
jzip = Zip
10
false
true
0
9
36
61
27
34
null
null
HIPERFIT/futhark
src/Futhark/CodeGen/Backends/MulticoreWASM.hs
isc
fRepMyRep :: Imp.Definitions Imp.Multicore -> [JSEntryPoint] fRepMyRep prog = let Imp.Functions fs = Imp.defFuns prog function (Imp.Function entry _ _ _ res args) = do n <- entry Just $ JSEntryPoint { name = nameToString n, parameters = map (extToString . snd) args, ret = map extToString res } in mapMaybe (function . snd) fs
415
fRepMyRep :: Imp.Definitions Imp.Multicore -> [JSEntryPoint] fRepMyRep prog = let Imp.Functions fs = Imp.defFuns prog function (Imp.Function entry _ _ _ res args) = do n <- entry Just $ JSEntryPoint { name = nameToString n, parameters = map (extToString . snd) args, ret = map extToString res } in mapMaybe (function . snd) fs
415
fRepMyRep prog = let Imp.Functions fs = Imp.defFuns prog function (Imp.Function entry _ _ _ res args) = do n <- entry Just $ JSEntryPoint { name = nameToString n, parameters = map (extToString . snd) args, ret = map extToString res } in mapMaybe (function . snd) fs
354
false
true
0
16
143
142
70
72
null
null
Jem777/deepthought
src/StdLib.hs
gpl-3.0
abs pos x = goLeft [functionError pos "abs" 1 x]
48
abs pos x = goLeft [functionError pos "abs" 1 x]
48
abs pos x = goLeft [functionError pos "abs" 1 x]
48
false
false
0
7
9
27
12
15
null
null
zerobuzz/uri-bytestring
src/URI/ByteString.hs
bsd-3-clause
------------------------------------------------------------------------------- -- | Parse a strict ByteString into a URI or an error. -- -- Example: -- -- >>> parseURI strictURIParserOptions "http://www.example.org/foo?bar=baz#quux" -- Right (URI {uriScheme = Scheme {getScheme = "http"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {getHost = "www.example.org"}, authorityPort = Nothing}), uriPath = "/foo", uriQuery = Query {getQuery = [("bar","baz")]}, uriFragment = Just "quux"}) -- -- >>> parseURI strictURIParserOptions "$$$$://badurl.example.org" -- Left (MalformedScheme NonAlphaLeading) -- -- There are some urls that you'll encounter which defy the spec, such -- as those with square brackets in the query string. If you must be -- able to parse those, you can use "laxURIParserOptions" or specify your own -- -- >>> parseURI strictURIParserOptions "http://www.example.org/foo?bar[]=baz" -- Left MalformedQuery -- -- >>> parseURI laxURIParserOptions "http://www.example.org/foo?bar[]=baz" -- Right (URI {uriScheme = Scheme {getScheme = "http"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {getHost = "www.example.org"}, authorityPort = Nothing}), uriPath = "/foo", uriQuery = Query {getQuery = [("bar[]","baz")]}, uriFragment = Nothing}) -- -- >>> let myLaxOptions = URIParserOptions { upoValidQueryChar = liftA2 (||) (upoValidQueryChar strictURIParserOptions) (inClass "[]")} -- >>> parseURI myLaxOptions "http://www.example.org/foo?bar[]=baz" -- Right (URI {uriScheme = Scheme {getScheme = "http"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {getHost = "www.example.org"}, authorityPort = Nothing}), uriPath = "/foo", uriQuery = Query {getQuery = [("bar[]","baz")]}, uriFragment = Nothing}) parseURI :: URIParserOptions -> ByteString -> Either URIParseError URI parseURI opts = parseOnly' OtherError (uriParser opts)
1,944
parseURI :: URIParserOptions -> ByteString -> Either URIParseError URI parseURI opts = parseOnly' OtherError (uriParser opts)
125
parseURI opts = parseOnly' OtherError (uriParser opts)
54
true
true
0
8
236
66
43
23
null
null
reactive-systems/syfco
src/lib/Reader/Abstraction.hs
mit
abstractBus :: Abstractor ((String,ExprPos),Expr String) ((Int,ExprPos),Expr Int) abstractBus ((s,p),e) = do (i,p') <- add (s,p) e' <- abstractExpr e return ((i,p'),e') -----------------------------------------------------------------------------
271
abstractBus :: Abstractor ((String,ExprPos),Expr String) ((Int,ExprPos),Expr Int) abstractBus ((s,p),e) = do (i,p') <- add (s,p) e' <- abstractExpr e return ((i,p'),e') -----------------------------------------------------------------------------
270
abstractBus ((s,p),e) = do (i,p') <- add (s,p) e' <- abstractExpr e return ((i,p'),e') -----------------------------------------------------------------------------
171
false
true
1
10
46
118
62
56
null
null
jpierre03/hs-pipotron
src/configuration.hs
apache-2.0
s3_b :: [String] s3_b = [ "du rapport." , "du produit." , "du logiciel." , "du materiel." ]
119
s3_b :: [String] s3_b = [ "du rapport." , "du produit." , "du logiciel." , "du materiel." ]
119
s3_b = [ "du rapport." , "du produit." , "du logiciel." , "du materiel." ]
102
false
true
0
5
45
26
16
10
null
null
andrewMacmurray/haskell-book-solutions
src/ch6/excercises.hs
mit
-- compiles but cannot print s1 (as no instance of Show for Show (Object -> Sentence)) s1 = Sentence "Dog" "Drool"
114
s1 = Sentence "Dog" "Drool"
27
s1 = Sentence "Dog" "Drool"
27
true
false
1
5
20
15
6
9
null
null
NICTA/seL4
haskell/src/SEL4/Machine/Hardware/ARM/Lyrebird.hs
bsd-2-clause
addrFromPPtr :: PPtr a -> PAddr addrFromPPtr (PPtr ptr) = PAddr ptr
67
addrFromPPtr :: PPtr a -> PAddr addrFromPPtr (PPtr ptr) = PAddr ptr
67
addrFromPPtr (PPtr ptr) = PAddr ptr
35
false
true
0
7
11
30
14
16
null
null
ddssff/process-listlike-old
System/Process/ListLike/Chunks.hs
mit
displayCreateProcess :: CreateProcess -> String displayCreateProcess p = showCmdSpecForUser (cmdspec p) ++ maybe "" (\ d -> " (in " ++ d ++ ")") (cwd p)
152
displayCreateProcess :: CreateProcess -> String displayCreateProcess p = showCmdSpecForUser (cmdspec p) ++ maybe "" (\ d -> " (in " ++ d ++ ")") (cwd p)
152
displayCreateProcess p = showCmdSpecForUser (cmdspec p) ++ maybe "" (\ d -> " (in " ++ d ++ ")") (cwd p)
104
false
true
0
10
25
60
30
30
null
null
kranich/haste-compiler
src/Haste/AST/Optimize.hs
bsd-3-clause
removeUpdate :: (Var -> Bool) -> Stm -> Stm removeUpdate p stm@(Assign _ _ next) | isEvalUpd p stm = next
105
removeUpdate :: (Var -> Bool) -> Stm -> Stm removeUpdate p stm@(Assign _ _ next) | isEvalUpd p stm = next
105
removeUpdate p stm@(Assign _ _ next) | isEvalUpd p stm = next
61
false
true
4
7
20
56
28
28
null
null
rueshyna/gogol
gogol-drive/gen/Network/Google/Drive/Types/Product.hs
mpl-2.0
-- | The ID of the file\'s head revision. This is currently only available -- for files with binary content in Drive. fHeadRevisionId :: Lens' File (Maybe Text) fHeadRevisionId = lens _fHeadRevisionId (\ s a -> s{_fHeadRevisionId = a})
243
fHeadRevisionId :: Lens' File (Maybe Text) fHeadRevisionId = lens _fHeadRevisionId (\ s a -> s{_fHeadRevisionId = a})
125
fHeadRevisionId = lens _fHeadRevisionId (\ s a -> s{_fHeadRevisionId = a})
82
true
true
0
8
46
50
26
24
null
null
bernstein/pixelparty
src/PixelParty/Shader.hs
bsd-3-clause
maybeSetUniform :: Maybe GL.GLint -> (GL.GLint -> t -> IO ()) -> t -> IO () maybeSetUniform m set val = maybe (return ()) (`set` val) m
135
maybeSetUniform :: Maybe GL.GLint -> (GL.GLint -> t -> IO ()) -> t -> IO () maybeSetUniform m set val = maybe (return ()) (`set` val) m
135
maybeSetUniform m set val = maybe (return ()) (`set` val) m
59
false
true
0
11
26
84
41
43
null
null
dmjio/aeson
src/Data/Aeson/Types/ToJSON.hs
bsd-3-clause
encodeVector :: (ToJSON a, VG.Vector v a) => v a -> Encoding encodeVector = listEncoding toEncoding . VG.toList
111
encodeVector :: (ToJSON a, VG.Vector v a) => v a -> Encoding encodeVector = listEncoding toEncoding . VG.toList
111
encodeVector = listEncoding toEncoding . VG.toList
50
false
true
0
8
17
53
24
29
null
null
christiaanb/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
freezeCommand :: CommandUI FreezeFlags freezeCommand = CommandUI { commandName = "freeze", commandSynopsis = "Freeze dependencies.", commandDescription = Just $ \_ -> wrapText $ "Calculates a valid set of dependencies and their exact versions. " ++ "If successful, saves the result to the file `cabal.config`.\n" ++ "\n" ++ "The package versions specified in `cabal.config` will be used for " ++ "any future installs.\n" ++ "\n" ++ "An existing `cabal.config` is ignored and overwritten.\n", commandNotes = Nothing, commandUsage = usageAlternatives "freeze" ["" ,"PACKAGES" ], commandDefaultFlags = defaultFreezeFlags, commandOptions = \ showOrParseArgs -> [ optionVerbosity freezeVerbosity (\v flags -> flags { freezeVerbosity = v }) , option [] ["dry-run"] "Do not freeze anything, only print what would be frozen" freezeDryRun (\v flags -> flags { freezeDryRun = v }) trueArg , option [] ["tests"] "freezing of the dependencies of any tests suites in the package description file." freezeTests (\v flags -> flags { freezeTests = v }) (boolOpt [] []) , option [] ["benchmarks"] "freezing of the dependencies of any benchmarks suites in the package description file." freezeBenchmarks (\v flags -> flags { freezeBenchmarks = v }) (boolOpt [] []) ] ++ optionSolver freezeSolver (\v flags -> flags { freezeSolver = v }) : optionSolverFlags showOrParseArgs freezeMaxBackjumps (\v flags -> flags { freezeMaxBackjumps = v }) freezeReorderGoals (\v flags -> flags { freezeReorderGoals = v }) freezeIndependentGoals (\v flags -> flags { freezeIndependentGoals = v }) freezeShadowPkgs (\v flags -> flags { freezeShadowPkgs = v }) freezeStrongFlags (\v flags -> flags { freezeStrongFlags = v }) }
2,245
freezeCommand :: CommandUI FreezeFlags freezeCommand = CommandUI { commandName = "freeze", commandSynopsis = "Freeze dependencies.", commandDescription = Just $ \_ -> wrapText $ "Calculates a valid set of dependencies and their exact versions. " ++ "If successful, saves the result to the file `cabal.config`.\n" ++ "\n" ++ "The package versions specified in `cabal.config` will be used for " ++ "any future installs.\n" ++ "\n" ++ "An existing `cabal.config` is ignored and overwritten.\n", commandNotes = Nothing, commandUsage = usageAlternatives "freeze" ["" ,"PACKAGES" ], commandDefaultFlags = defaultFreezeFlags, commandOptions = \ showOrParseArgs -> [ optionVerbosity freezeVerbosity (\v flags -> flags { freezeVerbosity = v }) , option [] ["dry-run"] "Do not freeze anything, only print what would be frozen" freezeDryRun (\v flags -> flags { freezeDryRun = v }) trueArg , option [] ["tests"] "freezing of the dependencies of any tests suites in the package description file." freezeTests (\v flags -> flags { freezeTests = v }) (boolOpt [] []) , option [] ["benchmarks"] "freezing of the dependencies of any benchmarks suites in the package description file." freezeBenchmarks (\v flags -> flags { freezeBenchmarks = v }) (boolOpt [] []) ] ++ optionSolver freezeSolver (\v flags -> flags { freezeSolver = v }) : optionSolverFlags showOrParseArgs freezeMaxBackjumps (\v flags -> flags { freezeMaxBackjumps = v }) freezeReorderGoals (\v flags -> flags { freezeReorderGoals = v }) freezeIndependentGoals (\v flags -> flags { freezeIndependentGoals = v }) freezeShadowPkgs (\v flags -> flags { freezeShadowPkgs = v }) freezeStrongFlags (\v flags -> flags { freezeStrongFlags = v }) }
2,245
freezeCommand = CommandUI { commandName = "freeze", commandSynopsis = "Freeze dependencies.", commandDescription = Just $ \_ -> wrapText $ "Calculates a valid set of dependencies and their exact versions. " ++ "If successful, saves the result to the file `cabal.config`.\n" ++ "\n" ++ "The package versions specified in `cabal.config` will be used for " ++ "any future installs.\n" ++ "\n" ++ "An existing `cabal.config` is ignored and overwritten.\n", commandNotes = Nothing, commandUsage = usageAlternatives "freeze" ["" ,"PACKAGES" ], commandDefaultFlags = defaultFreezeFlags, commandOptions = \ showOrParseArgs -> [ optionVerbosity freezeVerbosity (\v flags -> flags { freezeVerbosity = v }) , option [] ["dry-run"] "Do not freeze anything, only print what would be frozen" freezeDryRun (\v flags -> flags { freezeDryRun = v }) trueArg , option [] ["tests"] "freezing of the dependencies of any tests suites in the package description file." freezeTests (\v flags -> flags { freezeTests = v }) (boolOpt [] []) , option [] ["benchmarks"] "freezing of the dependencies of any benchmarks suites in the package description file." freezeBenchmarks (\v flags -> flags { freezeBenchmarks = v }) (boolOpt [] []) ] ++ optionSolver freezeSolver (\v flags -> flags { freezeSolver = v }) : optionSolverFlags showOrParseArgs freezeMaxBackjumps (\v flags -> flags { freezeMaxBackjumps = v }) freezeReorderGoals (\v flags -> flags { freezeReorderGoals = v }) freezeIndependentGoals (\v flags -> flags { freezeIndependentGoals = v }) freezeShadowPkgs (\v flags -> flags { freezeShadowPkgs = v }) freezeStrongFlags (\v flags -> flags { freezeStrongFlags = v }) }
2,206
false
true
0
16
810
431
242
189
null
null
maximilianhuber/softwareProjekt
src/GalFld/Sandbox/SerializeSandbox.hs
bsd-3-clause
--import Control.Monad {----------------------------------------------------------------------------------} {--- Beispiele-} e2f2Mipo = pList[1::F2,1,1]
153
e2f2Mipo = pList[1::F2,1,1]
27
e2f2Mipo = pList[1::F2,1,1]
27
true
false
1
5
8
27
15
12
null
null
danplubell/CTG1371
library/Data/CTG1371/Internal/Parser/Parsers.hs
mit
-- | Unpack the maternal heart rate mode unpackMHRMode::Word16 -> MHRMode unpackMHRMode hrdata = translateMHRMode $ (hrdata .&. 0xF0) `shiftR` 4
145
unpackMHRMode::Word16 -> MHRMode unpackMHRMode hrdata = translateMHRMode $ (hrdata .&. 0xF0) `shiftR` 4
104
unpackMHRMode hrdata = translateMHRMode $ (hrdata .&. 0xF0) `shiftR` 4
71
true
true
0
8
21
43
21
22
null
null
shicks/shsh
System/Console/ShSh/Command.hs
bsd-3-clause
runWithArgs :: String -> [String] -> Shell ExitCode runWithArgs cmd args = do exe <- withChangeCodeHandler 127 $ findExecutable cmd runInShell exe args
177
runWithArgs :: String -> [String] -> Shell ExitCode runWithArgs cmd args = do exe <- withChangeCodeHandler 127 $ findExecutable cmd runInShell exe args
177
runWithArgs cmd args = do exe <- withChangeCodeHandler 127 $ findExecutable cmd runInShell exe args
125
false
true
0
9
48
55
25
30
null
null
bkoropoff/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
tacimpl t = TacImp [] Dynamic t
31
tacimpl t = TacImp [] Dynamic t
31
tacimpl t = TacImp [] Dynamic t
31
false
false
0
6
6
18
8
10
null
null
bens/libmpd-haskell
src/Network/MPD/Commands/Query.hs
lgpl-2.1
-- | Negate a Query. -- -- Since MPD 0.21. -- -- @since 0.9.3.0 qNot :: Query -> Query qNot (Query ms) = Filter (ExprNot (toExpr ms))
133
qNot :: Query -> Query qNot (Query ms) = Filter (ExprNot (toExpr ms))
69
qNot (Query ms) = Filter (ExprNot (toExpr ms))
46
true
true
0
9
26
50
25
25
null
null
Cahu/krpc-hs
src/KRPCHS/InfernalRobotics.hs
gpl-3.0
getServoGroupExpandedStreamReq :: KRPCHS.InfernalRobotics.ServoGroup -> KRPCStreamReq (Bool) getServoGroupExpandedStreamReq thisArg = let req = makeRequest "InfernalRobotics" "ServoGroup_get_Expanded" [makeArgument 0 thisArg] in makeStream req
252
getServoGroupExpandedStreamReq :: KRPCHS.InfernalRobotics.ServoGroup -> KRPCStreamReq (Bool) getServoGroupExpandedStreamReq thisArg = let req = makeRequest "InfernalRobotics" "ServoGroup_get_Expanded" [makeArgument 0 thisArg] in makeStream req
252
getServoGroupExpandedStreamReq thisArg = let req = makeRequest "InfernalRobotics" "ServoGroup_get_Expanded" [makeArgument 0 thisArg] in makeStream req
159
false
true
0
11
29
56
27
29
null
null
sopvop/cabal
Cabal/Distribution/Simple/Program/GHC.hs
bsd-3-clause
ghcInvocation :: ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> ProgramInvocation ghcInvocation prog comp platform opts = (programInvocation prog (renderGhcOptions comp platform opts)) { progInvokePathEnv = fromNubListR (ghcOptExtraPath opts) }
286
ghcInvocation :: ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> ProgramInvocation ghcInvocation prog comp platform opts = (programInvocation prog (renderGhcOptions comp platform opts)) { progInvokePathEnv = fromNubListR (ghcOptExtraPath opts) }
286
ghcInvocation prog comp platform opts = (programInvocation prog (renderGhcOptions comp platform opts)) { progInvokePathEnv = fromNubListR (ghcOptExtraPath opts) }
178
false
true
0
9
59
71
36
35
null
null
NicolasDP/maild
Network/SMTP/Parser.hs
bsd-3-clause
intToResponseCode i = Left i
30
intToResponseCode i = Left i
30
intToResponseCode i = Left i
30
false
false
1
5
6
16
5
11
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/Check.hs
bsd-3-clause
first_column_only_vars :: [(EqnNo, EquationInfo)] -> ([ExhaustivePat],EqnSet) first_column_only_vars qs = (map (\ (xs,ys) -> (nlWildPatName:xs,ys)) pats,indexs) where (pats, indexs) = check' (map remove_var qs) {- This equation takes a matrix of patterns and split the equations by constructor, using all the constructors that appears in the first column of the pattern matching. We can need a default clause or not ...., it depends if we used all the constructors or not explicitly. The reasoning is similar to @process_literals@, the difference is that here the default case is not always needed. -}
611
first_column_only_vars :: [(EqnNo, EquationInfo)] -> ([ExhaustivePat],EqnSet) first_column_only_vars qs = (map (\ (xs,ys) -> (nlWildPatName:xs,ys)) pats,indexs) where (pats, indexs) = check' (map remove_var qs) {- This equation takes a matrix of patterns and split the equations by constructor, using all the constructors that appears in the first column of the pattern matching. We can need a default clause or not ...., it depends if we used all the constructors or not explicitly. The reasoning is similar to @process_literals@, the difference is that here the default case is not always needed. -}
611
first_column_only_vars qs = (map (\ (xs,ys) -> (nlWildPatName:xs,ys)) pats,indexs) where (pats, indexs) = check' (map remove_var qs) {- This equation takes a matrix of patterns and split the equations by constructor, using all the constructors that appears in the first column of the pattern matching. We can need a default clause or not ...., it depends if we used all the constructors or not explicitly. The reasoning is similar to @process_literals@, the difference is that here the default case is not always needed. -}
533
false
true
0
10
99
104
57
47
null
null
aspidites/vice-by-example
haskell/Experimental/Database.hs
agpl-3.0
findBySet :: String -> Database -> Database findBySet set = filter (\card -> cSet card == set)
94
findBySet :: String -> Database -> Database findBySet set = filter (\card -> cSet card == set)
94
findBySet set = filter (\card -> cSet card == set)
50
false
true
0
9
16
40
20
20
null
null