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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
colah/ImplicitCAD | Graphics/Implicit/ObjectUtil/GetBoxShared.hs | agpl-3.0 | -- | Define a box around all of the given points.
pointsBox :: (Applicative f, Num a, VectorStuff (f a)) => [f a] -> (f a, f a)
pointsBox [] = emptyBox | 151 | pointsBox :: (Applicative f, Num a, VectorStuff (f a)) => [f a] -> (f a, f a)
pointsBox [] = emptyBox | 101 | pointsBox [] = emptyBox | 23 | true | true | 0 | 10 | 31 | 72 | 35 | 37 | null | null |
tidalcycles/Tidal | src/Sound/Tidal/Control.hs | gpl-3.0 | {-
{- | Just like `striate`, but also loops each sample chunk a number of times specified in the second argument.
The primed version is just like `striateBy`, where the loop count is the third argument. For example:
@
d1 $ striateL' 3 0.125 4 $ sound "feel sn:2"
@
Like `striate`, these use the `begin` and `end` param... | 1,227 | slice :: Pattern Int -> Pattern Int -> ControlPattern -> ControlPattern
slice pN pI p = P.begin b # P.end e # p
where b = div' <$> pI <* pN
e = (\i n -> div' i n + div' 1 n) <$> pI <* pN
div' num den = fromIntegral (num `mod` den) / fromIntegral den | 267 | slice pN pI p = P.begin b # P.end e # p
where b = div' <$> pI <* pN
e = (\i n -> div' i n + div' 1 n) <$> pI <* pN
div' num den = fromIntegral (num `mod` den) / fromIntegral den | 195 | true | true | 2 | 13 | 257 | 139 | 68 | 71 | null | null |
alexander-at-github/eta | libraries/base/GHC/List.hs | bsd-3-clause | (_:xs) !! n = xs !! (n-1) | 34 | (_:xs) !! n = xs !! (n-1) | 34 | (_:xs) !! n = xs !! (n-1) | 34 | false | false | 2 | 7 | 15 | 32 | 15 | 17 | null | null |
copton/ocram | ocram/src/Ocram/Print.hs | gpl-2.0 | binPrec CAndOp = 15 | 19 | binPrec CAndOp = 15 | 19 | binPrec CAndOp = 15 | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
emc2/proglang-util | Control/Monad/Gensym/UnitTest.hs | bsd-3-clause | tests = TestList [
"symbol s; symbol s" ~: do (s1, s2) <- symssyms
assertBool (show s1 ++ " == " ++ show s2)
(s1 == s2),
"symbol s; symbol t" ~: do (s1, s2) <- symssymt
assertBool (show s1 ++ " /= " ++ show s2)
... | 1,903 | tests = TestList [
"symbol s; symbol s" ~: do (s1, s2) <- symssyms
assertBool (show s1 ++ " == " ++ show s2)
(s1 == s2),
"symbol s; symbol t" ~: do (s1, s2) <- symssymt
assertBool (show s1 ++ " /= " ++ show s2)
... | 1,903 | tests = TestList [
"symbol s; symbol s" ~: do (s1, s2) <- symssyms
assertBool (show s1 ++ " == " ++ show s2)
(s1 == s2),
"symbol s; symbol t" ~: do (s1, s2) <- symssymt
assertBool (show s1 ++ " /= " ++ show s2)
... | 1,903 | false | false | 1 | 14 | 797 | 748 | 366 | 382 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Config/Bluetile.hs | bsd-2-clause | bluetileConfig =
def
{ modMask = mod4Mask, -- logo key
manageHook = bluetileManageHook,
layoutHook = bluetileLayoutHook,
logHook = currentWorkspaceOnTop >> ewmhDesktopsLogHook,
handleEventHook = ewmhDesktopsEventHook
`mappend` fullscr... | 788 | bluetileConfig =
def
{ modMask = mod4Mask, -- logo key
manageHook = bluetileManageHook,
layoutHook = bluetileLayoutHook,
logHook = currentWorkspaceOnTop >> ewmhDesktopsLogHook,
handleEventHook = ewmhDesktopsEventHook
`mappend` fullscr... | 788 | bluetileConfig =
def
{ modMask = mod4Mask, -- logo key
manageHook = bluetileManageHook,
layoutHook = bluetileLayoutHook,
logHook = currentWorkspaceOnTop >> ewmhDesktopsLogHook,
handleEventHook = ewmhDesktopsEventHook
`mappend` fullscr... | 788 | false | false | 0 | 10 | 301 | 106 | 68 | 38 | null | null |
Hara-Laboratory/subleq-toolchain | Language/Subleq/Assembly/Parser.hs | gpl-3.0 | nonLineBreakSpaces :: Stream b m Char => ParsecT b u m ()
nonLineBreakSpaces = try . void $ many nonLineBreakSpace | 114 | nonLineBreakSpaces :: Stream b m Char => ParsecT b u m ()
nonLineBreakSpaces = try . void $ many nonLineBreakSpace | 114 | nonLineBreakSpaces = try . void $ many nonLineBreakSpace | 56 | false | true | 0 | 7 | 19 | 44 | 21 | 23 | null | null |
sgillespie/ghc | libraries/base/Data/Bitraversable.hs | bsd-3-clause | bifor :: (Bitraversable t, Applicative f)
=> t a b -> (a -> f c) -> (b -> f d) -> f (t c d)
bifor t f g = bitraverse f g t | 128 | bifor :: (Bitraversable t, Applicative f)
=> t a b -> (a -> f c) -> (b -> f d) -> f (t c d)
bifor t f g = bitraverse f g t | 128 | bifor t f g = bitraverse f g t | 30 | false | true | 0 | 12 | 39 | 92 | 44 | 48 | null | null |
mankyKitty/TypePlay | src/TypePlay/Infer/HM.hs | mit | mgu (TVar u) t = varBind u t | 39 | mgu (TVar u) t = varBind u t | 39 | mgu (TVar u) t = varBind u t | 39 | false | false | 1 | 7 | 18 | 24 | 10 | 14 | null | null |
chrys-h/ftag | src/FTag/Expr/Parser.hs | mit | -- Syntactic sugar: using a '-' with no term before it to mean "all files except those"
omittedAll = FTNode FTDifference (FTLeaf $ FTAtomic $ UASByName "all") <$> try (ws >> char '-' >> ws >> term)
<|> term | 215 | omittedAll = FTNode FTDifference (FTLeaf $ FTAtomic $ UASByName "all") <$> try (ws >> char '-' >> ws >> term)
<|> term | 127 | omittedAll = FTNode FTDifference (FTLeaf $ FTAtomic $ UASByName "all") <$> try (ws >> char '-' >> ws >> term)
<|> term | 127 | true | false | 4 | 11 | 47 | 63 | 29 | 34 | null | null |
TOSPIO/yi | src/library/Yi/Keymap/Emacs/Utils.hs | gpl-2.0 | -- TODO: replace tt by digit meta
tt :: KeymapM Char
tt = do
Event (KASCII c) _ <- foldr1 (<|>) $ fmap (event . metaCh ) ['0'..'9']
return c
-- doing the argument precisely is kind of tedious.
-- read: http://www.gnu.org/software/emacs/manual/html_node/Arguments.html
-- and: http://www.gnu.org/software/emacs/elis... | 353 | tt :: KeymapM Char
tt = do
Event (KASCII c) _ <- foldr1 (<|>) $ fmap (event . metaCh ) ['0'..'9']
return c
-- doing the argument precisely is kind of tedious.
-- read: http://www.gnu.org/software/emacs/manual/html_node/Arguments.html
-- and: http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_318.html | 319 | tt = do
Event (KASCII c) _ <- foldr1 (<|>) $ fmap (event . metaCh ) ['0'..'9']
return c
-- doing the argument precisely is kind of tedious.
-- read: http://www.gnu.org/software/emacs/manual/html_node/Arguments.html
-- and: http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_318.html | 300 | true | true | 0 | 12 | 50 | 74 | 36 | 38 | null | null |
DigitalBrains1/clash-lt24 | LT24/Commands.hs | bsd-2-clause | cRead_Memory_Continue :: Num a => a
cRDDMADCTL = 0x0B | 66 | cRead_Memory_Continue :: Num a => a
cRDDMADCTL = 0x0B | 65 | cRDDMADCTL = 0x0B | 29 | false | true | 0 | 7 | 21 | 25 | 10 | 15 | null | null |
LightAndLight/hindley-milner | src/Phil/PHP.hs | bsd-3-clause | phpDeclToSource (PHPDeclStatement st) = do
phpStatementToSource st
line "" | 78 | phpDeclToSource (PHPDeclStatement st) = do
phpStatementToSource st
line "" | 78 | phpDeclToSource (PHPDeclStatement st) = do
phpStatementToSource st
line "" | 78 | false | false | 0 | 7 | 12 | 27 | 11 | 16 | null | null |
ajnsit/packman | Test/AllTests.hs | bsd-3-clause | -- make a test instance. Action should check result and return Bool
runIt :: String -> IO Bool -> TestInstance
runIt name action
= TestInstance
{ run = action >>= return . Finished .
(\b -> if b then Pass
else Fail "unexpected output (see log)")... | 467 | runIt :: String -> IO Bool -> TestInstance
runIt name action
= TestInstance
{ run = action >>= return . Finished .
(\b -> if b then Pass
else Fail "unexpected output (see log)")
, name = "Test case " ++ name
, tags = []
,... | 399 | runIt name action
= TestInstance
{ run = action >>= return . Finished .
(\b -> if b then Pass
else Fail "unexpected output (see log)")
, name = "Test case " ++ name
, tags = []
, options = []
, setOption = \_ _ ->... | 356 | true | true | 0 | 12 | 187 | 125 | 67 | 58 | null | null |
ivanperez-keera/Yampa | yampa-test/src/FRP/Yampa/Stream.hs | bsd-3-clause | -- * Creation
-- | Group a series of samples with a series of time deltas.
--
-- The first sample will have no delta. Unused samples and deltas will be
-- dropped.
groupDeltas :: [a] -> [DTime] -> SignalSampleStream a
groupDeltas (x:xs) ds = (x, zip ds xs) | 261 | groupDeltas :: [a] -> [DTime] -> SignalSampleStream a
groupDeltas (x:xs) ds = (x, zip ds xs) | 92 | groupDeltas (x:xs) ds = (x, zip ds xs) | 38 | true | true | 0 | 7 | 53 | 56 | 32 | 24 | null | null |
vikraman/ghc | compiler/simplCore/SetLevels.hs | bsd-3-clause | lvlExpr env (_, AnnVar v) = return (lookupVar env v) | 58 | lvlExpr env (_, AnnVar v) = return (lookupVar env v) | 58 | lvlExpr env (_, AnnVar v) = return (lookupVar env v) | 58 | false | false | 0 | 7 | 15 | 33 | 15 | 18 | null | null |
hvr/cryptohash-sha256 | src/Crypto/Hash/SHA256.hs | bsd-3-clause | -- | perform IO for hashes that do allocation and ffi.
-- unsafeDupablePerformIO is used when possible as the
-- computation is pure and the output is directly linked
-- to the input. we also do not modify anything after it has
-- been returned to the user.
unsafeDoIO :: IO a -> a
unsafeDoIO = unsafeDupablePerformIO | 317 | unsafeDoIO :: IO a -> a
unsafeDoIO = unsafeDupablePerformIO | 59 | unsafeDoIO = unsafeDupablePerformIO | 35 | true | true | 0 | 6 | 56 | 23 | 14 | 9 | null | null |
deweyvm/starstats | src/StarStats/Parsers/Irssi.hs | mit | parseNickChange :: Parser DataLine
parseNickChange = Nick <$> parseTime
<*> (symbol "-!-" *> parseNick)
<*> (symbol "is now known as" *> parseNick) | 196 | parseNickChange :: Parser DataLine
parseNickChange = Nick <$> parseTime
<*> (symbol "-!-" *> parseNick)
<*> (symbol "is now known as" *> parseNick) | 195 | parseNickChange = Nick <$> parseTime
<*> (symbol "-!-" *> parseNick)
<*> (symbol "is now known as" *> parseNick) | 160 | false | true | 0 | 9 | 70 | 46 | 23 | 23 | null | null |
codemac/yi-editor | src/Shim/Messages.hs | gpl-2.0 | encodeNotes :: [CompileNote] -> Se
encodeNotes l =
Se . map (\c -> (encodeSeverity (severity c),
encodeSrcSpan c (projectdir c),
show (message c (pprStyle c)))) $ l
where encodeSeverity SevInfo = S ":sev-info"
encodeSeverity SevWarning = S ":sev-warning"
encode... | 1,215 | encodeNotes :: [CompileNote] -> Se
encodeNotes l =
Se . map (\c -> (encodeSeverity (severity c),
encodeSrcSpan c (projectdir c),
show (message c (pprStyle c)))) $ l
where encodeSeverity SevInfo = S ":sev-info"
encodeSeverity SevWarning = S ":sev-warning"
encode... | 1,215 | encodeNotes l =
Se . map (\c -> (encodeSeverity (severity c),
encodeSrcSpan c (projectdir c),
show (message c (pprStyle c)))) $ l
where encodeSeverity SevInfo = S ":sev-info"
encodeSeverity SevWarning = S ":sev-warning"
encodeSeverity SevError = S ":sev-error... | 1,180 | false | true | 4 | 13 | 503 | 350 | 176 | 174 | null | null |
holzensp/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | vecElemInjectCast :: DynFlags -> PrimOpVecCat -> Width -> Maybe MachOp
vecElemInjectCast _ FloatVec _ = Nothing | 119 | vecElemInjectCast :: DynFlags -> PrimOpVecCat -> Width -> Maybe MachOp
vecElemInjectCast _ FloatVec _ = Nothing | 119 | vecElemInjectCast _ FloatVec _ = Nothing | 48 | false | true | 0 | 8 | 23 | 33 | 16 | 17 | null | null |
CulpaBS/wbBach | src/Futhark/CodeGen/ImpGen/Kernels/ToOpenCL.hs | bsd-3-clause | typesInCode (While e c) = typesInExp e <> typesInCode c | 55 | typesInCode (While e c) = typesInExp e <> typesInCode c | 55 | typesInCode (While e c) = typesInExp e <> typesInCode c | 55 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
bmsherman/cublas | Foreign/CUDA/Cublas/TH.hs | bsd-3-clause | funname :: CDeclaration a -> String
funname (CDecl _ [(Just (CDeclr (Just ident ) _ _ _ _), _, _)] _) = identToString ident | 123 | funname :: CDeclaration a -> String
funname (CDecl _ [(Just (CDeclr (Just ident ) _ _ _ _), _, _)] _) = identToString ident | 123 | funname (CDecl _ [(Just (CDeclr (Just ident ) _ _ _ _), _, _)] _) = identToString ident | 87 | false | true | 0 | 14 | 23 | 69 | 35 | 34 | null | null |
rahulmutt/codec-jvm | src/Codec/JVM/ASM.hs | apache-2.0 | mkSourceFileAttr :: Text -> Attr
mkSourceFileAttr = ASourceFile | 63 | mkSourceFileAttr :: Text -> Attr
mkSourceFileAttr = ASourceFile | 63 | mkSourceFileAttr = ASourceFile | 30 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
haasn/colour | Data/Colour/Names.hs | mit | teal :: (Ord a, Floating a) => Colour a
teal = sRGB24 0 128 128 | 63 | teal :: (Ord a, Floating a) => Colour a
teal = sRGB24 0 128 128 | 63 | teal = sRGB24 0 128 128 | 23 | false | true | 0 | 7 | 14 | 44 | 19 | 25 | null | null |
dkandalov/katas | haskell/p99/src/p9x/p00/P00.hs | unlicense | penultimate [_] = error "Can't get penultimate element" | 55 | penultimate [_] = error "Can't get penultimate element" | 55 | penultimate [_] = error "Can't get penultimate element" | 55 | false | false | 0 | 6 | 7 | 15 | 7 | 8 | null | null |
ekmett/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | bytesToWordsRoundUp :: DynFlags -> CmmExpr -> CmmExpr
bytesToWordsRoundUp dflags e = cmmQuotWord dflags (cmmAddWord dflags e (mkIntExpr dflags (wORD_SIZE dflags - 1)))
(wordSize dflags) | 235 | bytesToWordsRoundUp :: DynFlags -> CmmExpr -> CmmExpr
bytesToWordsRoundUp dflags e = cmmQuotWord dflags (cmmAddWord dflags e (mkIntExpr dflags (wORD_SIZE dflags - 1)))
(wordSize dflags) | 235 | bytesToWordsRoundUp dflags e = cmmQuotWord dflags (cmmAddWord dflags e (mkIntExpr dflags (wORD_SIZE dflags - 1)))
(wordSize dflags) | 181 | false | true | 0 | 12 | 73 | 65 | 32 | 33 | null | null |
tomjefferys/fuligite | src/Scripting/Fuligite/PropertyList.hs | mit | empty :: PropList k v
empty = PropList Seq.empty | 48 | empty :: PropList k v
empty = PropList Seq.empty | 48 | empty = PropList Seq.empty | 26 | false | true | 1 | 6 | 8 | 24 | 10 | 14 | null | null |
scrive/hpqtypes | test/Main.hs | bsd-3-clause | transactionTest :: TestData -> IsolationLevel -> Test
transactionTest td lvl =
testCase
("Auto transaction works by default with isolation level"
<+> show lvl) .
runTestEnv td
defaultTransactionSettings {tsIsolationLevel = lvl} $ do
let sint = Identity (5::Int32)
runQuery_ $ rawSQL "INSERT INTO test1_ (... | 513 | transactionTest :: TestData -> IsolationLevel -> Test
transactionTest td lvl =
testCase
("Auto transaction works by default with isolation level"
<+> show lvl) .
runTestEnv td
defaultTransactionSettings {tsIsolationLevel = lvl} $ do
let sint = Identity (5::Int32)
runQuery_ $ rawSQL "INSERT INTO test1_ (... | 513 | transactionTest td lvl =
testCase
("Auto transaction works by default with isolation level"
<+> show lvl) .
runTestEnv td
defaultTransactionSettings {tsIsolationLevel = lvl} $ do
let sint = Identity (5::Int32)
runQuery_ $ rawSQL "INSERT INTO test1_ (a) VALUES ($1)" sint
withNewConnection $ do
n <-... | 459 | false | true | 0 | 13 | 101 | 125 | 58 | 67 | null | null |
weissi/astar | src/Data/Graph/AStar.hs | bsd-3-clause | aStarM :: (Monad m, Hashable a, Ord a, Ord c, Num c) =>
(a -> m (HashSet a)) -- ^ The graph we are searching through, given as a function from vertices
-- to their neighbours.
-> (a -> a -> m c) -- ^ Distance function between neighbouring vertices of the graph. This will
... | 1,236 | aStarM :: (Monad m, Hashable a, Ord a, Ord c, Num c) =>
(a -> m (HashSet a)) -- ^ The graph we are searching through, given as a function from vertices
-- to their neighbours.
-> (a -> a -> m c) -- ^ Distance function between neighbouring vertices of the graph. This will
... | 1,157 | aStarM graph dist heur goal start
= do sv <- start
s <- runAStarM graph dist heur goal sv
return $ case end s of
Nothing -> Nothing
Just e -> Just (reverse . takeWhile (not . (== sv)) . iterate (cameFrom s !) $ e) | 276 | true | true | 0 | 19 | 450 | 246 | 126 | 120 | null | null |
nevrenato/Hets_Fork | GUI/HTkUtils.hs | gpl-2.0 | createTextSaveDisplayExt :: String -- ^ title of the window
-> String -- ^ default filename for saving the text
-> String -- ^ text to be displayed
-> [Config Editor] {- ^ configuration options for
the text editor -}
... | 1,915 | createTextSaveDisplayExt :: String -- ^ title of the window
-> String -- ^ default filename for saving the text
-> String -- ^ text to be displayed
-> [Config Editor] {- ^ configuration options for
the text editor -}
... | 1,840 | createTextSaveDisplayExt title fname txt conf upost =
do win <- createToplevel [text title]
b <- newFrame win [relief Groove, borderwidth (cm 0.05)]
t <- newLabel b [text title, font (Helvetica, Roman, 18 :: Int)]
q <- newButton b [text "Close", width 12]
s <- newButton b [text "Save", wi... | 1,358 | true | true | 0 | 15 | 663 | 608 | 287 | 321 | null | null |
massysett/penny | penny/lib/Penny/Copper/Copperize.hs | bsd-3-clause | cSeven :: Seven Char ()
cSeven = Seven ('7', ()) | 48 | cSeven :: Seven Char ()
cSeven = Seven ('7', ()) | 48 | cSeven = Seven ('7', ()) | 24 | false | true | 0 | 7 | 9 | 29 | 15 | 14 | null | null |
paul-rouse/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | mongoFilterToBSON :: forall typ. PersistField typ
=> Text
-> MongoFilterOperator typ
-> DB.Document
mongoFilterToBSON fname filt = case filt of
(PersistFilterOperator v op) -> [filterToBSON fname v op]
(MongoFilterOperator bval) -> [fname DB.:= bval] | 314 | mongoFilterToBSON :: forall typ. PersistField typ
=> Text
-> MongoFilterOperator typ
-> DB.Document
mongoFilterToBSON fname filt = case filt of
(PersistFilterOperator v op) -> [filterToBSON fname v op]
(MongoFilterOperator bval) -> [fname DB.:= bval] | 314 | mongoFilterToBSON fname filt = case filt of
(PersistFilterOperator v op) -> [filterToBSON fname v op]
(MongoFilterOperator bval) -> [fname DB.:= bval] | 160 | false | true | 0 | 9 | 97 | 90 | 45 | 45 | null | null |
adityagupta1089/Project-Euler-Haskell | src/problems/Problem709.hs | bsd-3-clause | m2inv :: Int
-- 2^-1 mod m
m2inv = 510101005 | 44 | m2inv :: Int
m2inv = 510101005 | 30 | m2inv = 510101005 | 17 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
nlim/haskell-playground | src/Euler89.hs | mit | charMapping 'V' = Just V | 24 | charMapping 'V' = Just V | 24 | charMapping 'V' = Just V | 24 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
lamdu/lamdu | test/Test/Lamdu/SugarStubs.hs | gpl-3.0 | mkOptionalTag :: Maybe UUID -> T.Tag -> Sugar.OptionalTag InternalName Identity Unit
mkOptionalTag var tag = Sugar.OptionalTag (mkTag var tag) Unit | 147 | mkOptionalTag :: Maybe UUID -> T.Tag -> Sugar.OptionalTag InternalName Identity Unit
mkOptionalTag var tag = Sugar.OptionalTag (mkTag var tag) Unit | 147 | mkOptionalTag var tag = Sugar.OptionalTag (mkTag var tag) Unit | 62 | false | true | 0 | 9 | 19 | 57 | 26 | 31 | null | null |
sjpet/quark | src/Quark/Project.hs | mit | flipToParent' :: Project -> Project
flipToParent' = firstTree flipToParent'' | 76 | flipToParent' :: Project -> Project
flipToParent' = firstTree flipToParent'' | 76 | flipToParent' = firstTree flipToParent'' | 40 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
mrkkrp/alga | src/Alga/Language/Eval.hs | gpl-3.0 | matchHistory :: MonadState CalcSt m
=> [Element NRatio] -- ^ Stream of elements to test
-> m Bool -- ^ Do they match history?
matchHistory x = do
hs <- gets clHistory
return . or $ condMatch hs <$> x
-- | Add evaluated value to history. | 257 | matchHistory :: MonadState CalcSt m
=> [Element NRatio] -- ^ Stream of elements to test
-> m Bool
matchHistory x = do
hs <- gets clHistory
return . or $ condMatch hs <$> x
-- | Add evaluated value to history. | 218 | matchHistory x = do
hs <- gets clHistory
return . or $ condMatch hs <$> x
-- | Add evaluated value to history. | 115 | true | true | 0 | 9 | 67 | 68 | 32 | 36 | null | null |
ku-fpg/blank-canvas | examples/playbar/Main.hs | bsd-3-clause | playbarDraw context audio play curTime = do
send context $ do
-- clear frame
clearRect (0,0,200,45)
-- get full duration of audio file
let time = durationAudio audio
playbarBox 5 10 curTime time
-- draw play/pause depending on current state
if (play == Playing)
then do
pauseD... | 415 | playbarDraw context audio play curTime = do
send context $ do
-- clear frame
clearRect (0,0,200,45)
-- get full duration of audio file
let time = durationAudio audio
playbarBox 5 10 curTime time
-- draw play/pause depending on current state
if (play == Playing)
then do
pauseD... | 415 | playbarDraw context audio play curTime = do
send context $ do
-- clear frame
clearRect (0,0,200,45)
-- get full duration of audio file
let time = durationAudio audio
playbarBox 5 10 curTime time
-- draw play/pause depending on current state
if (play == Playing)
then do
pauseD... | 415 | false | false | 0 | 13 | 121 | 105 | 51 | 54 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 1058529 = 1910 | 34 | getValueFromProduct 1058529 = 1910 | 34 | getValueFromProduct 1058529 = 1910 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
fmapfmapfmap/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/GetJobOutput.hs | mpl-2.0 | -- | The job data, either archive data or inventory data.
gjorsBody :: Lens' GetJobOutputResponse RsBody
gjorsBody = lens _gjorsBody (\ s a -> s{_gjorsBody = a}) | 161 | gjorsBody :: Lens' GetJobOutputResponse RsBody
gjorsBody = lens _gjorsBody (\ s a -> s{_gjorsBody = a}) | 103 | gjorsBody = lens _gjorsBody (\ s a -> s{_gjorsBody = a}) | 56 | true | true | 1 | 9 | 26 | 45 | 22 | 23 | null | null |
mrordinaire/upenn-haskell | src/HW06.hs | mit | -- Exercise 6 -----------------------------------------
nats :: Stream Integer
nats = sIterate (+1) 0 | 102 | nats :: Stream Integer
nats = sIterate (+1) 0 | 45 | nats = sIterate (+1) 0 | 22 | true | true | 0 | 6 | 13 | 24 | 13 | 11 | null | null |
KommuSoft/dep-software | Dep.Ui.Utils.hs | gpl-3.0 | routMap :: Int -> ([WireC],[[WireR]],[WireC]) -> WreMp
routMap ww (a,b,c) = WreMp ww hh $ rut (map fst a) ($(mapN 2) fst b) (map fst c) 0 $ wreD $ zeroWireMap ww hh
where rut _ [] _ _ mp = mp
rut x ([]:ys) z ln mp = rut x ys z (ln+1) mp
rut x ((ya:yb):ys) z ln mp = rut (x++tail ya) (yb:ys)... | 531 | routMap :: Int -> ([WireC],[[WireR]],[WireC]) -> WreMp
routMap ww (a,b,c) = WreMp ww hh $ rut (map fst a) ($(mapN 2) fst b) (map fst c) 0 $ wreD $ zeroWireMap ww hh
where rut _ [] _ _ mp = mp
rut x ([]:ys) z ln mp = rut x ys z (ln+1) mp
rut x ((ya:yb):ys) z ln mp = rut (x++tail ya) (yb:ys)... | 531 | routMap ww (a,b,c) = WreMp ww hh $ rut (map fst a) ($(mapN 2) fst b) (map fst c) 0 $ wreD $ zeroWireMap ww hh
where rut _ [] _ _ mp = mp
rut x ([]:ys) z ln mp = rut x ys z (ln+1) mp
rut x ((ya:yb):ys) z ln mp = rut (x++tail ya) (yb:ys) z ln $ (UA.//) mp $ [(x2+xi,1)|xi<-x]++[(x2+xi,2)|xi<-... | 476 | false | true | 3 | 13 | 182 | 356 | 188 | 168 | null | null |
gwright83/Wheeler | src/Math/Symbolic/Wheeler/IO.hs | bsd-3-clause | integer :: Parser Integer
integer = P.integer lexer | 52 | integer :: Parser Integer
integer = P.integer lexer | 52 | integer = P.integer lexer | 26 | false | true | 0 | 6 | 8 | 19 | 9 | 10 | null | null |
nishiuramakoto/erasm-plusplus | src/haskell/Prefix.hs | gpl-3.0 | isSubsetOf :: Prefix.Set -> Prefix.Set -> Bool
isSubsetOf = Set.isSubsetOf `on` pset | 84 | isSubsetOf :: Prefix.Set -> Prefix.Set -> Bool
isSubsetOf = Set.isSubsetOf `on` pset | 84 | isSubsetOf = Set.isSubsetOf `on` pset | 37 | false | true | 0 | 7 | 11 | 31 | 17 | 14 | null | null |
input-output-hk/pos-haskell-prototype | auxx/src/Repl.hs | mit | ------- Util ---------
-- | Similar to 'Haskeline.outputStrLn', but for 'Text' rather than 'String'.
outputTextLn :: Text -> AuxxRepl ()
outputTextLn = Haskeline.outputStrLn . toString | 185 | outputTextLn :: Text -> AuxxRepl ()
outputTextLn = Haskeline.outputStrLn . toString | 83 | outputTextLn = Haskeline.outputStrLn . toString | 47 | true | true | 0 | 8 | 25 | 34 | 16 | 18 | null | null |
sdiehl/ghc | testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.hs | bsd-3-clause | foo :: F Int Char -> Int
foo = id | 33 | foo :: F Int Char -> Int
foo = id | 33 | foo = id | 8 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | -- | Read a vector from specified index of immutable array.
indexInt8X64Array# :: ByteArray# -> Int# -> Int8X64#
indexInt8X64Array# = indexInt8X64Array# | 154 | indexInt8X64Array# :: ByteArray# -> Int# -> Int8X64#
indexInt8X64Array# = indexInt8X64Array# | 92 | indexInt8X64Array# = indexInt8X64Array# | 39 | true | true | 0 | 6 | 22 | 20 | 11 | 9 | null | null |
sjfloat/dnngraph | NN/Backend/Torch/Lua.hs | bsd-3-clause | return' :: Name -> Exp
return' name' = PrefixExp (var name') | 60 | return' :: Name -> Exp
return' name' = PrefixExp (var name') | 60 | return' name' = PrefixExp (var name') | 37 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
dgvncsz0f/boats | src/main/haskell/Battleship/Game/Game.hs | gpl-2.0 | rudder_angle :: PlayerT -> Double
rudder_angle p = B.rudder_angle (ship p) | 74 | rudder_angle :: PlayerT -> Double
rudder_angle p = B.rudder_angle (ship p) | 74 | rudder_angle p = B.rudder_angle (ship p) | 40 | false | true | 0 | 7 | 10 | 34 | 15 | 19 | null | null |
josefs/autosar | ARSim/arsim-examples/AUTOSAR/ACC/Vehicle.hs | bsd-3-clause | vehicleIO :: Time
-> [Task]
-> AUTOSAR IOModule
vehicleIO deltaT tasks = composition $
do -- Specific task assignments
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let [veloT, absT, bangT, radarT, accT, brkT, thrT, gearT] = tasks
-- Car subsystems
-- ~~~~~~~~~~~... | 2,012 | vehicleIO :: Time
-> [Task]
-> AUTOSAR IOModule
vehicleIO deltaT tasks = composition $
do -- Specific task assignments
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let [veloT, absT, bangT, radarT, accT, brkT, thrT, gearT] = tasks
-- Car subsystems
-- ~~~~~~~~~~~... | 2,012 | vehicleIO deltaT tasks = composition $
do -- Specific task assignments
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let [veloT, absT, bangT, radarT, accT, brkT, thrT, gearT] = tasks
-- Car subsystems
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brakes <- brakeCtrl ... | 1,943 | false | true | 0 | 14 | 637 | 557 | 264 | 293 | null | null |
np/lens | src/Data/Data/Lens.hs | bsd-3-clause | -------------------------------------------------------------------------------
-- Naïve Traversal
-------------------------------------------------------------------------------
-- | Naïve 'Traversal' using 'Data'. This does not attempt to optimize the traversal.
--
-- This is primarily useful when the children are i... | 446 | tinplate :: (Data s, Typeable a) => Traversal' s a
tinplate f = gfoldl (step f) pure | 84 | tinplate f = gfoldl (step f) pure | 33 | true | true | 0 | 7 | 51 | 51 | 28 | 23 | null | null |
brendanhay/gogol | gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs | mpl-2.0 | -- | List of deals deleted (in the same proposal as passed in the request)
dDeals :: Lens' DeleteOrderDealsResponse [MarketplaceDeal]
dDeals
= lens _dDeals (\ s a -> s{_dDeals = a}) . _Default .
_Coerce | 210 | dDeals :: Lens' DeleteOrderDealsResponse [MarketplaceDeal]
dDeals
= lens _dDeals (\ s a -> s{_dDeals = a}) . _Default .
_Coerce | 135 | dDeals
= lens _dDeals (\ s a -> s{_dDeals = a}) . _Default .
_Coerce | 76 | true | true | 1 | 10 | 42 | 57 | 28 | 29 | null | null |
mettekou/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Decorate the body of an HsExpr with ticks.
-- (Whether to put a tick around the whole expression was already decided,
-- in the addTickLHsExpr family of functions.)
addTickHsExpr :: HsExpr Id -> TM (HsExpr Id)
addTickHsExpr e@(HsVar (L... | 353 | addTickHsExpr :: HsExpr Id -> TM (HsExpr Id)
addTickHsExpr e@(HsVar (L _ id)) = do freeVar id; return e | 103 | addTickHsExpr e@(HsVar (L _ id)) = do freeVar id; return e | 58 | true | true | 0 | 10 | 50 | 64 | 32 | 32 | null | null |
DavidAlphaFox/ghc | compiler/simplCore/SimplUtils.hs | bsd-3-clause | countArgs (ApplyToVal { sc_cont = cont }) = 1 + countArgs cont | 62 | countArgs (ApplyToVal { sc_cont = cont }) = 1 + countArgs cont | 62 | countArgs (ApplyToVal { sc_cont = cont }) = 1 + countArgs cont | 62 | false | false | 0 | 9 | 11 | 28 | 14 | 14 | null | null |
simonmichael/hledger | hledger-web/Hledger/Web/Handler/RegisterR.hs | gpl-3.0 | -- | The main journal/account register view, with accounts sidebar.
getRegisterR :: Handler Html
getRegisterR = do
checkServerSideUiEnabled
VD{caps, j, m, opts, q, qopts, today} <- getViewData
when (CapView `notElem` caps) (permissionDenied "Missing the 'view' capability")
let (a,inclsubs) = fromMaybe ("all ac... | 1,569 | getRegisterR :: Handler Html
getRegisterR = do
checkServerSideUiEnabled
VD{caps, j, m, opts, q, qopts, today} <- getViewData
when (CapView `notElem` caps) (permissionDenied "Missing the 'view' capability")
let (a,inclsubs) = fromMaybe ("all accounts",True) $ inAccount qopts
s1 = if inclsubs then "" else ... | 1,501 | getRegisterR = do
checkServerSideUiEnabled
VD{caps, j, m, opts, q, qopts, today} <- getViewData
when (CapView `notElem` caps) (permissionDenied "Missing the 'view' capability")
let (a,inclsubs) = fromMaybe ("all accounts",True) $ inAccount qopts
s1 = if inclsubs then "" else " (excluding subaccounts)"
... | 1,472 | true | true | 0 | 22 | 368 | 473 | 243 | 230 | null | null |
rueshyna/gogol | gogol-youtube/gen/Network/Google/Resource/YouTube/LiveBroadcasts/Control.hs | mpl-2.0 | -- | Note: This parameter is intended exclusively for YouTube content
-- partners. The onBehalfOfContentOwner parameter indicates that the
-- request\'s authorization credentials identify a YouTube CMS user who is
-- acting on behalf of the content owner specified in the parameter value.
-- This parameter is intended f... | 882 | lbcOnBehalfOfContentOwner :: Lens' LiveBroadcastsControl (Maybe Text)
lbcOnBehalfOfContentOwner
= lens _lbcOnBehalfOfContentOwner
(\ s a -> s{_lbcOnBehalfOfContentOwner = a}) | 182 | lbcOnBehalfOfContentOwner
= lens _lbcOnBehalfOfContentOwner
(\ s a -> s{_lbcOnBehalfOfContentOwner = a}) | 112 | true | true | 0 | 9 | 133 | 57 | 34 | 23 | null | null |
AlexanderPankiv/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | unitTy :: Type
unitTy = mkTupleTy Boxed [] | 42 | unitTy :: Type
unitTy = mkTupleTy Boxed [] | 42 | unitTy = mkTupleTy Boxed [] | 27 | false | true | 0 | 6 | 7 | 26 | 10 | 16 | null | null |
jsavatgy/hatupist | code/result-tables-02.hs | gpl-2.0 | ivsBetween iMin iMax ivs =
filter (\iv -> iMin <= (iNum iv) && (iNum iv) <= iMax) ivs | 87 | ivsBetween iMin iMax ivs =
filter (\iv -> iMin <= (iNum iv) && (iNum iv) <= iMax) ivs | 87 | ivsBetween iMin iMax ivs =
filter (\iv -> iMin <= (iNum iv) && (iNum iv) <= iMax) ivs | 87 | false | false | 0 | 12 | 19 | 53 | 25 | 28 | null | null |
nh2/WashNGo | WASH/HTML/HTMLMonad.hs | bsd-3-clause | li_T = mkElement_T "li" | 23 | li_T = mkElement_T "li" | 23 | li_T = mkElement_T "li" | 23 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
hargettp/raft | src/Control/Consensus/Raft/Protocol.hs | mit | onRequestVote :: Endpoint -> Name -> (RequestVote -> IO MemberResult) -> IO Bool
onRequestVote endpoint server fn = do
(bytes,reply) <- hear endpoint server methodRequestVote
let Right req = decode bytes
result <- fn req
reply $ encode result
return $ memberActionSuccess result
{-|
Wait for a reque... | 393 | onRequestVote :: Endpoint -> Name -> (RequestVote -> IO MemberResult) -> IO Bool
onRequestVote endpoint server fn = do
(bytes,reply) <- hear endpoint server methodRequestVote
let Right req = decode bytes
result <- fn req
reply $ encode result
return $ memberActionSuccess result
{-|
Wait for a reque... | 393 | onRequestVote endpoint server fn = do
(bytes,reply) <- hear endpoint server methodRequestVote
let Right req = decode bytes
result <- fn req
reply $ encode result
return $ memberActionSuccess result
{-|
Wait for a request from a client to perform an action, and process it when it arrives.
-} | 312 | false | true | 0 | 11 | 82 | 116 | 51 | 65 | null | null |
23Skidoo/snap-server | src/Snap/Internal/Http/Server/Config.hs | bsd-3-clause | -- The 'Config', after any command line parsing has been performed.
getStartupConfig :: StartupInfo m a -> Config m a
getStartupConfig = startupHookConfig | 154 | getStartupConfig :: StartupInfo m a -> Config m a
getStartupConfig = startupHookConfig | 86 | getStartupConfig = startupHookConfig | 36 | true | true | 0 | 6 | 22 | 26 | 13 | 13 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | The routes in the route table.
rtRoutes :: Lens' RouteTable [Route]
rtRoutes = lens _rtRoutes (\ s a -> s{_rtRoutes = a}) . _Default . _Coerce | 147 | rtRoutes :: Lens' RouteTable [Route]
rtRoutes = lens _rtRoutes (\ s a -> s{_rtRoutes = a}) . _Default . _Coerce | 111 | rtRoutes = lens _rtRoutes (\ s a -> s{_rtRoutes = a}) . _Default . _Coerce | 74 | true | true | 0 | 11 | 27 | 51 | 28 | 23 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/ghci/RtClosureInspect.hs | bsd-3-clause | isFun _ = False | 15 | isFun _ = False | 15 | isFun _ = False | 15 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
danfran/hcoord | test/LatLng/Tests.hs | bsd-3-clause | testToDatum = TestList [
(toDatum (LatLng 52.657570301933156 1.717921580645096 0 wgs84Datum) osgb36Datum) ~?= LatLng 52.65716468040487 1.7197915435025186 0 wgs84Datum
, (toDatum (LatLng 52.65716468040487 1.7197915435025186 0 osgb36Datum) wgs84Datum) ~?= LatLng 52.65716468040487 1.7197915435025186 0 osgb36Datum
... | 633 | testToDatum = TestList [
(toDatum (LatLng 52.657570301933156 1.717921580645096 0 wgs84Datum) osgb36Datum) ~?= LatLng 52.65716468040487 1.7197915435025186 0 wgs84Datum
, (toDatum (LatLng 52.65716468040487 1.7197915435025186 0 osgb36Datum) wgs84Datum) ~?= LatLng 52.65716468040487 1.7197915435025186 0 osgb36Datum
... | 633 | testToDatum = TestList [
(toDatum (LatLng 52.657570301933156 1.717921580645096 0 wgs84Datum) osgb36Datum) ~?= LatLng 52.65716468040487 1.7197915435025186 0 wgs84Datum
, (toDatum (LatLng 52.65716468040487 1.7197915435025186 0 osgb36Datum) wgs84Datum) ~?= LatLng 52.65716468040487 1.7197915435025186 0 osgb36Datum
... | 633 | false | false | 0 | 13 | 79 | 163 | 82 | 81 | null | null |
ezyang/ghc | libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs | bsd-3-clause | bindS :: PatQ -> ExpQ -> StmtQ
bindS p e = liftM2 BindS p e | 59 | bindS :: PatQ -> ExpQ -> StmtQ
bindS p e = liftM2 BindS p e | 59 | bindS p e = liftM2 BindS p e | 28 | false | true | 0 | 8 | 14 | 36 | 16 | 20 | null | null |
TimoFreiberg/hanabi | src/Hanabi/Client.hs | mit | send
:: (MonadLogger m, MonadIO m, ToJSON a)
=> WS.Connection -> a -> m ()
send conn x = do
let msg = encode x
logInfo ("Sending JSON:\n" <> convertString (encodePretty x))
liftIO (WS.sendTextData conn msg) | 216 | send
:: (MonadLogger m, MonadIO m, ToJSON a)
=> WS.Connection -> a -> m ()
send conn x = do
let msg = encode x
logInfo ("Sending JSON:\n" <> convertString (encodePretty x))
liftIO (WS.sendTextData conn msg) | 216 | send conn x = do
let msg = encode x
logInfo ("Sending JSON:\n" <> convertString (encodePretty x))
liftIO (WS.sendTextData conn msg) | 137 | false | true | 0 | 13 | 45 | 106 | 49 | 57 | null | null |
laurencer/confluence-sync | vendor/haxr/Network/XmlRpc/Pretty.hs | bsd-3-clause | elementB (Elem n as []) = "<" <> (name n <+> fsep (map attribute as)) <> "/>" | 77 | elementB (Elem n as []) = "<" <> (name n <+> fsep (map attribute as)) <> "/>" | 77 | elementB (Elem n as []) = "<" <> (name n <+> fsep (map attribute as)) <> "/>" | 77 | false | false | 0 | 11 | 16 | 50 | 24 | 26 | null | null |
tjakway/ghcjvm | compiler/utils/IOEnv.hs | bsd-3-clause | thenM_ :: IOEnv env a -> IOEnv env b -> IOEnv env b
thenM_ (IOEnv m) f = IOEnv (\ env -> do { _ <- m env ; unIOEnv f env }) | 123 | thenM_ :: IOEnv env a -> IOEnv env b -> IOEnv env b
thenM_ (IOEnv m) f = IOEnv (\ env -> do { _ <- m env ; unIOEnv f env }) | 123 | thenM_ (IOEnv m) f = IOEnv (\ env -> do { _ <- m env ; unIOEnv f env }) | 71 | false | true | 0 | 11 | 32 | 81 | 38 | 43 | null | null |
abooij/cubicaltt | TypeChecker.hs | mit | addTele :: Tele -> TEnv -> TEnv
addTele xas lenv = foldl (flip addType) lenv xas | 81 | addTele :: Tele -> TEnv -> TEnv
addTele xas lenv = foldl (flip addType) lenv xas | 80 | addTele xas lenv = foldl (flip addType) lenv xas | 48 | false | true | 0 | 7 | 16 | 37 | 18 | 19 | null | null |
pawel-n/fingertree-tf | Data/FingerTree.hs | bsd-3-clause | reverseNode :: Measured b => (a -> b) -> Node a -> Node b
reverseNode f (Node2 _ a b) = node2 (f b) (f a) | 105 | reverseNode :: Measured b => (a -> b) -> Node a -> Node b
reverseNode f (Node2 _ a b) = node2 (f b) (f a) | 105 | reverseNode f (Node2 _ a b) = node2 (f b) (f a) | 47 | false | true | 0 | 8 | 25 | 71 | 34 | 37 | null | null |
scharris/hmq | Example/GeneratedForeignKeyLinks.hs | bsd-3-clause | categories = HMQ.Example.GeneratedEntities.Categories.mappedQuery | 65 | categories = HMQ.Example.GeneratedEntities.Categories.mappedQuery | 65 | categories = HMQ.Example.GeneratedEntities.Categories.mappedQuery | 65 | false | false | 0 | 5 | 2 | 11 | 7 | 4 | null | null |
polarina/sdl2 | Graphics/UI/SDL/Video.hs | bsd-3-clause | setWindowTitle :: MonadIO m => Window -> CString -> m ()
setWindowTitle v1 v2 = liftIO $ setWindowTitle' v1 v2 | 110 | setWindowTitle :: MonadIO m => Window -> CString -> m ()
setWindowTitle v1 v2 = liftIO $ setWindowTitle' v1 v2 | 110 | setWindowTitle v1 v2 = liftIO $ setWindowTitle' v1 v2 | 53 | false | true | 0 | 9 | 19 | 45 | 21 | 24 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Common.hs | bsd-2-clause | complToText (OptComplSuggest choices) = "suggest=" ++ intercalate "," choices | 77 | complToText (OptComplSuggest choices) = "suggest=" ++ intercalate "," choices | 77 | complToText (OptComplSuggest choices) = "suggest=" ++ intercalate "," choices | 77 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
suhailshergill/liboleg | Lambda/Semantics.hs | bsd-3-clause | lsen1 = neg (conj (neg (neg true)) (neg true)) | 46 | lsen1 = neg (conj (neg (neg true)) (neg true)) | 46 | lsen1 = neg (conj (neg (neg true)) (neg true)) | 46 | false | false | 1 | 11 | 8 | 38 | 17 | 21 | null | null |
MichaelXavier/jse | JSE.hs | bsd-2-clause | collectMatches (PatternFilter f reg) = EL.map (\obj -> fuck $ finder obj)
where getMatch (String text) = match reg (encodeUtf8 text) []
fuck (Nothing) = Nothing
fuck (Just x) = getMatch x
finder obj = M.lookup f obj | 241 | collectMatches (PatternFilter f reg) = EL.map (\obj -> fuck $ finder obj)
where getMatch (String text) = match reg (encodeUtf8 text) []
fuck (Nothing) = Nothing
fuck (Just x) = getMatch x
finder obj = M.lookup f obj | 241 | collectMatches (PatternFilter f reg) = EL.map (\obj -> fuck $ finder obj)
where getMatch (String text) = match reg (encodeUtf8 text) []
fuck (Nothing) = Nothing
fuck (Just x) = getMatch x
finder obj = M.lookup f obj | 241 | false | false | 3 | 9 | 63 | 109 | 54 | 55 | null | null |
cutsea110/aop | src/CombPlus.hs | bsd-3-clause | br 0 = [[0]] | 12 | br 0 = [[0]] | 12 | br 0 = [[0]] | 12 | false | false | 0 | 6 | 3 | 16 | 8 | 8 | null | null |
tpsinnem/Idris-dev | src/Idris/Elab/Quasiquote.hs | bsd-3-clause | extractUnquotes n (PDPair fc hls info a b c)
= do (a', ex1) <- extractUnquotes n a
(b', ex2) <- extractUnquotes n b
(c', ex3) <- extractUnquotes n c
return (PDPair fc hls info a' b' c', ex1 ++ ex2 ++ ex3) | 227 | extractUnquotes n (PDPair fc hls info a b c)
= do (a', ex1) <- extractUnquotes n a
(b', ex2) <- extractUnquotes n b
(c', ex3) <- extractUnquotes n c
return (PDPair fc hls info a' b' c', ex1 ++ ex2 ++ ex3) | 227 | extractUnquotes n (PDPair fc hls info a b c)
= do (a', ex1) <- extractUnquotes n a
(b', ex2) <- extractUnquotes n b
(c', ex3) <- extractUnquotes n c
return (PDPair fc hls info a' b' c', ex1 ++ ex2 ++ ex3) | 227 | false | false | 0 | 10 | 64 | 116 | 56 | 60 | null | null |
GaloisInc/halvm-ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | coerceFP2Int' _ _ _ _ = panic "PPC.CodeGen.coerceFP2Int: unknown arch" | 70 | coerceFP2Int' _ _ _ _ = panic "PPC.CodeGen.coerceFP2Int: unknown arch" | 70 | coerceFP2Int' _ _ _ _ = panic "PPC.CodeGen.coerceFP2Int: unknown arch" | 70 | false | false | 0 | 5 | 9 | 18 | 8 | 10 | null | null |
jutaro/rdf4h | testsuite/tests/Data/RDF/GraphTestUtils.hs | bsd-3-clause | debug :: String -> Triples -> Bool
debug msg ts =
unsafePerformIO $
putStrLn msg >> mapM print ts >> return True | 118 | debug :: String -> Triples -> Bool
debug msg ts =
unsafePerformIO $
putStrLn msg >> mapM print ts >> return True | 118 | debug msg ts =
unsafePerformIO $
putStrLn msg >> mapM print ts >> return True | 83 | false | true | 4 | 8 | 27 | 55 | 23 | 32 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/ResolverType.hs | mit | resolveTPExp' p@PExp{_inPos, _exp} =
runListT $ runExceptT $ (case _exp of
e@IFunExp {_op = ".", _exps = [arg1, arg2]} -> do
(iType', exp') <- do
arg1' <- lift $ ListT $ resolveTPExp arg1
localCurPath (typeOf arg1') $ do
arg2' <- liftError $ lift $ ListT $ resolveT... | 8,453 | resolveTPExp' p@PExp{_inPos, _exp} =
runListT $ runExceptT $ (case _exp of
e@IFunExp {_op = ".", _exps = [arg1, arg2]} -> do
(iType', exp') <- do
arg1' <- lift $ ListT $ resolveTPExp arg1
localCurPath (typeOf arg1') $ do
arg2' <- liftError $ lift $ ListT $ resolveT... | 8,453 | resolveTPExp' p@PExp{_inPos, _exp} =
runListT $ runExceptT $ (case _exp of
e@IFunExp {_op = ".", _exps = [arg1, arg2]} -> do
(iType', exp') <- do
arg1' <- lift $ ListT $ resolveTPExp arg1
localCurPath (typeOf arg1') $ do
arg2' <- liftError $ lift $ ListT $ resolveT... | 8,453 | false | false | 40 | 31 | 2,573 | 2,648 | 1,306 | 1,342 | null | null |
ekmett/ghc | includes/CodeGen.Platform.hs | bsd-3-clause | globalRegMaybe (FloatReg 6) = Just (RealRegSingle REG_F6) | 69 | globalRegMaybe (FloatReg 6) = Just (RealRegSingle REG_F6) | 69 | globalRegMaybe (FloatReg 6) = Just (RealRegSingle REG_F6) | 69 | false | false | 0 | 7 | 18 | 24 | 11 | 13 | null | null |
TomMD/cryptol | tests/Main.hs | bsd-3-clause | nullTests :: TestFiles -> Bool
nullTests (TestFiles m as) = null as && Map.null m | 81 | nullTests :: TestFiles -> Bool
nullTests (TestFiles m as) = null as && Map.null m | 81 | nullTests (TestFiles m as) = null as && Map.null m | 50 | false | true | 0 | 7 | 14 | 38 | 18 | 20 | null | null |
abhinav/sandman | src/Main.hs | mit | destroy :: Text -> IO ()
destroy name = do
sandman <- defaultSandman
Sandbox{sandboxRoot} <- getSandbox sandman name
>>= maybe (die $ "Sandbox " <> name <> " does not exist.") return
removeTree sandboxRoot
TIO.putStrLn $ "Removed sandbox " <> name <> "."
---------------------------------------... | 359 | destroy :: Text -> IO ()
destroy name = do
sandman <- defaultSandman
Sandbox{sandboxRoot} <- getSandbox sandman name
>>= maybe (die $ "Sandbox " <> name <> " does not exist.") return
removeTree sandboxRoot
TIO.putStrLn $ "Removed sandbox " <> name <> "."
---------------------------------------... | 359 | destroy name = do
sandman <- defaultSandman
Sandbox{sandboxRoot} <- getSandbox sandman name
>>= maybe (die $ "Sandbox " <> name <> " does not exist.") return
removeTree sandboxRoot
TIO.putStrLn $ "Removed sandbox " <> name <> "."
----------------------------------------------------------------... | 334 | false | true | 0 | 13 | 69 | 96 | 45 | 51 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F07.hs | bsd-3-clause | ptr_glFinishFenceNV :: FunPtr (GLuint -> IO ())
ptr_glFinishFenceNV = unsafePerformIO $ getCommand "glFinishFenceNV" | 116 | ptr_glFinishFenceNV :: FunPtr (GLuint -> IO ())
ptr_glFinishFenceNV = unsafePerformIO $ getCommand "glFinishFenceNV" | 116 | ptr_glFinishFenceNV = unsafePerformIO $ getCommand "glFinishFenceNV" | 68 | false | true | 0 | 9 | 12 | 33 | 16 | 17 | null | null |
Saulzar/ghcjs-websockets-reflex | src/JavaScript/WebSockets/Reflex/WebSocket.hs | mit | splitEither :: (Reflex t) => Event t (Either a b) -> (Event t a, Event t b)
splitEither e = (fmapMaybe (firstOf _Left) e, fmapMaybe (firstOf _Right) e) | 151 | splitEither :: (Reflex t) => Event t (Either a b) -> (Event t a, Event t b)
splitEither e = (fmapMaybe (firstOf _Left) e, fmapMaybe (firstOf _Right) e) | 151 | splitEither e = (fmapMaybe (firstOf _Left) e, fmapMaybe (firstOf _Right) e) | 75 | false | true | 0 | 9 | 27 | 84 | 42 | 42 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-code/Language/Drasil/Code/ExtLibImport.hs | bsd-2-clause | genParameters [] [] = [] | 24 | genParameters [] [] = [] | 24 | genParameters [] [] = [] | 24 | false | false | 1 | 6 | 4 | 22 | 8 | 14 | null | null |
gridaphobe/cabal2nix | distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs | bsd-3-clause | hooks :: [(Dependency, Derivation -> Derivation)]
hooks =
[ ("Agda", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agdaPostInstall)
, ("dns", set testTarget "spec") -- don't execute tests that try to access the network
, ("bindings-GLFW", over (libraryDepends . system) (Se... | 2,447 | hooks :: [(Dependency, Derivation -> Derivation)]
hooks =
[ ("Agda", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agdaPostInstall)
, ("dns", set testTarget "spec") -- don't execute tests that try to access the network
, ("bindings-GLFW", over (libraryDepends . system) (Se... | 2,447 | hooks =
[ ("Agda", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agdaPostInstall)
, ("dns", set testTarget "spec") -- don't execute tests that try to access the network
, ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xlibs.libXext", ... | 2,397 | false | true | 0 | 15 | 390 | 870 | 469 | 401 | null | null |
cjlarose/advent-2016 | src/Taxicab.hs | bsd-3-clause | rotate E R = S | 14 | rotate E R = S | 14 | rotate E R = S | 14 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
stevezhee/grm | Grm/Lex.hs | bsd-3-clause | lexNumber :: M (Token Point)
lexNumber = do
a <- getLoc
c <- oneof
[ liftM singleton $ lexCharPred ((==) '-')
, return ""
]
s <- oneof
[ lex0x "0x" isHexit
, lex0x "0X" isHexit
, lex0x "0o" isOctit
, lex0x "0O" isOctit
, lex0x "0b" isBinit
, lex0x "0B... | 430 | lexNumber :: M (Token Point)
lexNumber = do
a <- getLoc
c <- oneof
[ liftM singleton $ lexCharPred ((==) '-')
, return ""
]
s <- oneof
[ lex0x "0x" isHexit
, lex0x "0X" isHexit
, lex0x "0o" isOctit
, lex0x "0O" isOctit
, lex0x "0b" isBinit
, lex0x "0B... | 430 | lexNumber = do
a <- getLoc
c <- oneof
[ liftM singleton $ lexCharPred ((==) '-')
, return ""
]
s <- oneof
[ lex0x "0x" isHexit
, lex0x "0X" isHexit
, lex0x "0o" isOctit
, lex0x "0O" isOctit
, lex0x "0b" isBinit
, lex0x "0B" isBinit
, lexFloat
... | 401 | false | true | 0 | 13 | 163 | 161 | 78 | 83 | null | null |
pparkkin/eta | compiler/ETA/SimplCore/OccurAnal.hs | bsd-3-clause | {-
Applications are dealt with specially because we want
the "build hack" to work.
Note [Arguments of let-bound constructors]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
f x = let y = expensive x in
let z = (True,y) in
(case z of {(p,q)->q}, case z of {(p,q)->q})
We feel free to duplica... | 1,802 | occAnalApp :: OccEnv
-> (Expr CoreBndr, [Arg CoreBndr], [Tickish Id])
-> (UsageDetails, Expr CoreBndr)
occAnalApp env (Var fun, args, ticks)
| null ticks = (uds, mkApps (Var fun) args')
| otherwise = (uds, mkTicks ticks $ mkApps (Var fun) args')
where
uds = fun_uds +++ final_args_uds
... | 1,298 | occAnalApp env (Var fun, args, ticks)
| null ticks = (uds, mkApps (Var fun) args')
| otherwise = (uds, mkTicks ticks $ mkApps (Var fun) args')
where
uds = fun_uds +++ final_args_uds
!(args_uds, args') = occAnalArgs env args one_shots
!final_args_uds = markManyIf (isRhsEnv env && is_exp) args_uds
... | 1,173 | true | true | 1 | 9 | 460 | 246 | 131 | 115 | null | null |
corajr/servant-state-graph | test/Servant/HAL/ServerSpec.hs | bsd-3-clause | api1 :: Proxy API1
api1 = Proxy | 31 | api1 :: Proxy API1
api1 = Proxy | 31 | api1 = Proxy | 12 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
hy-zhang/parser | Haskell/src/FullOmega.hs | bsd-3-clause | parseTmTAbs2 :: NewParser TmTAbs2 fs
parseTmTAbs2 e p = do
keyword "\\"
x <- parseWordUpper
keyword ":"
k <- p
keyword "."
body <- p
return $ In e (TmTAbs2 x k body) | 179 | parseTmTAbs2 :: NewParser TmTAbs2 fs
parseTmTAbs2 e p = do
keyword "\\"
x <- parseWordUpper
keyword ":"
k <- p
keyword "."
body <- p
return $ In e (TmTAbs2 x k body) | 179 | parseTmTAbs2 e p = do
keyword "\\"
x <- parseWordUpper
keyword ":"
k <- p
keyword "."
body <- p
return $ In e (TmTAbs2 x k body) | 142 | false | true | 0 | 10 | 46 | 82 | 35 | 47 | null | null |
andrewthad/yesod | yesod-core/Yesod/Core/Handler.hs | mit | lookupBearerAuth :: (MonadHandler m) => m (Maybe Text)
lookupBearerAuth = fmap (>>= getBR)
(lookupHeader "Authorization")
where
getBR bs = decodeUtf8With lenientDecode
<$> extractBearerAuth bs
-- | Lookup for GET parameters. | 266 | lookupBearerAuth :: (MonadHandler m) => m (Maybe Text)
lookupBearerAuth = fmap (>>= getBR)
(lookupHeader "Authorization")
where
getBR bs = decodeUtf8With lenientDecode
<$> extractBearerAuth bs
-- | Lookup for GET parameters. | 266 | lookupBearerAuth = fmap (>>= getBR)
(lookupHeader "Authorization")
where
getBR bs = decodeUtf8With lenientDecode
<$> extractBearerAuth bs
-- | Lookup for GET parameters. | 211 | false | true | 0 | 8 | 71 | 66 | 33 | 33 | null | null |
dmcclean/HaTeX | Text/LaTeX/Base/Commands.hs | bsd-3-clause | huge2 :: LaTeXC l => l -> l
huge2 = sizecomm "Huge" | 51 | huge2 :: LaTeXC l => l -> l
huge2 = sizecomm "Huge" | 51 | huge2 = sizecomm "Huge" | 23 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
genos/online_problems | advent_of_code_2016/day3/src/Main.hs | mit | validTriangle :: [Int] -> Bool
validTriangle xs = (a + b) > c && (a + c) > b && (b + c) > a
where [a, b, c] = take 3 xs | 121 | validTriangle :: [Int] -> Bool
validTriangle xs = (a + b) > c && (a + c) > b && (b + c) > a
where [a, b, c] = take 3 xs | 121 | validTriangle xs = (a + b) > c && (a + c) > b && (b + c) > a
where [a, b, c] = take 3 xs | 90 | false | true | 0 | 11 | 34 | 84 | 45 | 39 | null | null |
rootzlevel/hcharselect | HCharselect/Concurrency.hs | gpl-3.0 | parseThread var file = do
chars <- fmap (`using` rdeepseq) $ parseParallel file
putMVar var chars
-- | A list of computations that are to be executed in another thread.
-- The idea is that one thread adds computations and another runs them
-- when it it idle.
-- This is particularly suited for Gtk, because we hav... | 378 | parseThread var file = do
chars <- fmap (`using` rdeepseq) $ parseParallel file
putMVar var chars
-- | A list of computations that are to be executed in another thread.
-- The idea is that one thread adds computations and another runs them
-- when it it idle.
-- This is particularly suited for Gtk, because we hav... | 378 | parseThread var file = do
chars <- fmap (`using` rdeepseq) $ parseParallel file
putMVar var chars
-- | A list of computations that are to be executed in another thread.
-- The idea is that one thread adds computations and another runs them
-- when it it idle.
-- This is particularly suited for Gtk, because we hav... | 378 | false | false | 0 | 10 | 74 | 47 | 25 | 22 | null | null |
perryleo/sicp | ch1/sicpc1e33.hs | mit | -- Compute the sum of the squares of the prime numbers in the interval a
-- to b (we already have `prime?` procedure)
sqPrimeSum :: Integral a => a -> a -> a
sqPrimeSum a b =
filteredSum isPrime square a (\x -> x + 1) b | 221 | sqPrimeSum :: Integral a => a -> a -> a
sqPrimeSum a b =
filteredSum isPrime square a (\x -> x + 1) b | 103 | sqPrimeSum a b =
filteredSum isPrime square a (\x -> x + 1) b | 63 | true | true | 0 | 9 | 48 | 63 | 30 | 33 | null | null |
philopon/haddocset | Documentation/Haddocset.hs | bsd-3-clause | docsetDir :: FilePath -> FilePath
docsetDir = flip replaceExtension "docset" | 76 | docsetDir :: FilePath -> FilePath
docsetDir = flip replaceExtension "docset" | 76 | docsetDir = flip replaceExtension "docset" | 42 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
mightymoose/liquidhaskell | benchmarks/hmatrix-0.15.0.1/lib/Numeric/Chain.hs | bsd-3-clause | -----------------------------------------------------------------------------
{- |
Provide optimal association order for a chain of matrix multiplications
and apply the multiplications.
The algorithm is the well-known O(n\^3) dynamic programming algorithm
that builds a pyramid of optimal associat... | 946 | optimiseMult :: Product t => [Matrix t] -> Matrix t
optimiseMult = chain | 72 | optimiseMult = chain | 20 | true | true | 0 | 8 | 161 | 33 | 17 | 16 | null | null |
mitar/etage | lib/Control/Etage/Incubator.hs | lgpl-3.0 | maybeBranchMany (TranslatableFrom n:ns) ats = do
(n', ats') <- maybeBranch n ats
(ns', ats'') <- maybeBranchMany ns ats'
return (TranslatableFrom n':ns', ats'')
{-|
Grows a 'Neuron', taking a function which changes default options and returning a 'Nerve' 'attach'ed to the 'Neuron'.
Internally it combines 'growN... | 342 | maybeBranchMany (TranslatableFrom n:ns) ats = do
(n', ats') <- maybeBranch n ats
(ns', ats'') <- maybeBranchMany ns ats'
return (TranslatableFrom n':ns', ats'')
{-|
Grows a 'Neuron', taking a function which changes default options and returning a 'Nerve' 'attach'ed to the 'Neuron'.
Internally it combines 'growN... | 342 | maybeBranchMany (TranslatableFrom n:ns) ats = do
(n', ats') <- maybeBranch n ats
(ns', ats'') <- maybeBranchMany ns ats'
return (TranslatableFrom n':ns', ats'')
{-|
Grows a 'Neuron', taking a function which changes default options and returning a 'Nerve' 'attach'ed to the 'Neuron'.
Internally it combines 'growN... | 342 | false | false | 0 | 10 | 55 | 77 | 38 | 39 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.