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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CindyLinz/Haskell-Hass | src/Lexer.hs | bsd-3-clause | lexer :: B.ByteString -> [Token]
lexer bs = case B.uncons bs of
Nothing -> []
Just (first, bs') ->
if isSpace first then
let
(spaces, bs'') = B.span isSpace bs
lineCount = B.count W._lf spaces
in T_Space spaces lineCount : lexer bs''
else if W._hyphen == first && B.null bs' then
T_Symbol W._hyphen : []
else if isWord first then
takeWord T_Word bs
else case B.uncons bs' of
Nothing -> T_Symbol first : []
Just (second, bs'') -> case isWord second of
True
| first == W._at -> takeIDWord T_Directive bs'
| first == W._percent -> takeIDWord T_Placeholder bs'
| first == W._dollar -> takeIDWord T_Variable bs'
| otherwise -> fallback
False
| otherwise -> fallback
where
fallback = T_Symbol first : lexer bs'
where
isIDWord x = isWord x || x == W._hyphen
isWord x = W.isAlpha x || W.isDigit x || x == W._underscore || x > 127
isSpace x = x <= 127 && W.isSpace x
takeWord = takeWordWith isWord
takeIDWord = takeWordWith isIDWord
takeWordWith pred con bs = con word : lexer bs'
where (word, bs') = B.span pred bs | 1,207 | lexer :: B.ByteString -> [Token]
lexer bs = case B.uncons bs of
Nothing -> []
Just (first, bs') ->
if isSpace first then
let
(spaces, bs'') = B.span isSpace bs
lineCount = B.count W._lf spaces
in T_Space spaces lineCount : lexer bs''
else if W._hyphen == first && B.null bs' then
T_Symbol W._hyphen : []
else if isWord first then
takeWord T_Word bs
else case B.uncons bs' of
Nothing -> T_Symbol first : []
Just (second, bs'') -> case isWord second of
True
| first == W._at -> takeIDWord T_Directive bs'
| first == W._percent -> takeIDWord T_Placeholder bs'
| first == W._dollar -> takeIDWord T_Variable bs'
| otherwise -> fallback
False
| otherwise -> fallback
where
fallback = T_Symbol first : lexer bs'
where
isIDWord x = isWord x || x == W._hyphen
isWord x = W.isAlpha x || W.isDigit x || x == W._underscore || x > 127
isSpace x = x <= 127 && W.isSpace x
takeWord = takeWordWith isWord
takeIDWord = takeWordWith isIDWord
takeWordWith pred con bs = con word : lexer bs'
where (word, bs') = B.span pred bs | 1,207 | lexer bs = case B.uncons bs of
Nothing -> []
Just (first, bs') ->
if isSpace first then
let
(spaces, bs'') = B.span isSpace bs
lineCount = B.count W._lf spaces
in T_Space spaces lineCount : lexer bs''
else if W._hyphen == first && B.null bs' then
T_Symbol W._hyphen : []
else if isWord first then
takeWord T_Word bs
else case B.uncons bs' of
Nothing -> T_Symbol first : []
Just (second, bs'') -> case isWord second of
True
| first == W._at -> takeIDWord T_Directive bs'
| first == W._percent -> takeIDWord T_Placeholder bs'
| first == W._dollar -> takeIDWord T_Variable bs'
| otherwise -> fallback
False
| otherwise -> fallback
where
fallback = T_Symbol first : lexer bs'
where
isIDWord x = isWord x || x == W._hyphen
isWord x = W.isAlpha x || W.isDigit x || x == W._underscore || x > 127
isSpace x = x <= 127 && W.isSpace x
takeWord = takeWordWith isWord
takeIDWord = takeWordWith isIDWord
takeWordWith pred con bs = con word : lexer bs'
where (word, bs') = B.span pred bs | 1,174 | false | true | 12 | 21 | 384 | 495 | 224 | 271 | null | null |
ChadMcKinney/Haskollider | Examples/Intro/dist/build/autogen/Paths_HaskolliderIntro.hs | gpl-2.0 | libexecdir = "/home/octopian/.cabal/libexec" | 44 | libexecdir = "/home/octopian/.cabal/libexec" | 44 | libexecdir = "/home/octopian/.cabal/libexec" | 44 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
dschalk/score2 | dist/build/autogen/Paths_score2.hs | mit | sysconfdir = "/home/d/.cabal/etc" | 33 | sysconfdir = "/home/d/.cabal/etc" | 33 | sysconfdir = "/home/d/.cabal/etc" | 33 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
christiaanb/clash-tryout | src/CLaSH/Util/Core/Traverse.hs | bsd-3-clause | -- import CLaSH.Util.Pretty
startContext :: [CoreContext]
startContext = [] | 76 | startContext :: [CoreContext]
startContext = [] | 47 | startContext = [] | 17 | true | true | 0 | 7 | 9 | 24 | 11 | 13 | null | null |
haskellweekly/haskellweekly.github.io | tools/csv-to-opml.hs | mit | main :: IO ()
main = do
[input, output] <- Environment.getArgs
contents <- readFile input
writeFile output . unlines $ mconcat
[ [ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
, "<opml version=\"1.0\">"
, "<head>"
, "<title>Haskell Weekly</title>"
, "<dateCreated>2001-01-01 01:01:01 +0000</dateCreated>"
, "</head>"
, "<body>"
]
, Maybe.mapMaybe toOutline . drop 1 $ lines contents
, ["</body>", "</opml>"]
] | 492 | main :: IO ()
main = do
[input, output] <- Environment.getArgs
contents <- readFile input
writeFile output . unlines $ mconcat
[ [ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
, "<opml version=\"1.0\">"
, "<head>"
, "<title>Haskell Weekly</title>"
, "<dateCreated>2001-01-01 01:01:01 +0000</dateCreated>"
, "</head>"
, "<body>"
]
, Maybe.mapMaybe toOutline . drop 1 $ lines contents
, ["</body>", "</opml>"]
] | 492 | main = do
[input, output] <- Environment.getArgs
contents <- readFile input
writeFile output . unlines $ mconcat
[ [ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
, "<opml version=\"1.0\">"
, "<head>"
, "<title>Haskell Weekly</title>"
, "<dateCreated>2001-01-01 01:01:01 +0000</dateCreated>"
, "</head>"
, "<body>"
]
, Maybe.mapMaybe toOutline . drop 1 $ lines contents
, ["</body>", "</opml>"]
] | 478 | false | true | 1 | 14 | 120 | 117 | 59 | 58 | null | null |
ankeshs/numerikell | tmp/Stats.hs | bsd-3-clause | -- |gives the mean of data
mean :: (Fractional a) => [a] -> a
mean x = (sum x)/(fromIntegral.length $ x) | 106 | mean :: (Fractional a) => [a] -> a
mean x = (sum x)/(fromIntegral.length $ x) | 77 | mean x = (sum x)/(fromIntegral.length $ x) | 42 | true | true | 0 | 9 | 22 | 54 | 28 | 26 | null | null |
codemac/yi-editor | src/Yi/Buffer/Misc.hs | gpl-2.0 | -- | Extract the current point
pointB :: BufferM Point
pointB = getMarkPointB =<< getInsMark | 92 | pointB :: BufferM Point
pointB = getMarkPointB =<< getInsMark | 61 | pointB = getMarkPointB =<< getInsMark | 37 | true | true | 0 | 5 | 14 | 19 | 10 | 9 | null | null |
dorchard/camfort | src/Camfort/Specification/Units/Analysis.hs | apache-2.0 | fDiv fx (FReal y) = FReal $ fnumToDouble fx / y | 52 | fDiv fx (FReal y) = FReal $ fnumToDouble fx / y | 52 | fDiv fx (FReal y) = FReal $ fnumToDouble fx / y | 52 | false | false | 0 | 7 | 15 | 28 | 13 | 15 | null | null |
sdemos/prolog | src/Prolog.hs | mit | initSub :: Sub
initSub _ = Nothing | 34 | initSub :: Sub
initSub _ = Nothing | 34 | initSub _ = Nothing | 19 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
jrockway/c2hs | src/System/CIO.hs | gpl-2.0 | putStr :: String -> PreCST e s ()
putStr s = liftIO (IO.putStr s) | 68 | putStr :: String -> PreCST e s ()
putStr s = liftIO (IO.putStr s) | 68 | putStr s = liftIO (IO.putStr s) | 32 | false | true | 0 | 8 | 16 | 43 | 19 | 24 | null | null |
diku-dk/futhark | src/Language/Futhark/Prop.hs | isc | patternType :: PatBase Info VName -> PatType
patternType (Wildcard (Info t) _) = t | 82 | patternType :: PatBase Info VName -> PatType
patternType (Wildcard (Info t) _) = t | 82 | patternType (Wildcard (Info t) _) = t | 37 | false | true | 0 | 9 | 13 | 37 | 18 | 19 | null | null |
ddssff/lens | src/Control/Lens/Traversal.hs | bsd-3-clause | -- | Traverse any 'Traversable' container. This is an 'IndexedTraversal' that is indexed by ordinal position.
traversed64 :: Traversable f => IndexedTraversal Int64 (f a) (f b) a b
traversed64 = conjoined traverse (indexing64 traverse) | 235 | traversed64 :: Traversable f => IndexedTraversal Int64 (f a) (f b) a b
traversed64 = conjoined traverse (indexing64 traverse) | 125 | traversed64 = conjoined traverse (indexing64 traverse) | 54 | true | true | 0 | 8 | 34 | 53 | 26 | 27 | null | null |
christiaanb/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | true_Expr = nlHsVar true_RDR | 34 | true_Expr = nlHsVar true_RDR | 34 | true_Expr = nlHsVar true_RDR | 34 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
comonoidial/ALFIN | Simulate/DEvalTypes.hs | mit | refQueue :: Lens' DataPath (IOArray QueueIndex RefValue)
refQueue = lens _refQueue (\s x -> s {_refQueue = x}) | 110 | refQueue :: Lens' DataPath (IOArray QueueIndex RefValue)
refQueue = lens _refQueue (\s x -> s {_refQueue = x}) | 110 | refQueue = lens _refQueue (\s x -> s {_refQueue = x}) | 53 | false | true | 2 | 9 | 17 | 56 | 25 | 31 | null | null |
rueshyna/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Account for this ticket.
atAccount :: Lens' AccountTicket (Maybe Account)
atAccount
= lens _atAccount (\ s a -> s{_atAccount = a}) | 137 | atAccount :: Lens' AccountTicket (Maybe Account)
atAccount
= lens _atAccount (\ s a -> s{_atAccount = a}) | 107 | atAccount
= lens _atAccount (\ s a -> s{_atAccount = a}) | 58 | true | true | 0 | 9 | 24 | 48 | 25 | 23 | null | null |
hjwylde/werewolf | src/Game/Werewolf/Game.hs | bsd-3-clause | -- | Gets all 'Alive' players that have yet to vote. This is synonymous to @voters - Map.keys
-- votes@
getPendingVoters :: Game -> [Player]
getPendingVoters game = game ^.. allowedVoters . filtered ((`Map.notMember` votes') . view name)
where
votes' = game ^. votes
-- | The traversal of 'Game's on the first round. | 331 | getPendingVoters :: Game -> [Player]
getPendingVoters game = game ^.. allowedVoters . filtered ((`Map.notMember` votes') . view name)
where
votes' = game ^. votes
-- | The traversal of 'Game's on the first round. | 225 | getPendingVoters game = game ^.. allowedVoters . filtered ((`Map.notMember` votes') . view name)
where
votes' = game ^. votes
-- | The traversal of 'Game's on the first round. | 188 | true | true | 0 | 9 | 68 | 64 | 36 | 28 | null | null |
vlasenkov/Denga | denga-transaq/Denga/Transaq/Types.hs | bsd-3-clause | connectionToXML :: Connection -> XML
connectionToXML c = Element "command" [("id", "connect")] $
[ Element "login" [] [Text $ login c]
, Element "password" [] [Text $ password c]
, Element "host" [] [Text $ host c]
, Element "port" [] [Text $ uIntToBS $ port c]
] ++ optional
where
optional = catMaybes
[ fmap (\x -> Element "autopos" [] [Text $ boolToBS x]) $ autopos c
, fmap (\x -> Element "micex_registers" [] [Text $ boolToBS x]) $ micex_registers c
, fmap (\x -> Element "milliseconds" [] [Text $ boolToBS x]) $ milliseconds c
, fmap (\x -> Element "utc_time" [] [Text $ boolToBS x]) $ utc_time c
, fmap (\x -> proxyToXML x) $ proxy c
, fmap (\x -> Element "rqdelay" [] [Text $ uIntToBS x]) $ rqdelay c
, fmap (\x -> Element "session_timeout" [] [Text $ uIntToBS x]) $ session_timeout c
, fmap (\x -> Element "request_timeout" [] [Text $ uIntToBS x]) $ request_timeout c
, fmap (\x -> Element "push_u_limits" [] [Text $ uIntToBS x]) $ push_u_limits c
, fmap (\x -> Element "push_pos_equity" [] [Text $ uIntToBS x]) $ push_pos_equity c
] | 1,225 | connectionToXML :: Connection -> XML
connectionToXML c = Element "command" [("id", "connect")] $
[ Element "login" [] [Text $ login c]
, Element "password" [] [Text $ password c]
, Element "host" [] [Text $ host c]
, Element "port" [] [Text $ uIntToBS $ port c]
] ++ optional
where
optional = catMaybes
[ fmap (\x -> Element "autopos" [] [Text $ boolToBS x]) $ autopos c
, fmap (\x -> Element "micex_registers" [] [Text $ boolToBS x]) $ micex_registers c
, fmap (\x -> Element "milliseconds" [] [Text $ boolToBS x]) $ milliseconds c
, fmap (\x -> Element "utc_time" [] [Text $ boolToBS x]) $ utc_time c
, fmap (\x -> proxyToXML x) $ proxy c
, fmap (\x -> Element "rqdelay" [] [Text $ uIntToBS x]) $ rqdelay c
, fmap (\x -> Element "session_timeout" [] [Text $ uIntToBS x]) $ session_timeout c
, fmap (\x -> Element "request_timeout" [] [Text $ uIntToBS x]) $ request_timeout c
, fmap (\x -> Element "push_u_limits" [] [Text $ uIntToBS x]) $ push_u_limits c
, fmap (\x -> Element "push_pos_equity" [] [Text $ uIntToBS x]) $ push_pos_equity c
] | 1,224 | connectionToXML c = Element "command" [("id", "connect")] $
[ Element "login" [] [Text $ login c]
, Element "password" [] [Text $ password c]
, Element "host" [] [Text $ host c]
, Element "port" [] [Text $ uIntToBS $ port c]
] ++ optional
where
optional = catMaybes
[ fmap (\x -> Element "autopos" [] [Text $ boolToBS x]) $ autopos c
, fmap (\x -> Element "micex_registers" [] [Text $ boolToBS x]) $ micex_registers c
, fmap (\x -> Element "milliseconds" [] [Text $ boolToBS x]) $ milliseconds c
, fmap (\x -> Element "utc_time" [] [Text $ boolToBS x]) $ utc_time c
, fmap (\x -> proxyToXML x) $ proxy c
, fmap (\x -> Element "rqdelay" [] [Text $ uIntToBS x]) $ rqdelay c
, fmap (\x -> Element "session_timeout" [] [Text $ uIntToBS x]) $ session_timeout c
, fmap (\x -> Element "request_timeout" [] [Text $ uIntToBS x]) $ request_timeout c
, fmap (\x -> Element "push_u_limits" [] [Text $ uIntToBS x]) $ push_u_limits c
, fmap (\x -> Element "push_pos_equity" [] [Text $ uIntToBS x]) $ push_pos_equity c
] | 1,187 | false | true | 2 | 14 | 372 | 528 | 264 | 264 | null | null |
zmthy/snaplet-rest | src/Snap/Snaplet/Rest/Resource/Media.hs | mit | newMedia
:: (Intermediate int, MonadSnap m) => [MediaType] -> [MediaType]
-> Media res m diff int
newMedia = newIntermediateMedia defaultFrom defaultTo | 159 | newMedia
:: (Intermediate int, MonadSnap m) => [MediaType] -> [MediaType]
-> Media res m diff int
newMedia = newIntermediateMedia defaultFrom defaultTo | 159 | newMedia = newIntermediateMedia defaultFrom defaultTo | 53 | false | true | 0 | 8 | 28 | 54 | 28 | 26 | null | null |
nevrenato/HetsAlloy | OWL2/CASL2OWL.hs | gpl-2.0 | mapSortGenAx :: [Constraint] -> Bool -> [Named Axiom]
mapSortGenAx cs b = map (\ (s, as) ->
let is = map (\ (Qual_op_name n ty _) -> case args_OP_TYPE ty of
[] -> ObjectOneOf [idToIRI n]
[_] -> ObjectValuesFrom SomeValuesFrom (toO n (-1)) $ toC s
_ -> toC n) as
in makeNamed ("generated " ++ show s)
$ PlainAxiom (ClassEntity $ toC s)
$ if b && not (isSingle is) then AnnFrameBit [] $ ClassDisjointUnion is
else ListFrameBit (Just $ EDRelation Equivalent)
$ ExpressionBit [([], case is of
[i] -> i
_ -> ObjectJunction UnionOf is)])
$ recoverSortGen cs | 681 | mapSortGenAx :: [Constraint] -> Bool -> [Named Axiom]
mapSortGenAx cs b = map (\ (s, as) ->
let is = map (\ (Qual_op_name n ty _) -> case args_OP_TYPE ty of
[] -> ObjectOneOf [idToIRI n]
[_] -> ObjectValuesFrom SomeValuesFrom (toO n (-1)) $ toC s
_ -> toC n) as
in makeNamed ("generated " ++ show s)
$ PlainAxiom (ClassEntity $ toC s)
$ if b && not (isSingle is) then AnnFrameBit [] $ ClassDisjointUnion is
else ListFrameBit (Just $ EDRelation Equivalent)
$ ExpressionBit [([], case is of
[i] -> i
_ -> ObjectJunction UnionOf is)])
$ recoverSortGen cs | 681 | mapSortGenAx cs b = map (\ (s, as) ->
let is = map (\ (Qual_op_name n ty _) -> case args_OP_TYPE ty of
[] -> ObjectOneOf [idToIRI n]
[_] -> ObjectValuesFrom SomeValuesFrom (toO n (-1)) $ toC s
_ -> toC n) as
in makeNamed ("generated " ++ show s)
$ PlainAxiom (ClassEntity $ toC s)
$ if b && not (isSingle is) then AnnFrameBit [] $ ClassDisjointUnion is
else ListFrameBit (Just $ EDRelation Equivalent)
$ ExpressionBit [([], case is of
[i] -> i
_ -> ObjectJunction UnionOf is)])
$ recoverSortGen cs | 627 | false | true | 2 | 22 | 229 | 287 | 140 | 147 | null | null |
TomHammersley/HaskellRenderer | app/src/ShadowCache.hs | gpl-2.0 | rayFaceIndex :: Ray -> Int
rayFaceIndex (Ray _ (Vector dx dy dz _) _ _)
| dx > dy && dx > dz = if dx < 0 then 0 else 1
| dy > dx && dy > dz = if dx < 2 then 3 else 1
| otherwise = if dx < 0 then 4 else 5 | 210 | rayFaceIndex :: Ray -> Int
rayFaceIndex (Ray _ (Vector dx dy dz _) _ _)
| dx > dy && dx > dz = if dx < 0 then 0 else 1
| dy > dx && dy > dz = if dx < 2 then 3 else 1
| otherwise = if dx < 0 then 4 else 5 | 210 | rayFaceIndex (Ray _ (Vector dx dy dz _) _ _)
| dx > dy && dx > dz = if dx < 0 then 0 else 1
| dy > dx && dy > dz = if dx < 2 then 3 else 1
| otherwise = if dx < 0 then 4 else 5 | 183 | false | true | 0 | 11 | 66 | 136 | 67 | 69 | null | null |
bgamari/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | cedilla 'T' = "Ţ" | 17 | cedilla 'T' = "Ţ" | 17 | cedilla 'T' = "Ţ" | 17 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
bestian/haskell-sandbox | h99.hs | unlicense | --Problem 4: (*) Find the number of elements of a list.
myLength [] = 0 | 71 | myLength [] = 0 | 15 | myLength [] = 0 | 15 | true | false | 1 | 5 | 14 | 16 | 6 | 10 | null | null |
ijks/hexagons | src/Hexagon.hs | mit | direction BottomLeft = Hex (-1) 1 | 33 | direction BottomLeft = Hex (-1) 1 | 33 | direction BottomLeft = Hex (-1) 1 | 33 | false | false | 1 | 7 | 5 | 22 | 9 | 13 | null | null |
dirkz/haskell-cis-194 | 06/Fib.hs | isc | -- exercise 4
streamRepeat :: a -> Stream a
streamRepeat a = Cons a (streamRepeat a) | 85 | streamRepeat :: a -> Stream a
streamRepeat a = Cons a (streamRepeat a) | 70 | streamRepeat a = Cons a (streamRepeat a) | 40 | true | true | 0 | 7 | 16 | 33 | 16 | 17 | null | null |
akegalj/snowdrift | Handler/User.hs | agpl-3.0 | getUserDiscussionR :: UserId -> Handler Html
getUserDiscussionR user_id = getDiscussion (getUserDiscussionR' user_id) | 117 | getUserDiscussionR :: UserId -> Handler Html
getUserDiscussionR user_id = getDiscussion (getUserDiscussionR' user_id) | 117 | getUserDiscussionR user_id = getDiscussion (getUserDiscussionR' user_id) | 72 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
nyson/haste-compiler | src/Haste/AST/Traversal.hs | bsd-3-clause | finalExp :: Stm -> TravM (Maybe Exp)
finalExp stm = do
end <- finalStm stm
case end of
Return ex -> return $ Just ex
_ -> return Nothing | 156 | finalExp :: Stm -> TravM (Maybe Exp)
finalExp stm = do
end <- finalStm stm
case end of
Return ex -> return $ Just ex
_ -> return Nothing | 156 | finalExp stm = do
end <- finalStm stm
case end of
Return ex -> return $ Just ex
_ -> return Nothing | 119 | false | true | 0 | 11 | 48 | 69 | 31 | 38 | null | null |
GaloisInc/halvm-ghc | compiler/main/HscTypes.hs | bsd-3-clause | byteCodeOfObject other = pprPanic "byteCodeOfObject" (ppr other) | 68 | byteCodeOfObject other = pprPanic "byteCodeOfObject" (ppr other) | 68 | byteCodeOfObject other = pprPanic "byteCodeOfObject" (ppr other) | 68 | false | false | 0 | 7 | 10 | 20 | 9 | 11 | null | null |
urbanslug/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | pprSafeOverlap :: Bool -> SDoc
pprSafeOverlap True = ptext $ sLit "[safe]" | 75 | pprSafeOverlap :: Bool -> SDoc
pprSafeOverlap True = ptext $ sLit "[safe]" | 75 | pprSafeOverlap True = ptext $ sLit "[safe]" | 44 | false | true | 0 | 6 | 12 | 25 | 12 | 13 | null | null |
zaxtax/hakaru | haskell/Language/Hakaru/Pretty/Concrete.hs | bsd-3-clause | ppSCon p Plate = \(e1 :* e2 :* End) ->
let (vars, types, body) = ppBinder2 e2 in
[ PP.text "plate"
<+> toDoc vars
<+> PP.text "of"
<+> (toDoc $ ppArg e1)
<> PP.colon <> PP.space
, PP.nest 1 (toDoc body)
] | 244 | ppSCon p Plate = \(e1 :* e2 :* End) ->
let (vars, types, body) = ppBinder2 e2 in
[ PP.text "plate"
<+> toDoc vars
<+> PP.text "of"
<+> (toDoc $ ppArg e1)
<> PP.colon <> PP.space
, PP.nest 1 (toDoc body)
] | 244 | ppSCon p Plate = \(e1 :* e2 :* End) ->
let (vars, types, body) = ppBinder2 e2 in
[ PP.text "plate"
<+> toDoc vars
<+> PP.text "of"
<+> (toDoc $ ppArg e1)
<> PP.colon <> PP.space
, PP.nest 1 (toDoc body)
] | 244 | false | false | 0 | 15 | 81 | 117 | 58 | 59 | null | null |
josefs/MiniDSL | Feldspar/Compiler.hs | bsd-3-clause | binop Minus e1 e2 = [cexp| $e1 - $e2 |] | 39 | binop Minus e1 e2 = [cexp| $e1 - $e2 |] | 39 | binop Minus e1 e2 = [cexp| $e1 - $e2 |] | 39 | false | false | 0 | 5 | 9 | 17 | 10 | 7 | null | null |
Fuuzetsu/haddock | haddock-library/vendor/attoparsec-0.13.1.0/Data/Attoparsec/ByteString/Internal.hs | bsd-2-clause | advance :: Int -> Parser ()
advance n = T.Parser $ \t pos more _lose succ ->
succ t (pos + Pos n) more () | 107 | advance :: Int -> Parser ()
advance n = T.Parser $ \t pos more _lose succ ->
succ t (pos + Pos n) more () | 107 | advance n = T.Parser $ \t pos more _lose succ ->
succ t (pos + Pos n) more () | 79 | false | true | 0 | 8 | 26 | 69 | 32 | 37 | null | null |
mrkkrp/stack | src/Stack/Types/Config/Build.hs | bsd-3-clause | buildMonoidSplitObjsName :: Text
buildMonoidSplitObjsName = "split-objs" | 72 | buildMonoidSplitObjsName :: Text
buildMonoidSplitObjsName = "split-objs" | 72 | buildMonoidSplitObjsName = "split-objs" | 39 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
DavidAlphaFox/ghc | libraries/filepath/System/FilePath/Internal.hs | bsd-3-clause | -- | Set the directory, keeping the filename the same.
--
-- > replaceDirectory "root/file.ext" "/directory/" == "/directory/file.ext"
-- > Valid x => replaceDirectory x (takeDirectory x) `equalFilePath` x
replaceDirectory :: FilePath -> String -> FilePath
replaceDirectory x dir = combineAlways dir (takeFileName x) | 316 | replaceDirectory :: FilePath -> String -> FilePath
replaceDirectory x dir = combineAlways dir (takeFileName x) | 110 | replaceDirectory x dir = combineAlways dir (takeFileName x) | 59 | true | true | 0 | 7 | 43 | 39 | 21 | 18 | null | null |
conal/reification-rules | src/ReificationRules/MonoPrims.hs | bsd-3-clause | iPowI = PowIP :: Prim (PowIop Int ) | 41 | iPowI = PowIP :: Prim (PowIop Int ) | 41 | iPowI = PowIP :: Prim (PowIop Int ) | 41 | false | false | 0 | 7 | 13 | 18 | 9 | 9 | null | null |
texodus/forml | src/hs/lib/Forml/Optimize/Inline.hs | bsd-3-clause | replace_jval _ (JVar x) = JVar x | 32 | replace_jval _ (JVar x) = JVar x | 32 | replace_jval _ (JVar x) = JVar x | 32 | false | false | 1 | 6 | 6 | 22 | 9 | 13 | null | null |
nevrenato/Hets_Fork | DFOL/AS_DFOL.hs | gpl-2.0 | printSymbOrMap (Symb_map s t) = pretty s <+> mapsto <+> pretty t | 64 | printSymbOrMap (Symb_map s t) = pretty s <+> mapsto <+> pretty t | 64 | printSymbOrMap (Symb_map s t) = pretty s <+> mapsto <+> pretty t | 64 | false | false | 0 | 7 | 11 | 31 | 14 | 17 | null | null |
hmemcpy/milewski-ctfp-pdf | src/content/1.5/code/haskell/snippet07.hs | gpl-3.0 | snd :: (a, b) -> b
snd (x, y) = y | 33 | snd :: (a, b) -> b
snd (x, y) = y | 33 | snd (x, y) = y | 14 | false | true | 0 | 6 | 10 | 34 | 18 | 16 | null | null |
forste/haReFork | tools/base/TI/NameMapsDecorate.hs | bsd-3-clause | mts c f = map mt
where mt (i:>:t) = bothval mapHsIdent2 f i:>:mapNames2 c f t | 79 | mts c f = map mt
where mt (i:>:t) = bothval mapHsIdent2 f i:>:mapNames2 c f t | 79 | mts c f = map mt
where mt (i:>:t) = bothval mapHsIdent2 f i:>:mapNames2 c f t | 79 | false | false | 0 | 7 | 18 | 50 | 23 | 27 | null | null |
zepto-lang/zepto-js | src/Zepto/Primitives/LogMathPrimitives.hs | gpl-2.0 | numRound op [SimpleVal (Number (NumF n))] = return $ fromSimple $ Number $ NumI $ op n | 86 | numRound op [SimpleVal (Number (NumF n))] = return $ fromSimple $ Number $ NumI $ op n | 86 | numRound op [SimpleVal (Number (NumF n))] = return $ fromSimple $ Number $ NumI $ op n | 86 | false | false | 0 | 10 | 16 | 50 | 23 | 27 | null | null |
oldmanmike/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | integerSDataConKey = mkPreludeDataConUnique 7 | 67 | integerSDataConKey = mkPreludeDataConUnique 7 | 67 | integerSDataConKey = mkPreludeDataConUnique 7 | 67 | false | false | 0 | 5 | 25 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs | mpl-2.0 | -- | URL that can be used to access the Drive folder. Read-only.
dAlternateLink :: Lens' DriveFolder (Maybe Text)
dAlternateLink
= lens _dAlternateLink
(\ s a -> s{_dAlternateLink = a}) | 193 | dAlternateLink :: Lens' DriveFolder (Maybe Text)
dAlternateLink
= lens _dAlternateLink
(\ s a -> s{_dAlternateLink = a}) | 128 | dAlternateLink
= lens _dAlternateLink
(\ s a -> s{_dAlternateLink = a}) | 79 | true | true | 2 | 9 | 37 | 55 | 25 | 30 | null | null |
loadimpact/http2-test | hs-src/Rede/MainLoop/Tls.hs | bsd-3-clause | readyTCPSocket :: String -> Int -> IO Socket
readyTCPSocket hostname portnumber = do
the_socket <- socket AF_INET Stream defaultProtocol
addr_info0 : _ <- getAddrInfo Nothing (Just hostname) Nothing
addr_info1 <- return $ addr_info0 {
addrFamily = AF_INET
,addrSocketType = Stream
,addrAddress = (\ (SockAddrInet _ a) -> SockAddrInet (fromIntegral portnumber) a)
(addrAddress addr_info0)
}
host_address <- return $ addrAddress addr_info1
setSocketOption the_socket ReusePort 1
setSocketOption the_socket RecvBuffer 32000
setSocketOption the_socket SendBuffer 32000
setSocketOption the_socket RecvLowWater 8
bindSocket the_socket host_address
return the_socket | 761 | readyTCPSocket :: String -> Int -> IO Socket
readyTCPSocket hostname portnumber = do
the_socket <- socket AF_INET Stream defaultProtocol
addr_info0 : _ <- getAddrInfo Nothing (Just hostname) Nothing
addr_info1 <- return $ addr_info0 {
addrFamily = AF_INET
,addrSocketType = Stream
,addrAddress = (\ (SockAddrInet _ a) -> SockAddrInet (fromIntegral portnumber) a)
(addrAddress addr_info0)
}
host_address <- return $ addrAddress addr_info1
setSocketOption the_socket ReusePort 1
setSocketOption the_socket RecvBuffer 32000
setSocketOption the_socket SendBuffer 32000
setSocketOption the_socket RecvLowWater 8
bindSocket the_socket host_address
return the_socket | 760 | readyTCPSocket hostname portnumber = do
the_socket <- socket AF_INET Stream defaultProtocol
addr_info0 : _ <- getAddrInfo Nothing (Just hostname) Nothing
addr_info1 <- return $ addr_info0 {
addrFamily = AF_INET
,addrSocketType = Stream
,addrAddress = (\ (SockAddrInet _ a) -> SockAddrInet (fromIntegral portnumber) a)
(addrAddress addr_info0)
}
host_address <- return $ addrAddress addr_info1
setSocketOption the_socket ReusePort 1
setSocketOption the_socket RecvBuffer 32000
setSocketOption the_socket SendBuffer 32000
setSocketOption the_socket RecvLowWater 8
bindSocket the_socket host_address
return the_socket | 714 | false | true | 0 | 16 | 182 | 200 | 93 | 107 | null | null |
kindl/Hypatia | src/Typechecker.hs | mit | info s = lift (putStrLn s) | 26 | info s = lift (putStrLn s) | 26 | info s = lift (putStrLn s) | 26 | false | false | 1 | 7 | 5 | 22 | 8 | 14 | null | null |
brendanhay/gogol | gogol-ml/gen/Network/Google/MachineLearning/Types/Product.hs | mpl-2.0 | -- | Output only. A human readable string describing why the trial is
-- infeasible. This should only be set if trial_infeasible is true.
gcmvtInfeasibleReason :: Lens' GoogleCloudMlV1__Trial (Maybe Text)
gcmvtInfeasibleReason
= lens _gcmvtInfeasibleReason
(\ s a -> s{_gcmvtInfeasibleReason = a}) | 305 | gcmvtInfeasibleReason :: Lens' GoogleCloudMlV1__Trial (Maybe Text)
gcmvtInfeasibleReason
= lens _gcmvtInfeasibleReason
(\ s a -> s{_gcmvtInfeasibleReason = a}) | 167 | gcmvtInfeasibleReason
= lens _gcmvtInfeasibleReason
(\ s a -> s{_gcmvtInfeasibleReason = a}) | 100 | true | true | 0 | 9 | 48 | 49 | 26 | 23 | null | null |
tjakway/ghcjvm | compiler/hsSyn/HsBinds.hs | bsd-3-clause | isInlineLSig _ = False | 41 | isInlineLSig _ = False | 41 | isInlineLSig _ = False | 41 | false | false | 0 | 4 | 22 | 10 | 4 | 6 | null | null |
folivetti/PI-UFABC | AULA_08/Haskell/GeraPalindromo.hs | mit | inverso n inv = inverso (n `div` 10) (inv*10 + (n `rem` 10)) | 60 | inverso n inv = inverso (n `div` 10) (inv*10 + (n `rem` 10)) | 60 | inverso n inv = inverso (n `div` 10) (inv*10 + (n `rem` 10)) | 60 | false | false | 1 | 9 | 12 | 49 | 25 | 24 | null | null |
nejla/nejla-common | src/NejlaCommon/Persistence.hs | bsd-3-clause | -- | Create a singleton array (postgres)
array :: SqlExpr (Value a) -> SqlExpr (Value [a])
array = unsafeSqlFunction "array" | 124 | array :: SqlExpr (Value a) -> SqlExpr (Value [a])
array = unsafeSqlFunction "array" | 83 | array = unsafeSqlFunction "array" | 33 | true | true | 0 | 10 | 19 | 45 | 21 | 24 | null | null |
markeldigital/design-system | vendor/ruby/2.0.0/gems/pygments.rb-0.6.3/vendor/pygments-main/tests/examplefiles/SmallCheck.hs | mit | four :: Series a -> Series (a,a,a,a)
four s = \d -> [(w,x,y,z) | (w,(x,(y,z))) <- (s >< s >< s >< s) d] | 105 | four :: Series a -> Series (a,a,a,a)
four s = \d -> [(w,x,y,z) | (w,(x,(y,z))) <- (s >< s >< s >< s) d] | 105 | four s = \d -> [(w,x,y,z) | (w,(x,(y,z))) <- (s >< s >< s >< s) d] | 67 | false | true | 0 | 14 | 25 | 105 | 58 | 47 | null | null |
jparyani/capnproto-boostpython | compiler/src/CxxGenerator.hs | bsd-2-clause | cxxFieldSizeString (SizeData Size16) = "TWO_BYTES" | 50 | cxxFieldSizeString (SizeData Size16) = "TWO_BYTES" | 50 | cxxFieldSizeString (SizeData Size16) = "TWO_BYTES" | 50 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
ghorn/dynobud | dynobud/src/Dyno/View/M.hs | lgpl-3.0 | vsplitTrip ::
forall f g h j a .
(View f, View g, View h, View j, CMatrix a)
=> M (JTriple f g h) j a -> (M f j a, M g j a, M h j a)
vsplitTrip (UnsafeM x) =
case V.toList (CM.vertsplit x ncs) of
[f,g,h] -> (mkM f, mkM g, mkM h)
n -> error $ "vsplitTrip made a bad split with length " ++ show (length n)
where
nf = size (Proxy :: Proxy f)
ng = size (Proxy :: Proxy g)
nh = size (Proxy :: Proxy h)
ncs = V.fromList [0,nf,nf+ng,nf+ng+nh] | 469 | vsplitTrip ::
forall f g h j a .
(View f, View g, View h, View j, CMatrix a)
=> M (JTriple f g h) j a -> (M f j a, M g j a, M h j a)
vsplitTrip (UnsafeM x) =
case V.toList (CM.vertsplit x ncs) of
[f,g,h] -> (mkM f, mkM g, mkM h)
n -> error $ "vsplitTrip made a bad split with length " ++ show (length n)
where
nf = size (Proxy :: Proxy f)
ng = size (Proxy :: Proxy g)
nh = size (Proxy :: Proxy h)
ncs = V.fromList [0,nf,nf+ng,nf+ng+nh] | 469 | vsplitTrip (UnsafeM x) =
case V.toList (CM.vertsplit x ncs) of
[f,g,h] -> (mkM f, mkM g, mkM h)
n -> error $ "vsplitTrip made a bad split with length " ++ show (length n)
where
nf = size (Proxy :: Proxy f)
ng = size (Proxy :: Proxy g)
nh = size (Proxy :: Proxy h)
ncs = V.fromList [0,nf,nf+ng,nf+ng+nh] | 330 | false | true | 2 | 11 | 133 | 284 | 144 | 140 | null | null |
forste/haReFork | refactorer/RefacAsPatterns.hs | bsd-3-clause | checkGuards pat@(Pat (HsPAsPat s p)) ((s1, e1, e2):gs)
= do
-- rewrite the guard
newGuard <- rewriteExp s (rewritePats p) e1 pat
-- newGuard' <- checkExpr ps newGuard
-- rewrite the RHS of the guard
rhs <- rewriteExp s (rewritePats p) e2 pat
-- rhs' <- checkExpr ps rhs
rest <- checkGuards pat gs
return ((s1, newGuard, rhs):rest)
-- checkExpr :: [ HsPatP ] -> HsExpP -> m HsExpP
-- checkExpr [] e = return e | 488 | checkGuards pat@(Pat (HsPAsPat s p)) ((s1, e1, e2):gs)
= do
-- rewrite the guard
newGuard <- rewriteExp s (rewritePats p) e1 pat
-- newGuard' <- checkExpr ps newGuard
-- rewrite the RHS of the guard
rhs <- rewriteExp s (rewritePats p) e2 pat
-- rhs' <- checkExpr ps rhs
rest <- checkGuards pat gs
return ((s1, newGuard, rhs):rest)
-- checkExpr :: [ HsPatP ] -> HsExpP -> m HsExpP
-- checkExpr [] e = return e | 488 | checkGuards pat@(Pat (HsPAsPat s p)) ((s1, e1, e2):gs)
= do
-- rewrite the guard
newGuard <- rewriteExp s (rewritePats p) e1 pat
-- newGuard' <- checkExpr ps newGuard
-- rewrite the RHS of the guard
rhs <- rewriteExp s (rewritePats p) e2 pat
-- rhs' <- checkExpr ps rhs
rest <- checkGuards pat gs
return ((s1, newGuard, rhs):rest)
-- checkExpr :: [ HsPatP ] -> HsExpP -> m HsExpP
-- checkExpr [] e = return e | 488 | false | false | 0 | 10 | 155 | 128 | 67 | 61 | null | null |
databrary/databrary | src/Data/Csv/Contrib.hs | agpl-3.0 | extractColumnDefaulting :: BS.ByteString -> Vector Csv.NamedRecord -> [BS.ByteString]
extractColumnDefaulting hdr records =
extractColumn hdr records (maybe "" id) | 166 | extractColumnDefaulting :: BS.ByteString -> Vector Csv.NamedRecord -> [BS.ByteString]
extractColumnDefaulting hdr records =
extractColumn hdr records (maybe "" id) | 166 | extractColumnDefaulting hdr records =
extractColumn hdr records (maybe "" id) | 80 | false | true | 0 | 8 | 20 | 51 | 25 | 26 | null | null |
oisdk/SSystemOpt | src/Data/Utils.hs | mit | rightAlign :: Char -> Int -> String -> ShowS
rightAlign c m x xs =
uncurry ($) $ foldr f base x (max 0 m) where
f _ _ 0 = (id,xs)
f e a n = (e:) <$> a (n-1)
base n = (repC c n,xs) | 193 | rightAlign :: Char -> Int -> String -> ShowS
rightAlign c m x xs =
uncurry ($) $ foldr f base x (max 0 m) where
f _ _ 0 = (id,xs)
f e a n = (e:) <$> a (n-1)
base n = (repC c n,xs) | 193 | rightAlign c m x xs =
uncurry ($) $ foldr f base x (max 0 m) where
f _ _ 0 = (id,xs)
f e a n = (e:) <$> a (n-1)
base n = (repC c n,xs) | 148 | false | true | 7 | 9 | 60 | 143 | 66 | 77 | null | null |
pikajude/haspell | Language/Aspell.hs | mit | setOpts (TeXCheckComments b:opts) pt = setOptBool "tex-check-comments" b pt >>= setOpts opts | 92 | setOpts (TeXCheckComments b:opts) pt = setOptBool "tex-check-comments" b pt >>= setOpts opts | 92 | setOpts (TeXCheckComments b:opts) pt = setOptBool "tex-check-comments" b pt >>= setOpts opts | 92 | false | false | 0 | 8 | 11 | 35 | 16 | 19 | null | null |
tjakway/ghcjvm | compiler/nativeGen/Dwarf.hs | bsd-3-clause | blockToFrame :: DebugBlock -> UnwindTable -> DwarfFrameBlock
blockToFrame blk uws
= DwarfFrameBlock { dwFdeBlock = mkAsmTempLabel $ dblLabel blk
, dwFdeBlkHasInfo = dblHasInfoTbl blk
, dwFdeUnwind = uws
} | 275 | blockToFrame :: DebugBlock -> UnwindTable -> DwarfFrameBlock
blockToFrame blk uws
= DwarfFrameBlock { dwFdeBlock = mkAsmTempLabel $ dblLabel blk
, dwFdeBlkHasInfo = dblHasInfoTbl blk
, dwFdeUnwind = uws
} | 275 | blockToFrame blk uws
= DwarfFrameBlock { dwFdeBlock = mkAsmTempLabel $ dblLabel blk
, dwFdeBlkHasInfo = dblHasInfoTbl blk
, dwFdeUnwind = uws
} | 214 | false | true | 0 | 8 | 99 | 54 | 29 | 25 | null | null |
moonKimura/vector-0.10.9.1 | Data/Vector/Generic/New.hs | bsd-3-clause | unstreamR s = s `seq` New (MVector.unstreamR s) | 47 | unstreamR s = s `seq` New (MVector.unstreamR s) | 47 | unstreamR s = s `seq` New (MVector.unstreamR s) | 47 | false | false | 1 | 8 | 7 | 33 | 14 | 19 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Parse.hs | isc | pSubExps :: Parser [SubExp]
pSubExps = braces (pSubExp `sepBy` pComma) | 70 | pSubExps :: Parser [SubExp]
pSubExps = braces (pSubExp `sepBy` pComma) | 70 | pSubExps = braces (pSubExp `sepBy` pComma) | 42 | false | true | 1 | 7 | 9 | 32 | 16 | 16 | null | null |
NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter24/Fractions/src/TextFractions.hs | mit | shouldWork = "1/2" | 18 | shouldWork = "1/2" | 18 | shouldWork = "1/2" | 18 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
shayan-najd/QFeldspar | QFeldspar/Compiler.hs | gpl-3.0 | newAry _ _ = impossible | 34 | newAry _ _ = impossible | 34 | newAry _ _ = impossible | 34 | false | false | 0 | 5 | 15 | 11 | 5 | 6 | null | null |
brendanhay/gogol | gogol-cloudshell/gen/Network/Google/Resource/CloudShell/Users/Environments/Authorize.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ueaUploadProtocol :: Lens' UsersEnvironmentsAuthorize (Maybe Text)
ueaUploadProtocol
= lens _ueaUploadProtocol
(\ s a -> s{_ueaUploadProtocol = a}) | 217 | ueaUploadProtocol :: Lens' UsersEnvironmentsAuthorize (Maybe Text)
ueaUploadProtocol
= lens _ueaUploadProtocol
(\ s a -> s{_ueaUploadProtocol = a}) | 155 | ueaUploadProtocol
= lens _ueaUploadProtocol
(\ s a -> s{_ueaUploadProtocol = a}) | 88 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
mainland/dph | dph-lifted-boxed/Data/Array/Parallel/PArray.hs | bsd-3-clause | - Basics ---------------------------------------------------------------------
-- | Check that an array has a valid internal representation.
valid :: PArray a -> Bool
valid _ = True
| 182 | valid :: PArray a -> Bool
valid _ = True | 40 | valid _ = True | 14 | true | true | 0 | 7 | 24 | 33 | 15 | 18 | null | null |
hephaestus-pl/hephaestus | willian/hephaestus-integrated/asset-base/uc-model/src/UseCaseModel/Parsers/BNFC/SkelUCM.hs | mit | transIdent :: Ident -> Result
transIdent x = case x of
Ident str -> failure x | 80 | transIdent :: Ident -> Result
transIdent x = case x of
Ident str -> failure x | 80 | transIdent x = case x of
Ident str -> failure x | 50 | false | true | 0 | 8 | 18 | 34 | 16 | 18 | null | null |
toothbrush/forest-fire | src/Lib.hs | bsd-3-clause | buildDependencyGraph :: AWSExecution m => StackName -> m Dependency
buildDependencyGraph name = do
outputs <- findExportsByStack name
importers <- mapM whoImportsThisValue outputs
let children = sort $ nub $ concat importers
downstreamDeps <- mapM buildDependencyGraph children
pure $ Map.unionsWith (\new old -> nub $ (++) new old)
(downstreamDeps ++ [Map.singleton name children]) | 428 | buildDependencyGraph :: AWSExecution m => StackName -> m Dependency
buildDependencyGraph name = do
outputs <- findExportsByStack name
importers <- mapM whoImportsThisValue outputs
let children = sort $ nub $ concat importers
downstreamDeps <- mapM buildDependencyGraph children
pure $ Map.unionsWith (\new old -> nub $ (++) new old)
(downstreamDeps ++ [Map.singleton name children]) | 428 | buildDependencyGraph name = do
outputs <- findExportsByStack name
importers <- mapM whoImportsThisValue outputs
let children = sort $ nub $ concat importers
downstreamDeps <- mapM buildDependencyGraph children
pure $ Map.unionsWith (\new old -> nub $ (++) new old)
(downstreamDeps ++ [Map.singleton name children]) | 360 | false | true | 0 | 14 | 97 | 138 | 64 | 74 | null | null |
Haskell-Praxis/core-catcher | src/TH/MonoDerive.hs | mit | setContainerTh :: Name -> DecsQ
setContainerTh name = do
funcs <- sequenceA [memberTh, notMemberTh, unionTh, differenceTh, intersectionTh, keysTh]
let instanceType = AppT (ConT ''SetContainer) (ConT name)
containerKeyFamily <- Family.deriveNewtypedTypeFamily ''ContainerKey name
return [InstanceD Nothing [] instanceType (containerKeyFamily ++ funcs)]
where
memberTh = simpleUnwrap1 'member name
notMemberTh = simpleUnwrap1 'notMember name
unionTh = simpleBinOp 'union name
differenceTh = simpleBinOp 'difference name
intersectionTh = simpleBinOp 'intersection name
keysTh = simplePattern 'keys name | 665 | setContainerTh :: Name -> DecsQ
setContainerTh name = do
funcs <- sequenceA [memberTh, notMemberTh, unionTh, differenceTh, intersectionTh, keysTh]
let instanceType = AppT (ConT ''SetContainer) (ConT name)
containerKeyFamily <- Family.deriveNewtypedTypeFamily ''ContainerKey name
return [InstanceD Nothing [] instanceType (containerKeyFamily ++ funcs)]
where
memberTh = simpleUnwrap1 'member name
notMemberTh = simpleUnwrap1 'notMember name
unionTh = simpleBinOp 'union name
differenceTh = simpleBinOp 'difference name
intersectionTh = simpleBinOp 'intersection name
keysTh = simplePattern 'keys name | 665 | setContainerTh name = do
funcs <- sequenceA [memberTh, notMemberTh, unionTh, differenceTh, intersectionTh, keysTh]
let instanceType = AppT (ConT ''SetContainer) (ConT name)
containerKeyFamily <- Family.deriveNewtypedTypeFamily ''ContainerKey name
return [InstanceD Nothing [] instanceType (containerKeyFamily ++ funcs)]
where
memberTh = simpleUnwrap1 'member name
notMemberTh = simpleUnwrap1 'notMember name
unionTh = simpleBinOp 'union name
differenceTh = simpleBinOp 'difference name
intersectionTh = simpleBinOp 'intersection name
keysTh = simplePattern 'keys name | 633 | false | true | 5 | 13 | 135 | 186 | 95 | 91 | null | null |
shlevy/ghc | testsuite/tests/perf/should_run/DeriveNullTermination.hs | bsd-3-clause | ouch :: a -> Ouch a
ouch a = v where v = Ouch v a v | 51 | ouch :: a -> Ouch a
ouch a = v where v = Ouch v a v | 51 | ouch a = v where v = Ouch v a v | 31 | false | true | 0 | 7 | 16 | 35 | 17 | 18 | null | null |
Paow/encore | src/parser/Parser/Parser.hs | bsd-3-clause | -- | @blockedConstruct p@ parses a construct whose header is
-- parsed by @p@, and whose body is a block ended by "end".
blockedConstruct header = do
indent <- L.indentLevel
block <- indentBlock $ do
constructor <- header
parseBody constructor
atLevel indent $ reserved "end"
return block
-- | These parsers use the lexer above and are the smallest
-- building blocks of the whole parser. | 405 | blockedConstruct header = do
indent <- L.indentLevel
block <- indentBlock $ do
constructor <- header
parseBody constructor
atLevel indent $ reserved "end"
return block
-- | These parsers use the lexer above and are the smallest
-- building blocks of the whole parser. | 284 | blockedConstruct header = do
indent <- L.indentLevel
block <- indentBlock $ do
constructor <- header
parseBody constructor
atLevel indent $ reserved "end"
return block
-- | These parsers use the lexer above and are the smallest
-- building blocks of the whole parser. | 284 | true | false | 0 | 11 | 82 | 65 | 29 | 36 | null | null |
alistra/data-structure-inferrer | Defs/Util.hs | mit | maybeZipWith :: (a -> b -> Maybe c) -> [a] -> [b] -> [c]
maybeZipWith f (x:xs) (y:ys) = case f x y of
Just z -> z : maybeZipWith f xs ys
Nothing -> maybeZipWith f xs ys | 176 | maybeZipWith :: (a -> b -> Maybe c) -> [a] -> [b] -> [c]
maybeZipWith f (x:xs) (y:ys) = case f x y of
Just z -> z : maybeZipWith f xs ys
Nothing -> maybeZipWith f xs ys | 176 | maybeZipWith f (x:xs) (y:ys) = case f x y of
Just z -> z : maybeZipWith f xs ys
Nothing -> maybeZipWith f xs ys | 119 | false | true | 0 | 9 | 46 | 109 | 55 | 54 | null | null |
vladfi1/hs-misc | Vec.hs | mit | lookup a (VCons h t) =
if a == h
then Just LT_Z
else LT_S <$> Vec.lookup a t | 86 | lookup a (VCons h t) =
if a == h
then Just LT_Z
else LT_S <$> Vec.lookup a t | 86 | lookup a (VCons h t) =
if a == h
then Just LT_Z
else LT_S <$> Vec.lookup a t | 86 | false | false | 0 | 8 | 28 | 46 | 22 | 24 | null | null |
Megaleo/Minehack | src/Printing.hs | bsd-3-clause | tileSurface32 :: T.Tile -> IO SDL.Surface
tileSurface32 (T.Tile (TT.TBlock B.Wood) _) = SDLi.load "textures/32x32/log_oak.png" | 126 | tileSurface32 :: T.Tile -> IO SDL.Surface
tileSurface32 (T.Tile (TT.TBlock B.Wood) _) = SDLi.load "textures/32x32/log_oak.png" | 126 | tileSurface32 (T.Tile (TT.TBlock B.Wood) _) = SDLi.load "textures/32x32/log_oak.png" | 84 | false | true | 0 | 10 | 13 | 50 | 24 | 26 | null | null |
mrakgr/futhark | src/Futhark/Analysis/Range.hs | bsd-3-clause | lookupRange :: VName -> RangeM Range
lookupRange = asks . HM.lookupDefault unknownRange | 87 | lookupRange :: VName -> RangeM Range
lookupRange = asks . HM.lookupDefault unknownRange | 87 | lookupRange = asks . HM.lookupDefault unknownRange | 50 | false | true | 0 | 7 | 11 | 27 | 13 | 14 | null | null |
geekingfrog/advent-of-code | src/Y2017/Day23.hs | bsd-3-clause | execInstruction (Mul x y) = do
(i, regs) <- get
let regs' = regs V.// [(x, regs V.! x * getVal regs y)]
put (i + 1, regs') | 134 | execInstruction (Mul x y) = do
(i, regs) <- get
let regs' = regs V.// [(x, regs V.! x * getVal regs y)]
put (i + 1, regs') | 134 | execInstruction (Mul x y) = do
(i, regs) <- get
let regs' = regs V.// [(x, regs V.! x * getVal regs y)]
put (i + 1, regs') | 134 | false | false | 0 | 14 | 39 | 85 | 43 | 42 | null | null |
rueshyna/gogol | gogol-drive/gen/Network/Google/Drive/Types/Product.hs | mpl-2.0 | -- | The width of the video in pixels.
fvmmWidth :: Lens' FileVideoMediaMetadata (Maybe Int32)
fvmmWidth
= lens _fvmmWidth (\ s a -> s{_fvmmWidth = a}) .
mapping _Coerce | 177 | fvmmWidth :: Lens' FileVideoMediaMetadata (Maybe Int32)
fvmmWidth
= lens _fvmmWidth (\ s a -> s{_fvmmWidth = a}) .
mapping _Coerce | 138 | fvmmWidth
= lens _fvmmWidth (\ s a -> s{_fvmmWidth = a}) .
mapping _Coerce | 82 | true | true | 0 | 10 | 36 | 55 | 28 | 27 | null | null |
spechub/Hets | RelationalScheme/Keywords.hs | gpl-2.0 | rsDataTypes :: [String]
rsDataTypes = [rsBool, rsBin, rsDate, rsDatetime, rsDecimal, rsFloat, rsInteger,
rsString, rsText, rsTime, rsTimestamp, rsDouble, rsNonPosInteger,
rsNonNegInteger] | 217 | rsDataTypes :: [String]
rsDataTypes = [rsBool, rsBin, rsDate, rsDatetime, rsDecimal, rsFloat, rsInteger,
rsString, rsText, rsTime, rsTimestamp, rsDouble, rsNonPosInteger,
rsNonNegInteger] | 217 | rsDataTypes = [rsBool, rsBin, rsDate, rsDatetime, rsDecimal, rsFloat, rsInteger,
rsString, rsText, rsTime, rsTimestamp, rsDouble, rsNonPosInteger,
rsNonNegInteger] | 193 | false | true | 0 | 7 | 48 | 63 | 37 | 26 | null | null |
acowley/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isListCompExpr :: HsStmtContext id -> Bool
-- Uses syntax [ e | quals ]
isListCompExpr ListComp = True | 111 | isListCompExpr :: HsStmtContext id -> Bool
isListCompExpr ListComp = True | 82 | isListCompExpr ListComp = True | 39 | true | true | 0 | 7 | 26 | 28 | 12 | 16 | null | null |
nuttycom/haskoin | Network/Haskoin/Crypto/Point.hs | unlicense | mulPoint 1 p = p | 23 | mulPoint 1 p = p | 23 | mulPoint 1 p = p | 23 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
AlexeyRaga/eta | compiler/ETA/TypeCheck/TcType.hs | bsd-3-clause | getDFunTyKey (LitTy x) = getDFunTyLitKey x | 48 | getDFunTyKey (LitTy x) = getDFunTyLitKey x | 48 | getDFunTyKey (LitTy x) = getDFunTyLitKey x | 48 | false | false | 0 | 7 | 11 | 18 | 8 | 10 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/SSA/SSAMonad.hs | bsd-3-clause | ssaEnvIds = envKeys | 19 | ssaEnvIds = envKeys | 19 | ssaEnvIds = envKeys | 19 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
MFire30/haskellPresidentCardgame | app/src/Cards.hs | mit | stringToSuit :: String -> CardSuits
stringToSuit s = case s of
"C" -> Club
"D" -> Diamond
"H" -> Heart
"S" -> Spade
-- Creates a new CardSuits | 151 | stringToSuit :: String -> CardSuits
stringToSuit s = case s of
"C" -> Club
"D" -> Diamond
"H" -> Heart
"S" -> Spade
-- Creates a new CardSuits | 151 | stringToSuit s = case s of
"C" -> Club
"D" -> Diamond
"H" -> Heart
"S" -> Spade
-- Creates a new CardSuits | 115 | false | true | 0 | 8 | 36 | 53 | 25 | 28 | null | null |
mthom/abominable-klambda-compiler | Compiler/CodeGenerator.hs | bsd-3-clause | wrapOrLift (LBoundF n hn ar) =
appE (funcExpT "ApplC")
(appE (appE (funcExpT "wrapNamed") (stringE (T.unpack n))) (varE hn)) | 139 | wrapOrLift (LBoundF n hn ar) =
appE (funcExpT "ApplC")
(appE (appE (funcExpT "wrapNamed") (stringE (T.unpack n))) (varE hn)) | 139 | wrapOrLift (LBoundF n hn ar) =
appE (funcExpT "ApplC")
(appE (appE (funcExpT "wrapNamed") (stringE (T.unpack n))) (varE hn)) | 139 | false | false | 0 | 14 | 32 | 72 | 35 | 37 | null | null |
kfish/scope | Scope/Types.hs | bsd-3-clause | -- | Restrict a window to within a given range
restrictRange :: (Ord a, Coordinate a) => (a, a) -> (a, a) -> (a, a)
restrictRange (rangeX1, rangeX2) (x1, x2)
| w >= rW = (rangeX1, rangeX2)
| x1 < rangeX1 = (rangeX1, translate rangeX1 w)
| x2 > rangeX2 = (x1', rangeX2)
| otherwise = (x1, x2)
where
rW = distance rangeX1 rangeX2
w = distance x1 x2
x1' = distance w rangeX2 | 423 | restrictRange :: (Ord a, Coordinate a) => (a, a) -> (a, a) -> (a, a)
restrictRange (rangeX1, rangeX2) (x1, x2)
| w >= rW = (rangeX1, rangeX2)
| x1 < rangeX1 = (rangeX1, translate rangeX1 w)
| x2 > rangeX2 = (x1', rangeX2)
| otherwise = (x1, x2)
where
rW = distance rangeX1 rangeX2
w = distance x1 x2
x1' = distance w rangeX2 | 376 | restrictRange (rangeX1, rangeX2) (x1, x2)
| w >= rW = (rangeX1, rangeX2)
| x1 < rangeX1 = (rangeX1, translate rangeX1 w)
| x2 > rangeX2 = (x1', rangeX2)
| otherwise = (x1, x2)
where
rW = distance rangeX1 rangeX2
w = distance x1 x2
x1' = distance w rangeX2 | 307 | true | true | 3 | 8 | 125 | 201 | 99 | 102 | null | null |
Fuuzetsu/haddock | haddock-library/vendor/attoparsec-0.13.1.0/Data/Attoparsec/ByteString/Internal.hs | bsd-2-clause | -- | A stateful scanner. The predicate consumes and transforms a
-- state argument, and each transformed state is passed to successive
-- invocations of the predicate on each byte of the input until one
-- returns 'Nothing' or the input ends.
--
-- This parser does not fail. It will return an empty string if the
-- predicate returns 'Nothing' on the first byte of input.
--
-- /Note/: Because this parser does not fail, do not use it with
-- combinators such as 'Control.Applicative.many', because such
-- parsers loop until a failure occurs. Careless use will thus result
-- in an infinite loop.
scan :: s -> (s -> Word8 -> Maybe s) -> Parser ByteString
scan = scan_ $ \_ chunks -> return $! concatReverse chunks | 718 | scan :: s -> (s -> Word8 -> Maybe s) -> Parser ByteString
scan = scan_ $ \_ chunks -> return $! concatReverse chunks | 116 | scan = scan_ $ \_ chunks -> return $! concatReverse chunks | 58 | true | true | 2 | 11 | 131 | 72 | 40 | 32 | null | null |
SeanTater/hypergraph-disambiguate | src/Index/Utility.hs | apache-2.0 | simpleMapReduce :: (NFData b)
=> Int -- Batch size
-> (a -> b) -- Mapper
-> (b -> b -> b) -- Reducer
-> b -- Default
-> [a] -- Input
-> b
simpleMapReduce _ _ _ def [] = def | 254 | simpleMapReduce :: (NFData b)
=> Int -- Batch size
-> (a -> b) -- Mapper
-> (b -> b -> b) -- Reducer
-> b -- Default
-> [a] -- Input
-> b
simpleMapReduce _ _ _ def [] = def | 254 | simpleMapReduce _ _ _ def [] = def | 40 | false | true | 0 | 13 | 122 | 81 | 44 | 37 | null | null |
brendanhay/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | The paragraph specific text style applied to this bullet.
bBulletStyle :: Lens' Bullet (Maybe TextStyle)
bBulletStyle
= lens _bBulletStyle (\ s a -> s{_bBulletStyle = a}) | 177 | bBulletStyle :: Lens' Bullet (Maybe TextStyle)
bBulletStyle
= lens _bBulletStyle (\ s a -> s{_bBulletStyle = a}) | 114 | bBulletStyle
= lens _bBulletStyle (\ s a -> s{_bBulletStyle = a}) | 67 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
ademinn/JavaWithClasses | src/Native.hs | bsd-3-clause | readInt :: Method
readInt = readMethod "readInt" TInt | 53 | readInt :: Method
readInt = readMethod "readInt" TInt | 53 | readInt = readMethod "readInt" TInt | 35 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/AdExchangeBuyer2/Types/Product.hs | mpl-2.0 | -- | The daypart targeting to include \/ exclude. Filled in when the key is
-- GOOG_DAYPART_TARGETING. The definition of this targeting is derived from
-- the structure used by Ad Manager.
tvDayPartTargetingValue :: Lens' TargetingValue (Maybe DayPartTargeting)
tvDayPartTargetingValue
= lens _tvDayPartTargetingValue
(\ s a -> s{_tvDayPartTargetingValue = a}) | 368 | tvDayPartTargetingValue :: Lens' TargetingValue (Maybe DayPartTargeting)
tvDayPartTargetingValue
= lens _tvDayPartTargetingValue
(\ s a -> s{_tvDayPartTargetingValue = a}) | 179 | tvDayPartTargetingValue
= lens _tvDayPartTargetingValue
(\ s a -> s{_tvDayPartTargetingValue = a}) | 106 | true | true | 1 | 9 | 56 | 54 | 27 | 27 | null | null |
samstokes/pal | Language/Pal/Eval.hs | mit | tag (BuiltinFunction _) = TagFunction | 37 | tag (BuiltinFunction _) = TagFunction | 37 | tag (BuiltinFunction _) = TagFunction | 37 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
olsner/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | pprCLabel platform (DeadStripPreventer lbl)
| cGhcWithNativeCodeGen == "YES"
= pprCLabel platform lbl <> text "_dsp" | 120 | pprCLabel platform (DeadStripPreventer lbl)
| cGhcWithNativeCodeGen == "YES"
= pprCLabel platform lbl <> text "_dsp" | 120 | pprCLabel platform (DeadStripPreventer lbl)
| cGhcWithNativeCodeGen == "YES"
= pprCLabel platform lbl <> text "_dsp" | 120 | false | false | 0 | 8 | 18 | 40 | 17 | 23 | null | null |
maurotrb/xmonadrc | xmonadrc.hs | bsd-3-clause | myLayoutHook = desktopLayoutModifiers $
-- onWorkspace "9" gimpLayout $
((layoutHook xfceConfig) ||| Accordion) | 141 | myLayoutHook = desktopLayoutModifiers $
-- onWorkspace "9" gimpLayout $
((layoutHook xfceConfig) ||| Accordion) | 141 | myLayoutHook = desktopLayoutModifiers $
-- onWorkspace "9" gimpLayout $
((layoutHook xfceConfig) ||| Accordion) | 141 | false | false | 1 | 10 | 42 | 28 | 13 | 15 | null | null |
RefactoringTools/HaRe | old/refactorer/RefacIntroEvalDegree.hs | bsd-3-clause | checkForQualifiers r inscps
= ck1 r inscps
where
ck1 r i
| isInScopeAndUnqualified r i = r
| length res == 0 = r
| length res > 1 = error (r ++ " is qualified more than once. " ++ r ++ " must only be qualified once or not at all to proceed.")
| otherwise = if res /= [] then (modNameToStr (head res)) ++"."++ r else r
where res = hsQualifier2 (nameToPNT r) i | 410 | checkForQualifiers r inscps
= ck1 r inscps
where
ck1 r i
| isInScopeAndUnqualified r i = r
| length res == 0 = r
| length res > 1 = error (r ++ " is qualified more than once. " ++ r ++ " must only be qualified once or not at all to proceed.")
| otherwise = if res /= [] then (modNameToStr (head res)) ++"."++ r else r
where res = hsQualifier2 (nameToPNT r) i | 410 | checkForQualifiers r inscps
= ck1 r inscps
where
ck1 r i
| isInScopeAndUnqualified r i = r
| length res == 0 = r
| length res > 1 = error (r ++ " is qualified more than once. " ++ r ++ " must only be qualified once or not at all to proceed.")
| otherwise = if res /= [] then (modNameToStr (head res)) ++"."++ r else r
where res = hsQualifier2 (nameToPNT r) i | 410 | false | false | 0 | 12 | 128 | 150 | 71 | 79 | null | null |
f1u77y/xmonad-contrib | XMonad/Config/Dmwit.hs | bsd-3-clause | modVolume :: String -> Integer -> IO Double
modVolume kind n = do
is <- namedNumbers parseKind <$> outputOf listCommand
forM_ is (outputOf . setCommand)
parse <$> outputOf listCommand
where
sign | n > 0 = "+" | otherwise = "-"
ctlKind = map (\c -> if c == ' ' then '-' else c) kind
parseKind = unwords . map (\(c:cs) -> toUpper c : cs) . words $ kind
setCommand i = "pactl set-" ++ ctlKind ++ "-volume " ++ i ++ " -- " ++ sign ++ show (abs n) ++ "%"
listCommand = "pactl list " ++ ctlKind ++ "s"
-- }}}
-- convenient actions {{{ | 573 | modVolume :: String -> Integer -> IO Double
modVolume kind n = do
is <- namedNumbers parseKind <$> outputOf listCommand
forM_ is (outputOf . setCommand)
parse <$> outputOf listCommand
where
sign | n > 0 = "+" | otherwise = "-"
ctlKind = map (\c -> if c == ' ' then '-' else c) kind
parseKind = unwords . map (\(c:cs) -> toUpper c : cs) . words $ kind
setCommand i = "pactl set-" ++ ctlKind ++ "-volume " ++ i ++ " -- " ++ sign ++ show (abs n) ++ "%"
listCommand = "pactl list " ++ ctlKind ++ "s"
-- }}}
-- convenient actions {{{ | 573 | modVolume kind n = do
is <- namedNumbers parseKind <$> outputOf listCommand
forM_ is (outputOf . setCommand)
parse <$> outputOf listCommand
where
sign | n > 0 = "+" | otherwise = "-"
ctlKind = map (\c -> if c == ' ' then '-' else c) kind
parseKind = unwords . map (\(c:cs) -> toUpper c : cs) . words $ kind
setCommand i = "pactl set-" ++ ctlKind ++ "-volume " ++ i ++ " -- " ++ sign ++ show (abs n) ++ "%"
listCommand = "pactl list " ++ ctlKind ++ "s"
-- }}}
-- convenient actions {{{ | 529 | false | true | 0 | 14 | 154 | 227 | 113 | 114 | null | null |
sdiehl/ghc | compiler/GHC/StgToCmm/Utils.hs | bsd-3-clause | -- Right, off we go
emitSwitch tag_expr branches mb_deflt lo_tag hi_tag = do
join_lbl <- newBlockId
mb_deflt_lbl <- label_default join_lbl mb_deflt
branches_lbls <- label_branches join_lbl branches
tag_expr' <- assignTemp' tag_expr
-- Sort the branches before calling mk_discrete_switch
let branches_lbls' = [ (fromIntegral i, l) | (i,l) <- sortBy (comparing fst) branches_lbls ]
let range = (fromIntegral lo_tag, fromIntegral hi_tag)
emit $ mk_discrete_switch False tag_expr' branches_lbls' mb_deflt_lbl range
emitLabel join_lbl | 578 | emitSwitch tag_expr branches mb_deflt lo_tag hi_tag = do
join_lbl <- newBlockId
mb_deflt_lbl <- label_default join_lbl mb_deflt
branches_lbls <- label_branches join_lbl branches
tag_expr' <- assignTemp' tag_expr
-- Sort the branches before calling mk_discrete_switch
let branches_lbls' = [ (fromIntegral i, l) | (i,l) <- sortBy (comparing fst) branches_lbls ]
let range = (fromIntegral lo_tag, fromIntegral hi_tag)
emit $ mk_discrete_switch False tag_expr' branches_lbls' mb_deflt_lbl range
emitLabel join_lbl | 558 | emitSwitch tag_expr branches mb_deflt lo_tag hi_tag = do
join_lbl <- newBlockId
mb_deflt_lbl <- label_default join_lbl mb_deflt
branches_lbls <- label_branches join_lbl branches
tag_expr' <- assignTemp' tag_expr
-- Sort the branches before calling mk_discrete_switch
let branches_lbls' = [ (fromIntegral i, l) | (i,l) <- sortBy (comparing fst) branches_lbls ]
let range = (fromIntegral lo_tag, fromIntegral hi_tag)
emit $ mk_discrete_switch False tag_expr' branches_lbls' mb_deflt_lbl range
emitLabel join_lbl | 558 | true | false | 1 | 11 | 117 | 129 | 65 | 64 | null | null |
joeyadams/haskell-iocp | IOCP/Clock.hs | bsd-3-clause | -- | Get the current time, in seconds since some fixed time in the past.
getTime :: Clock -> IO Seconds
getTime (Clock io) = io | 127 | getTime :: Clock -> IO Seconds
getTime (Clock io) = io | 54 | getTime (Clock io) = io | 23 | true | true | 0 | 7 | 25 | 28 | 14 | 14 | null | null |
kawu/factorized-tag-parser | src/NLP/Partage/Format/Brackets.hs | bsd-2-clause | parseSuperTok :: T.Text -> SuperTok
parseSuperTok xs =
case T.splitOn "\t" xs of
[] -> error "Brackets.parseSuperTok: empty line"
[_] -> error "Brackets.parseSuperTok: no supertags"
[_, _] -> error "Brackets.parseSuperTok: no dependency head"
word : deph : tags -> SuperTok
{ tokWord = word
, tokTags = map ((,0) . parseTree') tags
, tokDeph = M.singleton (read (T.unpack deph)) 0.0
}
-- | Parse a sentence in a supertagged file. | 473 | parseSuperTok :: T.Text -> SuperTok
parseSuperTok xs =
case T.splitOn "\t" xs of
[] -> error "Brackets.parseSuperTok: empty line"
[_] -> error "Brackets.parseSuperTok: no supertags"
[_, _] -> error "Brackets.parseSuperTok: no dependency head"
word : deph : tags -> SuperTok
{ tokWord = word
, tokTags = map ((,0) . parseTree') tags
, tokDeph = M.singleton (read (T.unpack deph)) 0.0
}
-- | Parse a sentence in a supertagged file. | 473 | parseSuperTok xs =
case T.splitOn "\t" xs of
[] -> error "Brackets.parseSuperTok: empty line"
[_] -> error "Brackets.parseSuperTok: no supertags"
[_, _] -> error "Brackets.parseSuperTok: no dependency head"
word : deph : tags -> SuperTok
{ tokWord = word
, tokTags = map ((,0) . parseTree') tags
, tokDeph = M.singleton (read (T.unpack deph)) 0.0
}
-- | Parse a sentence in a supertagged file. | 437 | false | true | 0 | 15 | 113 | 141 | 74 | 67 | null | null |
Copilot-Language/sbv-for-copilot | Data/SBV/BitVectors/Symbolic.hs | bsd-3-clause | swKind :: SW -> Kind
swKind (SW k _) = k | 40 | swKind :: SW -> Kind
swKind (SW k _) = k | 40 | swKind (SW k _) = k | 19 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
venkat24/codeworld | codeworld-server/src/Main.hs | apache-2.0 | saveXMLHashHandler :: Snap ()
saveXMLHashHandler = do
mode <- getBuildMode
unless (mode==BuildMode "blocklyXML") $ modifyResponse $ setResponseCode 500
Just source <- getParam "source"
let programId = sourceToProgramId source
liftIO $ ensureProgramDir mode programId
liftIO $ B.writeFile (buildRootDir mode </> sourceXML programId) source
modifyResponse $ setContentType "text/plain"
writeBS (T.encodeUtf8 (unProgramId programId)) | 462 | saveXMLHashHandler :: Snap ()
saveXMLHashHandler = do
mode <- getBuildMode
unless (mode==BuildMode "blocklyXML") $ modifyResponse $ setResponseCode 500
Just source <- getParam "source"
let programId = sourceToProgramId source
liftIO $ ensureProgramDir mode programId
liftIO $ B.writeFile (buildRootDir mode </> sourceXML programId) source
modifyResponse $ setContentType "text/plain"
writeBS (T.encodeUtf8 (unProgramId programId)) | 462 | saveXMLHashHandler = do
mode <- getBuildMode
unless (mode==BuildMode "blocklyXML") $ modifyResponse $ setResponseCode 500
Just source <- getParam "source"
let programId = sourceToProgramId source
liftIO $ ensureProgramDir mode programId
liftIO $ B.writeFile (buildRootDir mode </> sourceXML programId) source
modifyResponse $ setContentType "text/plain"
writeBS (T.encodeUtf8 (unProgramId programId)) | 432 | false | true | 0 | 12 | 81 | 144 | 63 | 81 | null | null |
snoyberg/ghc | compiler/utils/Outputable.hs | bsd-3-clause | pprPrimWord64 w = integer w <> primWord64Suffix | 49 | pprPrimWord64 w = integer w <> primWord64Suffix | 49 | pprPrimWord64 w = integer w <> primWord64Suffix | 49 | false | false | 0 | 6 | 8 | 16 | 7 | 9 | null | null |
uemurax/carettah | FormatPangoMarkup.hs | gpl-2.0 | tokColor CommentTok = "<span foreground=\"#60a0b0\">" | 60 | tokColor CommentTok = "<span foreground=\"#60a0b0\">" | 60 | tokColor CommentTok = "<span foreground=\"#60a0b0\">" | 60 | false | false | 0 | 4 | 11 | 10 | 4 | 6 | null | null |
hguenther/nbis | Analyzation.hs | agpl-3.0 | getDefiningBlocks :: (String -> Bool) -> [(Ptr BasicBlock,Maybe String,[[InstrDesc Operand]])] -> Map (Ptr Instruction) (Ptr BasicBlock,Integer)
getDefiningBlocks isIntr
= foldl (\mp1 (blk,_,sblks)
-> foldl (\mp2 (instrs,sblk)
-> foldl (\mp3 instr -> case instr of
IAssign trg _ _ -> Map.insert trg (blk,sblk) mp3
ITerminator (ICall trg _ fun _) -> case operandDesc fun of
ODFunction _ fname _ -> if isIntr fname
then Map.insert trg (blk,sblk) mp3
else Map.insert trg (blk,sblk+1) mp3
_ -> mp3
) mp2 instrs
) mp1 (zip sblks [0..])
) Map.empty | 894 | getDefiningBlocks :: (String -> Bool) -> [(Ptr BasicBlock,Maybe String,[[InstrDesc Operand]])] -> Map (Ptr Instruction) (Ptr BasicBlock,Integer)
getDefiningBlocks isIntr
= foldl (\mp1 (blk,_,sblks)
-> foldl (\mp2 (instrs,sblk)
-> foldl (\mp3 instr -> case instr of
IAssign trg _ _ -> Map.insert trg (blk,sblk) mp3
ITerminator (ICall trg _ fun _) -> case operandDesc fun of
ODFunction _ fname _ -> if isIntr fname
then Map.insert trg (blk,sblk) mp3
else Map.insert trg (blk,sblk+1) mp3
_ -> mp3
) mp2 instrs
) mp1 (zip sblks [0..])
) Map.empty | 894 | getDefiningBlocks isIntr
= foldl (\mp1 (blk,_,sblks)
-> foldl (\mp2 (instrs,sblk)
-> foldl (\mp3 instr -> case instr of
IAssign trg _ _ -> Map.insert trg (blk,sblk) mp3
ITerminator (ICall trg _ fun _) -> case operandDesc fun of
ODFunction _ fname _ -> if isIntr fname
then Map.insert trg (blk,sblk) mp3
else Map.insert trg (blk,sblk+1) mp3
_ -> mp3
) mp2 instrs
) mp1 (zip sblks [0..])
) Map.empty | 749 | false | true | 0 | 23 | 436 | 277 | 145 | 132 | null | null |
rawlep/EQS | sourceCode/GlobalParameters.hs | mit | setScrollPolicy VScroll = (G.PolicyNever, G.PolicyAutomatic) | 60 | setScrollPolicy VScroll = (G.PolicyNever, G.PolicyAutomatic) | 60 | setScrollPolicy VScroll = (G.PolicyNever, G.PolicyAutomatic) | 60 | false | false | 1 | 6 | 4 | 22 | 10 | 12 | null | null |
rvion/lamdu | Lamdu/GUI/WidgetIdIRef.hs | gpl-3.0 | fromIRef :: IRef m a -> Id
fromIRef = fromGuid . IRef.guid | 58 | fromIRef :: IRef m a -> Id
fromIRef = fromGuid . IRef.guid | 58 | fromIRef = fromGuid . IRef.guid | 31 | false | true | 0 | 6 | 11 | 26 | 13 | 13 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.