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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
codemac/yi-editor | src/Data/ByteRope.hs | gpl-2.0 | -- | Append two strings by merging the two finger trees.
append :: ByteRope -> ByteRope -> ByteRope
append (ByteRope a) (ByteRope b) = ByteRope $
case T.viewr a of
EmptyR -> b
l :> x -> case T.viewl b of
EmptyL -> a
x' :< r -> if B.length x + B.length x' < chunkSize
then l >< singleton (x `B.append` x') >< r
else a >< b | 436 | append :: ByteRope -> ByteRope -> ByteRope
append (ByteRope a) (ByteRope b) = ByteRope $
case T.viewr a of
EmptyR -> b
l :> x -> case T.viewl b of
EmptyL -> a
x' :< r -> if B.length x + B.length x' < chunkSize
then l >< singleton (x `B.append` x') >< r
else a >< b | 379 | append (ByteRope a) (ByteRope b) = ByteRope $
case T.viewr a of
EmptyR -> b
l :> x -> case T.viewl b of
EmptyL -> a
x' :< r -> if B.length x + B.length x' < chunkSize
then l >< singleton (x `B.append` x') >< r
else a >< b | 336 | true | true | 0 | 17 | 183 | 143 | 72 | 71 | null | null |
lpsmith/blaze-builder-compat | src/Blaze/ByteString/Builder/Int.hs | bsd-3-clause | writeInt32le :: Int32 -> Write
writeInt32le = writePrimFixed P.int32LE | 72 | writeInt32le :: Int32 -> Write
writeInt32le = writePrimFixed P.int32LE | 72 | writeInt32le = writePrimFixed P.int32LE | 39 | false | true | 0 | 6 | 10 | 20 | 10 | 10 | null | null |
enolan/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v LStrRev [x] = v ++ "idris_strRev(vm, " ++ creg x ++ ")" | 62 | doOp v LStrRev [x] = v ++ "idris_strRev(vm, " ++ creg x ++ ")" | 62 | doOp v LStrRev [x] = v ++ "idris_strRev(vm, " ++ creg x ++ ")" | 62 | false | false | 0 | 7 | 13 | 34 | 15 | 19 | null | null |
tpsinnem/Idris-dev | src/Idris/Primitives.hs | bsd-3-clause | intOps :: IntTy -> [Prim]
intOps ity = intCmps ity ++ intArith ity ++ intConv ity | 81 | intOps :: IntTy -> [Prim]
intOps ity = intCmps ity ++ intArith ity ++ intConv ity | 81 | intOps ity = intCmps ity ++ intArith ity ++ intConv ity | 55 | false | true | 0 | 8 | 15 | 43 | 19 | 24 | null | null |
Helium4Haskell/helium | src/Helium/Syntax/UHA_Utils.hs | gpl-3.0 | getIdOrigin :: Name -> Id
getIdOrigin = idFromString . getNameOrigin | 68 | getIdOrigin :: Name -> Id
getIdOrigin = idFromString . getNameOrigin | 68 | getIdOrigin = idFromString . getNameOrigin | 42 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
jberryman/wai | warp/Network/Wai/Handler/Warp.hs | mit | -- | Port to listen on. Default value: 3000
--
-- Since 2.1.0
setPort :: Int -> Settings -> Settings
setPort x y = y { settingsPort = x } | 137 | setPort :: Int -> Settings -> Settings
setPort x y = y { settingsPort = x } | 75 | setPort x y = y { settingsPort = x } | 36 | true | true | 0 | 6 | 29 | 35 | 20 | 15 | null | null |
eightyeight/space-sim | src/Data/Space/Control.hs | bsd-3-clause | sendP ::
(ToProtocol a, Sender t) =>
Socket z t
-> [Flag]
-> a
-> ZMQ z ()
sendP s x =
send s x . pack . toProtocol | 127 | sendP ::
(ToProtocol a, Sender t) =>
Socket z t
-> [Flag]
-> a
-> ZMQ z ()
sendP s x =
send s x . pack . toProtocol | 127 | sendP s x =
send s x . pack . toProtocol | 42 | false | true | 0 | 11 | 40 | 72 | 35 | 37 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/GLUT/examples/Misc/ExtractContours.hs | bsd-3-clause | tri :: ComplexContour DontCare
tri = ComplexContour [
AnnotatedVertex (Vertex3 75 75 0) 0,
AnnotatedVertex (Vertex3 125 175 0) 0,
AnnotatedVertex (Vertex3 175 75 0) 0 ] | 180 | tri :: ComplexContour DontCare
tri = ComplexContour [
AnnotatedVertex (Vertex3 75 75 0) 0,
AnnotatedVertex (Vertex3 125 175 0) 0,
AnnotatedVertex (Vertex3 175 75 0) 0 ] | 180 | tri = ComplexContour [
AnnotatedVertex (Vertex3 75 75 0) 0,
AnnotatedVertex (Vertex3 125 175 0) 0,
AnnotatedVertex (Vertex3 175 75 0) 0 ] | 149 | false | true | 0 | 9 | 38 | 71 | 35 | 36 | null | null |
samidarko/euler | Helpers.hs | mit | minus xs _ = xs | 24 | minus xs _ = xs | 24 | minus xs _ = xs | 24 | false | false | 0 | 5 | 13 | 11 | 5 | 6 | null | null |
ikirill/ComputationalMathematics | Cube/CubeSolver.hs | gpl-3.0 | mulSRPJ :: SrotPerm -> SrotPerm -> SrotPerm
mulSRPJ sr1 sr2 = sr1 `mulSRP` sr2
where mulSRP (SrotPerm s1 sc1 sf1) (SrotPerm s2 sc2 sf2) = SrotPerm (s1 ++ s2) (sc1 `mul` sc2) (sf1 `mul` sf2)
-- }}}
-- {{{ A more algorithmic approach
-- | There is a dag between "goals", each goal a set of cubes that are
-- required to be in placed at a certain stage. Some goals may be
-- unreachable, so from each goal I generate a number of goals, trying
-- them in sequence and taking the first reachable one. Reachable is
-- probably defined as within 8 operations involving two sides only.
--
-- FIXME FIXME Remember to simlify searching for conjugates of very
-- FIXME FIXME simple permutations | 688 | mulSRPJ :: SrotPerm -> SrotPerm -> SrotPerm
mulSRPJ sr1 sr2 = sr1 `mulSRP` sr2
where mulSRP (SrotPerm s1 sc1 sf1) (SrotPerm s2 sc2 sf2) = SrotPerm (s1 ++ s2) (sc1 `mul` sc2) (sf1 `mul` sf2)
-- }}}
-- {{{ A more algorithmic approach
-- | There is a dag between "goals", each goal a set of cubes that are
-- required to be in placed at a certain stage. Some goals may be
-- unreachable, so from each goal I generate a number of goals, trying
-- them in sequence and taking the first reachable one. Reachable is
-- probably defined as within 8 operations involving two sides only.
--
-- FIXME FIXME Remember to simlify searching for conjugates of very
-- FIXME FIXME simple permutations | 688 | mulSRPJ sr1 sr2 = sr1 `mulSRP` sr2
where mulSRP (SrotPerm s1 sc1 sf1) (SrotPerm s2 sc2 sf2) = SrotPerm (s1 ++ s2) (sc1 `mul` sc2) (sf1 `mul` sf2)
-- }}}
-- {{{ A more algorithmic approach
-- | There is a dag between "goals", each goal a set of cubes that are
-- required to be in placed at a certain stage. Some goals may be
-- unreachable, so from each goal I generate a number of goals, trying
-- them in sequence and taking the first reachable one. Reachable is
-- probably defined as within 8 operations involving two sides only.
--
-- FIXME FIXME Remember to simlify searching for conjugates of very
-- FIXME FIXME simple permutations | 644 | false | true | 1 | 8 | 130 | 115 | 63 | 52 | null | null |
cutsea110/sig | sig-api/Api/Indicator.hs | bsd-3-clause | toTerms (P4 n s m l) = defaultTerms { n = Just n, s = Just s, m = Just m, l = Just l } | 86 | toTerms (P4 n s m l) = defaultTerms { n = Just n, s = Just s, m = Just m, l = Just l } | 86 | toTerms (P4 n s m l) = defaultTerms { n = Just n, s = Just s, m = Just m, l = Just l } | 86 | false | false | 0 | 7 | 25 | 59 | 31 | 28 | null | null |
tjakway/ghcjvm | compiler/prelude/PrelNames.hs | bsd-3-clause | toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey | 82 | toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey | 82 | toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey | 82 | false | false | 0 | 7 | 13 | 19 | 9 | 10 | null | null |
Cahu/krpc-hs | src/KRPCHS/KerbalAlarmClock.hs | gpl-3.0 | getAlarmMarginStream :: KRPCHS.KerbalAlarmClock.Alarm -> RPCContext (KRPCStream (Double))
getAlarmMarginStream thisArg = requestStream $ getAlarmMarginStreamReq thisArg | 168 | getAlarmMarginStream :: KRPCHS.KerbalAlarmClock.Alarm -> RPCContext (KRPCStream (Double))
getAlarmMarginStream thisArg = requestStream $ getAlarmMarginStreamReq thisArg | 168 | getAlarmMarginStream thisArg = requestStream $ getAlarmMarginStreamReq thisArg | 78 | false | true | 0 | 9 | 13 | 43 | 21 | 22 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Writers/RST.hs | gpl-2.0 | -- | Convert Pandoc to RST.
writeRST :: WriterOptions -> Pandoc -> String
writeRST opts document =
let st = WriterState { stNotes = [], stLinks = [],
stImages = [], stHasMath = False,
stOptions = opts }
in evalState (pandocToRST document) st | 295 | writeRST :: WriterOptions -> Pandoc -> String
writeRST opts document =
let st = WriterState { stNotes = [], stLinks = [],
stImages = [], stHasMath = False,
stOptions = opts }
in evalState (pandocToRST document) st | 267 | writeRST opts document =
let st = WriterState { stNotes = [], stLinks = [],
stImages = [], stHasMath = False,
stOptions = opts }
in evalState (pandocToRST document) st | 221 | true | true | 0 | 11 | 96 | 85 | 47 | 38 | null | null |
yiannist/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | nicVlan :: String
nicVlan = "vlan" | 34 | nicVlan :: String
nicVlan = "vlan" | 34 | nicVlan = "vlan" | 16 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-docLang/Drasil/DocLang/SRS.hs | bsd-2-clause | inModelLabel = makeSecRef "IMs" "Instance Models" | 55 | inModelLabel = makeSecRef "IMs" "Instance Models" | 55 | inModelLabel = makeSecRef "IMs" "Instance Models" | 55 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Embedded.hs | bsd-3-clause | -- | A short-hand notion for @ el\' \"audio\" ... @
audioN' ∷ forall t m a. DomBuilder t m ⇒ m a → m (Element EventResult (DomBuilderSpace m) t, a)
audioN' = el' "audio" | 169 | audioN' ∷ forall t m a. DomBuilder t m ⇒ m a → m (Element EventResult (DomBuilderSpace m) t, a)
audioN' = el' "audio" | 117 | audioN' = el' "audio" | 21 | true | true | 0 | 12 | 34 | 60 | 31 | 29 | null | null |
andre-artus/handbook-of-practical-logic-and-automated-reasoning-haskell | src/ATP/IntroSyn.hs | gpl-3.0 | -
The quasiquoter for Exprs. It is the only export besides the syntax
for Exprs.
-}
expr :: QuasiQuoter
expr = QuasiQuoter quoteExprExp quoteExprPat
| 153 | expr :: QuasiQuoter
expr = QuasiQuoter quoteExprExp quoteExprPat | 64 | expr = QuasiQuoter quoteExprExp quoteExprPat | 44 | true | true | 2 | 7 | 28 | 64 | 27 | 37 | null | null |
drets/scheme-haskell-48h | src/Scheme/Parser.hs | bsd-3-clause | parseExpr :: Parser LispValue
parseExpr =
choice [ try parseNumber
, try (char '#' >> parseCharacter)
, try parseVector
, parseString
, parseAtom
, parseQuoted
, parseQuasiQuote
, do char '('
x <- try parseList <|> parseDottedList
char ')'
return x
] | 366 | parseExpr :: Parser LispValue
parseExpr =
choice [ try parseNumber
, try (char '#' >> parseCharacter)
, try parseVector
, parseString
, parseAtom
, parseQuoted
, parseQuasiQuote
, do char '('
x <- try parseList <|> parseDottedList
char ')'
return x
] | 366 | parseExpr =
choice [ try parseNumber
, try (char '#' >> parseCharacter)
, try parseVector
, parseString
, parseAtom
, parseQuoted
, parseQuasiQuote
, do char '('
x <- try parseList <|> parseDottedList
char ')'
return x
] | 336 | false | true | 1 | 11 | 157 | 96 | 44 | 52 | null | null |
ItsLastDay/academic_university_2016-2018 | subjects/Haskell/coursework.hs | gpl-3.0 | myShowExpr (x :@ y) = (showChar '(')
. (myShowExpr x)
. (showChar ' ')
. (myShowExpr y)
. (showChar ')') | 155 | myShowExpr (x :@ y) = (showChar '(')
. (myShowExpr x)
. (showChar ' ')
. (myShowExpr y)
. (showChar ')') | 155 | myShowExpr (x :@ y) = (showChar '(')
. (myShowExpr x)
. (showChar ' ')
. (myShowExpr y)
. (showChar ')') | 155 | false | false | 0 | 10 | 70 | 62 | 31 | 31 | null | null |
mettekou/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mkTcKindCo = mkKindCo | 33 | mkTcKindCo = mkKindCo | 33 | mkTcKindCo = mkKindCo | 33 | false | false | 0 | 4 | 14 | 6 | 3 | 3 | null | null |
michalkonecny/aern2 | aern2-fnreps/main/waac-benchmarks.hs | bsd-3-clause | algName _ = undefined | 21 | algName _ = undefined | 21 | algName _ = undefined | 21 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/FontFace.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFace.status Mozilla FontFace.status documentation>
getStatus :: (MonadDOM m) => FontFace -> m FontFaceLoadStatus
getStatus self
= liftDOM ((self ^. js "status") >>= fromJSValUnchecked) | 246 | getStatus :: (MonadDOM m) => FontFace -> m FontFaceLoadStatus
getStatus self
= liftDOM ((self ^. js "status") >>= fromJSValUnchecked) | 135 | getStatus self
= liftDOM ((self ^. js "status") >>= fromJSValUnchecked) | 73 | true | true | 0 | 10 | 27 | 51 | 26 | 25 | null | null |
ykst/MetaC | Language/Meta/C/Parser.hs | mit | symbol :: String -> TheParser String
symbol = try . lx . string | 63 | symbol :: String -> TheParser String
symbol = try . lx . string | 63 | symbol = try . lx . string | 26 | false | true | 0 | 6 | 12 | 26 | 13 | 13 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeCustomerGateways.hs | mpl-2.0 | -- | One or more customer gateway IDs.
--
-- Default: Describes all your customer gateways.
dcgCustomerGatewayIds :: Lens' DescribeCustomerGateways [Text]
dcgCustomerGatewayIds =
lens _dcgCustomerGatewayIds (\s a -> s { _dcgCustomerGatewayIds = a })
. _List | 269 | dcgCustomerGatewayIds :: Lens' DescribeCustomerGateways [Text]
dcgCustomerGatewayIds =
lens _dcgCustomerGatewayIds (\s a -> s { _dcgCustomerGatewayIds = a })
. _List | 177 | dcgCustomerGatewayIds =
lens _dcgCustomerGatewayIds (\s a -> s { _dcgCustomerGatewayIds = a })
. _List | 114 | true | true | 2 | 8 | 47 | 56 | 28 | 28 | null | null |
jthornber/language-c-ejt | src/Language/C/Analysis/Debug.hs | bsd-3-clause | prettyAssocs :: (Pretty k, Pretty v) => String -> [(k,v)] -> Doc
prettyAssocs label = prettyAssocsWith label pretty pretty | 122 | prettyAssocs :: (Pretty k, Pretty v) => String -> [(k,v)] -> Doc
prettyAssocs label = prettyAssocsWith label pretty pretty | 122 | prettyAssocs label = prettyAssocsWith label pretty pretty | 57 | false | true | 0 | 9 | 18 | 53 | 28 | 25 | null | null |
wavewave/xournal-convert | lib/Application/XournalConvert/ProgType.hs | bsd-2-clause | mode = modes [test, makeSVG] | 28 | mode = modes [test, makeSVG] | 28 | mode = modes [test, makeSVG] | 28 | false | false | 0 | 6 | 4 | 15 | 8 | 7 | null | null |
davmre/matrizer | src/Matrizer/RewriteRules.hs | gpl-2.0 | autoTransposeTrace _ _ = Nothing | 32 | autoTransposeTrace _ _ = Nothing | 32 | autoTransposeTrace _ _ = Nothing | 32 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
Zielon/Bounce | src/Widgets/Widget.hs | bsd-3-clause | -- Smart constructors
forceBar :: Float -> Widget
forceBar v = Widget (ForceBar v) | 83 | forceBar :: Float -> Widget
forceBar v = Widget (ForceBar v) | 60 | forceBar v = Widget (ForceBar v) | 32 | true | true | 0 | 7 | 14 | 28 | 14 | 14 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/Model.hs | mit | -- | Set local-space bounding box.
modelSetBoundingBox :: (Parent Model a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to Model or ascentor
-> BoundingBox
-> m ()
modelSetBoundingBox p b = liftIO $ with b $ \b' -> do
let ptr = parentPointer p
[C.exp| void {$(Model* ptr)->SetBoundingBox(*$(BoundingBox* b'))} |]
-- | Set vertex buffers and their morph ranges. | 368 | modelSetBoundingBox :: (Parent Model a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to Model or ascentor
-> BoundingBox
-> m ()
modelSetBoundingBox p b = liftIO $ with b $ \b' -> do
let ptr = parentPointer p
[C.exp| void {$(Model* ptr)->SetBoundingBox(*$(BoundingBox* b'))} |]
-- | Set vertex buffers and their morph ranges. | 333 | modelSetBoundingBox p b = liftIO $ with b $ \b' -> do
let ptr = parentPointer p
[C.exp| void {$(Model* ptr)->SetBoundingBox(*$(BoundingBox* b'))} |]
-- | Set vertex buffers and their morph ranges. | 201 | true | true | 0 | 12 | 72 | 95 | 49 | 46 | null | null |
tranma/falling-turnip | repa/Alchemy.hs | bsd-3-clause | -- oil catches fire: oil + <some fire> = 2 x new fire
applyAlchemy' 6 f | isFire f = Left (fire, fire) | 102 | applyAlchemy' 6 f | isFire f = Left (fire, fire) | 48 | applyAlchemy' 6 f | isFire f = Left (fire, fire) | 48 | true | false | 0 | 8 | 22 | 30 | 14 | 16 | null | null |
bergmark/http2 | Network/HTTP2/Decode.hs | bsd-3-clause | decodeContinuationFrame :: FramePayloadDecoder
decodeContinuationFrame _ bs = Right $ ContinuationFrame bs | 106 | decodeContinuationFrame :: FramePayloadDecoder
decodeContinuationFrame _ bs = Right $ ContinuationFrame bs | 106 | decodeContinuationFrame _ bs = Right $ ContinuationFrame bs | 59 | false | true | 0 | 6 | 10 | 23 | 11 | 12 | null | null |
pbv/codex | src/Codex/Tester/Utils.hs | mit | -- | ensure an test assertion; throws MiscError otherwise
assert :: MonadIO m => IO Bool -> String -> m ()
assert chk msg = liftIO $ do
c <- chk
unless c $ throwIO (AssertionFailed msg) | 189 | assert :: MonadIO m => IO Bool -> String -> m ()
assert chk msg = liftIO $ do
c <- chk
unless c $ throwIO (AssertionFailed msg) | 131 | assert chk msg = liftIO $ do
c <- chk
unless c $ throwIO (AssertionFailed msg) | 82 | true | true | 0 | 11 | 40 | 70 | 32 | 38 | null | null |
urv/fixhs | src/Data/FIX/Spec/FIX43.hs | lgpl-2.1 | tClOrdID :: FIXTag
tClOrdID = FIXTag
{ tName = "ClOrdID"
, tnum = 11
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary } | 150 | tClOrdID :: FIXTag
tClOrdID = FIXTag
{ tName = "ClOrdID"
, tnum = 11
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary } | 150 | tClOrdID = FIXTag
{ tName = "ClOrdID"
, tnum = 11
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary } | 131 | false | true | 0 | 8 | 37 | 45 | 26 | 19 | null | null |
nh2/WashNGo | WASH/HTML/HTMLMonadAttrs.hs | bsd-3-clause | headers :: Monad m => String -> WithHTML x m ()
headers = attr "headers" | 73 | headers :: Monad m => String -> WithHTML x m ()
headers = attr "headers" | 73 | headers = attr "headers" | 25 | false | true | 0 | 8 | 15 | 34 | 16 | 18 | null | null |
narrative/stack | src/Stack/Setup.hs | bsd-3-clause | runAndLog :: (MonadIO m, MonadBaseControl IO m, MonadLogger m)
=> Maybe (Path Abs Dir) -> String -> EnvOverride -> [String] -> m ()
runAndLog mdir name menv args = liftBaseWith $ \restore -> do
let logLines = CB.lines =$ CL.mapM_ (void . restore . monadLoggerLog $(TH.location >>= liftLoc) "" LevelInfo . toLogStr)
void $ restore $ sinkProcessStderrStdout mdir menv name args logLines logLines | 411 | runAndLog :: (MonadIO m, MonadBaseControl IO m, MonadLogger m)
=> Maybe (Path Abs Dir) -> String -> EnvOverride -> [String] -> m ()
runAndLog mdir name menv args = liftBaseWith $ \restore -> do
let logLines = CB.lines =$ CL.mapM_ (void . restore . monadLoggerLog $(TH.location >>= liftLoc) "" LevelInfo . toLogStr)
void $ restore $ sinkProcessStderrStdout mdir menv name args logLines logLines | 411 | runAndLog mdir name menv args = liftBaseWith $ \restore -> do
let logLines = CB.lines =$ CL.mapM_ (void . restore . monadLoggerLog $(TH.location >>= liftLoc) "" LevelInfo . toLogStr)
void $ restore $ sinkProcessStderrStdout mdir menv name args logLines logLines | 269 | false | true | 0 | 22 | 80 | 168 | 81 | 87 | null | null |
kvelicka/htodo | src/Types.hs | bsd-3-clause | commaSepTags' :: [Tag] -> Text
commaSepTags' [] = "" | 56 | commaSepTags' :: [Tag] -> Text
commaSepTags' [] = "" | 56 | commaSepTags' [] = "" | 25 | false | true | 0 | 8 | 12 | 29 | 13 | 16 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/GLUT/examples/RedBook/Select.hs | bsd-3-clause | bufSize :: GLsizei
bufSize = 512 | 32 | bufSize :: GLsizei
bufSize = 512 | 32 | bufSize = 512 | 13 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
exercism/xhaskell | exercises/practice/poker/.meta/examples/success-standard/src/Poker.hs | mit | parseHand :: String -> [String]
parseHand = map f . words
where
f ('1':'0':xs) = 'T' : xs
f xs = xs | 119 | parseHand :: String -> [String]
parseHand = map f . words
where
f ('1':'0':xs) = 'T' : xs
f xs = xs | 119 | parseHand = map f . words
where
f ('1':'0':xs) = 'T' : xs
f xs = xs | 87 | false | true | 4 | 8 | 41 | 72 | 31 | 41 | null | null |
brinchj/bloomfilter | Data/BloomFilter.hs | bsd-3-clause | maxHash = 4294967296 | 20 | maxHash = 4294967296 | 20 | maxHash = 4294967296 | 20 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
cauterize-tools/cauterize | src/Cauterize/Schema/Util.hs | bsd-3-clause | typeDepthMap :: IsSchema a => a -> M.Map Identifier Integer
typeDepthMap schema = dm
where
s = getSchema schema
tm = typeMap s
dm = primDepthMap `M.union` fmap typeDepth tm
lu n = fromJust $ n `M.lookup` dm
typeDepth (Type _ d) =
let rdepth =
case d of
Synonym r -> lu r
Range _ _ -> 0
Array r _ -> lu r
Vector r _ -> lu r
Enumeration _ -> 0
Record fs -> maximum $ map fieldDepth fs
Combination fs -> maximum $ map fieldDepth fs
Union fs -> maximum $ map fieldDepth fs
in 1 + rdepth
fieldDepth (EmptyField _) = 0
fieldDepth (DataField _ r) = lu r | 745 | typeDepthMap :: IsSchema a => a -> M.Map Identifier Integer
typeDepthMap schema = dm
where
s = getSchema schema
tm = typeMap s
dm = primDepthMap `M.union` fmap typeDepth tm
lu n = fromJust $ n `M.lookup` dm
typeDepth (Type _ d) =
let rdepth =
case d of
Synonym r -> lu r
Range _ _ -> 0
Array r _ -> lu r
Vector r _ -> lu r
Enumeration _ -> 0
Record fs -> maximum $ map fieldDepth fs
Combination fs -> maximum $ map fieldDepth fs
Union fs -> maximum $ map fieldDepth fs
in 1 + rdepth
fieldDepth (EmptyField _) = 0
fieldDepth (DataField _ r) = lu r | 745 | typeDepthMap schema = dm
where
s = getSchema schema
tm = typeMap s
dm = primDepthMap `M.union` fmap typeDepth tm
lu n = fromJust $ n `M.lookup` dm
typeDepth (Type _ d) =
let rdepth =
case d of
Synonym r -> lu r
Range _ _ -> 0
Array r _ -> lu r
Vector r _ -> lu r
Enumeration _ -> 0
Record fs -> maximum $ map fieldDepth fs
Combination fs -> maximum $ map fieldDepth fs
Union fs -> maximum $ map fieldDepth fs
in 1 + rdepth
fieldDepth (EmptyField _) = 0
fieldDepth (DataField _ r) = lu r | 685 | false | true | 0 | 13 | 313 | 271 | 128 | 143 | null | null |
GaloisInc/halvm-ghc | compiler/utils/UniqDFM.hs | bsd-3-clause | listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM elt
listToUDFM_Directly = foldl (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM | 131 | listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM elt
listToUDFM_Directly = foldl (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM | 131 | listToUDFM_Directly = foldl (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM | 77 | false | true | 0 | 8 | 18 | 55 | 30 | 25 | null | null |
penteract/HigherOrderHornRefinement | HOCHC/Fresh.hs | bsd-3-clause | freshVar :: Mfresh Variable
freshVar = state (\n->("x_"++show n,n+1)) | 69 | freshVar :: Mfresh Variable
freshVar = state (\n->("x_"++show n,n+1)) | 69 | freshVar = state (\n->("x_"++show n,n+1)) | 41 | false | true | 0 | 10 | 8 | 42 | 22 | 20 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Widget.hs | bsd-3-clause | layout_getBackGroundColor :: (LayoutValue arg'1) => arg'1 -> HoppyP.IO M2.Color3BConst
layout_getBackGroundColor arg'1 =
withLayoutPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap M2.Color3BConst
(layout_getBackGroundColor' arg'1') | 257 | layout_getBackGroundColor :: (LayoutValue arg'1) => arg'1 -> HoppyP.IO M2.Color3BConst
layout_getBackGroundColor arg'1 =
withLayoutPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap M2.Color3BConst
(layout_getBackGroundColor' arg'1') | 257 | layout_getBackGroundColor arg'1 =
withLayoutPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap M2.Color3BConst
(layout_getBackGroundColor' arg'1') | 170 | false | true | 0 | 8 | 29 | 73 | 35 | 38 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeInstanceStatus.hs | mpl-2.0 | -- | The response status code.
disrsResponseStatus :: Lens' DescribeInstanceStatusResponse Int
disrsResponseStatus = lens _disrsResponseStatus (\ s a -> s{_disrsResponseStatus = a}) | 181 | disrsResponseStatus :: Lens' DescribeInstanceStatusResponse Int
disrsResponseStatus = lens _disrsResponseStatus (\ s a -> s{_disrsResponseStatus = a}) | 150 | disrsResponseStatus = lens _disrsResponseStatus (\ s a -> s{_disrsResponseStatus = a}) | 86 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
danoctavian/chownat | src/Network/UDP/HolePunch.hs | mit | --
-- The daemon infrastructure
--
runMain :: IO ()
runMain = do
putStrLn "running main"
pid <- forkProcess child
exitImmediately ExitSuccess | 175 | runMain :: IO ()
runMain = do
putStrLn "running main"
pid <- forkProcess child
exitImmediately ExitSuccess | 139 | runMain = do
putStrLn "running main"
pid <- forkProcess child
exitImmediately ExitSuccess | 122 | true | true | 0 | 9 | 55 | 47 | 20 | 27 | null | null |
MichielDerhaeg/stack | src/Stack/Types/Config.hs | bsd-3-clause | ghcVariantName (GHCCustom name) = "custom-" ++ name | 51 | ghcVariantName (GHCCustom name) = "custom-" ++ name | 51 | ghcVariantName (GHCCustom name) = "custom-" ++ name | 51 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
harendra-kumar/asyncly | benchmark/StreamDOps.hs | bsd-3-clause | foldlS n = composeN n $ S.foldlS (flip S.cons) S.nil | 60 | foldlS n = composeN n $ S.foldlS (flip S.cons) S.nil | 60 | foldlS n = composeN n $ S.foldlS (flip S.cons) S.nil | 60 | false | false | 0 | 9 | 17 | 33 | 15 | 18 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxMUTEX_DEAD_LOCK :: Int
wxMUTEX_DEAD_LOCK = 1 | 46 | wxMUTEX_DEAD_LOCK :: Int
wxMUTEX_DEAD_LOCK = 1 | 46 | wxMUTEX_DEAD_LOCK = 1 | 21 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
sopvop/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | createDirectoryIfMissingVerbose :: Verbosity
-> Bool -- ^ Create its parents too?
-> FilePath
-> IO ()
createDirectoryIfMissingVerbose verbosity create_parents path0
| create_parents = withFrozenCallStack $ createDirs (parents path0)
| otherwise = withFrozenCallStack $ createDirs (take 1 (parents path0))
where
parents = reverse . scanl1 (</>) . splitDirectories . normalise
createDirs [] = return ()
createDirs (dir:[]) = createDir dir throwIO
createDirs (dir:dirs) =
createDir dir $ \_ -> do
createDirs dirs
createDir dir throwIO
createDir :: FilePath -> (IOException -> IO ()) -> IO ()
createDir dir notExistHandler = do
r <- tryIO $ createDirectoryVerbose verbosity dir
case (r :: Either IOException ()) of
Right () -> return ()
Left e
| isDoesNotExistError e -> notExistHandler e
-- createDirectory (and indeed POSIX mkdir) does not distinguish
-- between a dir already existing and a file already existing. So we
-- check for it here. Unfortunately there is a slight race condition
-- here, but we think it is benign. It could report an exception in
-- the case that the dir did exist but another process deletes the
-- directory and creates a file in its place before we can check
-- that the directory did indeed exist.
| isAlreadyExistsError e -> (do
isDir <- doesDirectoryExist dir
if isDir then return ()
else throwIO e
) `catchIO` ((\_ -> return ()) :: IOException -> IO ())
| otherwise -> throwIO e | 1,807 | createDirectoryIfMissingVerbose :: Verbosity
-> Bool -- ^ Create its parents too?
-> FilePath
-> IO ()
createDirectoryIfMissingVerbose verbosity create_parents path0
| create_parents = withFrozenCallStack $ createDirs (parents path0)
| otherwise = withFrozenCallStack $ createDirs (take 1 (parents path0))
where
parents = reverse . scanl1 (</>) . splitDirectories . normalise
createDirs [] = return ()
createDirs (dir:[]) = createDir dir throwIO
createDirs (dir:dirs) =
createDir dir $ \_ -> do
createDirs dirs
createDir dir throwIO
createDir :: FilePath -> (IOException -> IO ()) -> IO ()
createDir dir notExistHandler = do
r <- tryIO $ createDirectoryVerbose verbosity dir
case (r :: Either IOException ()) of
Right () -> return ()
Left e
| isDoesNotExistError e -> notExistHandler e
-- createDirectory (and indeed POSIX mkdir) does not distinguish
-- between a dir already existing and a file already existing. So we
-- check for it here. Unfortunately there is a slight race condition
-- here, but we think it is benign. It could report an exception in
-- the case that the dir did exist but another process deletes the
-- directory and creates a file in its place before we can check
-- that the directory did indeed exist.
| isAlreadyExistsError e -> (do
isDir <- doesDirectoryExist dir
if isDir then return ()
else throwIO e
) `catchIO` ((\_ -> return ()) :: IOException -> IO ())
| otherwise -> throwIO e | 1,807 | createDirectoryIfMissingVerbose verbosity create_parents path0
| create_parents = withFrozenCallStack $ createDirs (parents path0)
| otherwise = withFrozenCallStack $ createDirs (take 1 (parents path0))
where
parents = reverse . scanl1 (</>) . splitDirectories . normalise
createDirs [] = return ()
createDirs (dir:[]) = createDir dir throwIO
createDirs (dir:dirs) =
createDir dir $ \_ -> do
createDirs dirs
createDir dir throwIO
createDir :: FilePath -> (IOException -> IO ()) -> IO ()
createDir dir notExistHandler = do
r <- tryIO $ createDirectoryVerbose verbosity dir
case (r :: Either IOException ()) of
Right () -> return ()
Left e
| isDoesNotExistError e -> notExistHandler e
-- createDirectory (and indeed POSIX mkdir) does not distinguish
-- between a dir already existing and a file already existing. So we
-- check for it here. Unfortunately there is a slight race condition
-- here, but we think it is benign. It could report an exception in
-- the case that the dir did exist but another process deletes the
-- directory and creates a file in its place before we can check
-- that the directory did indeed exist.
| isAlreadyExistsError e -> (do
isDir <- doesDirectoryExist dir
if isDir then return ()
else throwIO e
) `catchIO` ((\_ -> return ()) :: IOException -> IO ())
| otherwise -> throwIO e | 1,604 | false | true | 1 | 18 | 625 | 397 | 193 | 204 | null | null |
nh2/shake | Development/Ninja/Parse.hs | bsd-3-clause | parseStrs :: Env Str Str -> Str -> IO [Str]
parseStrs env = mapM (askExpr env) . parseExprs | 92 | parseStrs :: Env Str Str -> Str -> IO [Str]
parseStrs env = mapM (askExpr env) . parseExprs | 91 | parseStrs env = mapM (askExpr env) . parseExprs | 47 | false | true | 0 | 9 | 18 | 51 | 23 | 28 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/TextUnit.hs | gpl-2.0 | atBoundaryB u d = (||) <$> atBoundary u d <*> atBoundaryB (enclosingUnit u) d | 77 | atBoundaryB u d = (||) <$> atBoundary u d <*> atBoundaryB (enclosingUnit u) d | 77 | atBoundaryB u d = (||) <$> atBoundary u d <*> atBoundaryB (enclosingUnit u) d | 77 | false | false | 0 | 8 | 13 | 37 | 18 | 19 | null | null |
albertov/hs-abci | examples/Counter.hs | bsd-3-clause | serializeBe :: Int64 -> ByteString
serializeBe = LBS.toStrict . Put.runPut . Put.putInt64be | 91 | serializeBe :: Int64 -> ByteString
serializeBe = LBS.toStrict . Put.runPut . Put.putInt64be | 91 | serializeBe = LBS.toStrict . Put.runPut . Put.putInt64be | 56 | false | true | 0 | 7 | 11 | 29 | 15 | 14 | null | null |
camelpunch/rhascal | src/Combat.hs | bsd-3-clause | battle _ _ [x] = [x] | 20 | battle _ _ [x] = [x] | 20 | battle _ _ [x] = [x] | 20 | false | false | 1 | 6 | 5 | 20 | 9 | 11 | null | null |
kajigor/uKanren_transformations | test/auto/Test/SymExec.hs | bsd-3-clause | dA = Program doubleAppendo $ fresh ["x", "y", "z", "r"] (call "doubleAppendo" [V "x", V "y", V "z", V "r"]) | 107 | dA = Program doubleAppendo $ fresh ["x", "y", "z", "r"] (call "doubleAppendo" [V "x", V "y", V "z", V "r"]) | 107 | dA = Program doubleAppendo $ fresh ["x", "y", "z", "r"] (call "doubleAppendo" [V "x", V "y", V "z", V "r"]) | 107 | false | false | 1 | 10 | 19 | 65 | 32 | 33 | null | null |
nimia/bottle | bottlelib/Data/AtFieldTH.hs | gpl-3.0 | varsOfType ListT = [] | 21 | varsOfType ListT = [] | 21 | varsOfType ListT = [] | 21 | false | false | 0 | 5 | 3 | 12 | 5 | 7 | null | null |
ti1024/hacq | src/Control/Monad/Quantum/PhaseShift/Binary/Kickback/ResourceState.hs | bsd-3-clause | findMaximizerBy cmp (hd : tl) = go hd tl
where
go x (y : zs) | cmp x y /= GT = go y zs
go x _ = x | 107 | findMaximizerBy cmp (hd : tl) = go hd tl
where
go x (y : zs) | cmp x y /= GT = go y zs
go x _ = x | 107 | findMaximizerBy cmp (hd : tl) = go hd tl
where
go x (y : zs) | cmp x y /= GT = go y zs
go x _ = x | 107 | false | false | 0 | 9 | 39 | 75 | 34 | 41 | null | null |
siddhanathan/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | floatPrimTyConKey = mkPreludeTyConUnique 11 | 65 | floatPrimTyConKey = mkPreludeTyConUnique 11 | 65 | floatPrimTyConKey = mkPreludeTyConUnique 11 | 65 | false | false | 0 | 5 | 25 | 9 | 4 | 5 | null | null |
copumpkin/vector-static | Data/Vector/Storable/Static.hs | bsd-3-clause | product (Vec vs) = G.product vs | 31 | product (Vec vs) = G.product vs | 31 | product (Vec vs) = G.product vs | 31 | false | false | 0 | 6 | 5 | 21 | 9 | 12 | null | null |
xmonad/xmonad-contrib | XMonad/Prompt/Directory.hs | bsd-3-clause | notboring ('.':_) = False | 25 | notboring ('.':_) = False | 25 | notboring ('.':_) = False | 25 | false | false | 0 | 7 | 3 | 16 | 8 | 8 | null | null |
fiigii/dataflow | Parser.hs | mit | conertAss :: Js.AssignOp -> AssignOp
conertAss Js.OpAssign = OpAssign | 69 | conertAss :: Js.AssignOp -> AssignOp
conertAss Js.OpAssign = OpAssign | 69 | conertAss Js.OpAssign = OpAssign | 32 | false | true | 0 | 6 | 8 | 26 | 12 | 14 | null | null |
liamoc/tea-hs | Tea/Input.hs | bsd-3-clause | index' (a,b) c = fromEnum c - fromEnum a | 42 | index' (a,b) c = fromEnum c - fromEnum a | 42 | index' (a,b) c = fromEnum c - fromEnum a | 42 | false | false | 0 | 6 | 10 | 27 | 13 | 14 | null | null |
shlevy/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | rOOT_MAIN = mkMainModule (fsLit ":Main") | 46 | rOOT_MAIN = mkMainModule (fsLit ":Main") | 46 | rOOT_MAIN = mkMainModule (fsLit ":Main") | 46 | false | false | 0 | 7 | 10 | 15 | 7 | 8 | null | null |
wjt/bustle | Bustle/UI.hs | lgpl-2.1 | decWindows :: B Int
decWindows = modifyWindows (subtract 1) >> gets windows | 75 | decWindows :: B Int
decWindows = modifyWindows (subtract 1) >> gets windows | 75 | decWindows = modifyWindows (subtract 1) >> gets windows | 55 | false | true | 0 | 7 | 11 | 35 | 15 | 20 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Map.Internal.hs | bsd-3-clause | difference t1 Tip = t1 | 23 | difference t1 Tip = t1 | 23 | difference t1 Tip = t1 | 23 | false | false | 1 | 5 | 5 | 16 | 5 | 11 | null | null |
spoqa/nirum | src/Nirum/Constructs/Identifier.hs | gpl-3.0 | toNormalizedString :: Identifier -> String
toNormalizedString = T.unpack . toNormalizedText | 91 | toNormalizedString :: Identifier -> String
toNormalizedString = T.unpack . toNormalizedText | 91 | toNormalizedString = T.unpack . toNormalizedText | 48 | false | true | 0 | 6 | 9 | 21 | 11 | 10 | null | null |
keithodulaigh/Hets | OWL2/Keywords.hs | gpl-2.0 | someS :: String
someS = "some" | 30 | someS :: String
someS = "some" | 30 | someS = "some" | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
aredlich/hnfs | hnfs-tester/BasicTests.hs | lgpl-2.1 | test_destroy_context_twice :: IO ()
test_destroy_context_twice = do
ctx <- Nfs.initContext
Nfs.destroyContext ctx
Nfs.destroyContext ctx | 142 | test_destroy_context_twice :: IO ()
test_destroy_context_twice = do
ctx <- Nfs.initContext
Nfs.destroyContext ctx
Nfs.destroyContext ctx | 142 | test_destroy_context_twice = do
ctx <- Nfs.initContext
Nfs.destroyContext ctx
Nfs.destroyContext ctx | 106 | false | true | 0 | 8 | 19 | 41 | 18 | 23 | null | null |
wizh/dotfiles | black-2016/.xmonad/xmonad.hs | gpl-3.0 | spawnToWorkspace :: String -> String -> X ()
spawnToWorkspace program workspace = do
spawn program
windows $ W.greedyView workspace | 212 | spawnToWorkspace :: String -> String -> X ()
spawnToWorkspace program workspace = do
spawn program
windows $ W.greedyView workspace | 212 | spawnToWorkspace program workspace = do
spawn program
windows $ W.greedyView workspace | 167 | false | true | 0 | 9 | 99 | 47 | 21 | 26 | null | null |
sbergot/ArgParser | src/System/Console/ArgParser/Parser.hs | bsd-3-clause | liftParam :: ParamSpec spec => spec res -> ParserSpec res
liftParam param = ParserSpec
(getParamDescr param)
$ getParser param | 133 | liftParam :: ParamSpec spec => spec res -> ParserSpec res
liftParam param = ParserSpec
(getParamDescr param)
$ getParser param | 132 | liftParam param = ParserSpec
(getParamDescr param)
$ getParser param | 74 | false | true | 2 | 7 | 25 | 52 | 22 | 30 | null | null |
hnfmr/beginning_haskell | ex8.2/src/Main.hs | mit | toYear :: Integer
toYear = 1920 | 31 | toYear :: Integer
toYear = 1920 | 31 | toYear = 1920 | 13 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
jparyani/capnproto-boostpython | compiler/src/Semantics.hs | bsd-2-clause | offsetToSize (PointerOffset _) = SizePointer | 44 | offsetToSize (PointerOffset _) = SizePointer | 44 | offsetToSize (PointerOffset _) = SizePointer | 44 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromTo_2.hs | mit | not MyFalse = MyTrue | 20 | not MyFalse = MyTrue | 20 | not MyFalse = MyTrue | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mimi1vx/cabal-rpm | src/Commands/Spec.hs | gpl-3.0 | showLicense _ (UnknownLicense l) = "Unknown" +-+ l | 50 | showLicense _ (UnknownLicense l) = "Unknown" +-+ l | 50 | showLicense _ (UnknownLicense l) = "Unknown" +-+ l | 50 | false | false | 0 | 7 | 7 | 21 | 10 | 11 | null | null |
mitar/nxt | lib/Robotics/NXT/MotorControl.hs | lgpl-3.0 | -- Reads a message from MotorControl program on the NXT brick
motorControlReceive :: NXT String
motorControlReceive = ensureMessageRead RemoteInbox0 True | 153 | motorControlReceive :: NXT String
motorControlReceive = ensureMessageRead RemoteInbox0 True | 91 | motorControlReceive = ensureMessageRead RemoteInbox0 True | 57 | true | true | 0 | 5 | 19 | 20 | 10 | 10 | null | null |
jameysharp/lotos | LOTOS/Simplify.hs | gpl-2.0 | insertBeforeExit f results b = descendBehavior (insertBeforeExit f results) b | 77 | insertBeforeExit f results b = descendBehavior (insertBeforeExit f results) b | 77 | insertBeforeExit f results b = descendBehavior (insertBeforeExit f results) b | 77 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
d0kt0r0/Tidal | src/Sound/Tidal/Tempo.hs | gpl-3.0 | changeTempo' :: Tempo -> O.Time -> Rational -> Tempo
changeTempo' tempo newCps cyc = tempo {atTime = cyclesToTime tempo cyc,
cps = newCps,
atCycle = cyc
} | 270 | changeTempo' :: Tempo -> O.Time -> Rational -> Tempo
changeTempo' tempo newCps cyc = tempo {atTime = cyclesToTime tempo cyc,
cps = newCps,
atCycle = cyc
} | 270 | changeTempo' tempo newCps cyc = tempo {atTime = cyclesToTime tempo cyc,
cps = newCps,
atCycle = cyc
} | 217 | false | true | 0 | 7 | 142 | 57 | 31 | 26 | null | null |
myShoggoth/shakespeare | Text/Hamlet.hs | mit | getVars (ContentAttrs d) = [(d, VTAttrs)] | 41 | getVars (ContentAttrs d) = [(d, VTAttrs)] | 41 | getVars (ContentAttrs d) = [(d, VTAttrs)] | 41 | false | false | 0 | 6 | 5 | 25 | 13 | 12 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 3651 = 3650 | 11 | 3651 = 3650 | 11 | 3651 = 3650 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
sol/pandoc | src/Text/Pandoc/Readers/RST.hs | gpl-2.0 | fieldListItem :: String
-> GenParser Char ParserState (Maybe ([Inline], [[Block]]))
fieldListItem indent = try $ do
(name, raw) <- rawFieldListItem indent
let term = [Str name]
contents <- parseFromString (many block) raw
optional blanklines
case (name, contents) of
("Author", x) -> do
updateState $ \st ->
st{ stateAuthors = stateAuthors st ++ [extractContents x] }
return Nothing
("Authors", [BulletList auths]) -> do
updateState $ \st -> st{ stateAuthors = map extractContents auths }
return Nothing
("Date", x) -> do
updateState $ \st -> st{ stateDate = extractContents x }
return Nothing
("Title", x) -> do
updateState $ \st -> st{ stateTitle = extractContents x }
return Nothing
_ -> return $ Just (term, [contents]) | 894 | fieldListItem :: String
-> GenParser Char ParserState (Maybe ([Inline], [[Block]]))
fieldListItem indent = try $ do
(name, raw) <- rawFieldListItem indent
let term = [Str name]
contents <- parseFromString (many block) raw
optional blanklines
case (name, contents) of
("Author", x) -> do
updateState $ \st ->
st{ stateAuthors = stateAuthors st ++ [extractContents x] }
return Nothing
("Authors", [BulletList auths]) -> do
updateState $ \st -> st{ stateAuthors = map extractContents auths }
return Nothing
("Date", x) -> do
updateState $ \st -> st{ stateDate = extractContents x }
return Nothing
("Title", x) -> do
updateState $ \st -> st{ stateTitle = extractContents x }
return Nothing
_ -> return $ Just (term, [contents]) | 894 | fieldListItem indent = try $ do
(name, raw) <- rawFieldListItem indent
let term = [Str name]
contents <- parseFromString (many block) raw
optional blanklines
case (name, contents) of
("Author", x) -> do
updateState $ \st ->
st{ stateAuthors = stateAuthors st ++ [extractContents x] }
return Nothing
("Authors", [BulletList auths]) -> do
updateState $ \st -> st{ stateAuthors = map extractContents auths }
return Nothing
("Date", x) -> do
updateState $ \st -> st{ stateDate = extractContents x }
return Nothing
("Title", x) -> do
updateState $ \st -> st{ stateTitle = extractContents x }
return Nothing
_ -> return $ Just (term, [contents]) | 796 | false | true | 0 | 20 | 284 | 327 | 165 | 162 | null | null |
philopon/hassistant.vim | src/Hassistant/Header.hs | bsd-3-clause | parseImports :: String -> GHC.Ghc (Maybe (GHC.ImportDecl GHC.RdrName))
parseImports i = (Just <$> GHC.parseImportDecl i) `Exception.gcatch` handler
where handler (_::Exception.SomeException) = return Nothing | 209 | parseImports :: String -> GHC.Ghc (Maybe (GHC.ImportDecl GHC.RdrName))
parseImports i = (Just <$> GHC.parseImportDecl i) `Exception.gcatch` handler
where handler (_::Exception.SomeException) = return Nothing | 209 | parseImports i = (Just <$> GHC.parseImportDecl i) `Exception.gcatch` handler
where handler (_::Exception.SomeException) = return Nothing | 138 | false | true | 0 | 11 | 24 | 81 | 41 | 40 | null | null |
danr/hipspec | tfp1/tests/Patterns.hs | gpl-3.0 | foo :: [a] -> [b] -> ABC
foo (_:_) _ = A | 44 | foo :: [a] -> [b] -> ABC
foo (_:_) _ = A | 44 | foo (_:_) _ = A | 19 | false | true | 0 | 7 | 15 | 37 | 20 | 17 | null | null |
spechub/Hets | Common/ToXml.hs | gpl-2.0 | myDataToXml :: MyData -> Element
myDataToXml d =
let
listTag, listItemTag, dataItemTag :: String
listTag = "List"
listItemTag = "li"
dataItemTag = "d"
myDataToXmlWorker :: String -> MyData -> Element
myDataToXmlWorker tag md = case md of
Builtin _ v -> unode tag v
ListOrTuple _ values ->
unode tag $ map (myDataToXmlWorker listItemTag) values
Cons _ Nothing values ->
unode tag $ map (myDataToXmlWorker dataItemTag) values
Cons _ (Just fields) values ->
unode tag $ zipWith myDataToXmlWorker fields values
in
case d of
Cons constructor _ _ -> myDataToXmlWorker constructor d
ListOrTuple _ _ -> myDataToXmlWorker listTag d
Builtin _ v -> unode dataItemTag v | 756 | myDataToXml :: MyData -> Element
myDataToXml d =
let
listTag, listItemTag, dataItemTag :: String
listTag = "List"
listItemTag = "li"
dataItemTag = "d"
myDataToXmlWorker :: String -> MyData -> Element
myDataToXmlWorker tag md = case md of
Builtin _ v -> unode tag v
ListOrTuple _ values ->
unode tag $ map (myDataToXmlWorker listItemTag) values
Cons _ Nothing values ->
unode tag $ map (myDataToXmlWorker dataItemTag) values
Cons _ (Just fields) values ->
unode tag $ zipWith myDataToXmlWorker fields values
in
case d of
Cons constructor _ _ -> myDataToXmlWorker constructor d
ListOrTuple _ _ -> myDataToXmlWorker listTag d
Builtin _ v -> unode dataItemTag v | 756 | myDataToXml d =
let
listTag, listItemTag, dataItemTag :: String
listTag = "List"
listItemTag = "li"
dataItemTag = "d"
myDataToXmlWorker :: String -> MyData -> Element
myDataToXmlWorker tag md = case md of
Builtin _ v -> unode tag v
ListOrTuple _ values ->
unode tag $ map (myDataToXmlWorker listItemTag) values
Cons _ Nothing values ->
unode tag $ map (myDataToXmlWorker dataItemTag) values
Cons _ (Just fields) values ->
unode tag $ zipWith myDataToXmlWorker fields values
in
case d of
Cons constructor _ _ -> myDataToXmlWorker constructor d
ListOrTuple _ _ -> myDataToXmlWorker listTag d
Builtin _ v -> unode dataItemTag v | 723 | false | true | 0 | 15 | 204 | 243 | 115 | 128 | null | null |
CharlesRandles/cryptoChallenge | crackxor.hs | gpl-3.0 | average :: [Int] -> Double
average xs = (fromIntegral $ sum xs) / (fromIntegral $ length xs) | 92 | average :: [Int] -> Double
average xs = (fromIntegral $ sum xs) / (fromIntegral $ length xs) | 92 | average xs = (fromIntegral $ sum xs) / (fromIntegral $ length xs) | 65 | false | true | 2 | 8 | 16 | 52 | 24 | 28 | null | null |
BartAdv/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reflectErr (UnknownImplicit n f) = raw_apply (Var $ reflErrName "UnknownImplicit") [reflectName n, reflectName f] | 113 | reflectErr (UnknownImplicit n f) = raw_apply (Var $ reflErrName "UnknownImplicit") [reflectName n, reflectName f] | 113 | reflectErr (UnknownImplicit n f) = raw_apply (Var $ reflErrName "UnknownImplicit") [reflectName n, reflectName f] | 113 | false | false | 0 | 8 | 13 | 44 | 21 | 23 | null | null |
markus1189/discrimination | src/Data/Discrimination/Internal/WordMap.hs | bsd-2-clause | -- offset :: Int -> Word16 -> Int
-- offset k w = popCount $ w .&. (unsafeShiftL 1 k - 1)
-- {-# INLINE offset #-}
fork :: Int -> Key -> WordMap v -> Key -> WordMap v -> WordMap v
fork o k n ok on = Node (k .&. unsafeShiftL 0xfffffffffffffff0 o) o (mask k o .|. mask ok o) $ runST $ do
arr <- newSmallArray 2 n
writeSmallArray arr (fromEnum (k < ok)) on
unsafeFreezeSmallArray arr | 387 | fork :: Int -> Key -> WordMap v -> Key -> WordMap v -> WordMap v
fork o k n ok on = Node (k .&. unsafeShiftL 0xfffffffffffffff0 o) o (mask k o .|. mask ok o) $ runST $ do
arr <- newSmallArray 2 n
writeSmallArray arr (fromEnum (k < ok)) on
unsafeFreezeSmallArray arr | 271 | fork o k n ok on = Node (k .&. unsafeShiftL 0xfffffffffffffff0 o) o (mask k o .|. mask ok o) $ runST $ do
arr <- newSmallArray 2 n
writeSmallArray arr (fromEnum (k < ok)) on
unsafeFreezeSmallArray arr | 206 | true | true | 0 | 13 | 88 | 145 | 67 | 78 | null | null |
quivade/screwdriver | src/Language/FIRRTL/Parser/Statement.hs | gpl-3.0 | stmt :: RTLParser Statement
stmt = conditional
<|> connect
<|> empty
<|> inst
<|> invalid
<|> memory
<|> node
<|> partial
<|> print
<|> register
<|> stop
<|> wire | 195 | stmt :: RTLParser Statement
stmt = conditional
<|> connect
<|> empty
<|> inst
<|> invalid
<|> memory
<|> node
<|> partial
<|> print
<|> register
<|> stop
<|> wire | 195 | stmt = conditional
<|> connect
<|> empty
<|> inst
<|> invalid
<|> memory
<|> node
<|> partial
<|> print
<|> register
<|> stop
<|> wire | 167 | false | true | 0 | 15 | 61 | 58 | 29 | 29 | null | null |
alphalambda/codeworld | codeworld-prediction/src/CodeWorld/Prediction.hs | apache-2.0 | advanceCurrentTime ::
StepFun s -> AnimationRate -> Timestamp -> Future s -> Future s
advanceCurrentTime step rate target f =
f
{ current = timePassesBigStep step rate target $ current f
, lastQuery = target
} | 232 | advanceCurrentTime ::
StepFun s -> AnimationRate -> Timestamp -> Future s -> Future s
advanceCurrentTime step rate target f =
f
{ current = timePassesBigStep step rate target $ current f
, lastQuery = target
} | 232 | advanceCurrentTime step rate target f =
f
{ current = timePassesBigStep step rate target $ current f
, lastQuery = target
} | 139 | false | true | 0 | 9 | 58 | 77 | 37 | 40 | null | null |
mettekou/ghc | compiler/prelude/THNames.hs | bsd-3-clause | stringLName = libFun (fsLit "stringL") stringLIdKey | 59 | stringLName = libFun (fsLit "stringL") stringLIdKey | 59 | stringLName = libFun (fsLit "stringL") stringLIdKey | 59 | false | false | 0 | 7 | 13 | 17 | 8 | 9 | null | null |
vTurbine/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | labelType (CmmLabel _ _ CmmCode) = CodeLabel | 59 | labelType (CmmLabel _ _ CmmCode) = CodeLabel | 59 | labelType (CmmLabel _ _ CmmCode) = CodeLabel | 59 | false | false | 0 | 6 | 21 | 20 | 9 | 11 | null | null |
beni55/fay | tests/basicFunctions.hs | bsd-3-clause | append (x:xs) ys = x : append xs ys | 35 | append (x:xs) ys = x : append xs ys | 35 | append (x:xs) ys = x : append xs ys | 35 | false | false | 1 | 6 | 8 | 31 | 13 | 18 | null | null |
Saulzar/Ants | Ant/Square.hs | bsd-3-clause | waterFlag = 4 | 15 | waterFlag = 4 | 15 | waterFlag = 4 | 15 | false | false | 0 | 4 | 4 | 6 | 3 | 3 | null | null |
thsutton/rossum | src/Rossum/Krivine/Term.hs | bsd-3-clause | compile :: LC.Term a -> Either [String] Term
compile t = Right (evalState (comp t) mempty)
where
-- We ignore all partiality - a lookup in the state cannot fail as
-- the original lamba terms are well-formed.
comp :: LC.Term a -> State (Map Name Nat) Term
comp (LC.Var _ n) = (Var . fromJust) <$> (gets (M.lookup n))
comp (LC.Sym _ n) = pure (Sym n)
comp (LC.Abs _ n v) = Abs <$> (scope n (comp v))
comp (LC.App _ m n) = App <$> comp m <*> comp n
-- | Enter a scope which binds a 'Name'; restoring the current state
-- afterward. | 560 | compile :: LC.Term a -> Either [String] Term
compile t = Right (evalState (comp t) mempty)
where
-- We ignore all partiality - a lookup in the state cannot fail as
-- the original lamba terms are well-formed.
comp :: LC.Term a -> State (Map Name Nat) Term
comp (LC.Var _ n) = (Var . fromJust) <$> (gets (M.lookup n))
comp (LC.Sym _ n) = pure (Sym n)
comp (LC.Abs _ n v) = Abs <$> (scope n (comp v))
comp (LC.App _ m n) = App <$> comp m <*> comp n
-- | Enter a scope which binds a 'Name'; restoring the current state
-- afterward. | 560 | compile t = Right (evalState (comp t) mempty)
where
-- We ignore all partiality - a lookup in the state cannot fail as
-- the original lamba terms are well-formed.
comp :: LC.Term a -> State (Map Name Nat) Term
comp (LC.Var _ n) = (Var . fromJust) <$> (gets (M.lookup n))
comp (LC.Sym _ n) = pure (Sym n)
comp (LC.Abs _ n v) = Abs <$> (scope n (comp v))
comp (LC.App _ m n) = App <$> comp m <*> comp n
-- | Enter a scope which binds a 'Name'; restoring the current state
-- afterward. | 515 | false | true | 5 | 14 | 138 | 223 | 111 | 112 | null | null |
merijn/lambda-except | Eval.hs | bsd-3-clause | nf (Pi n t1 t2 l) = Pi n (nf t1) (toScope . nf . fromScope $ t2) l | 66 | nf (Pi n t1 t2 l) = Pi n (nf t1) (toScope . nf . fromScope $ t2) l | 66 | nf (Pi n t1 t2 l) = Pi n (nf t1) (toScope . nf . fromScope $ t2) l | 66 | false | false | 0 | 9 | 18 | 51 | 25 | 26 | null | null |
mlite/hLLVM | src/Llvm/Pass/Visualization.hs | bsd-3-clause | scanModule :: (DataLayoutMetrics dlm, CheckpointMonad m, FuelMonad m, Ord g, IrPrint g, Show g) =>
VisualPlugin dlm g a -> Module g a -> m (Ds.Set String)
scanModule visPlugin (Module l) =
foldM (\p x -> case x of
ToplevelDefine def@(TlDefine fn _ _) ->
do { fct <- scanDefine visPlugin def
; return (Ds.union fct p)
}
_ -> return p
) Ds.empty l | 444 | scanModule :: (DataLayoutMetrics dlm, CheckpointMonad m, FuelMonad m, Ord g, IrPrint g, Show g) =>
VisualPlugin dlm g a -> Module g a -> m (Ds.Set String)
scanModule visPlugin (Module l) =
foldM (\p x -> case x of
ToplevelDefine def@(TlDefine fn _ _) ->
do { fct <- scanDefine visPlugin def
; return (Ds.union fct p)
}
_ -> return p
) Ds.empty l | 444 | scanModule visPlugin (Module l) =
foldM (\p x -> case x of
ToplevelDefine def@(TlDefine fn _ _) ->
do { fct <- scanDefine visPlugin def
; return (Ds.union fct p)
}
_ -> return p
) Ds.empty l | 274 | false | true | 0 | 15 | 163 | 183 | 88 | 95 | null | null |
mat8913/haskell-rust-experiments | haskell/hsbits/Setup.hs | apache-2.0 | toCargoOption :: String -> LinkerOption -> String
toCargoOption _ (LinkPath p) = "cargo:rustc-link-search=native=" ++ p | 121 | toCargoOption :: String -> LinkerOption -> String
toCargoOption _ (LinkPath p) = "cargo:rustc-link-search=native=" ++ p | 121 | toCargoOption _ (LinkPath p) = "cargo:rustc-link-search=native=" ++ p | 71 | false | true | 0 | 7 | 16 | 34 | 17 | 17 | null | null |
NicolasDP/hs-smtp | Network/SMTP.hs | bsd-3-clause | prettyPrintResponse :: String
-> String
-> Response
-> String
prettyPrintResponse indentation time resp =
intercalate "\n" $ map (((++) prefix) . BC.unpack) $ message resp
where
prefix :: String
prefix = indentation ++ "[" ++ time ++ "][RSP][" ++ show (responseCodeToInt $ code resp) ++ "] " | 365 | prettyPrintResponse :: String
-> String
-> Response
-> String
prettyPrintResponse indentation time resp =
intercalate "\n" $ map (((++) prefix) . BC.unpack) $ message resp
where
prefix :: String
prefix = indentation ++ "[" ++ time ++ "][RSP][" ++ show (responseCodeToInt $ code resp) ++ "] " | 365 | prettyPrintResponse indentation time resp =
intercalate "\n" $ map (((++) prefix) . BC.unpack) $ message resp
where
prefix :: String
prefix = indentation ++ "[" ++ time ++ "][RSP][" ++ show (responseCodeToInt $ code resp) ++ "] " | 243 | false | true | 0 | 11 | 120 | 110 | 55 | 55 | null | null |
michalkonecny/aern2 | aern2-mp/src/AERN2/MP/Dyadic.hs | bsd-3-clause | lift1 :: (MPFloat -> MPFloat) -> (Dyadic -> Dyadic)
lift1 op (Dyadic x) = Dyadic (op x) | 87 | lift1 :: (MPFloat -> MPFloat) -> (Dyadic -> Dyadic)
lift1 op (Dyadic x) = Dyadic (op x) | 87 | lift1 op (Dyadic x) = Dyadic (op x) | 35 | false | true | 0 | 7 | 16 | 49 | 25 | 24 | null | null |
ddssff/pandoc | src/Text/Pandoc/Writers/ICML.hs | gpl-2.0 | inlineToICML opts style (Emph lst) = inlinesToICML opts (emphName:style) lst | 76 | inlineToICML opts style (Emph lst) = inlinesToICML opts (emphName:style) lst | 76 | inlineToICML opts style (Emph lst) = inlinesToICML opts (emphName:style) lst | 76 | false | false | 0 | 7 | 9 | 33 | 16 | 17 | null | null |
tgrospic/advent-of-code | src/AoC2016/Day09.hs | mit | grammarLen :: Parser Int
grammarLen = foldl (+) 0 <$> many exprLen | 66 | grammarLen :: Parser Int
grammarLen = foldl (+) 0 <$> many exprLen | 66 | grammarLen = foldl (+) 0 <$> many exprLen | 41 | false | true | 0 | 6 | 11 | 28 | 14 | 14 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.