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
zaquest/redflare
src/Network/RedEclipse/RedFlare.hs
mit
port :: Address -> Maybe PortNumber port (IP _ p) = Just p
60
port :: Address -> Maybe PortNumber port (IP _ p) = Just p
60
port (IP _ p) = Just p
24
false
true
0
7
14
32
15
17
null
null
MichaelBaker/opengl-haskell
src/Utilities.hs
mit
flattenVerticies = concat . map detuple
39
flattenVerticies = concat . map detuple
39
flattenVerticies = concat . map detuple
39
false
false
2
5
5
17
6
11
null
null
thegreatpissant/haskell
LearnYouaHaskell/baby.hs
bsd-2-clause
doubleUs x y = x * 2 + y * 2
28
doubleUs x y = x * 2 + y * 2
28
doubleUs x y = x * 2 + y * 2
28
false
false
0
7
10
23
11
12
null
null
JacquesCarette/literate-scientific-software
code/drasil-lang/Language/Drasil/ShortHands.hs
bsd-2-clause
lU = Variable "u"
17
lU = Variable "u"
17
lU = Variable "u"
17
false
false
1
5
3
13
4
9
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
orbitUTAtTrueAnomalyStream :: KRPCHS.SpaceCenter.Orbit -> Double -> RPCContext (KRPCStream (Double)) orbitUTAtTrueAnomalyStream thisArg trueAnomalyArg = requestStream $ orbitUTAtTrueAnomalyStreamReq thisArg trueAnomalyArg
221
orbitUTAtTrueAnomalyStream :: KRPCHS.SpaceCenter.Orbit -> Double -> RPCContext (KRPCStream (Double)) orbitUTAtTrueAnomalyStream thisArg trueAnomalyArg = requestStream $ orbitUTAtTrueAnomalyStreamReq thisArg trueAnomalyArg
221
orbitUTAtTrueAnomalyStream thisArg trueAnomalyArg = requestStream $ orbitUTAtTrueAnomalyStreamReq thisArg trueAnomalyArg
120
false
true
0
10
17
52
25
27
null
null
oldmanmike/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
pprUserTypeCtxt InstDeclCtxt = text "an instance declaration"
66
pprUserTypeCtxt InstDeclCtxt = text "an instance declaration"
66
pprUserTypeCtxt InstDeclCtxt = text "an instance declaration"
66
false
false
0
5
11
12
5
7
null
null
ben-schulz/Idris-dev
src/IRTS/CodegenJavaScript.hs
bsd-3-clause
translateConstant (B64 b) = JSWord (JSWord64 b)
64
translateConstant (B64 b) = JSWord (JSWord64 b)
64
translateConstant (B64 b) = JSWord (JSWord64 b)
64
false
false
0
7
23
24
11
13
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'V.unsafeUpdate' v_unsafeUpdate = V.unsafeUpdate
52
v_unsafeUpdate = V.unsafeUpdate
31
v_unsafeUpdate = V.unsafeUpdate
31
true
false
0
5
4
9
5
4
null
null
christiaanb/clash-compiler
clash-lib/src/CLaSH/Netlist/BlackBox/Util.hs
bsd-2-clause
-- | Render a single template element renderElem :: Backend backend => BlackBoxContext -> Element -> State backend Text renderElem b (D (Decl n (l:ls))) = do (o,oTy,_) <- syncIdToSyncExpr <$> combineM (lineToIdentifier b) (return . lineToType b) l is <- mapM (fmap syncIdToSyncExpr . combineM (lineToIdentifier b) (return . lineToType b)) ls let Just (templ,pCtx) = IntMap.lookup n (bbFunctions b) b' = pCtx { bbResult = (o,oTy), bbInputs = bbInputs pCtx ++ is } templ' <- case templ of Left t -> return t Right d -> do Just inst' <- inst d return . parseFail . displayT $ renderCompact inst' if verifyBlackBoxContext b' templ' then Text.concat <$> mapM (renderElem b') templ' else error $ $(curLoc) ++ "\nCan't match context:\n" ++ show b' ++ "\nwith template:\n" ++ show templ
917
renderElem :: Backend backend => BlackBoxContext -> Element -> State backend Text renderElem b (D (Decl n (l:ls))) = do (o,oTy,_) <- syncIdToSyncExpr <$> combineM (lineToIdentifier b) (return . lineToType b) l is <- mapM (fmap syncIdToSyncExpr . combineM (lineToIdentifier b) (return . lineToType b)) ls let Just (templ,pCtx) = IntMap.lookup n (bbFunctions b) b' = pCtx { bbResult = (o,oTy), bbInputs = bbInputs pCtx ++ is } templ' <- case templ of Left t -> return t Right d -> do Just inst' <- inst d return . parseFail . displayT $ renderCompact inst' if verifyBlackBoxContext b' templ' then Text.concat <$> mapM (renderElem b') templ' else error $ $(curLoc) ++ "\nCan't match context:\n" ++ show b' ++ "\nwith template:\n" ++ show templ
879
renderElem b (D (Decl n (l:ls))) = do (o,oTy,_) <- syncIdToSyncExpr <$> combineM (lineToIdentifier b) (return . lineToType b) l is <- mapM (fmap syncIdToSyncExpr . combineM (lineToIdentifier b) (return . lineToType b)) ls let Just (templ,pCtx) = IntMap.lookup n (bbFunctions b) b' = pCtx { bbResult = (o,oTy), bbInputs = bbInputs pCtx ++ is } templ' <- case templ of Left t -> return t Right d -> do Just inst' <- inst d return . parseFail . displayT $ renderCompact inst' if verifyBlackBoxContext b' templ' then Text.concat <$> mapM (renderElem b') templ' else error $ $(curLoc) ++ "\nCan't match context:\n" ++ show b' ++ "\nwith template:\n" ++ show templ
764
true
true
0
16
268
339
163
176
null
null
alphalambda/codeworld
codeworld-compiler/src/CodeWorld/Compile/Requirements/Matcher.hs
apache-2.0
matchesWildcard :: IdP GhcPs -> IdP GhcPs -> Maybe Bool matchesWildcard id _ | "_" `isPrefixOf` (idName id) && "_" `isSuffixOf` (idName id) = Just True
151
matchesWildcard :: IdP GhcPs -> IdP GhcPs -> Maybe Bool matchesWildcard id _ | "_" `isPrefixOf` (idName id) && "_" `isSuffixOf` (idName id) = Just True
151
matchesWildcard id _ | "_" `isPrefixOf` (idName id) && "_" `isSuffixOf` (idName id) = Just True
95
false
true
0
12
25
74
35
39
null
null
notabotanist/fuzzy-octo-adventure
NabRay.hs
bsd-3-clause
extraLight :: Light.LitScene extraLight = Light.insertLight red myScene where red = Light.Point (Vect.Vec3 (-5) 1 0) (Vect.Vec3 1.5 0 0) -- |Scales all light sources in a scene by a factor
191
extraLight :: Light.LitScene extraLight = Light.insertLight red myScene where red = Light.Point (Vect.Vec3 (-5) 1 0) (Vect.Vec3 1.5 0 0) -- |Scales all light sources in a scene by a factor
191
extraLight = Light.insertLight red myScene where red = Light.Point (Vect.Vec3 (-5) 1 0) (Vect.Vec3 1.5 0 0) -- |Scales all light sources in a scene by a factor
162
false
true
1
8
33
76
34
42
null
null
kim/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/DescribeTags.hs
mpl-2.0
-- | A tag value or values for which you want to return all matching resources -- that are associated with the specified value or values. For example, suppose -- that you have resources tagged with values called 'admin' and 'test'. If you -- specify both of these tag values in the request, Amazon Redshift returns a -- response with all resources that have either or both of these tag values -- associated with them. dtTagValues :: Lens' DescribeTags [Text] dtTagValues = lens _dtTagValues (\s a -> s { _dtTagValues = a }) . _List
531
dtTagValues :: Lens' DescribeTags [Text] dtTagValues = lens _dtTagValues (\s a -> s { _dtTagValues = a }) . _List
113
dtTagValues = lens _dtTagValues (\s a -> s { _dtTagValues = a }) . _List
72
true
true
1
10
94
58
31
27
null
null
jnb/zookeeper
testsuite/tests/Zookeeper/Queue.hs
bsd-2-clause
sleepUs = 1000
14
sleepUs = 1000
14
sleepUs = 1000
14
false
false
0
4
2
6
3
3
null
null
emwap/feldspar-compiler
lib/Feldspar/Compiler/Imperative/FromCore.hs
bsd-3-clause
compileFunction :: CompileEnv -> Expression () -> (String, Fork, Ut.UntypedFeld) -> CodeWriter () compileFunction env loc (coreName, kind, e) | (bs, e') <- collectBinders e = do es' <- mapM (compileExpr env) (map (In . Ut.Variable) bs) let args = nub $ map exprToVar es' ++ fv loc -- Task core: ((_, ws), Block ds bl) <- confiscateBigBlock $ case kind of Future -> do p' <- compileExprVar env {inTask = True } e' tellProg [iVarPut loc p'] Par -> compileProg env {inTask = True} (Just loc) e' Loop | (_:_) <- es' , Ut.ElementsType{} <- typeof e' -> compileProg env (Just loc) e' | (ix:_) <- es' -> compileProg env (Just $ ArrayElem loc ix) e' None -> compileProg env (Just loc) e' tellDef [Proc coreName (kind == Loop) args (Left []) $ Just $ Block (decl ws ++ ds) bl] -- Task: let taskName = "task" ++ drop 9 coreName runTask = Just $ toBlock $ run coreName args outs = [mkNamedRef "params" Rep.VoidType (-1)] case kind of _ | kind `elem` [None, Loop] -> return () _ -> tellDef [Proc taskName False [] (Left outs) runTask] -- | Create a variable of the right type for storing a length.
1,211
compileFunction :: CompileEnv -> Expression () -> (String, Fork, Ut.UntypedFeld) -> CodeWriter () compileFunction env loc (coreName, kind, e) | (bs, e') <- collectBinders e = do es' <- mapM (compileExpr env) (map (In . Ut.Variable) bs) let args = nub $ map exprToVar es' ++ fv loc -- Task core: ((_, ws), Block ds bl) <- confiscateBigBlock $ case kind of Future -> do p' <- compileExprVar env {inTask = True } e' tellProg [iVarPut loc p'] Par -> compileProg env {inTask = True} (Just loc) e' Loop | (_:_) <- es' , Ut.ElementsType{} <- typeof e' -> compileProg env (Just loc) e' | (ix:_) <- es' -> compileProg env (Just $ ArrayElem loc ix) e' None -> compileProg env (Just loc) e' tellDef [Proc coreName (kind == Loop) args (Left []) $ Just $ Block (decl ws ++ ds) bl] -- Task: let taskName = "task" ++ drop 9 coreName runTask = Just $ toBlock $ run coreName args outs = [mkNamedRef "params" Rep.VoidType (-1)] case kind of _ | kind `elem` [None, Loop] -> return () _ -> tellDef [Proc taskName False [] (Left outs) runTask] -- | Create a variable of the right type for storing a length.
1,211
compileFunction env loc (coreName, kind, e) | (bs, e') <- collectBinders e = do es' <- mapM (compileExpr env) (map (In . Ut.Variable) bs) let args = nub $ map exprToVar es' ++ fv loc -- Task core: ((_, ws), Block ds bl) <- confiscateBigBlock $ case kind of Future -> do p' <- compileExprVar env {inTask = True } e' tellProg [iVarPut loc p'] Par -> compileProg env {inTask = True} (Just loc) e' Loop | (_:_) <- es' , Ut.ElementsType{} <- typeof e' -> compileProg env (Just loc) e' | (ix:_) <- es' -> compileProg env (Just $ ArrayElem loc ix) e' None -> compileProg env (Just loc) e' tellDef [Proc coreName (kind == Loop) args (Left []) $ Just $ Block (decl ws ++ ds) bl] -- Task: let taskName = "task" ++ drop 9 coreName runTask = Just $ toBlock $ run coreName args outs = [mkNamedRef "params" Rep.VoidType (-1)] case kind of _ | kind `elem` [None, Loop] -> return () _ -> tellDef [Proc taskName False [] (Left outs) runTask] -- | Create a variable of the right type for storing a length.
1,097
false
true
0
18
327
533
264
269
null
null
yangsiwei880813/CS644
src/Environment.hs
gpl-2.0
buildEnvironmentFromStatements parent ((If expr isb mesb):remain) = ENV su [e0, e1, buildEnvironmentFromStatements parent remain] where cname' = ((scope parent) ++ [[]]) su = (SU cname' (IfBlock expr) [] parent) bld = buildEnvironmentFromStatements su e0 = bld (statements isb) e1 = case mesb of Just tsb -> bld (statements tsb) _ -> ENVE
414
buildEnvironmentFromStatements parent ((If expr isb mesb):remain) = ENV su [e0, e1, buildEnvironmentFromStatements parent remain] where cname' = ((scope parent) ++ [[]]) su = (SU cname' (IfBlock expr) [] parent) bld = buildEnvironmentFromStatements su e0 = bld (statements isb) e1 = case mesb of Just tsb -> bld (statements tsb) _ -> ENVE
414
buildEnvironmentFromStatements parent ((If expr isb mesb):remain) = ENV su [e0, e1, buildEnvironmentFromStatements parent remain] where cname' = ((scope parent) ++ [[]]) su = (SU cname' (IfBlock expr) [] parent) bld = buildEnvironmentFromStatements su e0 = bld (statements isb) e1 = case mesb of Just tsb -> bld (statements tsb) _ -> ENVE
414
false
false
4
11
127
157
78
79
null
null
karamellpelle/grid
source/OpenAL/Values.hs
gpl-3.0
al_FALSE :: ALboolean al_FALSE = 0
65
al_FALSE :: ALboolean al_FALSE = 0
65
al_FALSE = 0
43
false
true
0
4
36
11
6
5
null
null
creichert/persistent
persistent-template/Database/Persist/TH.hs
mit
lowerFirst :: Text -> Text lowerFirst t = case uncons t of Just (a, b) -> cons (toLower a) b Nothing -> t
125
lowerFirst :: Text -> Text lowerFirst t = case uncons t of Just (a, b) -> cons (toLower a) b Nothing -> t
125
lowerFirst t = case uncons t of Just (a, b) -> cons (toLower a) b Nothing -> t
98
false
true
0
10
42
57
28
29
null
null
databrary/databrary
src/Model/VolumeAccess.hs
agpl-3.0
volumeAccessPartyJSON :: JSON.ToNestedObject o u => VolumeAccess -> o volumeAccessPartyJSON va@VolumeAccess{..} = volumeAccessJSON va <> "party" JSON..=: partyJSON volumeAccessParty
183
volumeAccessPartyJSON :: JSON.ToNestedObject o u => VolumeAccess -> o volumeAccessPartyJSON va@VolumeAccess{..} = volumeAccessJSON va <> "party" JSON..=: partyJSON volumeAccessParty
183
volumeAccessPartyJSON va@VolumeAccess{..} = volumeAccessJSON va <> "party" JSON..=: partyJSON volumeAccessParty
113
false
true
2
8
20
55
26
29
null
null
Peaker/hssophia
Database/Sophia.hs
bsd-2-clause
withByteString :: ByteString -> ((S.Key, CSize) -> IO a) -> IO a withByteString bs f = unsafeUseAsCStringLen bs $ \(cKey, keyLen) -> f (castPtr cKey, fromIntegral keyLen)
174
withByteString :: ByteString -> ((S.Key, CSize) -> IO a) -> IO a withByteString bs f = unsafeUseAsCStringLen bs $ \(cKey, keyLen) -> f (castPtr cKey, fromIntegral keyLen)
174
withByteString bs f = unsafeUseAsCStringLen bs $ \(cKey, keyLen) -> f (castPtr cKey, fromIntegral keyLen)
109
false
true
2
11
30
84
41
43
null
null
mgrabmueller/waddle
Game/Waddle/ExportJS.hs
bsd-3-clause
exportThing :: Handle -> (String, Thing) -> IO () exportThing h (comma, Thing{..}) = do hPrintf h " %s{x:%d,y:%d,angle:%d,type:\"%s\",flags:%d}\n" comma thingX thingY thingAngle (show thingType) thingFlags
214
exportThing :: Handle -> (String, Thing) -> IO () exportThing h (comma, Thing{..}) = do hPrintf h " %s{x:%d,y:%d,angle:%d,type:\"%s\",flags:%d}\n" comma thingX thingY thingAngle (show thingType) thingFlags
214
exportThing h (comma, Thing{..}) = do hPrintf h " %s{x:%d,y:%d,angle:%d,type:\"%s\",flags:%d}\n" comma thingX thingY thingAngle (show thingType) thingFlags
164
false
true
0
9
34
73
37
36
null
null
yuvallanger/threepenny-gui
samples/CRUD.hs
bsd-3-clause
delete key (Database newkey db) = Database newkey $ Map.delete key db
75
delete key (Database newkey db) = Database newkey $ Map.delete key db
75
delete key (Database newkey db) = Database newkey $ Map.delete key db
75
false
false
0
7
17
35
15
20
null
null
alphalambda/codeworld
funblocks-client/src/Blocks/CodeGen.hs
apache-2.0
show :: Show a => a -> T.Text show = T.pack . P.show
52
show :: Show a => a -> T.Text show = T.pack . P.show
52
show = T.pack . P.show
22
false
true
0
7
12
32
16
16
null
null
vTurbine/ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
iRREFUT_PAT_ERROR_ID = mkRuntimeErrorId irrefutPatErrorName
70
iRREFUT_PAT_ERROR_ID = mkRuntimeErrorId irrefutPatErrorName
70
iRREFUT_PAT_ERROR_ID = mkRuntimeErrorId irrefutPatErrorName
70
false
false
0
5
14
9
4
5
null
null
smaccm/capDL-tool
CapDL/ParserUtils.hs
bsd-2-clause
maybe_slot :: MapParser (Maybe Word) maybe_slot = do n <- parse_slot colon return $ Just n <|> return Nothing
134
maybe_slot :: MapParser (Maybe Word) maybe_slot = do n <- parse_slot colon return $ Just n <|> return Nothing
134
maybe_slot = do n <- parse_slot colon return $ Just n <|> return Nothing
97
false
true
4
8
43
54
23
31
null
null
fmapfmapfmap/amazonka
amazonka-ec2/test/Test/AWS/Gen/EC2.hs
mpl-2.0
testDescribeAvailabilityZonesResponse :: DescribeAvailabilityZonesResponse -> TestTree testDescribeAvailabilityZonesResponse = res "DescribeAvailabilityZonesResponse" "fixture/DescribeAvailabilityZonesResponse.proto" eC2 (Proxy :: Proxy DescribeAvailabilityZones)
279
testDescribeAvailabilityZonesResponse :: DescribeAvailabilityZonesResponse -> TestTree testDescribeAvailabilityZonesResponse = res "DescribeAvailabilityZonesResponse" "fixture/DescribeAvailabilityZonesResponse.proto" eC2 (Proxy :: Proxy DescribeAvailabilityZones)
279
testDescribeAvailabilityZonesResponse = res "DescribeAvailabilityZonesResponse" "fixture/DescribeAvailabilityZonesResponse.proto" eC2 (Proxy :: Proxy DescribeAvailabilityZones)
192
false
true
0
7
30
33
17
16
null
null
pusher-community/pusher-http-haskell
src/Network/Pusher.hs
mit
triggerBatch :: MonadIO m => Pusher -> -- | The list of events to trigger. [Event] -> m (Either PusherError ()) triggerBatch pusher events = do (requestParams, requestBody) <- Pusher.mkTriggerBatchRequest pusher events <$> getSystemTimeSeconds liftIO $ HTTP.post (pConnectionManager pusher) requestParams requestBody -- | Query a list of channels for information.
382
triggerBatch :: MonadIO m => Pusher -> -- | The list of events to trigger. [Event] -> m (Either PusherError ()) triggerBatch pusher events = do (requestParams, requestBody) <- Pusher.mkTriggerBatchRequest pusher events <$> getSystemTimeSeconds liftIO $ HTTP.post (pConnectionManager pusher) requestParams requestBody -- | Query a list of channels for information.
382
triggerBatch pusher events = do (requestParams, requestBody) <- Pusher.mkTriggerBatchRequest pusher events <$> getSystemTimeSeconds liftIO $ HTTP.post (pConnectionManager pusher) requestParams requestBody -- | Query a list of channels for information.
260
false
true
0
11
68
95
47
48
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | ID of the placement strategy assigned to this placement. p1PlacementStrategyId :: Lens' Placement (Maybe Int64) p1PlacementStrategyId = lens _p1PlacementStrategyId (\ s a -> s{_p1PlacementStrategyId = a}) . mapping _Coerce
241
p1PlacementStrategyId :: Lens' Placement (Maybe Int64) p1PlacementStrategyId = lens _p1PlacementStrategyId (\ s a -> s{_p1PlacementStrategyId = a}) . mapping _Coerce
179
p1PlacementStrategyId = lens _p1PlacementStrategyId (\ s a -> s{_p1PlacementStrategyId = a}) . mapping _Coerce
124
true
true
0
10
44
53
28
25
null
null
kawu/crf-chain2-tiers
src/Data/CRF/Chain2/Tiers.hs
bsd-2-clause
train :: (Ord a, Ord b) => Int -- ^ Number of layers (tiers) -> FeatSel -- ^ Feature selection -> SGD.SgdArgs -- ^ SGD parameters -> Bool -- ^ Store dataset on a disk -> IO [SentL a b] -- ^ Training data 'IO' action -> IO [SentL a b] -- ^ Evaluation data -> IO (CRF a b) -- ^ Resulting model train numOfLayers featSel sgdArgs onDisk trainIO evalIO = do hSetBuffering stdout NoBuffering -- Create codec and encode the training dataset codec <- mkCodec numOfLayers <$> trainIO trainData_ <- encodeDataL codec <$> trainIO SGD.withData onDisk trainData_ $ \trainData -> do -- Encode the evaluation dataset evalData_ <- encodeDataL codec <$> evalIO SGD.withData onDisk evalData_ $ \evalData -> do -- Train the model model <- mkModel featSel <$> SGD.loadData trainData para <- SGD.sgd sgdArgs (notify sgdArgs model trainData evalData) (gradOn model) trainData (values model) return $ CRF numOfLayers codec model { values = para } -- | Re-train the CRF using the stochastic gradient descent method.
1,227
train :: (Ord a, Ord b) => Int -- ^ Number of layers (tiers) -> FeatSel -- ^ Feature selection -> SGD.SgdArgs -- ^ SGD parameters -> Bool -- ^ Store dataset on a disk -> IO [SentL a b] -- ^ Training data 'IO' action -> IO [SentL a b] -- ^ Evaluation data -> IO (CRF a b) train numOfLayers featSel sgdArgs onDisk trainIO evalIO = do hSetBuffering stdout NoBuffering -- Create codec and encode the training dataset codec <- mkCodec numOfLayers <$> trainIO trainData_ <- encodeDataL codec <$> trainIO SGD.withData onDisk trainData_ $ \trainData -> do -- Encode the evaluation dataset evalData_ <- encodeDataL codec <$> evalIO SGD.withData onDisk evalData_ $ \evalData -> do -- Train the model model <- mkModel featSel <$> SGD.loadData trainData para <- SGD.sgd sgdArgs (notify sgdArgs model trainData evalData) (gradOn model) trainData (values model) return $ CRF numOfLayers codec model { values = para } -- | Re-train the CRF using the stochastic gradient descent method.
1,190
train numOfLayers featSel sgdArgs onDisk trainIO evalIO = do hSetBuffering stdout NoBuffering -- Create codec and encode the training dataset codec <- mkCodec numOfLayers <$> trainIO trainData_ <- encodeDataL codec <$> trainIO SGD.withData onDisk trainData_ $ \trainData -> do -- Encode the evaluation dataset evalData_ <- encodeDataL codec <$> evalIO SGD.withData onDisk evalData_ $ \evalData -> do -- Train the model model <- mkModel featSel <$> SGD.loadData trainData para <- SGD.sgd sgdArgs (notify sgdArgs model trainData evalData) (gradOn model) trainData (values model) return $ CRF numOfLayers codec model { values = para } -- | Re-train the CRF using the stochastic gradient descent method.
772
true
true
0
19
403
287
139
148
null
null
mightymoose/liquidhaskell
benchmarks/bytestring-0.9.2.1/Data/ByteString/Internal.hs
bsd-3-clause
toForeignPtr :: ByteString -> (ForeignPtr Word8, Int, Int) -- ^ (ptr, offset, length) toForeignPtr (PS ps s l) = (ps, s, l)
123
toForeignPtr :: ByteString -> (ForeignPtr Word8, Int, Int) toForeignPtr (PS ps s l) = (ps, s, l)
96
toForeignPtr (PS ps s l) = (ps, s, l)
37
true
true
0
7
21
50
28
22
null
null
input-output-hk/pos-haskell-prototype
wallet/test/unit/Util/Buildable/Hspec.hs
mit
shouldNotBe :: (HasCallStack, Buildable a, Eq a) => a -> a -> H.Expectation shouldNotBe a a' = H.shouldNotBe (STB a) (STB a')
137
shouldNotBe :: (HasCallStack, Buildable a, Eq a) => a -> a -> H.Expectation shouldNotBe a a' = H.shouldNotBe (STB a) (STB a')
137
shouldNotBe a a' = H.shouldNotBe (STB a) (STB a')
49
false
true
0
8
33
64
32
32
null
null
meteogrid/sigym-core
src/SIGyM/Store/Registry.hs
bsd-3-clause
lookupContext :: ContextID -> Registry -> Maybe Context lookupContext k Registry{..} = M.lookup k contexts
106
lookupContext :: ContextID -> Registry -> Maybe Context lookupContext k Registry{..} = M.lookup k contexts
106
lookupContext k Registry{..} = M.lookup k contexts
50
false
true
0
7
14
40
19
21
null
null
sgf-dma/hs-sgf-lib
src/Sgf/OrderedLine.hs
bsd-3-clause
-- Some more "specific" instances. mapOrdered :: (a -> a) -> Line a -> Line a mapOrdered f = mappend <$> fmap f . onlyOrdered <*> onlyOthers
147
mapOrdered :: (a -> a) -> Line a -> Line a mapOrdered f = mappend <$> fmap f . onlyOrdered <*> onlyOthers
112
mapOrdered f = mappend <$> fmap f . onlyOrdered <*> onlyOthers
69
true
true
0
8
33
56
26
30
null
null
mcschroeder/ghc
compiler/types/OptCoercion.hs
bsd-3-clause
opt_co4 env sym rep r (AxiomInstCo con ind cos) -- Do *not* push sym inside top-level axioms -- e.g. if g is a top-level axiom -- g a : f a ~ a -- then (sym (g ty)) /= g (sym ty) !! = ASSERT( r == coAxiomRole con ) wrapRole rep (coAxiomRole con) $ wrapSym sym $ -- some sub-cos might be P: use opt_co2 -- See Note [Optimising coercion optimisation] AxiomInstCo con ind (zipWith (opt_co2 env False) (coAxBranchRoles (coAxiomNthBranch con ind)) cos)
591
opt_co4 env sym rep r (AxiomInstCo con ind cos) -- Do *not* push sym inside top-level axioms -- e.g. if g is a top-level axiom -- g a : f a ~ a -- then (sym (g ty)) /= g (sym ty) !! = ASSERT( r == coAxiomRole con ) wrapRole rep (coAxiomRole con) $ wrapSym sym $ -- some sub-cos might be P: use opt_co2 -- See Note [Optimising coercion optimisation] AxiomInstCo con ind (zipWith (opt_co2 env False) (coAxBranchRoles (coAxiomNthBranch con ind)) cos)
591
opt_co4 env sym rep r (AxiomInstCo con ind cos) -- Do *not* push sym inside top-level axioms -- e.g. if g is a top-level axiom -- g a : f a ~ a -- then (sym (g ty)) /= g (sym ty) !! = ASSERT( r == coAxiomRole con ) wrapRole rep (coAxiomRole con) $ wrapSym sym $ -- some sub-cos might be P: use opt_co2 -- See Note [Optimising coercion optimisation] AxiomInstCo con ind (zipWith (opt_co2 env False) (coAxBranchRoles (coAxiomNthBranch con ind)) cos)
591
false
false
0
12
227
108
55
53
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Ocaml.hs
gpl-2.0
regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a = compileRegex True "[A-Z][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*"
179
regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a = compileRegex True "[A-Z][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*"
179
regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a = compileRegex True "[A-Z][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*"
179
false
false
0
5
4
11
5
6
null
null
esengie/fpl-exploration-tool
src/specLang/AST/Judgement.hs
bsd-3-clause
isRedJudgement _ = False
24
isRedJudgement _ = False
24
isRedJudgement _ = False
24
false
false
0
5
3
9
4
5
null
null
chrra/iCalendar
Text/ICalendar/Parser/Components.hs
bsd-3-clause
-- | Parse a VTIMEZONE component. 3.6.5 parseVTimeZone :: Content -> ContentParser VTimeZone parseVTimeZone (Component _ "VTIMEZONE" _) = do vtzId <- reqLine1 "TZID" parseTZID vtzLastMod <- optLine1 "LAST-MODIFIED" (Just .: parseLastModified) vtzUrl <- optLine1 "TZURL" (Just .: parseSimpleURI TZUrl) vtzStandardC <- optCompN "STANDARD" parseTZProp vtzDaylightC <- optCompN "DAYLIGHT" parseTZProp when (S.size vtzStandardC + S.size vtzDaylightC < 1) . throwError $ "VTIMEZONE must include at least one of the STANDARD or \ \DAYLIGHT components." vtzOther <- otherProperties return VTimeZone {..}
656
parseVTimeZone :: Content -> ContentParser VTimeZone parseVTimeZone (Component _ "VTIMEZONE" _) = do vtzId <- reqLine1 "TZID" parseTZID vtzLastMod <- optLine1 "LAST-MODIFIED" (Just .: parseLastModified) vtzUrl <- optLine1 "TZURL" (Just .: parseSimpleURI TZUrl) vtzStandardC <- optCompN "STANDARD" parseTZProp vtzDaylightC <- optCompN "DAYLIGHT" parseTZProp when (S.size vtzStandardC + S.size vtzDaylightC < 1) . throwError $ "VTIMEZONE must include at least one of the STANDARD or \ \DAYLIGHT components." vtzOther <- otherProperties return VTimeZone {..}
616
parseVTimeZone (Component _ "VTIMEZONE" _) = do vtzId <- reqLine1 "TZID" parseTZID vtzLastMod <- optLine1 "LAST-MODIFIED" (Just .: parseLastModified) vtzUrl <- optLine1 "TZURL" (Just .: parseSimpleURI TZUrl) vtzStandardC <- optCompN "STANDARD" parseTZProp vtzDaylightC <- optCompN "DAYLIGHT" parseTZProp when (S.size vtzStandardC + S.size vtzDaylightC < 1) . throwError $ "VTIMEZONE must include at least one of the STANDARD or \ \DAYLIGHT components." vtzOther <- otherProperties return VTimeZone {..}
563
true
true
0
14
140
162
74
88
null
null
wavewave/detector-yaml
lib/CMS.hs
gpl-3.0
cms2011 :: DetectorDescription ImportList cms2011 = DetectorDescription { detectorName = "CMS2011" , detectorDescription = "CMS 2011 detector description" , detectorReference = "arXiv:xxxx.yyyy" , detectorComment = "extracted the efficiencies from the plot 3,4,5 in the reference" , detectorValidationInfo = "Validated on 2014/02" , detectorRange = RangeDescription (ImportList []) , detectorIdentification = cms2011Object , detectorSmearing = cmsSmearing }
569
cms2011 :: DetectorDescription ImportList cms2011 = DetectorDescription { detectorName = "CMS2011" , detectorDescription = "CMS 2011 detector description" , detectorReference = "arXiv:xxxx.yyyy" , detectorComment = "extracted the efficiencies from the plot 3,4,5 in the reference" , detectorValidationInfo = "Validated on 2014/02" , detectorRange = RangeDescription (ImportList []) , detectorIdentification = cms2011Object , detectorSmearing = cmsSmearing }
569
cms2011 = DetectorDescription { detectorName = "CMS2011" , detectorDescription = "CMS 2011 detector description" , detectorReference = "arXiv:xxxx.yyyy" , detectorComment = "extracted the efficiencies from the plot 3,4,5 in the reference" , detectorValidationInfo = "Validated on 2014/02" , detectorRange = RangeDescription (ImportList []) , detectorIdentification = cms2011Object , detectorSmearing = cmsSmearing }
527
false
true
0
11
167
84
47
37
null
null
bens/libmpd-haskell
src/Network/MPD/Applicative/PlaybackControl.hs
lgpl-2.1
-- | Play previous song. previous :: Command () previous = Command emptyResponse ["previous"]
93
previous :: Command () previous = Command emptyResponse ["previous"]
68
previous = Command emptyResponse ["previous"]
45
true
true
0
6
13
25
13
12
null
null
lfritz/python-type-inference
infer-python-types/src/InferPythonTypes.hs
bsd-3-clause
ratioUsefulToTotal :: Map TypeSize Int -> Double ratioUsefulToTotal m = let list = Map.toAscList m total = sum $ map snd list usefulTypeSize (TypeSize 0) = False usefulTypeSize TypeSizeTop = False usefulTypeSize _ = True good = sum [count | (sz, count) <- list, usefulTypeSize sz] in fromRational $ toRational $ good % total
384
ratioUsefulToTotal :: Map TypeSize Int -> Double ratioUsefulToTotal m = let list = Map.toAscList m total = sum $ map snd list usefulTypeSize (TypeSize 0) = False usefulTypeSize TypeSizeTop = False usefulTypeSize _ = True good = sum [count | (sz, count) <- list, usefulTypeSize sz] in fromRational $ toRational $ good % total
384
ratioUsefulToTotal m = let list = Map.toAscList m total = sum $ map snd list usefulTypeSize (TypeSize 0) = False usefulTypeSize TypeSizeTop = False usefulTypeSize _ = True good = sum [count | (sz, count) <- list, usefulTypeSize sz] in fromRational $ toRational $ good % total
335
false
true
0
13
113
127
63
64
null
null
nagyf/wyas
src/Types.hs
mit
showError (NumArgs expected found) = "Expected " ++ show expected ++ " args; found values " ++ unwordsList found
156
showError (NumArgs expected found) = "Expected " ++ show expected ++ " args; found values " ++ unwordsList found
156
showError (NumArgs expected found) = "Expected " ++ show expected ++ " args; found values " ++ unwordsList found
156
false
false
0
8
62
35
16
19
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGMatrix.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix.flipX Mozilla SVGMatrix.flipX documentation> flipX_ :: (MonadDOM m) => SVGMatrix -> m () flipX_ self = liftDOM (void (self ^. jsf "flipX" ()))
208
flipX_ :: (MonadDOM m) => SVGMatrix -> m () flipX_ self = liftDOM (void (self ^. jsf "flipX" ()))
97
flipX_ self = liftDOM (void (self ^. jsf "flipX" ()))
53
true
true
0
11
25
61
29
32
null
null
mstksg/netwire-experiments
src/Utils/Helpers.hs
gpl-3.0
zipTake xs [] = ([],(xs,[]))
28
zipTake xs [] = ([],(xs,[]))
28
zipTake xs [] = ([],(xs,[]))
28
false
false
1
7
4
33
16
17
null
null
aburnett88/HSat
src/HSat/Make/Instances/CNF.hs
mit
makeCNF :: (MonadRandom m, MonadThrow m) => CNFConfig -> m (CNF, Maybe BoolSolution) makeCNF = undefined
104
makeCNF :: (MonadRandom m, MonadThrow m) => CNFConfig -> m (CNF, Maybe BoolSolution) makeCNF = undefined
104
makeCNF = undefined
19
false
true
0
10
15
48
23
25
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Protocol.hs
bsd-3-clause
parseQueryResult (IfThenElseI16W8 _ _ _) (IfThenElseW8Reply r) = Just $ ExprRight $ lit r
89
parseQueryResult (IfThenElseI16W8 _ _ _) (IfThenElseW8Reply r) = Just $ ExprRight $ lit r
89
parseQueryResult (IfThenElseI16W8 _ _ _) (IfThenElseW8Reply r) = Just $ ExprRight $ lit r
89
false
false
0
7
13
38
18
20
null
null
peterokagey/haskellOEIS
test/Graham/A248663Spec.hs
apache-2.0
spec :: Spec spec = describe "A248663" $ it "correctly computes the first 20 elements" $ take 20 (map a248663 [1..]) `shouldBe` expectedValue where expectedValue = [0,1,2,0,4,3,8,1,0,5,16,2,32,9,6,0,64,1,128,4]
222
spec :: Spec spec = describe "A248663" $ it "correctly computes the first 20 elements" $ take 20 (map a248663 [1..]) `shouldBe` expectedValue where expectedValue = [0,1,2,0,4,3,8,1,0,5,16,2,32,9,6,0,64,1,128,4]
222
spec = describe "A248663" $ it "correctly computes the first 20 elements" $ take 20 (map a248663 [1..]) `shouldBe` expectedValue where expectedValue = [0,1,2,0,4,3,8,1,0,5,16,2,32,9,6,0,64,1,128,4]
209
false
true
0
10
38
114
68
46
null
null
bitemyapp/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT {} }) = pprConDecl (decl { con_details = PrefixCon [ty1,ty2] })
144
pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT {} }) = pprConDecl (decl { con_details = PrefixCon [ty1,ty2] })
144
pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT {} }) = pprConDecl (decl { con_details = PrefixCon [ty1,ty2] })
144
false
false
0
11
23
62
34
28
null
null
facebook/Haxl
Haxl/Core/Exception.hs
bsd-3-clause
logicErrorFromException :: (Exception e) => SomeException -> Maybe e logicErrorFromException x = do LogicError a <- fromException x cast a
144
logicErrorFromException :: (Exception e) => SomeException -> Maybe e logicErrorFromException x = do LogicError a <- fromException x cast a
144
logicErrorFromException x = do LogicError a <- fromException x cast a
73
false
true
0
9
25
54
23
31
null
null
eriksvedang/Carp
src/Qualify.hs
mpl-2.0
setFullyQualifiedDefn xobj _ = error ("Can't set new path on " ++ show xobj)
76
setFullyQualifiedDefn xobj _ = error ("Can't set new path on " ++ show xobj)
76
setFullyQualifiedDefn xobj _ = error ("Can't set new path on " ++ show xobj)
76
false
false
0
8
13
24
11
13
null
null
noteed/python-pickle
Language/Python/Pickle.hs
bsd-3-clause
append = string "a" *> return APPEND
36
append = string "a" *> return APPEND
36
append = string "a" *> return APPEND
36
false
false
0
6
6
16
7
9
null
null
dylanmc/cryptol
src/Cryptol/ModuleSystem/Monad.hs
bsd-3-clause
getQualifiedEnv :: ModuleM IfaceDecls getQualifiedEnv = ModuleT (qualifiedEnv `fmap` get)
90
getQualifiedEnv :: ModuleM IfaceDecls getQualifiedEnv = ModuleT (qualifiedEnv `fmap` get)
90
getQualifiedEnv = ModuleT (qualifiedEnv `fmap` get)
52
false
true
0
7
10
26
14
12
null
null
schell/odin
odin-engine/src/Odin/Engine/GUI/Styles.hs
mit
lnColorForTextInputState :: TextInputState -> V4 Float lnColorForTextInputState TextInputStateUp = white `withAlpha` 0.4
120
lnColorForTextInputState :: TextInputState -> V4 Float lnColorForTextInputState TextInputStateUp = white `withAlpha` 0.4
120
lnColorForTextInputState TextInputStateUp = white `withAlpha` 0.4
65
false
true
0
6
11
27
14
13
null
null
LukeHoersten/io-streams
test/System/IO/Streams/Tests/Common.hs
bsd-3-clause
liftQ :: forall a m . (Monad m) => m a -> PropertyM m a liftQ = QC.run
70
liftQ :: forall a m . (Monad m) => m a -> PropertyM m a liftQ = QC.run
70
liftQ = QC.run
14
false
true
0
9
17
46
22
24
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
fL_ALIGN_RIGHT_PANE :: Int fL_ALIGN_RIGHT_PANE = 8
50
fL_ALIGN_RIGHT_PANE :: Int fL_ALIGN_RIGHT_PANE = 8
50
fL_ALIGN_RIGHT_PANE = 8
23
false
true
0
4
5
11
6
5
null
null
dmjio/aeson
benchmarks/bench/UnescapePureText2.hs
bsd-3-clause
decode Utf843f4 point word = case word of w | 0x80 <= w && w <= 0x8f -> (UtfTail2, setByte3 point word) _ -> throwDecodeError
158
decode Utf843f4 point word = case word of w | 0x80 <= w && w <= 0x8f -> (UtfTail2, setByte3 point word) _ -> throwDecodeError
158
decode Utf843f4 point word = case word of w | 0x80 <= w && w <= 0x8f -> (UtfTail2, setByte3 point word) _ -> throwDecodeError
158
false
false
0
13
57
58
28
30
null
null
diagrams/diagrams-contrib
src/Diagrams/TwoD/Path/Turtle/Internal.hs
bsd-3-clause
penUp :: (Ord n, Floating n) => TurtleState n -- ^ Turtle to modify -> TurtleState n -- ^ Resulting turtle penUp t | isPenDown t = t # makeNewTrail # \t' -> t' { isPenDown = False } | otherwise = t
210
penUp :: (Ord n, Floating n) => TurtleState n -- ^ Turtle to modify -> TurtleState n penUp t | isPenDown t = t # makeNewTrail # \t' -> t' { isPenDown = False } | otherwise = t
187
penUp t | isPenDown t = t # makeNewTrail # \t' -> t' { isPenDown = False } | otherwise = t
95
true
true
1
9
55
79
40
39
null
null
sdiehl/ghc
compiler/nativeGen/SPARC/Ppr.hs
bsd-3-clause
pprInstr (ORN b reg1 ri reg2) = pprRegRIReg (sLit "orn") b reg1 ri reg2
72
pprInstr (ORN b reg1 ri reg2) = pprRegRIReg (sLit "orn") b reg1 ri reg2
72
pprInstr (ORN b reg1 ri reg2) = pprRegRIReg (sLit "orn") b reg1 ri reg2
72
false
false
0
7
14
39
18
21
null
null
kojiromike/Idris-dev
src/Idris/Core/Elaborate.hs
bsd-3-clause
defer :: [Name] -> [Name] -> Name -> Elab' aux Name defer ds ls n = do n' <- unique_hole n processTactic' (Defer ds ls n') return n'
154
defer :: [Name] -> [Name] -> Name -> Elab' aux Name defer ds ls n = do n' <- unique_hole n processTactic' (Defer ds ls n') return n'
154
defer ds ls n = do n' <- unique_hole n processTactic' (Defer ds ls n') return n'
102
false
true
0
10
49
78
35
43
null
null
gamelost/pcgen-rules
src/Bonus.hs
apache-2.0
parseBonusDR :: PParser BonusDR parseBonusDR = do _ <- bonusTag "DR" damageReductionType <- parseTill '|' -- TODO need to implement DR tag damageReductionFormula <- parseFormula return BonusDR { .. } -- BONUS:EQM|x|y|z -- x is HANDS, WEIGHTADD, WEIGHTDIV, WEIGHTMULT -- y is formula -- z is type (optional)
321
parseBonusDR :: PParser BonusDR parseBonusDR = do _ <- bonusTag "DR" damageReductionType <- parseTill '|' -- TODO need to implement DR tag damageReductionFormula <- parseFormula return BonusDR { .. } -- BONUS:EQM|x|y|z -- x is HANDS, WEIGHTADD, WEIGHTDIV, WEIGHTMULT -- y is formula -- z is type (optional)
321
parseBonusDR = do _ <- bonusTag "DR" damageReductionType <- parseTill '|' -- TODO need to implement DR tag damageReductionFormula <- parseFormula return BonusDR { .. } -- BONUS:EQM|x|y|z -- x is HANDS, WEIGHTADD, WEIGHTDIV, WEIGHTMULT -- y is formula -- z is type (optional)
289
false
true
0
8
62
57
28
29
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Mediawiki.hs
gpl-2.0
regex_'5b'7e'5d'7b3'2c4'7d = compileRegex True "[~]{3,4}"
57
regex_'5b'7e'5d'7b3'2c4'7d = compileRegex True "[~]{3,4}"
57
regex_'5b'7e'5d'7b3'2c4'7d = compileRegex True "[~]{3,4}"
57
false
false
0
5
4
11
5
6
null
null
holzensp/ghc
testsuite/tests/indexed-types/should_fail/NoMatchErr.hs
bsd-3-clause
f :: (Fun d) => Memo d a -> Memo d a -- (1) f = abst . appl
63
f :: (Fun d) => Memo d a -> Memo d a f = abst . appl
53
f = abst . appl
15
true
true
0
8
22
45
21
24
null
null
vikraman/gentoo-haskell-status
src/Package.hs
mit
packageInEbuild :: Ebuild -> Either String Package packageInEbuild ebuild = do ver <- P.parseOnly parsePackageVersion (ebuildVersion ebuild) return $ Package (ebuildPackage ebuild) ver
212
packageInEbuild :: Ebuild -> Either String Package packageInEbuild ebuild = do ver <- P.parseOnly parsePackageVersion (ebuildVersion ebuild) return $ Package (ebuildPackage ebuild) ver
212
packageInEbuild ebuild = do ver <- P.parseOnly parsePackageVersion (ebuildVersion ebuild) return $ Package (ebuildPackage ebuild) ver
161
false
true
0
10
50
61
28
33
null
null
sukwon0709/z3-haskell
src/Z3/Monad.hs
bsd-3-clause
--------------------------------------------------------------------- -- Sequences and regular expressions mkSeqSort :: MonadZ3 z3 => Sort -> z3 Sort mkSeqSort = liftFun1 Base.mkSeqSort
186
mkSeqSort :: MonadZ3 z3 => Sort -> z3 Sort mkSeqSort = liftFun1 Base.mkSeqSort
78
mkSeqSort = liftFun1 Base.mkSeqSort
35
true
true
0
7
19
32
16
16
null
null
jmgimeno/haskell-playground
src/Zippers/Life.hs
unlicense
unfoldLst :: (s -> (s, a)) -> s -> [a] unfoldLst g z = let (z', a) = g z in a : unfoldLst g z'
98
unfoldLst :: (s -> (s, a)) -> s -> [a] unfoldLst g z = let (z', a) = g z in a : unfoldLst g z'
98
unfoldLst g z = let (z', a) = g z in a : unfoldLst g z'
59
false
true
0
9
29
70
36
34
null
null
ekmett/containers
Data/IntMap/Strict.hs
bsd-3-clause
fromSet f (IntSet.Tip kx bm) = buildTree f kx bm (IntSet.suffixBitMask + 1) where -- This is slightly complicated, as we to convert the dense -- representation of IntSet into tree representation of IntMap. -- -- We are given a nonzero bit mask 'bmask' of 'bits' bits with prefix 'prefix'. -- We split bmask into halves corresponding to left and right subtree. -- If they are both nonempty, we create a Bin node, otherwise exactly -- one of them is nonempty and we construct the IntMap from that half. buildTree g prefix bmask bits = prefix `seq` bmask `seq` case bits of 0 -> Tip prefix $! g prefix _ -> case intFromNat ((natFromInt bits) `shiftRL` 1) of bits2 | bmask .&. ((1 `shiftLL` bits2) - 1) == 0 -> buildTree g (prefix + bits2) (bmask `shiftRL` bits2) bits2 | (bmask `shiftRL` bits2) .&. ((1 `shiftLL` bits2) - 1) == 0 -> buildTree g prefix bmask bits2 | otherwise -> Bin prefix bits2 (buildTree g prefix bmask bits2) (buildTree g (prefix + bits2) (bmask `shiftRL` bits2) bits2) {-------------------------------------------------------------------- Lists --------------------------------------------------------------------} -- | /O(n*min(n,W))/. Create a map from a list of key\/value pairs. -- -- > fromList [] == empty -- > fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] -- > fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
1,602
fromSet f (IntSet.Tip kx bm) = buildTree f kx bm (IntSet.suffixBitMask + 1) where -- This is slightly complicated, as we to convert the dense -- representation of IntSet into tree representation of IntMap. -- -- We are given a nonzero bit mask 'bmask' of 'bits' bits with prefix 'prefix'. -- We split bmask into halves corresponding to left and right subtree. -- If they are both nonempty, we create a Bin node, otherwise exactly -- one of them is nonempty and we construct the IntMap from that half. buildTree g prefix bmask bits = prefix `seq` bmask `seq` case bits of 0 -> Tip prefix $! g prefix _ -> case intFromNat ((natFromInt bits) `shiftRL` 1) of bits2 | bmask .&. ((1 `shiftLL` bits2) - 1) == 0 -> buildTree g (prefix + bits2) (bmask `shiftRL` bits2) bits2 | (bmask `shiftRL` bits2) .&. ((1 `shiftLL` bits2) - 1) == 0 -> buildTree g prefix bmask bits2 | otherwise -> Bin prefix bits2 (buildTree g prefix bmask bits2) (buildTree g (prefix + bits2) (bmask `shiftRL` bits2) bits2) {-------------------------------------------------------------------- Lists --------------------------------------------------------------------} -- | /O(n*min(n,W))/. Create a map from a list of key\/value pairs. -- -- > fromList [] == empty -- > fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] -- > fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
1,602
fromSet f (IntSet.Tip kx bm) = buildTree f kx bm (IntSet.suffixBitMask + 1) where -- This is slightly complicated, as we to convert the dense -- representation of IntSet into tree representation of IntMap. -- -- We are given a nonzero bit mask 'bmask' of 'bits' bits with prefix 'prefix'. -- We split bmask into halves corresponding to left and right subtree. -- If they are both nonempty, we create a Bin node, otherwise exactly -- one of them is nonempty and we construct the IntMap from that half. buildTree g prefix bmask bits = prefix `seq` bmask `seq` case bits of 0 -> Tip prefix $! g prefix _ -> case intFromNat ((natFromInt bits) `shiftRL` 1) of bits2 | bmask .&. ((1 `shiftLL` bits2) - 1) == 0 -> buildTree g (prefix + bits2) (bmask `shiftRL` bits2) bits2 | (bmask `shiftRL` bits2) .&. ((1 `shiftLL` bits2) - 1) == 0 -> buildTree g prefix bmask bits2 | otherwise -> Bin prefix bits2 (buildTree g prefix bmask bits2) (buildTree g (prefix + bits2) (bmask `shiftRL` bits2) bits2) {-------------------------------------------------------------------- Lists --------------------------------------------------------------------} -- | /O(n*min(n,W))/. Create a map from a list of key\/value pairs. -- -- > fromList [] == empty -- > fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] -- > fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
1,602
false
false
0
20
445
298
163
135
null
null
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Intents/List.hs
mpl-2.0
-- | The language to list intents for. The following fields are language -- dependent: * \`Intent.training_phrases.parts.text\` If not specified, -- the agent\'s default language is used. [Many -- languages](https:\/\/cloud.google.com\/dialogflow\/cx\/docs\/reference\/language) -- are supported. Note: languages must be enabled in the agent before they -- can be used. plailLanguageCode :: Lens' ProjectsLocationsAgentsIntentsList (Maybe Text) plailLanguageCode = lens _plailLanguageCode (\ s a -> s{_plailLanguageCode = a})
533
plailLanguageCode :: Lens' ProjectsLocationsAgentsIntentsList (Maybe Text) plailLanguageCode = lens _plailLanguageCode (\ s a -> s{_plailLanguageCode = a})
163
plailLanguageCode = lens _plailLanguageCode (\ s a -> s{_plailLanguageCode = a})
88
true
true
0
9
71
53
30
23
null
null
sholland1/mandelbrot
app/Main.hs
bsd-3-clause
screenY = 1080
14
screenY = 1080
14
screenY = 1080
14
false
false
1
5
2
10
3
7
null
null
ezyang/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
cmmLoadIndexOffExpr :: DynFlags -> ByteOff -- Initial offset in bytes -> CmmType -- Type of element we are accessing -> CmmExpr -- Base address -> CmmType -- Type of element by which we are indexing -> CmmExpr -- Index -> CmmExpr cmmLoadIndexOffExpr dflags off ty base idx_ty idx = CmmLoad (cmmIndexOffExpr dflags off (typeWidth idx_ty) base idx) ty
477
cmmLoadIndexOffExpr :: DynFlags -> ByteOff -- Initial offset in bytes -> CmmType -- Type of element we are accessing -> CmmExpr -- Base address -> CmmType -- Type of element by which we are indexing -> CmmExpr -- Index -> CmmExpr cmmLoadIndexOffExpr dflags off ty base idx_ty idx = CmmLoad (cmmIndexOffExpr dflags off (typeWidth idx_ty) base idx) ty
477
cmmLoadIndexOffExpr dflags off ty base idx_ty idx = CmmLoad (cmmIndexOffExpr dflags off (typeWidth idx_ty) base idx) ty
122
false
true
0
12
185
84
42
42
null
null
anchor/gearman-haskell
src/System/Gearman/Worker.hs
mit
completeJob :: GearmanPacket -> FuncMap -> Gearman (Maybe String) completeJob pkt funcMap = case parseJob pkt funcMap of Left err -> return $ Just err Right jobSpec@JobSpec{..} -> do job@Job{..} <- createJob jobSpec let Capability{..} = fromJust $ M.lookup jobName funcMap liftIO $ case timeout of Nothing -> do result <- func job handleResult job result Just t -> do result <- System.timeout t (func job) maybe (return Nothing) (handleResult job) result where handleResult Job{..} (Left jobErr) = case jobErr of Nothing -> sendFailure Just jobException -> sendException jobException handleResult Job{..} (Right payload) = sendComplete payload -- |Builds a Job with the appropriate packet sending functions from a JobSpec
932
completeJob :: GearmanPacket -> FuncMap -> Gearman (Maybe String) completeJob pkt funcMap = case parseJob pkt funcMap of Left err -> return $ Just err Right jobSpec@JobSpec{..} -> do job@Job{..} <- createJob jobSpec let Capability{..} = fromJust $ M.lookup jobName funcMap liftIO $ case timeout of Nothing -> do result <- func job handleResult job result Just t -> do result <- System.timeout t (func job) maybe (return Nothing) (handleResult job) result where handleResult Job{..} (Left jobErr) = case jobErr of Nothing -> sendFailure Just jobException -> sendException jobException handleResult Job{..} (Right payload) = sendComplete payload -- |Builds a Job with the appropriate packet sending functions from a JobSpec
932
completeJob pkt funcMap = case parseJob pkt funcMap of Left err -> return $ Just err Right jobSpec@JobSpec{..} -> do job@Job{..} <- createJob jobSpec let Capability{..} = fromJust $ M.lookup jobName funcMap liftIO $ case timeout of Nothing -> do result <- func job handleResult job result Just t -> do result <- System.timeout t (func job) maybe (return Nothing) (handleResult job) result where handleResult Job{..} (Left jobErr) = case jobErr of Nothing -> sendFailure Just jobException -> sendException jobException handleResult Job{..} (Right payload) = sendComplete payload -- |Builds a Job with the appropriate packet sending functions from a JobSpec
866
false
true
0
19
319
295
133
162
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1E41' = "\x006D\x0307"
39
decomposeChar '\x1E41' = "\x006D\x0307"
39
decomposeChar '\x1E41' = "\x006D\x0307"
39
false
false
0
4
3
10
4
6
null
null
literate-unitb/literate-unitb
src/Code/Synthesis.hs
mit
safety_aux (Loop exit inv b _) ps = do local <- lift $ asks localEvts establish_pre "precondition" (znot exit : inv) b PG.with (PG.prefix "body") $ safety_aux b inv entails "postcondition" (exit : inv) ps let cert = certainly b unless (local == cert) $ lift $ tell [[s|Loop is missing events %s|] $ intercalate "," $ L.map pretty $ local L.\\ cert]
410
safety_aux (Loop exit inv b _) ps = do local <- lift $ asks localEvts establish_pre "precondition" (znot exit : inv) b PG.with (PG.prefix "body") $ safety_aux b inv entails "postcondition" (exit : inv) ps let cert = certainly b unless (local == cert) $ lift $ tell [[s|Loop is missing events %s|] $ intercalate "," $ L.map pretty $ local L.\\ cert]
410
safety_aux (Loop exit inv b _) ps = do local <- lift $ asks localEvts establish_pre "precondition" (znot exit : inv) b PG.with (PG.prefix "body") $ safety_aux b inv entails "postcondition" (exit : inv) ps let cert = certainly b unless (local == cert) $ lift $ tell [[s|Loop is missing events %s|] $ intercalate "," $ L.map pretty $ local L.\\ cert]
410
false
false
0
14
124
168
79
89
null
null
geophf/1HaskellADay
exercises/HAD/Y2017/M07/D03/Solution.hs
mit
-- The answer, at a glance, is Jim, as Tom is younger than Rose, who is younger -- than Susan, who is younger than Jim who is only older, not younger, than the -- others. But how do we go about proving it? Well, as Larry Wall says, -- TMTOWTDI, or, 'There's More Than One Way To Do It,' so, take your pick. An -- easy approach is to use list-sorting logic, I suppose. oldest :: [AgeRel] -> [Person] oldest peeps = [b | (a `IsYoungerThan` b) <- peeps, not (any (\(x `IsYoungerThan` y) -> x == b) (filter ahYouth peeps))]
572
oldest :: [AgeRel] -> [Person] oldest peeps = [b | (a `IsYoungerThan` b) <- peeps, not (any (\(x `IsYoungerThan` y) -> x == b) (filter ahYouth peeps))]
201
oldest peeps = [b | (a `IsYoungerThan` b) <- peeps, not (any (\(x `IsYoungerThan` y) -> x == b) (filter ahYouth peeps))]
170
true
true
0
14
153
97
55
42
null
null
codecurve/FieldML-Haskell-01
src/FieldML/Utility01.hs
bsd-2-clause
domain Pi = UnitSpace
21
domain Pi = UnitSpace
21
domain Pi = UnitSpace
21
false
false
1
5
3
13
4
9
null
null
synsem/texhs
src/Text/TeX/Lexer/TokenParser/Basic.hs
gpl-3.0
ctrlseqEqT :: Monad m => String -> Bool -> LexerT m Token ctrlseqEqT cs active = tok (CtrlSeq cs active)
104
ctrlseqEqT :: Monad m => String -> Bool -> LexerT m Token ctrlseqEqT cs active = tok (CtrlSeq cs active)
104
ctrlseqEqT cs active = tok (CtrlSeq cs active)
46
false
true
0
8
19
47
22
25
null
null
wavewave/hxournal
lib/Application/HXournal/ProgType.hs
bsd-2-clause
test :: Hxournal test = Test { xojfile = def &= typ "FILENAME" &= args -- &= argPos 0 &= opt "OPTIONAL" } &= auto
126
test :: Hxournal test = Test { xojfile = def &= typ "FILENAME" &= args -- &= argPos 0 &= opt "OPTIONAL" } &= auto
126
test = Test { xojfile = def &= typ "FILENAME" &= args -- &= argPos 0 &= opt "OPTIONAL" } &= auto
109
false
true
0
10
37
35
19
16
null
null
ezyang/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
collectArgsTicks :: (Tickish Id -> Bool) -> Expr b -> (Expr b, [Arg b], [Tickish Id]) collectArgsTicks skipTick expr = go expr [] [] where go (App f a) as ts = go f (a:as) ts go (Tick t e) as ts | skipTick t = go e as (t:ts) go e as ts = (e, as, reverse ts) {- ************************************************************************ * * \subsection{Predicates} * * ************************************************************************ At one time we optionally carried type arguments through to runtime. @isRuntimeVar v@ returns if (Lam v _) really becomes a lambda at runtime, i.e. if type applications are actual lambdas because types are kept around at runtime. Similarly isRuntimeArg. -} -- | Will this variable exist at runtime?
934
collectArgsTicks :: (Tickish Id -> Bool) -> Expr b -> (Expr b, [Arg b], [Tickish Id]) collectArgsTicks skipTick expr = go expr [] [] where go (App f a) as ts = go f (a:as) ts go (Tick t e) as ts | skipTick t = go e as (t:ts) go e as ts = (e, as, reverse ts) {- ************************************************************************ * * \subsection{Predicates} * * ************************************************************************ At one time we optionally carried type arguments through to runtime. @isRuntimeVar v@ returns if (Lam v _) really becomes a lambda at runtime, i.e. if type applications are actual lambdas because types are kept around at runtime. Similarly isRuntimeArg. -} -- | Will this variable exist at runtime?
934
collectArgsTicks skipTick expr = go expr [] [] where go (App f a) as ts = go f (a:as) ts go (Tick t e) as ts | skipTick t = go e as (t:ts) go e as ts = (e, as, reverse ts) {- ************************************************************************ * * \subsection{Predicates} * * ************************************************************************ At one time we optionally carried type arguments through to runtime. @isRuntimeVar v@ returns if (Lam v _) really becomes a lambda at runtime, i.e. if type applications are actual lambdas because types are kept around at runtime. Similarly isRuntimeArg. -} -- | Will this variable exist at runtime?
831
false
true
0
9
312
178
89
89
null
null
brendanhay/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
mpl-2.0
-- | The nid parameter value used in cookie match requests. Please contact -- your technical account manager if you need to change this. aCookieMatchingNid :: Lens' Account (Maybe Text) aCookieMatchingNid = lens _aCookieMatchingNid (\ s a -> s{_aCookieMatchingNid = a})
277
aCookieMatchingNid :: Lens' Account (Maybe Text) aCookieMatchingNid = lens _aCookieMatchingNid (\ s a -> s{_aCookieMatchingNid = a})
140
aCookieMatchingNid = lens _aCookieMatchingNid (\ s a -> s{_aCookieMatchingNid = a})
91
true
true
1
9
48
53
26
27
null
null
miguel-negrao/iCalendar
Text/ICalendar/Parser/Parameters.hs
bsd-3-clause
parseCUType x = CUTypeX x
25
parseCUType x = CUTypeX x
25
parseCUType x = CUTypeX x
25
false
false
1
5
4
16
5
11
null
null
urbanslug/ghc
compiler/rename/RnBinds.hs
bsd-3-clause
rnMethodBinds :: Name -- Class name -> (Name -> [Name]) -- Signature tyvar function -> LHsBinds RdrName -> RnM (LHsBinds Name, FreeVars) rnMethodBinds cls sig_fn binds = do { checkDupRdrNames meth_names -- Check that the same method is not given twice in the -- same instance decl instance C T where -- f x = ... -- g y = ... -- f x = ... -- We must use checkDupRdrNames because the Name of the -- method is the Name of the class selector, whose SrcSpan -- points to the class declaration; and we use rnMethodBinds -- for instance decls too ; foldlM do_one (emptyBag, emptyFVs) (bagToList binds) } where meth_names = collectMethodBinders binds do_one (binds,fvs) bind = do { (bind', fvs_bind) <- rnMethodBind cls sig_fn bind ; return (binds `unionBags` bind', fvs_bind `plusFV` fvs) }
1,079
rnMethodBinds :: Name -- Class name -> (Name -> [Name]) -- Signature tyvar function -> LHsBinds RdrName -> RnM (LHsBinds Name, FreeVars) rnMethodBinds cls sig_fn binds = do { checkDupRdrNames meth_names -- Check that the same method is not given twice in the -- same instance decl instance C T where -- f x = ... -- g y = ... -- f x = ... -- We must use checkDupRdrNames because the Name of the -- method is the Name of the class selector, whose SrcSpan -- points to the class declaration; and we use rnMethodBinds -- for instance decls too ; foldlM do_one (emptyBag, emptyFVs) (bagToList binds) } where meth_names = collectMethodBinders binds do_one (binds,fvs) bind = do { (bind', fvs_bind) <- rnMethodBind cls sig_fn bind ; return (binds `unionBags` bind', fvs_bind `plusFV` fvs) }
1,078
rnMethodBinds cls sig_fn binds = do { checkDupRdrNames meth_names -- Check that the same method is not given twice in the -- same instance decl instance C T where -- f x = ... -- g y = ... -- f x = ... -- We must use checkDupRdrNames because the Name of the -- method is the Name of the class selector, whose SrcSpan -- points to the class declaration; and we use rnMethodBinds -- for instance decls too ; foldlM do_one (emptyBag, emptyFVs) (bagToList binds) } where meth_names = collectMethodBinders binds do_one (binds,fvs) bind = do { (bind', fvs_bind) <- rnMethodBind cls sig_fn bind ; return (binds `unionBags` bind', fvs_bind `plusFV` fvs) }
875
false
true
1
10
431
171
96
75
null
null
banacorn/agda-language-server
src/Agda/Convert.hs
mit
fromResponse :: Response -> TCM IR.Response fromResponse (Resp_HighlightingInfo info remove method modFile) = fromHighlightingInfo info remove method modFile
159
fromResponse :: Response -> TCM IR.Response fromResponse (Resp_HighlightingInfo info remove method modFile) = fromHighlightingInfo info remove method modFile
159
fromResponse (Resp_HighlightingInfo info remove method modFile) = fromHighlightingInfo info remove method modFile
115
false
true
0
9
19
50
22
28
null
null
leksah/leksah-server
src/IDE/Utils/GHCUtils.hs
gpl-2.0
viewDependency :: Dependency -> (PackageName, VersionRange, Set LibraryName) viewDependency (Dependency a b c) = (a, b, c)
122
viewDependency :: Dependency -> (PackageName, VersionRange, Set LibraryName) viewDependency (Dependency a b c) = (a, b, c)
122
viewDependency (Dependency a b c) = (a, b, c)
45
false
true
0
7
16
49
27
22
null
null
opqdonut/riot
Riot/KeyMap.hs
gpl-2.0
key2str (KeyChar c) = show c
28
key2str (KeyChar c) = show c
28
key2str (KeyChar c) = show c
28
false
false
0
7
5
18
8
10
null
null
copton/ocram
util/view_ast/ViewAst.hs
gpl-2.0
usageMsg :: String -> String usageMsg prg = render $ text "Usage:" <+> text prg <+> hsep (map text ["CPP_OPTIONS","input_file.c","output_file.svg"])
148
usageMsg :: String -> String usageMsg prg = render $ text "Usage:" <+> text prg <+> hsep (map text ["CPP_OPTIONS","input_file.c","output_file.svg"])
148
usageMsg prg = render $ text "Usage:" <+> text prg <+> hsep (map text ["CPP_OPTIONS","input_file.c","output_file.svg"])
119
false
true
0
9
19
61
29
32
null
null
plumlife/cabal
cabal-install/Distribution/Client/Init.hs
bsd-3-clause
createSourceDirectories :: InitFlags -> IO () createSourceDirectories flags = case sourceDirs flags of Just dirs -> forM_ dirs (createDirectoryIfMissing True) Nothing -> return () -- | Move an existing file, if there is one, and the overwrite flag is -- not set.
335
createSourceDirectories :: InitFlags -> IO () createSourceDirectories flags = case sourceDirs flags of Just dirs -> forM_ dirs (createDirectoryIfMissing True) Nothing -> return () -- | Move an existing file, if there is one, and the overwrite flag is -- not set.
335
createSourceDirectories flags = case sourceDirs flags of Just dirs -> forM_ dirs (createDirectoryIfMissing True) Nothing -> return () -- | Move an existing file, if there is one, and the overwrite flag is -- not set.
289
false
true
0
10
114
63
30
33
null
null
da-x/ghc
compiler/utils/Outputable.hs
bsd-3-clause
rparen = docToSDoc $ Pretty.rparen
38
rparen = docToSDoc $ Pretty.rparen
38
rparen = docToSDoc $ Pretty.rparen
38
false
false
0
6
8
12
6
6
null
null
vincenthz/hs-xyz-test
Core/Chunks.hs
bsd-3-clause
snoc :: C.SemiOrderedCollection s => Chunks s -> C.Element (Chunks s) -> Chunks s snoc End el = Chunk (C.singleton el) End
135
snoc :: C.SemiOrderedCollection s => Chunks s -> C.Element (Chunks s) -> Chunks s snoc End el = Chunk (C.singleton el) End
135
snoc End el = Chunk (C.singleton el) End
48
false
true
0
11
34
68
30
38
null
null
DominikJaniec/LearnHaskell
problems/calculator/src/Tools/BlankChopper.hs
mit
chopTokens :: String -> [Token] chopTokens str = let input = ' ' : str infos = map makeInfo $ zip input [-1..] initial = Stats { lastChar = BlankChar, tokens = [], buffer = "" } in tokens $ foldr chopper initial infos
241
chopTokens :: String -> [Token] chopTokens str = let input = ' ' : str infos = map makeInfo $ zip input [-1..] initial = Stats { lastChar = BlankChar, tokens = [], buffer = "" } in tokens $ foldr chopper initial infos
241
chopTokens str = let input = ' ' : str infos = map makeInfo $ zip input [-1..] initial = Stats { lastChar = BlankChar, tokens = [], buffer = "" } in tokens $ foldr chopper initial infos
209
false
true
0
12
67
96
51
45
null
null
DaMSL/K3
src/Language/K3/Interpreter/Builtins.hs
apache-2.0
genBuiltin (channelMethod -> ("Write", Just n)) _ = vfun $ \arg -> liftEngine (doWrite n arg) >> return vunit
111
genBuiltin (channelMethod -> ("Write", Just n)) _ = vfun $ \arg -> liftEngine (doWrite n arg) >> return vunit
111
genBuiltin (channelMethod -> ("Write", Just n)) _ = vfun $ \arg -> liftEngine (doWrite n arg) >> return vunit
111
false
false
0
10
20
54
27
27
null
null
DanielJanzon/CryptoLab
ElGamalMain.hs
bsd-3-clause
main = start `catch` print_usage
32
main = start `catch` print_usage
32
main = start `catch` print_usage
32
false
false
1
5
4
18
8
10
null
null
brendanhay/gogol
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Clusters/Get.hs
mpl-2.0
-- | Required. The Dataproc region in which to handle the request. prcgRegion :: Lens' ProjectsRegionsClustersGet Text prcgRegion = lens _prcgRegion (\ s a -> s{_prcgRegion = a})
180
prcgRegion :: Lens' ProjectsRegionsClustersGet Text prcgRegion = lens _prcgRegion (\ s a -> s{_prcgRegion = a})
113
prcgRegion = lens _prcgRegion (\ s a -> s{_prcgRegion = a})
61
true
true
1
9
29
45
22
23
null
null
shlevy/ghc
compiler/main/HscTypes.hs
bsd-3-clause
shouldPrintWarning dflags ReasonUnrecognisedFlag = wopt Opt_WarnUnrecognisedWarningFlags dflags
97
shouldPrintWarning dflags ReasonUnrecognisedFlag = wopt Opt_WarnUnrecognisedWarningFlags dflags
97
shouldPrintWarning dflags ReasonUnrecognisedFlag = wopt Opt_WarnUnrecognisedWarningFlags dflags
97
false
false
0
5
8
16
7
9
null
null
randen/haddock
haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
bsd-2-clause
enrichToken :: Token -> DetailsMap -> Maybe TokenDetails enrichToken (Token typ _ spn) dm | typ `elem` [TkIdentifier, TkOperator] = lookupBySpan spn dm
155
enrichToken :: Token -> DetailsMap -> Maybe TokenDetails enrichToken (Token typ _ spn) dm | typ `elem` [TkIdentifier, TkOperator] = lookupBySpan spn dm
155
enrichToken (Token typ _ spn) dm | typ `elem` [TkIdentifier, TkOperator] = lookupBySpan spn dm
98
false
true
0
10
26
64
31
33
null
null
oldmanmike/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
heqDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "Eq#") heqDataConKey heqDataCon
98
heqDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "Eq#") heqDataConKey heqDataCon
98
heqDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "Eq#") heqDataConKey heqDataCon
98
false
false
1
7
9
27
11
16
null
null
ribag/ganeti-experiments
src/Ganeti/DataCollectors/InstStatus.hs
gpl-2.0
-- | The list of arguments supported by the program. arguments :: [ArgCompletion] arguments = []
96
arguments :: [ArgCompletion] arguments = []
43
arguments = []
14
true
true
0
5
15
17
10
7
null
null
kaoskorobase/hsc3-process
Sound/SC3/Server/Process/Options.hs
gpl-2.0
-- | Default UDP port. defaultUDPPort :: NetworkPort defaultUDPPort = UDPPort defaultPortNumber
95
defaultUDPPort :: NetworkPort defaultUDPPort = UDPPort defaultPortNumber
72
defaultUDPPort = UDPPort defaultPortNumber
42
true
true
0
5
11
15
8
7
null
null
CoryXie/BarrelfishOS
tools/flounder/UMPCommon.hs
mit
-- Name of the cap send/recv handlers cap_rx_handler_name p ifn = ump_ifscope p ifn "cap_rx_handler"
100
cap_rx_handler_name p ifn = ump_ifscope p ifn "cap_rx_handler"
62
cap_rx_handler_name p ifn = ump_ifscope p ifn "cap_rx_handler"
62
true
false
0
5
14
19
9
10
null
null
bkoropoff/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
-- | Pretty-printer helper for the binding site of a name bindingOf :: Name -- ^^ the bound name -> Bool -- ^^ whether the name is implicit -> Doc OutputAnnotation bindingOf n imp = annotate (AnnBoundName n imp) (text (show n))
247
bindingOf :: Name -- ^^ the bound name -> Bool -- ^^ whether the name is implicit -> Doc OutputAnnotation bindingOf n imp = annotate (AnnBoundName n imp) (text (show n))
189
bindingOf n imp = annotate (AnnBoundName n imp) (text (show n))
63
true
true
0
9
61
59
29
30
null
null
aloiscochard/sarsi
sarsi-nvim/NVIM/Client.hs
apache-2.0
send :: CommandQueue -> Command -> IO () send q c = atomically $ writeTBQueue q (c, \_ -> return ())
100
send :: CommandQueue -> Command -> IO () send q c = atomically $ writeTBQueue q (c, \_ -> return ())
100
send q c = atomically $ writeTBQueue q (c, \_ -> return ())
59
false
true
0
10
20
54
27
27
null
null
y-usuzumi/survive-the-course
advent-of-code/app/Year2021/Day3/Part2/Main.hs
bsd-3-clause
mostCommonBit :: [Char] -> Char mostCommonBit bits = case countZerosOnes bits of (zeros, ones) | zeros <= ones -> '1' | zeros > ones -> '0'
157
mostCommonBit :: [Char] -> Char mostCommonBit bits = case countZerosOnes bits of (zeros, ones) | zeros <= ones -> '1' | zeros > ones -> '0'
157
mostCommonBit bits = case countZerosOnes bits of (zeros, ones) | zeros <= ones -> '1' | zeros > ones -> '0'
125
false
true
0
11
43
63
31
32
null
null
hnakamur/haskell-sandbox
sandbox-css/SandBox/Text/CSS/Parser.hs
bsd-3-clause
fontWeightVal :: Stream s Identity Char => ParsecT s u Identity FontWeightVal fontWeightVal = choice [ try fontWeight >>= \s -> return (FWVVal s) , try (keywordCase "inherit") >> return FWVInherit ]
210
fontWeightVal :: Stream s Identity Char => ParsecT s u Identity FontWeightVal fontWeightVal = choice [ try fontWeight >>= \s -> return (FWVVal s) , try (keywordCase "inherit") >> return FWVInherit ]
210
fontWeightVal = choice [ try fontWeight >>= \s -> return (FWVVal s) , try (keywordCase "inherit") >> return FWVInherit ]
132
false
true
0
10
43
77
37
40
null
null
alexstachnik/High-Level-C
src/Language/HLC/HighLevelC/HLCCalls.hs
gpl-2.0
listToExpr' :: (ListToExpr listTy) => HList listTy -> HLC [HLCExpr] listToExpr' = sequence . listToExpr
103
listToExpr' :: (ListToExpr listTy) => HList listTy -> HLC [HLCExpr] listToExpr' = sequence . listToExpr
103
listToExpr' = sequence . listToExpr
35
false
true
1
9
14
44
20
24
null
null