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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rvion/ride | jetpack/src/Control/Concurrent/STM/AsStm.hs | bsd-3-clause | -- stm_newTVar :: forall a. a -> STM (TVar a)
stm_newTVar = I.newTVar | 69 | stm_newTVar = I.newTVar | 23 | stm_newTVar = I.newTVar | 23 | true | false | 1 | 6 | 12 | 13 | 5 | 8 | null | null |
deyaaeldeen/GTLC | src/GTLC/Eval.hs | gpl-3.0 | interp (IGRef e) = interp e >>= \v -> get >>= \x@(EvHeap {evHeap = h, evTop = a}) -> put (x {evHeap = H.insert a v h, evTop = a+1}) >>= \_ -> return $ VAddr a | 158 | interp (IGRef e) = interp e >>= \v -> get >>= \x@(EvHeap {evHeap = h, evTop = a}) -> put (x {evHeap = H.insert a v h, evTop = a+1}) >>= \_ -> return $ VAddr a | 158 | interp (IGRef e) = interp e >>= \v -> get >>= \x@(EvHeap {evHeap = h, evTop = a}) -> put (x {evHeap = H.insert a v h, evTop = a+1}) >>= \_ -> return $ VAddr a | 158 | false | false | 0 | 15 | 36 | 106 | 57 | 49 | null | null |
UBMLtonGroup/timberc | src/Core2Kindle.hs | bsd-3-clause | adaptR env (s,FunR _ ss) (t,ValR c) = do (tss,t') <- splitClosureType env (length ss) t
g <- adaptVals env (concat tss) ss
h <- adaptVal env [] s [] t'
return (s, FunR (sat g h tss)... | 415 | adaptR env (s,FunR _ ss) (t,ValR c) = do (tss,t') <- splitClosureType env (length ss) t
g <- adaptVals env (concat tss) ss
h <- adaptVal env [] s [] t'
return (s, FunR (sat g h tss)... | 415 | adaptR env (s,FunR _ ss) (t,ValR c) = do (tss,t') <- splitClosureType env (length ss) t
g <- adaptVals env (concat tss) ss
h <- adaptVal env [] s [] t'
return (s, FunR (sat g h tss)... | 415 | false | false | 0 | 11 | 211 | 178 | 83 | 95 | null | null |
beni55/fay | src/Fay/Types/Printer.hs | bsd-3-clause | execPrinter :: Printer -> PrintReader -> PrintWriter
execPrinter (Printer p) r = snd $ execRWS p r defaultPrintState | 116 | execPrinter :: Printer -> PrintReader -> PrintWriter
execPrinter (Printer p) r = snd $ execRWS p r defaultPrintState | 116 | execPrinter (Printer p) r = snd $ execRWS p r defaultPrintState | 63 | false | true | 0 | 10 | 17 | 46 | 21 | 25 | null | null |
rkoeninger/GameCom | src/lib/CPU.hs | mit | decode 0xc0 = (cpy, imdMode, 2) | 31 | decode 0xc0 = (cpy, imdMode, 2) | 31 | decode 0xc0 = (cpy, imdMode, 2) | 31 | false | false | 0 | 5 | 5 | 18 | 10 | 8 | null | null |
wtanaka/graphql-schema | src/Text/GraphQL/Schema/Graphene.hs | gpl-2.0 | graphene :: PY.Expr PY.SrcSpan
graphene = var "graphene" | 56 | graphene :: PY.Expr PY.SrcSpan
graphene = var "graphene" | 56 | graphene = var "graphene" | 25 | false | true | 0 | 7 | 7 | 27 | 11 | 16 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | pHiddenOs :: Field
pHiddenOs =
withDoc "Modify list of hidden operating systems: each modification\
\ must have two items, the operation and the OS name; the operation\
\ can be add or remove" .
optionalField $ simpleField "hidden_os" [t| [(DdmSimple, NonEmptyString)] |] | 295 | pHiddenOs :: Field
pHiddenOs =
withDoc "Modify list of hidden operating systems: each modification\
\ must have two items, the operation and the OS name; the operation\
\ can be add or remove" .
optionalField $ simpleField "hidden_os" [t| [(DdmSimple, NonEmptyString)] |] | 295 | pHiddenOs =
withDoc "Modify list of hidden operating systems: each modification\
\ must have two items, the operation and the OS name; the operation\
\ can be add or remove" .
optionalField $ simpleField "hidden_os" [t| [(DdmSimple, NonEmptyString)] |] | 276 | false | true | 0 | 7 | 65 | 31 | 17 | 14 | null | null |
froozen/kademlia | src/Network/Kademlia/Protocol/Parsing.hs | bsd-3-clause | parseCommand 4 = liftM2 RETURN_NODES parseSerialize parseKBucket | 65 | parseCommand 4 = liftM2 RETURN_NODES parseSerialize parseKBucket | 65 | parseCommand 4 = liftM2 RETURN_NODES parseSerialize parseKBucket | 65 | false | false | 1 | 5 | 7 | 19 | 7 | 12 | null | null |
scrive/happstack-static-routing | src/Happstack/StaticRouting/Internal.hs | bsd-3-clause | compile :: ServerMonad m => Route (m r) -> Either String (m (Maybe r))
compile r = case routeTree $ routeTreeWithOverlaps r of
Left s -> Left s
Right t -> Right $ dispatch t
-- | Dispatch a request given a route. Give priority to more specific paths. | 280 | compile :: ServerMonad m => Route (m r) -> Either String (m (Maybe r))
compile r = case routeTree $ routeTreeWithOverlaps r of
Left s -> Left s
Right t -> Right $ dispatch t
-- | Dispatch a request given a route. Give priority to more specific paths. | 280 | compile r = case routeTree $ routeTreeWithOverlaps r of
Left s -> Left s
Right t -> Right $ dispatch t
-- | Dispatch a request given a route. Give priority to more specific paths. | 209 | false | true | 0 | 12 | 78 | 95 | 43 | 52 | null | null |
jml/hodor | Tests/TypesSpec.hs | apache-2.0 | itemsTransformations :: TaskAction -> Transformation [Int] -> Property
itemsTransformations action transformation = conjoin [
prop_emptyUnchanged_multiple transformation,
prop_invalidUnchanged_multiple transformation,
prop_reportsEvent_multiple action transformation,
prop_ignoresUnmentioned_multiple transformat... | 407 | itemsTransformations :: TaskAction -> Transformation [Int] -> Property
itemsTransformations action transformation = conjoin [
prop_emptyUnchanged_multiple transformation,
prop_invalidUnchanged_multiple transformation,
prop_reportsEvent_multiple action transformation,
prop_ignoresUnmentioned_multiple transformat... | 407 | itemsTransformations action transformation = conjoin [
prop_emptyUnchanged_multiple transformation,
prop_invalidUnchanged_multiple transformation,
prop_reportsEvent_multiple action transformation,
prop_ignoresUnmentioned_multiple transformation,
prop_uniqueEvent_multiple transformation,
prop_noItemsGiven tr... | 336 | false | true | 0 | 8 | 41 | 71 | 35 | 36 | null | null |
shockkolate/containers | Data/IntSet/Base.hs | bsd-3-clause | intersection (Bin _ _ _ _) Nil = Nil | 36 | intersection (Bin _ _ _ _) Nil = Nil | 36 | intersection (Bin _ _ _ _) Nil = Nil | 36 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
diagrams/diagrams-contrib | src/Diagrams/TwoD/Layout/Constrained.hs | bsd-3-clause | -- | Create a variable unattached to any particular diagram, with a
-- a given name and type. Not intended to be called by end users.
mkVar :: Num n => String -> VarType -> Expr s n
mkVar s ty = MFS.makeVariable (newVar s ty) | 227 | mkVar :: Num n => String -> VarType -> Expr s n
mkVar s ty = MFS.makeVariable (newVar s ty) | 91 | mkVar s ty = MFS.makeVariable (newVar s ty) | 43 | true | true | 0 | 8 | 47 | 51 | 25 | 26 | null | null |
sdiehl/ghc | compiler/nativeGen/RegAlloc/Liveness.hs | bsd-3-clause | regLiveness
:: (Outputable instr, Instruction instr)
=> Platform
-> LiveCmmDecl statics instr
-> UniqSM (LiveCmmDecl statics instr)
regLiveness _ (CmmData i d)
= return $ CmmData i d | 223 | regLiveness
:: (Outputable instr, Instruction instr)
=> Platform
-> LiveCmmDecl statics instr
-> UniqSM (LiveCmmDecl statics instr)
regLiveness _ (CmmData i d)
= return $ CmmData i d | 222 | regLiveness _ (CmmData i d)
= return $ CmmData i d | 58 | false | true | 0 | 10 | 68 | 72 | 35 | 37 | null | null |
prikhi/campbx-haskell | src/Web/CampBX.hs | gpl-3.0 | -- | Retrieves a Bitcoin Address for Depositing Funds into the CampBX
-- Account
getDepositAddress :: CampBX DepositAddress
getDepositAddress = queryEndPoint GetBTCAddr [] | 171 | getDepositAddress :: CampBX DepositAddress
getDepositAddress = queryEndPoint GetBTCAddr [] | 90 | getDepositAddress = queryEndPoint GetBTCAddr [] | 47 | true | true | 0 | 6 | 22 | 23 | 12 | 11 | null | null |
joelburget/material-ui-hs | Main.hs | mit | toggleExamples_ :: [AttrOrHandler a] -> () -> ReactNode a
toggleExamples_ = classLeaf $ dumbClass
{ name = ""
, renderFn = \_ _ -> div_ [ class_ "switches-example-group" ]$ do
div_ [ class_ "switches-example-container" ] $
h2_ [ class_ "mui-font-style-headline" ] "Toggle"
div_ [ clas... | 805 | toggleExamples_ :: [AttrOrHandler a] -> () -> ReactNode a
toggleExamples_ = classLeaf $ dumbClass
{ name = ""
, renderFn = \_ _ -> div_ [ class_ "switches-example-group" ]$ do
div_ [ class_ "switches-example-container" ] $
h2_ [ class_ "mui-font-style-headline" ] "Toggle"
div_ [ clas... | 805 | toggleExamples_ = classLeaf $ dumbClass
{ name = ""
, renderFn = \_ _ -> div_ [ class_ "switches-example-group" ]$ do
div_ [ class_ "switches-example-container" ] $
h2_ [ class_ "mui-font-style-headline" ] "Toggle"
div_ [ class_ "switches-example-container" ] $
toggle [ n... | 747 | false | true | 0 | 15 | 194 | 227 | 107 | 120 | null | null |
MichaelBurge/ToxicSludgeDB | src/Database/Toxic/Query/Interpreter.hs | mit | getRowAggregates :: ArrayOf Expression -> (ArrayOf Expression, ArrayOf QueryAggregate, ArrayOf Expression)
getRowAggregates expressions =
let splits = V.map getAggregate expressions
continuations = V.map (\(x,_,_) -> x) splits
aggregates = V.map (\(_,x,_) -> x) splits
inputTransformers = ... | 400 | getRowAggregates :: ArrayOf Expression -> (ArrayOf Expression, ArrayOf QueryAggregate, ArrayOf Expression)
getRowAggregates expressions =
let splits = V.map getAggregate expressions
continuations = V.map (\(x,_,_) -> x) splits
aggregates = V.map (\(_,x,_) -> x) splits
inputTransformers = ... | 400 | getRowAggregates expressions =
let splits = V.map getAggregate expressions
continuations = V.map (\(x,_,_) -> x) splits
aggregates = V.map (\(_,x,_) -> x) splits
inputTransformers = V.map (\(_,_,x) -> x) splits
in (continuations, aggregates, inputTransformers) | 293 | false | true | 0 | 12 | 77 | 153 | 84 | 69 | null | null |
ghc-android/ghc | compiler/utils/Digraph.hs | bsd-3-clause | dfsTopSortG :: Graph node -> [[node]]
dfsTopSortG graph =
map (map (gr_vertex_to_node graph) . flatten) $ dfs g (topSort g)
where
g = gr_int_graph graph | 160 | dfsTopSortG :: Graph node -> [[node]]
dfsTopSortG graph =
map (map (gr_vertex_to_node graph) . flatten) $ dfs g (topSort g)
where
g = gr_int_graph graph | 160 | dfsTopSortG graph =
map (map (gr_vertex_to_node graph) . flatten) $ dfs g (topSort g)
where
g = gr_int_graph graph | 122 | false | true | 1 | 10 | 32 | 81 | 36 | 45 | null | null |
alexander-at-github/eta | compiler/ETA/StgSyn/CoreToStg.hs | bsd-3-clause | unionFVInfo :: FreeVarsInfo -> FreeVarsInfo -> FreeVarsInfo
unionFVInfo fv1 fv2 = plusVarEnv_C plusFVInfo fv1 fv2 | 113 | unionFVInfo :: FreeVarsInfo -> FreeVarsInfo -> FreeVarsInfo
unionFVInfo fv1 fv2 = plusVarEnv_C plusFVInfo fv1 fv2 | 113 | unionFVInfo fv1 fv2 = plusVarEnv_C plusFVInfo fv1 fv2 | 53 | false | true | 0 | 8 | 14 | 36 | 16 | 20 | null | null |
riottracker/sequencer | src/Sound/Sequencer/Editor.hs | bsd-3-clause | modifyCurrentCell :: Editor -> (Cell -> Cell) -> Editor
modifyCurrentCell ed@Editor{..} f = ed { sqncr = sqncr {
patterns = updateNth y1 (\(n,p) -> (n, updateNth y2 (updateNth x1 f) p)) (patterns sqncr) }}
where (x1,x2) = cursorX
(y1,y2) = cursorY | 261 | modifyCurrentCell :: Editor -> (Cell -> Cell) -> Editor
modifyCurrentCell ed@Editor{..} f = ed { sqncr = sqncr {
patterns = updateNth y1 (\(n,p) -> (n, updateNth y2 (updateNth x1 f) p)) (patterns sqncr) }}
where (x1,x2) = cursorX
(y1,y2) = cursorY | 261 | modifyCurrentCell ed@Editor{..} f = ed { sqncr = sqncr {
patterns = updateNth y1 (\(n,p) -> (n, updateNth y2 (updateNth x1 f) p)) (patterns sqncr) }}
where (x1,x2) = cursorX
(y1,y2) = cursorY | 205 | false | true | 1 | 15 | 55 | 131 | 72 | 59 | null | null |
jsavatgy/hatupist | code/result-tables-03.hs | gpl-2.0 | colLines (xs:xss) =
(unwords xs) : colLines xss | 49 | colLines (xs:xss) =
(unwords xs) : colLines xss | 49 | colLines (xs:xss) =
(unwords xs) : colLines xss | 49 | false | false | 0 | 7 | 9 | 29 | 14 | 15 | null | null |
notae/haskell-exercise | graphics/Graphics.hs | bsd-3-clause | convToImageRGB8 :: DynamicImage -> Image PixelRGB8
convToImageRGB8 dimg = case dimg of
ImageY8 _ -> error "ImageY8"
ImageY16 _ -> error "ImageY16"
ImageYF _ -> error "ImageYF"
ImageYA8 _ -> error "ImageYA8"
ImageYA16 _ -> error "ImageYA16"
ImageRGB8 img -> img
ImageRGB16 _ -> error "ImageRGB16"
ImageRGB... | 547 | convToImageRGB8 :: DynamicImage -> Image PixelRGB8
convToImageRGB8 dimg = case dimg of
ImageY8 _ -> error "ImageY8"
ImageY16 _ -> error "ImageY16"
ImageYF _ -> error "ImageYF"
ImageYA8 _ -> error "ImageYA8"
ImageYA16 _ -> error "ImageYA16"
ImageRGB8 img -> img
ImageRGB16 _ -> error "ImageRGB16"
ImageRGB... | 547 | convToImageRGB8 dimg = case dimg of
ImageY8 _ -> error "ImageY8"
ImageY16 _ -> error "ImageY16"
ImageYF _ -> error "ImageYF"
ImageYA8 _ -> error "ImageYA8"
ImageYA16 _ -> error "ImageYA16"
ImageRGB8 img -> img
ImageRGB16 _ -> error "ImageRGB16"
ImageRGBF _ -> error "ImageRGBF"
ImageRGBA8 img -> pixelM... | 496 | false | true | 14 | 6 | 102 | 156 | 77 | 79 | null | null |
iliastsi/gac | src/codeGen/LambdaLift.hs | mit | chProtoDef (ADefFun (TDefProt _ide ptype) atype) pname =
ADefFun (TDefProt pname ptype) atype | 97 | chProtoDef (ADefFun (TDefProt _ide ptype) atype) pname =
ADefFun (TDefProt pname ptype) atype | 97 | chProtoDef (ADefFun (TDefProt _ide ptype) atype) pname =
ADefFun (TDefProt pname ptype) atype | 97 | false | false | 0 | 9 | 16 | 40 | 19 | 21 | null | null |
leksah/yi | src/library/Yi/Keymap/Vim/NormalMap.hs | gpl-2.0 | repeatGotoCharE :: (Direction -> Direction) -> EditorM ()
repeatGotoCharE mutateDir = do
prevCommand <- fmap vsLastGotoCharCommand getEditorDyn
count <- getCountE
withCurrentBuffer $ case prevCommand of
Just (GotoCharCommand c dir style) -> do
let newDir = mutateDir dir
let m... | 650 | repeatGotoCharE :: (Direction -> Direction) -> EditorM ()
repeatGotoCharE mutateDir = do
prevCommand <- fmap vsLastGotoCharCommand getEditorDyn
count <- getCountE
withCurrentBuffer $ case prevCommand of
Just (GotoCharCommand c dir style) -> do
let newDir = mutateDir dir
let m... | 650 | repeatGotoCharE mutateDir = do
prevCommand <- fmap vsLastGotoCharCommand getEditorDyn
count <- getCountE
withCurrentBuffer $ case prevCommand of
Just (GotoCharCommand c dir style) -> do
let newDir = mutateDir dir
let move = gotoCharacterB c newDir style True
p0 <-... | 592 | false | true | 0 | 20 | 236 | 211 | 94 | 117 | null | null |
acowley/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprStmt :: (OutputableBndr idL, OutputableBndr idR, Outputable body)
=> (StmtLR idL idR body) -> SDoc
pprStmt (LastStmt expr _) = ifPprDebug (ptext (sLit "[last]")) <+> ppr expr | 193 | pprStmt :: (OutputableBndr idL, OutputableBndr idR, Outputable body)
=> (StmtLR idL idR body) -> SDoc
pprStmt (LastStmt expr _) = ifPprDebug (ptext (sLit "[last]")) <+> ppr expr | 193 | pprStmt (LastStmt expr _) = ifPprDebug (ptext (sLit "[last]")) <+> ppr expr | 83 | false | true | 0 | 10 | 42 | 84 | 40 | 44 | null | null |
supermitch/learn-haskell | sandbox/pulse/pulse.hs | mit | parseCSV :: String -> Either ParseError [[String]]
parseCSV input = parse csvFile "(unknown)" input | 99 | parseCSV :: String -> Either ParseError [[String]]
parseCSV input = parse csvFile "(unknown)" input | 99 | parseCSV input = parse csvFile "(unknown)" input | 48 | false | true | 0 | 8 | 13 | 36 | 18 | 18 | null | null |
OS2World/DEV-UTIL-HUGS | demos/GLUT/examples/RedBook/Tess.hs | bsd-3-clause | simpleTessellator ::
Storable v =>
TessWinding -> Combiner v -> ComplexPolygon v -> IO (SimplePolygon v)
simpleTessellator windingRule combiner complexPolygon =
checkForError $
tessellate windingRule 0 (Normal3 0 0 0) combiner complexPolygon | 256 | simpleTessellator ::
Storable v =>
TessWinding -> Combiner v -> ComplexPolygon v -> IO (SimplePolygon v)
simpleTessellator windingRule combiner complexPolygon =
checkForError $
tessellate windingRule 0 (Normal3 0 0 0) combiner complexPolygon | 256 | simpleTessellator windingRule combiner complexPolygon =
checkForError $
tessellate windingRule 0 (Normal3 0 0 0) combiner complexPolygon | 145 | false | true | 2 | 12 | 46 | 85 | 37 | 48 | null | null |
konn/sized-vector | Data/Vector/Sized.hs | bsd-3-clause | vecHashWithSalt :: Hashable a => Int -> Vector a n -> Int
vecHashWithSalt salt Nil = salt `hashWithSalt` (0 :: Int) | 115 | vecHashWithSalt :: Hashable a => Int -> Vector a n -> Int
vecHashWithSalt salt Nil = salt `hashWithSalt` (0 :: Int) | 115 | vecHashWithSalt salt Nil = salt `hashWithSalt` (0 :: Int) | 57 | false | true | 0 | 8 | 20 | 48 | 25 | 23 | null | null |
arirahikkala/straylight-divergence | src/Game.hs | gpl-3.0 | -- | Are these Coords the same or in each other's Moore neighborhood?
adjacentOrSame :: Coord -> Coord -> Bool
adjacentOrSame a b = chebyshevDistance a b <= 1 | 158 | adjacentOrSame :: Coord -> Coord -> Bool
adjacentOrSame a b = chebyshevDistance a b <= 1 | 88 | adjacentOrSame a b = chebyshevDistance a b <= 1 | 47 | true | true | 0 | 6 | 28 | 34 | 17 | 17 | null | null |
ideas-edu/ideas | src/Ideas/Encoding/DecoderJSON.hs | apache-2.0 | decodeContext :: JSONDecoder a (Context a)
decodeContext = do
ex <- getExercise
inContext ex <$> decodeExpression | 122 | decodeContext :: JSONDecoder a (Context a)
decodeContext = do
ex <- getExercise
inContext ex <$> decodeExpression | 121 | decodeContext = do
ex <- getExercise
inContext ex <$> decodeExpression | 78 | false | true | 0 | 8 | 24 | 39 | 18 | 21 | null | null |
timtylin/scholdoc-texmath | extra/texmath.hs | gpl-2.0 | output dt (StringWriter w) es = w dt es | 39 | output dt (StringWriter w) es = w dt es | 39 | output dt (StringWriter w) es = w dt es | 39 | false | false | 1 | 7 | 8 | 27 | 11 | 16 | null | null |
michaxm/haskell-hdfs-thrift-client | src-gen-thrift/ThriftHadoopFileSystem.hs | bsd-3-clause | write_SetReplication_result :: (T.Protocol p, T.Transport t) => p t -> SetReplication_result -> P.IO ()
write_SetReplication_result oprot record = T.writeVal oprot $ from_SetReplication_result record | 199 | write_SetReplication_result :: (T.Protocol p, T.Transport t) => p t -> SetReplication_result -> P.IO ()
write_SetReplication_result oprot record = T.writeVal oprot $ from_SetReplication_result record | 199 | write_SetReplication_result oprot record = T.writeVal oprot $ from_SetReplication_result record | 95 | false | true | 0 | 9 | 22 | 65 | 31 | 34 | null | null |
ditto/ditto | src/Ditto/Sub.hs | gpl-3.0 | sub1 xa (ECon _Y y as) = ECon _Y y <$> subs1 xa as | 50 | sub1 xa (ECon _Y y as) = ECon _Y y <$> subs1 xa as | 50 | sub1 xa (ECon _Y y as) = ECon _Y y <$> subs1 xa as | 50 | false | false | 0 | 7 | 13 | 35 | 16 | 19 | null | null |
ignuki/projecteuler | 10/problem10.hs | gpl-3.0 | union :: [[Integer]] -> [Integer]
union = foldr merge []
where merge (x:xs) ys = x:merge' xs ys
merge [] x = x
merge' [] x = x
merge' x [] = x
merge' (x:xs) (y:ys)
| x < y = x:merge' xs (y:ys)
| x == y = x:merge' xs ys
| x > y = y:merge' (x:xs) ys
... | 345 | union :: [[Integer]] -> [Integer]
union = foldr merge []
where merge (x:xs) ys = x:merge' xs ys
merge [] x = x
merge' [] x = x
merge' x [] = x
merge' (x:xs) (y:ys)
| x < y = x:merge' xs (y:ys)
| x == y = x:merge' xs ys
| x > y = y:merge' (x:xs) ys
... | 345 | union = foldr merge []
where merge (x:xs) ys = x:merge' xs ys
merge [] x = x
merge' [] x = x
merge' x [] = x
merge' (x:xs) (y:ys)
| x < y = x:merge' xs (y:ys)
| x == y = x:merge' xs ys
| x > y = y:merge' (x:xs) ys
merge' (_:_) (_:_) = [] | 311 | false | true | 10 | 14 | 138 | 221 | 112 | 109 | null | null |
thinkpad20/oneormore | src/Data/OneOrMore/Operators.hs | mit | reverse (More x xs) = go (One x) xs where
go ys (One y) = More y ys
go ys (More y ys') = go (More y ys) ys' | 111 | reverse (More x xs) = go (One x) xs where
go ys (One y) = More y ys
go ys (More y ys') = go (More y ys) ys' | 111 | reverse (More x xs) = go (One x) xs where
go ys (One y) = More y ys
go ys (More y ys') = go (More y ys) ys' | 111 | false | false | 0 | 9 | 32 | 82 | 39 | 43 | null | null |
k-bx/snap-server | src/System/FastLogger.hs | bsd-3-clause | loggingThread :: Logger -> (forall a. IO a -> IO a) -> IO ()
loggingThread (Logger queue notifier filePath _ errAct) unmask = do
initialize >>= go
where
openIt =
if filePath == "-"
then return stdout
else
if filePath == "stderr"
then return stderr
... | 3,216 | loggingThread :: Logger -> (forall a. IO a -> IO a) -> IO ()
loggingThread (Logger queue notifier filePath _ errAct) unmask = do
initialize >>= go
where
openIt =
if filePath == "-"
then return stdout
else
if filePath == "stderr"
then return stderr
... | 3,216 | loggingThread (Logger queue notifier filePath _ errAct) unmask = do
initialize >>= go
where
openIt =
if filePath == "-"
then return stdout
else
if filePath == "stderr"
then return stderr
else openFile filePath AppendMode `catch`
... | 3,155 | false | true | 6 | 15 | 1,173 | 741 | 348 | 393 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrelNames.hs | bsd-3-clause | bcoPrimTyConKey = mkPreludeTyConUnique 73 | 65 | bcoPrimTyConKey = mkPreludeTyConUnique 73 | 65 | bcoPrimTyConKey = mkPreludeTyConUnique 73 | 65 | false | false | 0 | 5 | 27 | 9 | 4 | 5 | null | null |
jwiegley/ghc-release | libraries/Cabal/cabal-install/Distribution/Client/Dependency.hs | gpl-3.0 | resolveDependencies platform comp solver params =
fmap (mkInstallPlan platform comp)
$ runSolver solver (SolverConfig reorderGoals indGoals noReinstalls
shadowing maxBkjumps)
platform comp installedPkgIndex sourcePkgIndex
preferences constraints ta... | 1,302 | resolveDependencies platform comp solver params =
fmap (mkInstallPlan platform comp)
$ runSolver solver (SolverConfig reorderGoals indGoals noReinstalls
shadowing maxBkjumps)
platform comp installedPkgIndex sourcePkgIndex
preferences constraints ta... | 1,302 | resolveDependencies platform comp solver params =
fmap (mkInstallPlan platform comp)
$ runSolver solver (SolverConfig reorderGoals indGoals noReinstalls
shadowing maxBkjumps)
platform comp installedPkgIndex sourcePkgIndex
preferences constraints ta... | 1,302 | false | false | 3 | 9 | 488 | 146 | 76 | 70 | null | null |
yusent/cfdis | src/CFDI/XmlNode.hs | mit | requireChild :: XmlNode n => String -> Element -> Either XmlParseError n
requireChild childName parent = do
node <- justErr (ElemNotFound childName) $ findChildByName childName parent
case parseNode node of
Left err -> Left $ ParseErrorInChild childName err
Right pn -> Right pn | 290 | requireChild :: XmlNode n => String -> Element -> Either XmlParseError n
requireChild childName parent = do
node <- justErr (ElemNotFound childName) $ findChildByName childName parent
case parseNode node of
Left err -> Left $ ParseErrorInChild childName err
Right pn -> Right pn | 290 | requireChild childName parent = do
node <- justErr (ElemNotFound childName) $ findChildByName childName parent
case parseNode node of
Left err -> Left $ ParseErrorInChild childName err
Right pn -> Right pn | 217 | false | true | 0 | 11 | 54 | 101 | 45 | 56 | null | null |
wochinge/CacheSimulator | src/Fifo.hs | bsd-3-clause | to :: C.File -> Fifo -> Fifo
to f@(fileId, fileSize) cache
| f `C.biggerAsMax` cache = cache
| C.fits f cache = cache {files = files', prio = currentPrio + 1, size = size cache + fileSize}
| otherwise = to f $ removeFirst cache
where files' = H.insert fileId currentPrio fileSize $ files cache
... | 344 | to :: C.File -> Fifo -> Fifo
to f@(fileId, fileSize) cache
| f `C.biggerAsMax` cache = cache
| C.fits f cache = cache {files = files', prio = currentPrio + 1, size = size cache + fileSize}
| otherwise = to f $ removeFirst cache
where files' = H.insert fileId currentPrio fileSize $ files cache
... | 344 | to f@(fileId, fileSize) cache
| f `C.biggerAsMax` cache = cache
| C.fits f cache = cache {files = files', prio = currentPrio + 1, size = size cache + fileSize}
| otherwise = to f $ removeFirst cache
where files' = H.insert fileId currentPrio fileSize $ files cache
currentPrio = prio cache | 315 | false | true | 2 | 9 | 84 | 156 | 77 | 79 | null | null |
AndreasPK/stack | src/Stack/Build/ConstructPlan.hs | bsd-3-clause | toolWarningText (AmbiguousToolsFound toolName pkgName options) =
"Multiple packages found in snapshot which provide a " <>
T.pack (show toolName) <>
" exeuctable, which is a build-tool dependency of " <>
T.pack (show (packageNameString pkgName)) <>
", so none will be installed.\n" <>
"Here's the... | 498 | toolWarningText (AmbiguousToolsFound toolName pkgName options) =
"Multiple packages found in snapshot which provide a " <>
T.pack (show toolName) <>
" exeuctable, which is a build-tool dependency of " <>
T.pack (show (packageNameString pkgName)) <>
", so none will be installed.\n" <>
"Here's the... | 498 | toolWarningText (AmbiguousToolsFound toolName pkgName options) =
"Multiple packages found in snapshot which provide a " <>
T.pack (show toolName) <>
" exeuctable, which is a build-tool dependency of " <>
T.pack (show (packageNameString pkgName)) <>
", so none will be installed.\n" <>
"Here's the... | 498 | false | false | 0 | 14 | 104 | 90 | 43 | 47 | null | null |
JoeyEremondi/elm-type-effect | src/Generate/JavaScript.hs | bsd-3-clause | literal :: Literal -> Expression ()
literal lit =
case lit of
Chr c -> _Utils "chr" <| string [c]
Str s -> string s
IntNum n -> IntLit () n
FloatNum n -> NumLit () n
Boolean b -> BoolLit () b | 216 | literal :: Literal -> Expression ()
literal lit =
case lit of
Chr c -> _Utils "chr" <| string [c]
Str s -> string s
IntNum n -> IntLit () n
FloatNum n -> NumLit () n
Boolean b -> BoolLit () b | 216 | literal lit =
case lit of
Chr c -> _Utils "chr" <| string [c]
Str s -> string s
IntNum n -> IntLit () n
FloatNum n -> NumLit () n
Boolean b -> BoolLit () b | 180 | false | true | 0 | 10 | 67 | 109 | 49 | 60 | null | null |
mariefarrell/Hets | OWL2/Print.hs | gpl-2.0 | printObjPropExp :: ObjectPropertyExpression -> Doc
printObjPropExp obExp = case obExp of
ObjectProp ou -> pretty ou
ObjectInverseOf iopExp -> keyword inverseS <+> printObjPropExp iopExp | 193 | printObjPropExp :: ObjectPropertyExpression -> Doc
printObjPropExp obExp = case obExp of
ObjectProp ou -> pretty ou
ObjectInverseOf iopExp -> keyword inverseS <+> printObjPropExp iopExp | 193 | printObjPropExp obExp = case obExp of
ObjectProp ou -> pretty ou
ObjectInverseOf iopExp -> keyword inverseS <+> printObjPropExp iopExp | 142 | false | true | 0 | 9 | 31 | 53 | 24 | 29 | null | null |
harendra-kumar/asyncly | test/Prop.hs | bsd-3-clause | zipAsyncMonadic
:: IsStream t
=> ([Int] -> t IO Int)
-> ([(Int, Int)] -> [(Int, Int)] -> Bool)
-> (t IO (Int, Int) -> SerialT IO (Int, Int))
-> ([Int], [Int])
-> Property
zipAsyncMonadic constr eq t (a, b) = withMaxSuccess maxTestCount $
monadicIO $ do
stream1 <-
run
... | 878 | zipAsyncMonadic
:: IsStream t
=> ([Int] -> t IO Int)
-> ([(Int, Int)] -> [(Int, Int)] -> Bool)
-> (t IO (Int, Int) -> SerialT IO (Int, Int))
-> ([Int], [Int])
-> Property
zipAsyncMonadic constr eq t (a, b) = withMaxSuccess maxTestCount $
monadicIO $ do
stream1 <-
run
... | 878 | zipAsyncMonadic constr eq t (a, b) = withMaxSuccess maxTestCount $
monadicIO $ do
stream1 <-
run
((S.toList . t)
(S.zipWithM (curry return) (constr a) (constr b)))
stream2 <-
run
((S.toList . t)
(S.zipA... | 683 | false | true | 2 | 15 | 263 | 315 | 160 | 155 | null | null |
ezyang/ghc | compiler/nativeGen/Dwarf.hs | bsd-3-clause | mkDwarfARange :: DebugBlock -> DwarfARange
mkDwarfARange proc = DwarfARange start end
where
start = dblCLabel proc
end = mkAsmTempEndLabel start
-- | Header for a compilation unit, establishing global format
-- parameters | 232 | mkDwarfARange :: DebugBlock -> DwarfARange
mkDwarfARange proc = DwarfARange start end
where
start = dblCLabel proc
end = mkAsmTempEndLabel start
-- | Header for a compilation unit, establishing global format
-- parameters | 232 | mkDwarfARange proc = DwarfARange start end
where
start = dblCLabel proc
end = mkAsmTempEndLabel start
-- | Header for a compilation unit, establishing global format
-- parameters | 189 | false | true | 2 | 7 | 42 | 57 | 23 | 34 | null | null |
geophf/1HaskellADay | exercises/HAD/Wikidata/Query/Builder.hs | mit | doshow (OPTIONAL opt) = "OPTIONAL ( " ++ show opt ++ " )" | 57 | doshow (OPTIONAL opt) = "OPTIONAL ( " ++ show opt ++ " )" | 57 | doshow (OPTIONAL opt) = "OPTIONAL ( " ++ show opt ++ " )" | 57 | false | false | 0 | 7 | 12 | 27 | 12 | 15 | null | null |
k0001/reflex-dom | src/Reflex/Dom/Widget/Input.hs | bsd-3-clause | dropdown :: forall k t m. (MonadWidget t m, Ord k, Show k, Read k) => k -> Dynamic t (Map k String) -> DropdownConfig t k -> m (Dropdown t k)
dropdown k0 options (DropdownConfig setK attrs) = do
(eRaw, _) <- elDynAttr' "select" attrs $ do
optionsWithDefault <- mapDyn (`Map.union` (k0 =: "")) options
listWithK... | 989 | dropdown :: forall k t m. (MonadWidget t m, Ord k, Show k, Read k) => k -> Dynamic t (Map k String) -> DropdownConfig t k -> m (Dropdown t k)
dropdown k0 options (DropdownConfig setK attrs) = do
(eRaw, _) <- elDynAttr' "select" attrs $ do
optionsWithDefault <- mapDyn (`Map.union` (k0 =: "")) options
listWithK... | 989 | dropdown k0 options (DropdownConfig setK attrs) = do
(eRaw, _) <- elDynAttr' "select" attrs $ do
optionsWithDefault <- mapDyn (`Map.union` (k0 =: "")) options
listWithKey optionsWithDefault $ \k v -> do
elAttr "option" ("value" =: show k <> if k == k0 then "selected" =: "selected" else mempty) $ dynText... | 847 | false | true | 0 | 20 | 217 | 410 | 195 | 215 | null | null |
qzchenwl/IHaskell | main/Main.hs | mit | ihaskell (Args ConvertLhs args) = showingHelp ConvertLhs args $ convert args | 76 | ihaskell (Args ConvertLhs args) = showingHelp ConvertLhs args $ convert args | 76 | ihaskell (Args ConvertLhs args) = showingHelp ConvertLhs args $ convert args | 76 | false | false | 0 | 7 | 10 | 29 | 13 | 16 | null | null |
achirkin/qua-kit | apps/hs/qua-server/src/Handler/QuaViewSettings.hs | mit | -- | These settings are for students when we know their exercise id,
-- can save exercise submissions, write reviews, etc.
getQuaViewExerciseSettingsR :: ExerciseId -> UserId -> Handler Value
getQuaViewExerciseSettingsR exId uId = do
e <- runDB $ get404 exId
quaViewSettingsR (SubmissionR exId uId) (Just exId) (Ju... | 723 | getQuaViewExerciseSettingsR :: ExerciseId -> UserId -> Handler Value
getQuaViewExerciseSettingsR exId uId = do
e <- runDB $ get404 exId
quaViewSettingsR (SubmissionR exId uId) (Just exId) (Just uId)
QuaTypes.Permissions
{ canEditProperties = exerciseCanEditProperties e
, canEraseReloadGeometr... | 598 | getQuaViewExerciseSettingsR exId uId = do
e <- runDB $ get404 exId
quaViewSettingsR (SubmissionR exId uId) (Just exId) (Just uId)
QuaTypes.Permissions
{ canEditProperties = exerciseCanEditProperties e
, canEraseReloadGeometry = False
, canAddDeleteGeometry = exerciseCanAddDeleteGeom ... | 529 | true | true | 0 | 10 | 185 | 133 | 72 | 61 | null | null |
input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/DHT/Real/CLI.hs | mit | dhtNodeOption :: Opt.Parser DHTNode
dhtNodeOption =
Opt.option (fromParsec dhtNodeParser) $
Opt.long "kademlia-peer" <>
Opt.metavar "HOST:PORT/HOST_ID" <>
Opt.help "Identifier of a node in a Kademlia network" | 236 | dhtNodeOption :: Opt.Parser DHTNode
dhtNodeOption =
Opt.option (fromParsec dhtNodeParser) $
Opt.long "kademlia-peer" <>
Opt.metavar "HOST:PORT/HOST_ID" <>
Opt.help "Identifier of a node in a Kademlia network" | 236 | dhtNodeOption =
Opt.option (fromParsec dhtNodeParser) $
Opt.long "kademlia-peer" <>
Opt.metavar "HOST:PORT/HOST_ID" <>
Opt.help "Identifier of a node in a Kademlia network" | 200 | false | true | 0 | 7 | 52 | 60 | 26 | 34 | null | null |
herngyi/hmol | Geometry.hs | gpl-3.0 | (|*|) :: Double -> Vector -> Vector
k |*| Vector x y z = Vector (k * x) (k * y) (k * z) | 88 | (|*|) :: Double -> Vector -> Vector
k |*| Vector x y z = Vector (k * x) (k * y) (k * z) | 87 | k |*| Vector x y z = Vector (k * x) (k * y) (k * z) | 51 | false | true | 0 | 9 | 24 | 66 | 33 | 33 | null | null |
jberryman/chan-benchmarks | TestAtomics.hs | bsd-3-clause | testCAS_ABA_0_modAfterAtomicMod = do
barrier <- newIORef ()
a <- newIORef ()
ta <- readForCAS a
atomicModifyIORef' a (\u-> (u,u))
modifyIORef a (const ()) -- i.e. readIORef >> writeIORef
(res, _) <- casIORef a ta ()
print res
-- ...whereas this one returns False again | 307 | testCAS_ABA_0_modAfterAtomicMod = do
barrier <- newIORef ()
a <- newIORef ()
ta <- readForCAS a
atomicModifyIORef' a (\u-> (u,u))
modifyIORef a (const ()) -- i.e. readIORef >> writeIORef
(res, _) <- casIORef a ta ()
print res
-- ...whereas this one returns False again | 307 | testCAS_ABA_0_modAfterAtomicMod = do
barrier <- newIORef ()
a <- newIORef ()
ta <- readForCAS a
atomicModifyIORef' a (\u-> (u,u))
modifyIORef a (const ()) -- i.e. readIORef >> writeIORef
(res, _) <- casIORef a ta ()
print res
-- ...whereas this one returns False again | 307 | false | false | 0 | 10 | 82 | 108 | 51 | 57 | null | null |
mhcurylo/scheme-haskell-tutorial | src/Evaluator.hs | bsd-3-clause | lispCond :: Env -> [LispVal] -> IOThrowsError LispVal
lispCond env [] = evalAllReturnLast env [] | 96 | lispCond :: Env -> [LispVal] -> IOThrowsError LispVal
lispCond env [] = evalAllReturnLast env [] | 96 | lispCond env [] = evalAllReturnLast env [] | 42 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
sdiehl/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) =
liftM5 HsCmdArrApp
(return arr_ty)
(addTickLHsExpr e1)
(addTickLHsExpr e2)
(return ty1)
(return lr) | 232 | addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) =
liftM5 HsCmdArrApp
(return arr_ty)
(addTickLHsExpr e1)
(addTickLHsExpr e2)
(return ty1)
(return lr) | 232 | addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) =
liftM5 HsCmdArrApp
(return arr_ty)
(addTickLHsExpr e1)
(addTickLHsExpr e2)
(return ty1)
(return lr) | 232 | false | false | 0 | 7 | 103 | 66 | 32 | 34 | null | null |
unisonweb/platform | unison-core/src/Unison/DataDeclaration.hs | mit | constructorVars :: DataDeclaration v a -> [v]
constructorVars dd = fst <$> constructors dd | 90 | constructorVars :: DataDeclaration v a -> [v]
constructorVars dd = fst <$> constructors dd | 90 | constructorVars dd = fst <$> constructors dd | 44 | false | true | 2 | 8 | 13 | 39 | 17 | 22 | null | null |
peter-fogg/pardoc | src/Text/Pandoc/Readers/EPUB.hs | gpl-2.0 | mkE :: MonadError String m => String -> Maybe a -> m a
mkE s = maybe (throwError s) return | 90 | mkE :: MonadError String m => String -> Maybe a -> m a
mkE s = maybe (throwError s) return | 90 | mkE s = maybe (throwError s) return | 35 | false | true | 0 | 8 | 19 | 48 | 22 | 26 | null | null |
bgamari/text | tests/Tests/Properties.hs | bsd-2-clause | tl_justifyLeft k c = justifyLeft j c `eqP`
(unpackS . TL.justifyLeft (fromIntegral j) c)
where j = fromIntegral (k :: Word8) | 149 | tl_justifyLeft k c = justifyLeft j c `eqP`
(unpackS . TL.justifyLeft (fromIntegral j) c)
where j = fromIntegral (k :: Word8) | 149 | tl_justifyLeft k c = justifyLeft j c `eqP`
(unpackS . TL.justifyLeft (fromIntegral j) c)
where j = fromIntegral (k :: Word8) | 149 | false | false | 0 | 10 | 45 | 59 | 30 | 29 | null | null |
shlevy/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | -- | Make a sigma ty where all type variables are 'Inferred'. That is,
-- they cannot be used with visible type application.
mkInfSigmaTy :: [TyVar] -> [PredType] -> Type -> Type
mkInfSigmaTy tyvars theta ty = mkSigmaTy (mkTyVarBinders Inferred tyvars) theta ty | 261 | mkInfSigmaTy :: [TyVar] -> [PredType] -> Type -> Type
mkInfSigmaTy tyvars theta ty = mkSigmaTy (mkTyVarBinders Inferred tyvars) theta ty | 136 | mkInfSigmaTy tyvars theta ty = mkSigmaTy (mkTyVarBinders Inferred tyvars) theta ty | 82 | true | true | 0 | 7 | 42 | 53 | 28 | 25 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M12/D08/Solution.hs | mit | nextWord :: [String] -> WordPool -> [(String, WordPool)]
{--
There's a different, monotomically smaller, word-pool for each word selected.
For example, followOns ["ΜΗΛΟΝ", "ΗΔΟΝΗ"] {"ΛΟΓΟΣ", "ΟΝΟΜΑ", "ΝΗΣΑΣ"} ~>
[("ΛΟΓΟΣ", [{"ΟΝΟΜΑ"}, {"ΝΗΣΑΣ"}])]
I mean, no duh, but it'll be nice to verify that, yes. And then veri... | 880 | nextWord :: [String] -> WordPool -> [(String, WordPool)]
nextWord chosenwords pool =
let raw = setup pool -- setup (Set.filter (startsWith chosenwords) pool)
in raw >>= \(word, words) ->
let newpool = Set.filter (startsWith (chosenwords ++ [word])) words
in guard (not (null newpool)) >> return (word,... | 329 | nextWord chosenwords pool =
let raw = setup pool -- setup (Set.filter (startsWith chosenwords) pool)
in raw >>= \(word, words) ->
let newpool = Set.filter (startsWith (chosenwords ++ [word])) words
in guard (not (null newpool)) >> return (word, newpool) | 272 | true | true | 0 | 18 | 161 | 129 | 68 | 61 | null | null |
garykrige/project_euler | Haskell/Math/Combinat/Permutations.hs | gpl-2.0 | - | Checks whether the input is a permutation of the numbers @[1..n]@.
isPermutation :: [Int] -> Bool
isPermutation xs = (ar!0 == 0) && and [ ar!j == 1 | j<-[1..n] ] where
n = length xs
-- the zero index is an unidiomatic hack
ar = accumArray (+) 0 (0,n) $ map f xs
f :: Int -> (Int,Int)
f j = if j<1 || j>n t... | 365 | isPermutation :: [Int] -> Bool
isPermutation xs = (ar!0 == 0) && and [ ar!j == 1 | j<-[1..n] ] where
n = length xs
-- the zero index is an unidiomatic hack
ar = accumArray (+) 0 (0,n) $ map f xs
f :: Int -> (Int,Int)
f j = if j<1 || j>n then (0,1) else (j,1)
-- | Checks the input. | 293 | isPermutation xs = (ar!0 == 0) && and [ ar!j == 1 | j<-[1..n] ] where
n = length xs
-- the zero index is an unidiomatic hack
ar = accumArray (+) 0 (0,n) $ map f xs
f :: Int -> (Int,Int)
f j = if j<1 || j>n then (0,1) else (j,1)
-- | Checks the input. | 262 | true | true | 2 | 10 | 89 | 206 | 108 | 98 | null | null |
UweSchmidt/ppl2 | src/PPL2/VM/Control/Types.hs | mit | -- ----------------------------------------
--
-- lift IO commands and catch all IO exceptions
io :: IO a -> MicroCode v a
io x = do
r <- liftIO $ try x
either (abort . IOError . showExc) return r
where
showExc :: IOException -> String
showExc = show | 265 | io :: IO a -> MicroCode v a
io x = do
r <- liftIO $ try x
either (abort . IOError . showExc) return r
where
showExc :: IOException -> String
showExc = show | 169 | io x = do
r <- liftIO $ try x
either (abort . IOError . showExc) return r
where
showExc :: IOException -> String
showExc = show | 141 | true | true | 0 | 10 | 61 | 92 | 42 | 50 | null | null |
shmookey/pure | src/Rel/Git.hs | bsd-3-clause | formatRepoUrl :: RepoUrl -> String
formatRepoUrl x =
concat
[ (formatProtocol $ protocol x) ++ "://"
, formatUser $ user x
, hostname x
, "/" ++ (path x)
]
where
formatUser (Just user) = user ++ "@"
formatUser Nothing = "" | 259 | formatRepoUrl :: RepoUrl -> String
formatRepoUrl x =
concat
[ (formatProtocol $ protocol x) ++ "://"
, formatUser $ user x
, hostname x
, "/" ++ (path x)
]
where
formatUser (Just user) = user ++ "@"
formatUser Nothing = "" | 259 | formatRepoUrl x =
concat
[ (formatProtocol $ protocol x) ++ "://"
, formatUser $ user x
, hostname x
, "/" ++ (path x)
]
where
formatUser (Just user) = user ++ "@"
formatUser Nothing = "" | 224 | false | true | 1 | 10 | 78 | 96 | 48 | 48 | null | null |
bennofs/cabal | cabal-install/Main.hs | bsd-3-clause | -- | Used as an entry point when cabal-install needs to invoke itself
-- as a setup script. This can happen e.g. when doing parallel builds.
--
actAsSetupAction :: ActAsSetupFlags -> [String] -> Action
actAsSetupAction actAsSetupFlags args _globalFlags =
let bt = fromFlag (actAsSetupBuildType actAsSetupFlags)
in ca... | 643 | actAsSetupAction :: ActAsSetupFlags -> [String] -> Action
actAsSetupAction actAsSetupFlags args _globalFlags =
let bt = fromFlag (actAsSetupBuildType actAsSetupFlags)
in case bt of
Simple -> Simple.defaultMainArgs args
Configure -> Simple.defaultMainWithHooksArgs
Simple.autoconfUserHook... | 499 | actAsSetupAction actAsSetupFlags args _globalFlags =
let bt = fromFlag (actAsSetupBuildType actAsSetupFlags)
in case bt of
Simple -> Simple.defaultMainArgs args
Configure -> Simple.defaultMainWithHooksArgs
Simple.autoconfUserHooks args
Make -> Make.defaultMainArgs args
Cust... | 441 | true | true | 0 | 11 | 136 | 117 | 57 | 60 | null | null |
vincenthz/hs-foundation | basement/Basement/BoxedArray.hs | bsd-3-clause | -- | write to a cell in a mutable array without bounds checking.
--
-- Writing with invalid bounds will corrupt memory and your program will
-- become unreliable. use 'write' if unsure.
unsafeWrite :: PrimMonad prim => MArray ty (PrimState prim) -> Offset ty -> ty -> prim ()
unsafeWrite (MArray start _ ma) ofs v =
... | 360 | unsafeWrite :: PrimMonad prim => MArray ty (PrimState prim) -> Offset ty -> ty -> prim ()
unsafeWrite (MArray start _ ma) ofs v =
primMutableArrayWrite ma (start + ofs) v | 174 | unsafeWrite (MArray start _ ma) ofs v =
primMutableArrayWrite ma (start + ofs) v | 84 | true | true | 0 | 10 | 67 | 84 | 42 | 42 | null | null |
jamshidh/ethereum-data-sql | src/Blockchain/Data/Json.hs | bsd-3-clause | rawTransactionSemantics :: RawTransaction -> TransactionType
rawTransactionSemantics t@(RawTransaction fa non gp gl ta val cod v r s bid bn h) = work
where work | (not (isAddr ta)) = Contract
| (isAddr ta) && ((B.length cod) > 0) = FunctionCall
| otherwise = Transfer | 313 | rawTransactionSemantics :: RawTransaction -> TransactionType
rawTransactionSemantics t@(RawTransaction fa non gp gl ta val cod v r s bid bn h) = work
where work | (not (isAddr ta)) = Contract
| (isAddr ta) && ((B.length cod) > 0) = FunctionCall
| otherwise = Transfer | 313 | rawTransactionSemantics t@(RawTransaction fa non gp gl ta val cod v r s bid bn h) = work
where work | (not (isAddr ta)) = Contract
| (isAddr ta) && ((B.length cod) > 0) = FunctionCall
| otherwise = Transfer | 252 | false | true | 0 | 13 | 89 | 120 | 59 | 61 | null | null |
bitc/crap-chopper-game | Main.hs | mit | goLoop :: Window -> IO ()
goLoop window = initDeltaTimeData >>= loop window initGameState initProcessInputData | 110 | goLoop :: Window -> IO ()
goLoop window = initDeltaTimeData >>= loop window initGameState initProcessInputData | 110 | goLoop window = initDeltaTimeData >>= loop window initGameState initProcessInputData | 84 | false | true | 0 | 7 | 14 | 34 | 16 | 18 | null | null |
hackern/halfs | Halfs/SuperBlock.hs | bsd-3-clause | cleanMark :: Word64
cleanMark = 0x2357111317192329 | 50 | cleanMark :: Word64
cleanMark = 0x2357111317192329 | 50 | cleanMark = 0x2357111317192329 | 30 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
snoyberg/ghc | compiler/utils/Outputable.hs | bsd-3-clause | pprPgmError :: String -> SDoc -> a
-- ^ Throw an exception saying "bug in pgm being compiled" (used for unusual program errors)
pprPgmError = pgmErrorDoc | 153 | pprPgmError :: String -> SDoc -> a
pprPgmError = pgmErrorDoc | 60 | pprPgmError = pgmErrorDoc | 25 | true | true | 0 | 6 | 25 | 20 | 11 | 9 | null | null |
Erdwolf/autotool-bonn | src/Syntax/Generator.hs | gpl-2.0 | frequency xs0 = choose (1 :: Int, tot) >>= (\n -> pick n xs0 0)
where
tot = sum (map fst xs0)
pick n ((k,x):xs) i
| n <= k = x <|> frequency (xs0 \! i)
| otherwise = pick (n-k) xs (succ n)
pick _ _ _ = fail "pick used with empty list" | 254 | frequency xs0 = choose (1 :: Int, tot) >>= (\n -> pick n xs0 0)
where
tot = sum (map fst xs0)
pick n ((k,x):xs) i
| n <= k = x <|> frequency (xs0 \! i)
| otherwise = pick (n-k) xs (succ n)
pick _ _ _ = fail "pick used with empty list" | 254 | frequency xs0 = choose (1 :: Int, tot) >>= (\n -> pick n xs0 0)
where
tot = sum (map fst xs0)
pick n ((k,x):xs) i
| n <= k = x <|> frequency (xs0 \! i)
| otherwise = pick (n-k) xs (succ n)
pick _ _ _ = fail "pick used with empty list" | 254 | false | false | 6 | 8 | 75 | 170 | 79 | 91 | null | null |
zohl/postgresql-simple-bind | tests/Test/PGIdentifier.hs | bsd-3-clause | spec :: Spec
spec = do
describe "pgNormalIdentifier" $ do
propParsingWorks pgNormalIdentifier (Proxy :: Proxy TestPGNormalIdentifier)
let prop' = propParserRight (tagWith (Proxy :: Proxy TestPGNormalIdentifier) pgNormalIdentifier)
prop' "the first symbol is not '$'" . flip shouldSatisfy $ \s -> (T.head s)... | 621 | spec :: Spec
spec = do
describe "pgNormalIdentifier" $ do
propParsingWorks pgNormalIdentifier (Proxy :: Proxy TestPGNormalIdentifier)
let prop' = propParserRight (tagWith (Proxy :: Proxy TestPGNormalIdentifier) pgNormalIdentifier)
prop' "the first symbol is not '$'" . flip shouldSatisfy $ \s -> (T.head s)... | 621 | spec = do
describe "pgNormalIdentifier" $ do
propParsingWorks pgNormalIdentifier (Proxy :: Proxy TestPGNormalIdentifier)
let prop' = propParserRight (tagWith (Proxy :: Proxy TestPGNormalIdentifier) pgNormalIdentifier)
prop' "the first symbol is not '$'" . flip shouldSatisfy $ \s -> (T.head s) /= '$'
p... | 608 | false | true | 0 | 17 | 105 | 184 | 87 | 97 | null | null |
mzini/gubs | src/GUBS/Interpretation.hs | mit | empty :: Interpretation f c
empty = Inter M.empty | 49 | empty :: Interpretation f c
empty = Inter M.empty | 49 | empty = Inter M.empty | 21 | false | true | 0 | 6 | 8 | 21 | 10 | 11 | null | null |
meteogrid/mime-mail-parser | Network/Mail/Mime/Parser/Internal/Rfc2045.hs | bsd-3-clause | content_type :: Parser Field
content_type
= header "Content-Type" $
ContentType <$> type_
<*> ("/"*>subtype)
<*> many (trim ";" *> content_type_parm) | 193 | content_type :: Parser Field
content_type
= header "Content-Type" $
ContentType <$> type_
<*> ("/"*>subtype)
<*> many (trim ";" *> content_type_parm) | 193 | content_type
= header "Content-Type" $
ContentType <$> type_
<*> ("/"*>subtype)
<*> many (trim ";" *> content_type_parm) | 164 | false | true | 0 | 9 | 63 | 55 | 26 | 29 | null | null |
GRACeFUL-project/haskelzinc | src/Interfaces/FZSolutionParser.hs | bsd-3-clause | parseAll :: Parser a -> P.SourceName -> String -> Either P.ParseError a
parseAll = P.parse | 90 | parseAll :: Parser a -> P.SourceName -> String -> Either P.ParseError a
parseAll = P.parse | 90 | parseAll = P.parse | 18 | false | true | 0 | 10 | 14 | 43 | 19 | 24 | null | null |
afwlehmann/rhm-io-iter | src/RHM/EnumeratorT.hs | bsd-3-clause | enumerate _ m = m | 22 | enumerate _ m = m | 22 | enumerate _ m = m | 22 | false | false | 0 | 5 | 9 | 11 | 5 | 6 | null | null |
hth313/hthforth | src/Translator/Expression.hs | bsd-2-clause | neq = operator "!=" (bool2Num (/=)) | 35 | neq = operator "!=" (bool2Num (/=)) | 35 | neq = operator "!=" (bool2Num (/=)) | 35 | false | false | 0 | 7 | 5 | 19 | 10 | 9 | null | null |
ant0nsc/bond | compiler/tests/Main.hs | mit | tests :: TestTree
tests = testGroup "Compiler tests"
[ testGroup "AST"
[ localOption (QuickCheckMaxSize 15) $
testProperty "roundtrip" roundtripAST
, testGroup "Compare .bond and .json"
[ testCase "attributes" $ compareAST "attributes"
, testCase "basic types" $ c... | 5,124 | tests :: TestTree
tests = testGroup "Compiler tests"
[ testGroup "AST"
[ localOption (QuickCheckMaxSize 15) $
testProperty "roundtrip" roundtripAST
, testGroup "Compare .bond and .json"
[ testCase "attributes" $ compareAST "attributes"
, testCase "basic types" $ c... | 5,124 | tests = testGroup "Compiler tests"
[ testGroup "AST"
[ localOption (QuickCheckMaxSize 15) $
testProperty "roundtrip" roundtripAST
, testGroup "Compare .bond and .json"
[ testCase "attributes" $ compareAST "attributes"
, testCase "basic types" $ compareAST "basic_t... | 5,106 | false | true | 0 | 14 | 1,860 | 717 | 357 | 360 | null | null |
icyfork/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | prop_readExtglob1 = isOk readExtglob "!(*.mp3)" | 47 | prop_readExtglob1 = isOk readExtglob "!(*.mp3)" | 47 | prop_readExtglob1 = isOk readExtglob "!(*.mp3)" | 47 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
beni55/hermit | src/HERMIT/PrettyPrinter/AST.hs | bsd-2-clause | ---------------------------------------------------------------------------
coText :: String -> DocH
coText = coercionColor . text | 131 | coText :: String -> DocH
coText = coercionColor . text | 54 | coText = coercionColor . text | 29 | true | true | 0 | 7 | 11 | 27 | 12 | 15 | null | null |
d0kt0r0/estuary | client/src/Estuary/Languages/Hydra/Parser.hs | gpl-3.0 | sourceAsArgument :: Parser Source
sourceAsArgument = try $ choice [
try outputAsSource, --o0,o1,o2,o3
try source -- osc()
] | 129 | sourceAsArgument :: Parser Source
sourceAsArgument = try $ choice [
try outputAsSource, --o0,o1,o2,o3
try source -- osc()
] | 129 | sourceAsArgument = try $ choice [
try outputAsSource, --o0,o1,o2,o3
try source -- osc()
] | 95 | false | true | 0 | 8 | 23 | 35 | 18 | 17 | null | null |
oldmanmike/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | lvectDeclName (L _ (HsVectClassOut cls)) = getName cls | 66 | lvectDeclName (L _ (HsVectClassOut cls)) = getName cls | 66 | lvectDeclName (L _ (HsVectClassOut cls)) = getName cls | 66 | false | false | 0 | 9 | 19 | 26 | 12 | 14 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Lex.hs | bsd-3-clause | runDList :: DList a -> [a]
runDList (DList run) = run [] | 56 | runDList :: DList a -> [a]
runDList (DList run) = run [] | 56 | runDList (DList run) = run [] | 29 | false | true | 0 | 7 | 11 | 35 | 17 | 18 | null | null |
osa1/Idris-dev | src/Idris/Core/Unify.hs | bsd-3-clause | recoverable (P (TCon _ _) x _) (UType _) = False | 48 | recoverable (P (TCon _ _) x _) (UType _) = False | 48 | recoverable (P (TCon _ _) x _) (UType _) = False | 48 | false | false | 0 | 9 | 10 | 35 | 17 | 18 | null | null |
xu-hao/QueryArrow | QueryArrow-rpc-socket/src/QueryArrow/RPC/Service/Service/Common.hs | bsd-3-clause | worker :: (IDatabase db, DBFormulaType db ~ FormulaT, RowType (StatementType (ConnectionType db)) ~ MapResultRow) => Handle -> db -> ConnectionType db -> IO ()
worker handle tdb conn = do
t0 <- getCurrentTime
req <- receiveMsgPack handle
infoM "RPC_TCP_SERVER" ("received ... | 3,062 | worker :: (IDatabase db, DBFormulaType db ~ FormulaT, RowType (StatementType (ConnectionType db)) ~ MapResultRow) => Handle -> db -> ConnectionType db -> IO ()
worker handle tdb conn = do
t0 <- getCurrentTime
req <- receiveMsgPack handle
infoM "RPC_TCP_SERVER" ("received ... | 3,062 | worker handle tdb conn = do
t0 <- getCurrentTime
req <- receiveMsgPack handle
infoM "RPC_TCP_SERVER" ("received message " ++ show req)
(t2, t3, b) <- case req of
Nothing -> do
sendMsgPack handle (errorSet (-1, "c... | 2,902 | false | true | 0 | 27 | 1,676 | 666 | 308 | 358 | null | null |
pkukielka/99-haskell-problems | tests/Main.hs | mit | tests :: [TF.Test]
tests =
[
testGroup "myLast" [
testProperty "myLast" (prop_myLast myLast),
testProperty "myLast'" (prop_myLast myLast')
],
testGroup "myButLast" [
testProperty "myButLast" (prop_myButLast myButLast),
testProperty "myButLast'" (prop_myB... | 5,747 | tests :: [TF.Test]
tests =
[
testGroup "myLast" [
testProperty "myLast" (prop_myLast myLast),
testProperty "myLast'" (prop_myLast myLast')
],
testGroup "myButLast" [
testProperty "myButLast" (prop_myButLast myButLast),
testProperty "myButLast'" (prop_myB... | 5,747 | tests =
[
testGroup "myLast" [
testProperty "myLast" (prop_myLast myLast),
testProperty "myLast'" (prop_myLast myLast')
],
testGroup "myButLast" [
testProperty "myButLast" (prop_myButLast myButLast),
testProperty "myButLast'" (prop_myButLast myButLast'),... | 5,728 | false | true | 0 | 20 | 1,822 | 1,778 | 928 | 850 | null | null |
dorchard/camfort | src/Camfort/Specification/Stencils/Annotation.hs | apache-2.0 | -- | Set the annotation's stencil specification to a region alias.
giveRegionSpec :: Syn.RegionDecl -> SA -> SA
giveRegionSpec spec = setSpec (RegionDecl spec) | 159 | giveRegionSpec :: Syn.RegionDecl -> SA -> SA
giveRegionSpec spec = setSpec (RegionDecl spec) | 92 | giveRegionSpec spec = setSpec (RegionDecl spec) | 47 | true | true | 0 | 8 | 23 | 39 | 18 | 21 | null | null |
JAnthelme/relation-tool | test/Spec.hs | bsd-3-clause | -- self union is identity
prop01 :: QCRelvar -> Bool
prop01 (QCRelvar r) = union r r == r | 89 | prop01 :: QCRelvar -> Bool
prop01 (QCRelvar r) = union r r == r | 63 | prop01 (QCRelvar r) = union r r == r | 36 | true | true | 0 | 9 | 18 | 40 | 18 | 22 | null | null |
wavewave/fficxx-runtime | lib/FFICXX/Runtime/Cast.hs | bsd-2-clause | xform5 :: (Castable a ca, Castable x1 cx1, Castable x2 cx2, Castable x3 cx3, Castable x4 cx4,
Castable x5 cx5, Castable y cy)
=> (ca -> cx1 -> cx2 -> cx3 -> cx4 -> cx5 -> IO cy) -> a -> x1 -> x2 -> x3 -> x4 -> x5 -> IO y
xform5 f a x1 x2 x3 x4 x5 = f (cast a) (cast x1) (cast x2) (cast x3) (cast x4) (... | 348 | xform5 :: (Castable a ca, Castable x1 cx1, Castable x2 cx2, Castable x3 cx3, Castable x4 cx4,
Castable x5 cx5, Castable y cy)
=> (ca -> cx1 -> cx2 -> cx3 -> cx4 -> cx5 -> IO cy) -> a -> x1 -> x2 -> x3 -> x4 -> x5 -> IO y
xform5 f a x1 x2 x3 x4 x5 = f (cast a) (cast x1) (cast x2) (cast x3) (cast x4) (... | 348 | xform5 f a x1 x2 x3 x4 x5 = f (cast a) (cast x1) (cast x2) (cast x3) (cast x4) (cast x5) >>= return . uncast | 108 | false | true | 0 | 14 | 97 | 213 | 102 | 111 | null | null |
borgsmidt/adv-prog-2013 | src/salsa/SalsaInterp.hs | mit | -- Helper functions that determine new positions based on current position
-- and absolute/relative position information
getToPositions :: Context -> [Position] -> Maybe Pos -> [Position]
getToPositions context positions pos = map (\p -> getToPos context p pos) positions | 271 | getToPositions :: Context -> [Position] -> Maybe Pos -> [Position]
getToPositions context positions pos = map (\p -> getToPos context p pos) positions | 150 | getToPositions context positions pos = map (\p -> getToPos context p pos) positions | 83 | true | true | 0 | 8 | 38 | 65 | 33 | 32 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M09/D08/Solution.hs | mit | -- Now that you have the summaries, build a Merkle tree from them
blockTree :: [Block] -> MerkleTree Block
blockTree = uncurry (foldr insertLeaf)
. (Merkle . mkbranch1 . mkBlockLeaf . head &&& map mkBlockLeaf . tail) | 227 | blockTree :: [Block] -> MerkleTree Block
blockTree = uncurry (foldr insertLeaf)
. (Merkle . mkbranch1 . mkBlockLeaf . head &&& map mkBlockLeaf . tail) | 160 | blockTree = uncurry (foldr insertLeaf)
. (Merkle . mkbranch1 . mkBlockLeaf . head &&& map mkBlockLeaf . tail) | 119 | true | true | 0 | 11 | 47 | 61 | 31 | 30 | null | null |
GaloisInc/hierarchical-exceptions | src/Control/Exception/Hierarchical.hs | apache-2.0 | {-| Creates declarations to implement the 'Exception' instance for a
sub-exception. -}
exceptionHierarchyFunctions :: Name -- ^ the name of the super-exception
-> DecsQ
exceptionHierarchyFunctions super =
[d| toException = toException . sup
where sup = $(conE super)
from... | 402 | exceptionHierarchyFunctions :: Name -- ^ the name of the super-exception
-> DecsQ
exceptionHierarchyFunctions super =
[d| toException = toException . sup
where sup = $(conE super)
fromException = cast . sub <=< fromException
where sub = $(destruct1 super) |] | 315 | exceptionHierarchyFunctions super =
[d| toException = toException . sup
where sup = $(conE super)
fromException = cast . sub <=< fromException
where sub = $(destruct1 super) |] | 202 | true | true | 0 | 5 | 107 | 24 | 15 | 9 | null | null |
keithodulaigh/Hets | QVTR/StatAna.hs | gpl-2.0 | -- ToDo Diagnosis
{- ToDo :: Diagnosis
las Keys no son vacias
los tipos en RelVar existen
los tipos en PrimitiveDomain existen
los nombres de variables en RelVar, PrimitiveDomain, Domain no se repiten
el domModelId del source y target Domain son los de la transformacion
los domMeta del source (de todos lo... | 905 | getObjectTemplates :: Domain -> [ObjectTemplate]
getObjectTemplates dom = template dom : getObjectTemplatesFromOT (template dom) | 128 | getObjectTemplates dom = template dom : getObjectTemplatesFromOT (template dom) | 79 | true | true | 0 | 8 | 169 | 43 | 22 | 21 | null | null |
sgord512/Algebra | Algebra/Rewriting.hs | mit | g :: Function
g m | m == 1 = placeholders .+. (p [T alpha :* 1])
| otherwise = placeholders .+. front .+. back
where front = p [T gamma :* n, T (beta_ r) :* 1]
back = p [(T $ only1 $ R $ Recurrence Latin.G (Suspension g n)) :* 3]
(n, r) = m `divMod` 2
placeholders = p $ emptyConst... | 632 | g :: Function
g m | m == 1 = placeholders .+. (p [T alpha :* 1])
| otherwise = placeholders .+. front .+. back
where front = p [T gamma :* n, T (beta_ r) :* 1]
back = p [(T $ only1 $ R $ Recurrence Latin.G (Suspension g n)) :* 3]
(n, r) = m `divMod` 2
placeholders = p $ emptyConsta... | 631 | g m | m == 1 = placeholders .+. (p [T alpha :* 1])
| otherwise = placeholders .+. front .+. back
where front = p [T gamma :* n, T (beta_ r) :* 1]
back = p [(T $ only1 $ R $ Recurrence Latin.G (Suspension g n)) :* 3]
(n, r) = m `divMod` 2
placeholders = p $ emptyConstantTerms [Sym G... | 617 | false | true | 4 | 14 | 312 | 238 | 118 | 120 | null | null |
sdiehl/ghc | compiler/types/TyCoFVs.hs | bsd-3-clause | noFreeVarsOfType (CoercionTy co) = noFreeVarsOfCo co | 53 | noFreeVarsOfType (CoercionTy co) = noFreeVarsOfCo co | 53 | noFreeVarsOfType (CoercionTy co) = noFreeVarsOfCo co | 53 | false | false | 0 | 7 | 6 | 18 | 8 | 10 | null | null |
wavewave/EventAnalysis | exe/test.hs | bsd-2-clause | -- |
boostBack :: FourMomentum -> PtlInfo -> PtlInfo
boostBack mom pinfo =
let v3 = NL.scale (-1) . beta . fourMomentumToLorentzVector $ mom
lrot = boost v3
v = lrot NL.<> fourMomentumToLorentzVector (pupTo4mom (pup pinfo))
e = v ! 0
px = v ! 1
py = v ! 2
pz = v ! 3
... | 492 | boostBack :: FourMomentum -> PtlInfo -> PtlInfo
boostBack mom pinfo =
let v3 = NL.scale (-1) . beta . fourMomentumToLorentzVector $ mom
lrot = boost v3
v = lrot NL.<> fourMomentumToLorentzVector (pupTo4mom (pup pinfo))
e = v ! 0
px = v ! 1
py = v ! 2
pz = v ! 3
masssqr... | 484 | boostBack mom pinfo =
let v3 = NL.scale (-1) . beta . fourMomentumToLorentzVector $ mom
lrot = boost v3
v = lrot NL.<> fourMomentumToLorentzVector (pupTo4mom (pup pinfo))
e = v ! 0
px = v ! 1
py = v ! 2
pz = v ! 3
masssqr = e*e-px*px-py*py-pz*pz
mass = if masssqr... | 436 | true | true | 0 | 15 | 154 | 221 | 119 | 102 | null | null |
gridaphobe/ghc | compiler/main/DynFlags.hs | bsd-3-clause | --------------------------
setGeneralFlag, unSetGeneralFlag :: GeneralFlag -> DynP ()
setGeneralFlag f = upd (setGeneralFlag' f) | 130 | setGeneralFlag, unSetGeneralFlag :: GeneralFlag -> DynP ()
setGeneralFlag f = upd (setGeneralFlag' f) | 103 | setGeneralFlag f = upd (setGeneralFlag' f) | 44 | true | true | 2 | 8 | 15 | 40 | 18 | 22 | null | null |
lukexi/bindings-Oculus | Bindings/OculusRift.hs | apache-2.0 | -- | Detects or re-detects HMDs and reports the total number detected.
-- Users can get information about each HMD by calling ovrHmd_Create with an index.
--
ovrHmd_Detect :: IO Int
ovrHmd_Detect = fmap fromIntegral c_ovrHmd_Detect | 231 | ovrHmd_Detect :: IO Int
ovrHmd_Detect = fmap fromIntegral c_ovrHmd_Detect | 73 | ovrHmd_Detect = fmap fromIntegral c_ovrHmd_Detect | 49 | true | true | 0 | 5 | 35 | 22 | 12 | 10 | null | null |
farrellm/advent | src/Day6.hs | mit | eol :: GenParser Char st Char
eol = char '\n' | 45 | eol :: GenParser Char st Char
eol = char '\n' | 45 | eol = char '\n' | 15 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
ajhc/drift | src/GetOpt.hs | mit | getNext (a :rest) _ = (NonOpt a,rest) | 54 | getNext (a :rest) _ = (NonOpt a,rest) | 54 | getNext (a :rest) _ = (NonOpt a,rest) | 54 | false | false | 1 | 7 | 23 | 30 | 14 | 16 | null | null |
kawu/concraft | src/NLP/Concraft/Disamb.hs | bsd-2-clause | train
:: X.Word w
=> TrainConf -- ^ Training configuration
-> IO [X.Sent w T.Tag] -- ^ Training data
-> IO [X.Sent w T.Tag] -- ^ Evaluation data
-> IO Disamb -- ^ Resultant model
train TrainConf{..} trainData evalData = do
crf <- CRF.train (length tiersT) ... | 657 | train
:: X.Word w
=> TrainConf -- ^ Training configuration
-> IO [X.Sent w T.Tag] -- ^ Training data
-> IO [X.Sent w T.Tag] -- ^ Evaluation data
-> IO Disamb
train TrainConf{..} trainData evalData = do
crf <- CRF.train (length tiersT) CRF.selectHidden sgdArgsT onDiskT
... | 621 | train TrainConf{..} trainData evalData = do
crf <- CRF.train (length tiersT) CRF.selectHidden sgdArgsT onDiskT
(schemed schema split <$> trainData)
(schemed schema split <$> evalData)
putStr "\nNumber of features: " >> print (CRF.size crf)
return $ Disamb tiersT schemaConfT crf
where
s... | 418 | true | true | 12 | 8 | 190 | 185 | 98 | 87 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | maxHitPoints TerranBunker = 94 | 30 | maxHitPoints TerranBunker = 94 | 30 | maxHitPoints TerranBunker = 94 | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_ACTIVE_VARYING_MAX_LENGTH_NV :: GLenum
gl_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82 | 82 | gl_ACTIVE_VARYING_MAX_LENGTH_NV :: GLenum
gl_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82 | 82 | gl_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82 | 40 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.