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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GaloisInc/halvm-ghc | compiler/utils/Outputable.hs | bsd-3-clause | double n = docToSDoc $ Pretty.double n | 41 | double n = docToSDoc $ Pretty.double n | 41 | double n = docToSDoc $ Pretty.double n | 41 | false | false | 0 | 7 | 9 | 18 | 8 | 10 | null | null |
wilbowma/accelerate | Data/Array/Accelerate/Interpreter.hs | bsd-3-clause | evalOpenExp (Size acc) _ aenv
= case force $ evalOpenAcc acc aenv of
Array sh _ -> size sh
-- Evaluate a closed expression
-- | 135 | evalOpenExp (Size acc) _ aenv
= case force $ evalOpenAcc acc aenv of
Array sh _ -> size sh
-- Evaluate a closed expression
-- | 135 | evalOpenExp (Size acc) _ aenv
= case force $ evalOpenAcc acc aenv of
Array sh _ -> size sh
-- Evaluate a closed expression
-- | 135 | false | false | 0 | 8 | 34 | 48 | 23 | 25 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | -- | Emits a marker event via the RTS tracing framework. The contents
-- of the event is the zero-terminated byte string passed as the first
-- argument. The event will be emitted either to the .eventlog file,
-- or to stderr, depending on the runtime RTS flags.
traceMarker# :: Addr# -> State# s -> S... | 355 | traceMarker# :: Addr# -> State# s -> State# s
traceMarker# = traceMarker# | 73 | traceMarker# = traceMarker# | 27 | true | true | 0 | 8 | 78 | 35 | 17 | 18 | null | null |
glennrfisher/cis194-haskell | 06 Laziness/Fibonacci.hs | mit | streamRepeat :: a -> Stream a
streamRepeat x = Cons x (streamRepeat x) | 70 | streamRepeat :: a -> Stream a
streamRepeat x = Cons x (streamRepeat x) | 70 | streamRepeat x = Cons x (streamRepeat x) | 40 | false | true | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Update.hs | mpl-2.0 | -- | JSONP
pjuCallback :: Lens' ProjectsJobsUpdate (Maybe Text)
pjuCallback
= lens _pjuCallback (\ s a -> s{_pjuCallback = a}) | 128 | pjuCallback :: Lens' ProjectsJobsUpdate (Maybe Text)
pjuCallback
= lens _pjuCallback (\ s a -> s{_pjuCallback = a}) | 117 | pjuCallback
= lens _pjuCallback (\ s a -> s{_pjuCallback = a}) | 64 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
maximilianhuber/innovation | lib/Game/Innovation/Types.hs | bsd-3-clause | mkColored Red = HsT.mkBkRed . HsT.mkBlack | 44 | mkColored Red = HsT.mkBkRed . HsT.mkBlack | 44 | mkColored Red = HsT.mkBkRed . HsT.mkBlack | 44 | false | false | 0 | 6 | 8 | 17 | 8 | 9 | null | null |
ancientlanguage/haskell-analysis | grammar/src/Grammar/Common/Decompose.hs | mit | decomposeChar '\x22EC' = "\x22B4\x0338" | 39 | decomposeChar '\x22EC' = "\x22B4\x0338" | 39 | decomposeChar '\x22EC' = "\x22B4\x0338" | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ivanperez-keera/Yampa | yampa/src/FRP/Yampa/Event.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Event tagging
------------------------------------------------------------------------------
-- | Tags an (occurring) event with a value ("replacing" the old value).
--
-- Applicative-based definition:
-- tag = ($>)
tag :: Event a -> b ... | 359 | tag :: Event a -> b -> Event b
e `tag` b = fmap (const b) e | 59 | e `tag` b = fmap (const b) e | 28 | true | true | 0 | 7 | 44 | 57 | 30 | 27 | null | null |
RAFIRAF/HASKELL | mergeSort4.hs | mit | mergeIter :: (Ord a) => [[a]] -> [[a]]
mergeIter [] = [] | 56 | mergeIter :: (Ord a) => [[a]] -> [[a]]
mergeIter [] = [] | 56 | mergeIter [] = [] | 17 | false | true | 0 | 8 | 11 | 43 | 24 | 19 | null | null |
gustavoramos00/tecnicas-topdown | S8_3.hs | mit | score _ _ = 2 | 22 | score _ _ = 2 | 22 | score _ _ = 2 | 22 | false | false | 0 | 5 | 13 | 11 | 5 | 6 | null | null |
mhlakhani/hlisp | src/Types.hs | mit | showError (Parser parseErr) = "Parse Error: " ++ parseErr ++ "" | 63 | showError (Parser parseErr) = "Parse Error: " ++ parseErr ++ "" | 63 | showError (Parser parseErr) = "Parse Error: " ++ parseErr ++ "" | 63 | false | false | 0 | 7 | 10 | 23 | 11 | 12 | null | null |
codemiller/pirate-gold | src/View/Header.hs | apache-2.0 | header :: H.Html
header =
H.head $ do
H.title "Pirate Gold"
H.link H.! rel "stylesheet" H.! href "css/style.css" | 124 | header :: H.Html
header =
H.head $ do
H.title "Pirate Gold"
H.link H.! rel "stylesheet" H.! href "css/style.css" | 123 | header =
H.head $ do
H.title "Pirate Gold"
H.link H.! rel "stylesheet" H.! href "css/style.css" | 106 | false | true | 2 | 10 | 29 | 58 | 24 | 34 | null | null |
coreyoconnor/ansi-terminal | System/Console/ANSI/Windows/Emulator.hs | bsd-3-clause | clearChar :: WCHAR
clearChar = charToWCHAR ' ' | 46 | clearChar :: WCHAR
clearChar = charToWCHAR ' ' | 46 | clearChar = charToWCHAR ' ' | 27 | false | true | 0 | 5 | 7 | 14 | 7 | 7 | null | null |
swift-nav/wolf | src/Network/AWS/Wolf/Ctx.hs | mit | throttled :: MonadStatsCtx c m => m a -> m a
throttled action = do
traceError "throttled" mempty
statsIncrement "wolf.throttled" mempty
liftIO $ threadDelay $ 5 * 1000000
catch action $ throttler action
-- | Amazon throttle handler.
-- | 244 | throttled :: MonadStatsCtx c m => m a -> m a
throttled action = do
traceError "throttled" mempty
statsIncrement "wolf.throttled" mempty
liftIO $ threadDelay $ 5 * 1000000
catch action $ throttler action
-- | Amazon throttle handler.
-- | 244 | throttled action = do
traceError "throttled" mempty
statsIncrement "wolf.throttled" mempty
liftIO $ threadDelay $ 5 * 1000000
catch action $ throttler action
-- | Amazon throttle handler.
-- | 199 | false | true | 0 | 9 | 47 | 79 | 35 | 44 | null | null |
ctford/Idris-Elba-dev | src/Idris/CaseSplit.hs | bsd-3-clause | tidy :: IState -> PTerm -> Maybe Name -> State MergeState PTerm
tidy ist orig@(PRef fc n) ty
= do ms <- get
case lookup n (namemap ms) of
Just x -> return (PRef fc x)
Nothing -> case n of
(UN _) -> return orig
_ -... | 409 | tidy :: IState -> PTerm -> Maybe Name -> State MergeState PTerm
tidy ist orig@(PRef fc n) ty
= do ms <- get
case lookup n (namemap ms) of
Just x -> return (PRef fc x)
Nothing -> case n of
(UN _) -> return orig
_ -... | 409 | tidy ist orig@(PRef fc n) ty
= do ms <- get
case lookup n (namemap ms) of
Just x -> return (PRef fc x)
Nothing -> case n of
(UN _) -> return orig
_ -> do n' <- inventName ist ty n
... | 345 | false | true | 1 | 19 | 204 | 159 | 72 | 87 | null | null |
alexander-at-github/eta | compiler/ETA/Utils/Encoding.hs | bsd-3-clause | encode_ch '#' = "zh" | 21 | encode_ch '#' = "zh" | 21 | encode_ch '#' = "zh" | 21 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
meiersi/bytestring | Data/ByteString.hs | bsd-3-clause | {-
--
-- around 30% slower
--
count w (PS x s m) = inlinePerformIO $ withForeignPtr x $ \p ->
go (p `plusPtr` s) (fromIntegral m) 0
where
go :: Ptr Word8 -> CSize -> Int -> IO Int
STRICT3(go)
go p l i = do
q <- memchr p w l
if q == nullPtr
then re... | 1,019 | findIndex :: (Word8 -> Bool) -> ByteString -> Maybe Int
findIndex k (PS x s l) = inlinePerformIO $ withForeignPtr x $ \f -> go (f `plusPtr` s) 0
where
STRICT2(go)
go ptr n | n >= l = return Nothing
| otherwise = do w <- peek ptr
if k w
... | 409 | findIndex k (PS x s l) = inlinePerformIO $ withForeignPtr x $ \f -> go (f `plusPtr` s) 0
where
STRICT2(go)
go ptr n | n >= l = return Nothing
| otherwise = do w <- peek ptr
if k w
then return (Just n)
... | 353 | true | true | 2 | 10 | 400 | 181 | 89 | 92 | null | null |
esmolanka/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | ppLFunLhType unicode y = ppFunLhType unicode (unLoc y) | 55 | ppLFunLhType unicode y = ppFunLhType unicode (unLoc y) | 55 | ppLFunLhType unicode y = ppFunLhType unicode (unLoc y) | 55 | false | false | 0 | 7 | 8 | 22 | 10 | 12 | null | null |
nakamuray/htig | HTIG/IRCServer/Connection.hs | bsd-3-clause | startWriterThread :: Handle -> IO (ThreadId, WriteChan)
startWriterThread h = starter writer h | 94 | startWriterThread :: Handle -> IO (ThreadId, WriteChan)
startWriterThread h = starter writer h | 94 | startWriterThread h = starter writer h | 38 | false | true | 0 | 7 | 12 | 32 | 16 | 16 | null | null |
mumuki/mulang | src/Language/Mulang/Interpreter.hs | gpl-3.0 | muEquals (MuString s1) (MuString s2) = s1 == s2 | 47 | muEquals (MuString s1) (MuString s2) = s1 == s2 | 47 | muEquals (MuString s1) (MuString s2) = s1 == s2 | 47 | false | false | 1 | 6 | 8 | 33 | 14 | 19 | null | null |
bennofs/dynamic-cabal | src/Distribution/Client/Dynamic/PackageDescription.hs | bsd-3-clause | dependencies' :: Selector BuildInfo [(String, Maybe Version)]
dependencies' = selector $ const $ applyE map' serializeDep <>. targetBuildDepends'
where serializeDep :: ExpG (Dependency -> (String, Maybe Version))
serializeDep = expr $ \dep -> do
dependency <- useCon "Distribution.Package" $ Ident ... | 1,105 | dependencies' :: Selector BuildInfo [(String, Maybe Version)]
dependencies' = selector $ const $ applyE map' serializeDep <>. targetBuildDepends'
where serializeDep :: ExpG (Dependency -> (String, Maybe Version))
serializeDep = expr $ \dep -> do
dependency <- useCon "Distribution.Package" $ Ident ... | 1,105 | dependencies' = selector $ const $ applyE map' serializeDep <>. targetBuildDepends'
where serializeDep :: ExpG (Dependency -> (String, Maybe Version))
serializeDep = expr $ \dep -> do
dependency <- useCon "Distribution.Package" $ Ident "Dependency"
packageName <- useCon "Distribution.Pack... | 1,042 | false | true | 5 | 17 | 273 | 257 | 124 | 133 | null | null |
hakuch/Pulsar | src/Pulsar/Decode.hs | apache-2.0 | getNext :: Get (Maybe Word16)
getNext =
do isEmpty_ <- isEmpty
if isEmpty_
then return Nothing
else Just <$> getWord | 139 | getNext :: Get (Maybe Word16)
getNext =
do isEmpty_ <- isEmpty
if isEmpty_
then return Nothing
else Just <$> getWord | 139 | getNext =
do isEmpty_ <- isEmpty
if isEmpty_
then return Nothing
else Just <$> getWord | 109 | false | true | 2 | 9 | 42 | 52 | 22 | 30 | null | null |
DanielRS/marquee | src/Text/Marquee/Writers/HTMLBlaze.hs | mit | writeInline (LineBreak) = toHtml (" " :: String) | 58 | writeInline (LineBreak) = toHtml (" " :: String) | 58 | writeInline (LineBreak) = toHtml (" " :: String) | 58 | false | false | 0 | 6 | 17 | 22 | 11 | 11 | null | null |
mstksg/typelits-witnesses | src/GHC/TypeLits/Compare.hs | mit | cmpNatGOrdering :: SCmpNat n m -> GOrdering n m
cmpNatGOrdering = \case
CLT Refl -> GLT
CEQ Refl Refl -> GEQ
CGT Refl -> GGT | 146 | cmpNatGOrdering :: SCmpNat n m -> GOrdering n m
cmpNatGOrdering = \case
CLT Refl -> GLT
CEQ Refl Refl -> GEQ
CGT Refl -> GGT | 146 | cmpNatGOrdering = \case
CLT Refl -> GLT
CEQ Refl Refl -> GEQ
CGT Refl -> GGT | 98 | false | true | 0 | 8 | 46 | 62 | 27 | 35 | null | null |
montefra/email_compare | src/Tools.hs | bsd-2-clause | safeTail xs = tail xs | 21 | safeTail xs = tail xs | 21 | safeTail xs = tail xs | 21 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
spyked/writer-monkey | src/Main.hs | bsd-3-clause | runWalks model numSteps parSize = do
let ns = min numSteps parSize
result <- runWalk model ns
rest <- runWalks model (numSteps - ns) parSize
return $ unwords result : rest | 187 | runWalks model numSteps parSize = do
let ns = min numSteps parSize
result <- runWalk model ns
rest <- runWalks model (numSteps - ns) parSize
return $ unwords result : rest | 187 | runWalks model numSteps parSize = do
let ns = min numSteps parSize
result <- runWalk model ns
rest <- runWalks model (numSteps - ns) parSize
return $ unwords result : rest | 187 | false | false | 0 | 10 | 46 | 74 | 33 | 41 | null | null |
sdiehl/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | mkBigCoreVarTup1 ids = mkBigCoreTup (map Var ids) | 50 | mkBigCoreVarTup1 ids = mkBigCoreTup (map Var ids) | 50 | mkBigCoreVarTup1 ids = mkBigCoreTup (map Var ids) | 50 | false | false | 0 | 7 | 7 | 20 | 9 | 11 | null | null |
Icelandjack/lens | src/Language/Haskell/TH/Lens.hs | bsd-3-clause | _PromotedConsT :: Prism' Type ()
_PromotedConsT
= prism remitter reviewer
where
remitter () = PromotedConsT
reviewer PromotedConsT = Right ()
reviewer x = Left x | 183 | _PromotedConsT :: Prism' Type ()
_PromotedConsT
= prism remitter reviewer
where
remitter () = PromotedConsT
reviewer PromotedConsT = Right ()
reviewer x = Left x | 183 | _PromotedConsT
= prism remitter reviewer
where
remitter () = PromotedConsT
reviewer PromotedConsT = Right ()
reviewer x = Left x | 150 | false | true | 2 | 7 | 46 | 60 | 28 | 32 | null | null |
Taketrung/HsPredictor | library/HsPredictor/ExportCSV.hs | mit | outcome :: Int -- ^ goals scored by home team
-> Int -- ^ goals scored by away team
-> Outcome
outcome x y
| x > y = HomeWin
| x < y = AwayWin
| otherwise = NoWinner | 187 | outcome :: Int -- ^ goals scored by home team
-> Int -- ^ goals scored by away team
-> Outcome
outcome x y
| x > y = HomeWin
| x < y = AwayWin
| otherwise = NoWinner | 187 | outcome x y
| x > y = HomeWin
| x < y = AwayWin
| otherwise = NoWinner | 76 | false | true | 1 | 8 | 61 | 64 | 30 | 34 | null | null |
zydeon/PeMo | src/IM.hs | bsd-3-clause | imLoop :: Chan UIAction -> Session -> IO ()
imLoop cUI s = forever $ do
msg <- getMessage s
case (getIM msg) of
Nothing -> return ()
Just im -> do
jid <- return $ formatJid $ fromJus... | 650 | imLoop :: Chan UIAction -> Session -> IO ()
imLoop cUI s = forever $ do
msg <- getMessage s
case (getIM msg) of
Nothing -> return ()
Just im -> do
jid <- return $ formatJid $ fromJus... | 650 | imLoop cUI s = forever $ do
msg <- getMessage s
case (getIM msg) of
Nothing -> return ()
Just im -> do
jid <- return $ formatJid $ fromJust $ messageFrom msg
... | 606 | false | true | 2 | 17 | 358 | 156 | 70 | 86 | null | null |
rueshyna/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | The players.
plrItems :: Lens' PlayerListResponse [Player]
plrItems
= lens _plrItems (\ s a -> s{_plrItems = a}) .
_Default
. _Coerce | 152 | plrItems :: Lens' PlayerListResponse [Player]
plrItems
= lens _plrItems (\ s a -> s{_plrItems = a}) .
_Default
. _Coerce | 134 | plrItems
= lens _plrItems (\ s a -> s{_plrItems = a}) .
_Default
. _Coerce | 88 | true | true | 0 | 11 | 37 | 53 | 28 | 25 | null | null |
JakDar/lab6-project | src/Lab2.hs | bsd-3-clause | - Using lambda in definition
-- |Function pover five to x using lambda
fiveToPower_ :: Integer -> Integer
fiveToPower_ = \x -> 5 ^ x
| 134 | fiveToPower_ :: Integer -> Integer
fiveToPower_ = \x -> 5 ^ x | 61 | fiveToPower_ = \x -> 5 ^ x | 26 | true | true | 1 | 6 | 26 | 32 | 17 | 15 | null | null |
jBugman/fun-lang | test/Test/Instances.hs | mit | genAtomic :: Gen Expression
genAtomic = WFSAtom <$> genAtom | 59 | genAtomic :: Gen Expression
genAtomic = WFSAtom <$> genAtom | 59 | genAtomic = WFSAtom <$> genAtom | 31 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
robrix/derivative-parsing | src/Derivative/Parser.hs | bsd-3-clause | compact :: Parser t a -> Parser t a
compact = transform compactF | 64 | compact :: Parser t a -> Parser t a
compact = transform compactF | 64 | compact = transform compactF | 28 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
psibi/cabal2nix | src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs | bsd-3-clause | libNixName "gmime-2.4" = return "gmime" | 64 | libNixName "gmime-2.4" = return "gmime" | 64 | libNixName "gmime-2.4" = return "gmime" | 64 | false | false | 0 | 5 | 29 | 12 | 5 | 7 | null | null |
kim/amazonka | amazonka-rds/gen/Network/AWS/RDS/Types.hs | mpl-2.0 | -- | The name of the DB security group.
dbsgmDBSecurityGroupName :: Lens' DBSecurityGroupMembership (Maybe Text)
dbsgmDBSecurityGroupName =
lens _dbsgmDBSecurityGroupName
(\s a -> s { _dbsgmDBSecurityGroupName = a }) | 228 | dbsgmDBSecurityGroupName :: Lens' DBSecurityGroupMembership (Maybe Text)
dbsgmDBSecurityGroupName =
lens _dbsgmDBSecurityGroupName
(\s a -> s { _dbsgmDBSecurityGroupName = a }) | 188 | dbsgmDBSecurityGroupName =
lens _dbsgmDBSecurityGroupName
(\s a -> s { _dbsgmDBSecurityGroupName = a }) | 115 | true | true | 1 | 9 | 39 | 51 | 25 | 26 | null | null |
natepisarski/modmaster | Modmaster/Server.hs | bsd-3-clause | actOn :: [((String,String),[String])] -> String -> IO ()
actOn x c = do
let rules = matching x (Ct.before c ':') (Ct.after c ':')
mapM_ help rules
-- | Keyword of a rule. Move a register into a command line argument. | 221 | actOn :: [((String,String),[String])] -> String -> IO ()
actOn x c = do
let rules = matching x (Ct.before c ':') (Ct.after c ':')
mapM_ help rules
-- | Keyword of a rule. Move a register into a command line argument. | 221 | actOn x c = do
let rules = matching x (Ct.before c ':') (Ct.after c ':')
mapM_ help rules
-- | Keyword of a rule. Move a register into a command line argument. | 164 | false | true | 0 | 13 | 45 | 92 | 47 | 45 | null | null |
mariefarrell/Hets | CASL/Quantification.hs | gpl-2.0 | warnUnused :: Sign f e -> [Named (FORMULA f)] -> [Diagnosis]
warnUnused sig = warnUnusedVars " " sig . getTopVars | 113 | warnUnused :: Sign f e -> [Named (FORMULA f)] -> [Diagnosis]
warnUnused sig = warnUnusedVars " " sig . getTopVars | 113 | warnUnused sig = warnUnusedVars " " sig . getTopVars | 52 | false | true | 0 | 10 | 19 | 51 | 25 | 26 | null | null |
viloocity/CMQ | src/System/CMQ.hs | mit | newRq :: Serialize a => Socket -- ^ Socket does not need to be in connected state.
-> Int -- ^ Maximum Queue length in bytes.
-> Rational -- ^ Maximum Queue age in ms.
-> IO (Cmq a) -- ^ Token returned to identify the Queue.
newRq s qthresh tdelay = do
q <- atomically $ new... | 522 | newRq :: Serialize a => Socket -- ^ Socket does not need to be in connected state.
-> Int -- ^ Maximum Queue length in bytes.
-> Rational -- ^ Maximum Queue age in ms.
-> IO (Cmq a)
newRq s qthresh tdelay = do
q <- atomically $ newTVar (PSQ.empty)
m <- atomically $ new... | 478 | newRq s qthresh tdelay = do
q <- atomically $ newTVar (PSQ.empty)
m <- atomically $ newTVar (Map.empty)
t <- newTChanIO
let cmq = Cmq qthresh tdelay q m t
forkIO $ loopMyQ s cmq q m
forkIO $ loadTChan s t
return cmq | 257 | true | true | 0 | 11 | 172 | 149 | 70 | 79 | null | null |
geocurnoff/nikki | src/Sorts/Nikki/Types.hs | lgpl-3.0 | toActionNumber Wait{} = 0 | 39 | toActionNumber Wait{} = 0 | 39 | toActionNumber Wait{} = 0 | 39 | false | false | 0 | 6 | 17 | 13 | 6 | 7 | null | null |
mgaut72/cbf | cbf.hs | mit | parse ('<':xs) = LeftS 1 : parse xs | 37 | parse ('<':xs) = LeftS 1 : parse xs | 37 | parse ('<':xs) = LeftS 1 : parse xs | 37 | false | false | 0 | 6 | 9 | 27 | 12 | 15 | null | null |
linusyang/barrelfish | tools/flounder/UMPCommon.hs | mit | -- Name of the receive handler
rx_handler_name p ifn = ump_ifscope p ifn "rx_handler" | 85 | rx_handler_name p ifn = ump_ifscope p ifn "rx_handler" | 54 | rx_handler_name p ifn = ump_ifscope p ifn "rx_handler" | 54 | true | false | 0 | 5 | 13 | 19 | 9 | 10 | null | null |
kellino/TypeSystems | fullSub/PrettyPrint.hs | mit | count :: Term -> Int
count TmZero = 0 | 37 | count :: Term -> Int
count TmZero = 0 | 37 | count TmZero = 0 | 16 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
jyrimatti/alava | src-exe/Main.hs | mit | show :: Show a => a -> Text
show = pack . P.show | 48 | show :: Show a => a -> Text
show = pack . P.show | 48 | show = pack . P.show | 20 | false | true | 0 | 6 | 12 | 28 | 14 | 14 | null | null |
randallalexander/LYAH | src/Ch2.hs | bsd-3-clause | lastTest = last testList | 24 | lastTest = last testList | 24 | lastTest = last testList | 24 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
PierreR/streaming | benchmarks/old/Stream/Producer/Prelude.hs | bsd-3-clause | -- ---------------
-- map
-- ---------------
map :: Monad m => (a -> b) -> Producer a m r -> Producer b m r
map f = buildProducer . F.map f . foldProducer | 156 | map :: Monad m => (a -> b) -> Producer a m r -> Producer b m r
map f = buildProducer . F.map f . foldProducer | 109 | map f = buildProducer . F.map f . foldProducer | 46 | true | true | 0 | 9 | 34 | 71 | 34 | 37 | null | null |
riccardotommasini/plp16 | haskell/prepared/ESE20181109/ESE20181109.hs | apache-2.0 | -- guards vs pattern matching
--fibonacci
fib :: Int -> Int
fib n
| n == 0 = 0
| n == 1 = 1
| n == 2 = 1
| n > 2 = fib (n - 1) + fib (n - 2) | 160 | fib :: Int -> Int
fib n
| n == 0 = 0
| n == 1 = 1
| n == 2 = 1
| n > 2 = fib (n - 1) + fib (n - 2) | 117 | fib n
| n == 0 = 0
| n == 1 = 1
| n == 2 = 1
| n > 2 = fib (n - 1) + fib (n - 2) | 99 | true | true | 2 | 8 | 64 | 105 | 49 | 56 | null | null |
EDmitry/olympiad-hs | informatics/111508/111508.hs | mit | extractMin Empty = Nothing | 26 | extractMin Empty = Nothing | 26 | extractMin Empty = Nothing | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
uduki/hsQt | demos/PathDeform.hs | bsd-2-clause | pdRenderer_modMouseDrag :: PathDeformRenderer -> Bool -> IO ()
pdRenderer_modMouseDrag pdr drag = modifyIORef (pdRr_m_mouseDrag_io pdr) (\_ -> drag) | 148 | pdRenderer_modMouseDrag :: PathDeformRenderer -> Bool -> IO ()
pdRenderer_modMouseDrag pdr drag = modifyIORef (pdRr_m_mouseDrag_io pdr) (\_ -> drag) | 148 | pdRenderer_modMouseDrag pdr drag = modifyIORef (pdRr_m_mouseDrag_io pdr) (\_ -> drag) | 85 | false | true | 0 | 8 | 17 | 48 | 24 | 24 | null | null |
m3mitsuppe/haskell | exercises/kwon2.hs | unlicense | e :: A -> C
e x = w (q x) | 25 | e :: A -> C
e x = w (q x) | 25 | e x = w (q x) | 13 | false | true | 0 | 7 | 10 | 33 | 14 | 19 | null | null |
massysett/pipes-cliff | pipes-cliff/lib/Pipes/Cliff/Core.hs | bsd-3-clause | convertCreateProcess
:: Maybe NonPipe
-> Maybe NonPipe
-> Maybe NonPipe
-> CreateProcess
-> Process.CreateProcess
convertCreateProcess inp out err a = Process.CreateProcess
{ Process.cmdspec = convertCmdSpec $ cmdspec a
, Process.cwd = cwd a
, Process.env = env a
, Process.std_in = conv inp
, Proces... | 934 | convertCreateProcess
:: Maybe NonPipe
-> Maybe NonPipe
-> Maybe NonPipe
-> CreateProcess
-> Process.CreateProcess
convertCreateProcess inp out err a = Process.CreateProcess
{ Process.cmdspec = convertCmdSpec $ cmdspec a
, Process.cwd = cwd a
, Process.env = env a
, Process.std_in = conv inp
, Proces... | 934 | convertCreateProcess inp out err a = Process.CreateProcess
{ Process.cmdspec = convertCmdSpec $ cmdspec a
, Process.cwd = cwd a
, Process.env = env a
, Process.std_in = conv inp
, Process.std_out = conv out
, Process.std_err = conv err
, Process.close_fds = close_fds a
, Process.create_group = create_gr... | 810 | false | true | 1 | 11 | 169 | 235 | 122 | 113 | null | null |
markus-git/co-feldspar | src/Feldspar/Software/Primitive/Backend.hs | bsd-3-clause | compDiv t a b | wordType t = compBinOp C.Div a b | 48 | compDiv t a b | wordType t = compBinOp C.Div a b | 48 | compDiv t a b | wordType t = compBinOp C.Div a b | 48 | false | false | 0 | 8 | 11 | 36 | 14 | 22 | null | null |
seereason/HJScript | src/HJScript/Utils.hs | bsd-3-clause | isInVisible :: IsElementNode n => Exp n -> JBool
isInVisible elem = (val $ elem # style # display) .==. dispNone | 112 | isInVisible :: IsElementNode n => Exp n -> JBool
isInVisible elem = (val $ elem # style # display) .==. dispNone | 112 | isInVisible elem = (val $ elem # style # display) .==. dispNone | 63 | false | true | 0 | 9 | 20 | 47 | 23 | 24 | null | null |
ku-fpg/thrust-gen | src/Ion/Private/Lang.hs | bsd-3-clause | getLibInfo (DeclEmpty v n) = getLibInfo $ Decl v n | 51 | getLibInfo (DeclEmpty v n) = getLibInfo $ Decl v n | 51 | getLibInfo (DeclEmpty v n) = getLibInfo $ Decl v n | 51 | false | false | 0 | 6 | 10 | 27 | 12 | 15 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Internal/InlineC.hs | gpl-3.0 | -- Input Parameters :
-- mat - the matrix
-- row - the row to get
-- ncols, cols - the number of nonzeros and their columns
-- vals - if nonzero the column values
-- Notes :
-- This routine should be called after you have finished examining the entries.
-- This routine zeros out ncols, cols, and vals. This is to preven... | 629 | matRestoreRow' mat row ncols cols vals = with ncols $ \ncolsp -> with cols $ \colsp -> with vals $ \valsp -> matRestoreRow0' mat row ncolsp colsp valsp | 151 | matRestoreRow' mat row ncols cols vals = with ncols $ \ncolsp -> with cols $ \colsp -> with vals $ \valsp -> matRestoreRow0' mat row ncolsp colsp valsp | 151 | true | false | 0 | 11 | 120 | 72 | 39 | 33 | null | null |
jystic/dipper | src/Dipper/Core.hs | bsd-3-clause | ------------------------------------------------------------------------
-- Renaming
renameAtom :: (Ord a, Show a, Show b, Typeable b)
=> Map a b
-> Atom a r
-> Atom b r
renameAtom names atom = case atom of
Var (Name x) -> Var (Name (unsafeLookup "renameAtom" x names))
Const x ... | 335 | renameAtom :: (Ord a, Show a, Show b, Typeable b)
=> Map a b
-> Atom a r
-> Atom b r
renameAtom names atom = case atom of
Var (Name x) -> Var (Name (unsafeLookup "renameAtom" x names))
Const x -> Const x | 249 | renameAtom names atom = case atom of
Var (Name x) -> Var (Name (unsafeLookup "renameAtom" x names))
Const x -> Const x | 131 | true | true | 0 | 12 | 93 | 118 | 57 | 61 | null | null |
bixuanzju/fcore | lib/SymbolicEvaluator.hs | bsd-2-clause | merge (_, MUL) _ zero@(Exp (SInt 0)) = zero | 43 | merge (_, MUL) _ zero@(Exp (SInt 0)) = zero | 43 | merge (_, MUL) _ zero@(Exp (SInt 0)) = zero | 43 | false | false | 0 | 10 | 8 | 34 | 18 | 16 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F02.hs | bsd-3-clause | ptr_glClear :: FunPtr (GLbitfield -> IO ())
ptr_glClear = unsafePerformIO $ getCommand "glClear" | 96 | ptr_glClear :: FunPtr (GLbitfield -> IO ())
ptr_glClear = unsafePerformIO $ getCommand "glClear" | 96 | ptr_glClear = unsafePerformIO $ getCommand "glClear" | 52 | false | true | 0 | 9 | 12 | 33 | 16 | 17 | null | null |
hesselink/haskell-opaleye | src/Opaleye/Internal/HaskellDB/Sql/Default.hs | bsd-3-clause | showBinOp OpBitAnd = "&" | 29 | showBinOp OpBitAnd = "&" | 29 | showBinOp OpBitAnd = "&" | 29 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
raventid/coursera_learning | haskell/chapter18/worksheet.hs | mit | mkSphericalCow'' :: String -> Int -> Int -> Maybe Cow
mkSphericalCow'' name' age' weight' =
noEmpty name' >>=
\nammy ->
noNegative age' >>=
\agey ->
noNegative weight' >>=
\weighty ->
weightCheck (Cow nammy agey weighty) | 252 | mkSphericalCow'' :: String -> Int -> Int -> Maybe Cow
mkSphericalCow'' name' age' weight' =
noEmpty name' >>=
\nammy ->
noNegative age' >>=
\agey ->
noNegative weight' >>=
\weighty ->
weightCheck (Cow nammy agey weighty) | 252 | mkSphericalCow'' name' age' weight' =
noEmpty name' >>=
\nammy ->
noNegative age' >>=
\agey ->
noNegative weight' >>=
\weighty ->
weightCheck (Cow nammy agey weighty) | 198 | false | true | 0 | 13 | 66 | 82 | 40 | 42 | null | null |
spechub/Hets | TPTP/Pretty.hs | gpl-2.0 | printFOF_variable_list :: FOF_variable_list -> Doc
printFOF_variable_list = sepByCommas . map pretty | 100 | printFOF_variable_list :: FOF_variable_list -> Doc
printFOF_variable_list = sepByCommas . map pretty | 100 | printFOF_variable_list = sepByCommas . map pretty | 49 | false | true | 0 | 7 | 10 | 28 | 12 | 16 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Mediawiki.hs | gpl-2.0 | parseRules ("MediaWiki","TableHeader") =
(((pDetect2Chars False '{' '|' >>= withAttribute DecValTok))
<|>
((parseRules ("MediaWiki","FindHtmlStartTagAttributes")))
<|>
(currentContext >>= \x -> guard (x == ("MediaWiki","TableHeader")) >> pDefault >>= withAttribute NormalTok)) | 290 | parseRules ("MediaWiki","TableHeader") =
(((pDetect2Chars False '{' '|' >>= withAttribute DecValTok))
<|>
((parseRules ("MediaWiki","FindHtmlStartTagAttributes")))
<|>
(currentContext >>= \x -> guard (x == ("MediaWiki","TableHeader")) >> pDefault >>= withAttribute NormalTok)) | 290 | parseRules ("MediaWiki","TableHeader") =
(((pDetect2Chars False '{' '|' >>= withAttribute DecValTok))
<|>
((parseRules ("MediaWiki","FindHtmlStartTagAttributes")))
<|>
(currentContext >>= \x -> guard (x == ("MediaWiki","TableHeader")) >> pDefault >>= withAttribute NormalTok)) | 290 | false | false | 0 | 15 | 40 | 100 | 54 | 46 | null | null |
davdar/quals | OldAddLocConvert.hs | bsd-3-clause | ucall :: SCall -> U RCall
ucall sc = unit RCall <@> nextLoc <@> case runFix sc of
If a tc fc -> unit If <@> uatom a <@> ucall tc <@> ucall fc
App a aes -> unit App <@> uatom a <@> mapM uatom aes
Halt a -> unit Halt <@> uatom a | 232 | ucall :: SCall -> U RCall
ucall sc = unit RCall <@> nextLoc <@> case runFix sc of
If a tc fc -> unit If <@> uatom a <@> ucall tc <@> ucall fc
App a aes -> unit App <@> uatom a <@> mapM uatom aes
Halt a -> unit Halt <@> uatom a | 232 | ucall sc = unit RCall <@> nextLoc <@> case runFix sc of
If a tc fc -> unit If <@> uatom a <@> ucall tc <@> ucall fc
App a aes -> unit App <@> uatom a <@> mapM uatom aes
Halt a -> unit Halt <@> uatom a | 206 | false | true | 16 | 7 | 60 | 85 | 48 | 37 | null | null |
aisamanra/matterhorn | src/Types.hs | bsd-3-clause | csCurrentChannelId :: Lens' ChatState ChannelId
csCurrentChannelId = csFocus.focusL | 83 | csCurrentChannelId :: Lens' ChatState ChannelId
csCurrentChannelId = csFocus.focusL | 83 | csCurrentChannelId = csFocus.focusL | 35 | false | true | 1 | 6 | 7 | 22 | 9 | 13 | null | null |
ghorn/classy-dvda | src/Classy/DebugShow.hs | bsd-3-clause | debugShow4 mi name x y z w = debugShow3 mi name x y z ++ " (" ++ debugShow (dec mi) w ++ ")" | 92 | debugShow4 mi name x y z w = debugShow3 mi name x y z ++ " (" ++ debugShow (dec mi) w ++ ")" | 92 | debugShow4 mi name x y z w = debugShow3 mi name x y z ++ " (" ++ debugShow (dec mi) w ++ ")" | 92 | false | false | 1 | 9 | 23 | 64 | 25 | 39 | null | null |
Deewiant/pipe | System/Process/Pipe.hs | bsd-3-clause | filePipe' :: [(FilePath,[String])] -> FilePath -> FilePath -> IO ()
filePipe' progs infile = filePipe (dropFileName infile) progs infile | 137 | filePipe' :: [(FilePath,[String])] -> FilePath -> FilePath -> IO ()
filePipe' progs infile = filePipe (dropFileName infile) progs infile | 136 | filePipe' progs infile = filePipe (dropFileName infile) progs infile | 68 | false | true | 0 | 9 | 19 | 58 | 30 | 28 | null | null |
zepto-lang/zepto-js | src/Zepto/Primitives/TypeCheckPrimitives.hs | gpl-2.0 | isChar _ = return $ fromSimple $ Bool False | 43 | isChar _ = return $ fromSimple $ Bool False | 43 | isChar _ = return $ fromSimple $ Bool False | 43 | false | false | 0 | 6 | 8 | 20 | 9 | 11 | null | null |
coghex/abridgefaraway | src/GLUtil/Textures.hs | bsd-3-clause | texture2DWrap :: StateVar (Repetition, Clamping)
texture2DWrap = makeStateVar (get (textureWrapMode Texture2D S))
(forM_ [S,T] . aux)
where aux x d = textureWrapMode Texture2D d $= x
-- | Set texture coordinate wrapping options for the 'S', 'T', and 'R'
-- dimensions of a 3D texture. | 316 | texture2DWrap :: StateVar (Repetition, Clamping)
texture2DWrap = makeStateVar (get (textureWrapMode Texture2D S))
(forM_ [S,T] . aux)
where aux x d = textureWrapMode Texture2D d $= x
-- | Set texture coordinate wrapping options for the 'S', 'T', and 'R'
-- dimensions of a 3D texture. | 316 | texture2DWrap = makeStateVar (get (textureWrapMode Texture2D S))
(forM_ [S,T] . aux)
where aux x d = textureWrapMode Texture2D d $= x
-- | Set texture coordinate wrapping options for the 'S', 'T', and 'R'
-- dimensions of a 3D texture. | 267 | false | true | 0 | 9 | 76 | 78 | 41 | 37 | null | null |
AlexanderPankiv/ghc | compiler/cmm/CmmLint.hs | bsd-3-clause | checkCond :: DynFlags -> CmmExpr -> CmmLint ()
checkCond _ (CmmMachOp mop _) | isComparisonMachOp mop = return () | 113 | checkCond :: DynFlags -> CmmExpr -> CmmLint ()
checkCond _ (CmmMachOp mop _) | isComparisonMachOp mop = return () | 113 | checkCond _ (CmmMachOp mop _) | isComparisonMachOp mop = return () | 66 | false | true | 0 | 8 | 18 | 51 | 23 | 28 | null | null |
conal/hermit | src/HERMIT/Dictionary/Inline.hs | bsd-2-clause | alt2Exp :: Monad m => [Type] -> (AltCon,[Var]) -> m CoreExpr
alt2Exp _ (DEFAULT , _ ) = fail "DEFAULT alternative cannot be converted to an expression." | 156 | alt2Exp :: Monad m => [Type] -> (AltCon,[Var]) -> m CoreExpr
alt2Exp _ (DEFAULT , _ ) = fail "DEFAULT alternative cannot be converted to an expression." | 156 | alt2Exp _ (DEFAULT , _ ) = fail "DEFAULT alternative cannot be converted to an expression." | 95 | false | true | 0 | 9 | 30 | 55 | 29 | 26 | null | null |
qpliu/esolang | flower/hs/Interp.hs | gpl-3.0 | evalStmts :: [Bool] -> [(Int,Bool)] -> [Stmt] -> [(Int,Bool)]
evalStmts locals outputs stmts = (snd . foldl evalStmt (locals,outputs)) stmts | 140 | evalStmts :: [Bool] -> [(Int,Bool)] -> [Stmt] -> [(Int,Bool)]
evalStmts locals outputs stmts = (snd . foldl evalStmt (locals,outputs)) stmts | 140 | evalStmts locals outputs stmts = (snd . foldl evalStmt (locals,outputs)) stmts | 78 | false | true | 0 | 9 | 19 | 75 | 42 | 33 | null | null |
jwiegley/ghc-release | libraries/binary/tests/QC.hs | gpl-3.0 | prop_Word16host :: Word16 -> Property
prop_Word16host = roundTripWith putWord16host getWord16host | 97 | prop_Word16host :: Word16 -> Property
prop_Word16host = roundTripWith putWord16host getWord16host | 97 | prop_Word16host = roundTripWith putWord16host getWord16host | 59 | false | true | 0 | 5 | 9 | 20 | 10 | 10 | null | null |
silkapp/bloodhound | src/Database/Bloodhound/Types.hs | bsd-3-clause | rangeValueToPair :: RangeValue -> [Pair]
rangeValueToPair rv = case rv of
RangeDateLte (LessThanEqD t) -> ["lte" .= t]
RangeDateGte (GreaterThanEqD t) -> ["gte" .= t]
RangeDateLt (LessThanD t) -> ["lt" .= t]
RangeDateGt (GreaterThanD t) ... | 1,273 | rangeValueToPair :: RangeValue -> [Pair]
rangeValueToPair rv = case rv of
RangeDateLte (LessThanEqD t) -> ["lte" .= t]
RangeDateGte (GreaterThanEqD t) -> ["gte" .= t]
RangeDateLt (LessThanD t) -> ["lt" .= t]
RangeDateGt (GreaterThanD t) ... | 1,273 | rangeValueToPair rv = case rv of
RangeDateLte (LessThanEqD t) -> ["lte" .= t]
RangeDateGte (GreaterThanEqD t) -> ["gte" .= t]
RangeDateLt (LessThanD t) -> ["lt" .= t]
RangeDateGt (GreaterThanD t) -> ["gt" .= t]
RangeDate... | 1,232 | false | true | 0 | 10 | 402 | 503 | 254 | 249 | null | null |
Philonous/pontarius-xmpp | source/Network/Xmpp/Lens.hs | bsd-3-clause | -- Xmpp Lenses
--------------------
_JidText :: Prism Text Jid
_JidText = prism' jidToText jidFromText | 103 | _JidText :: Prism Text Jid
_JidText = prism' jidToText jidFromText | 66 | _JidText = prism' jidToText jidFromText | 39 | true | true | 0 | 5 | 14 | 23 | 12 | 11 | null | null |
BartAdv/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | extractPArg (PTacImplicit {pname=n, getScript=p1, getTm=p2})
= n : (concatMap extract [p1, p2]) | 133 | extractPArg (PTacImplicit {pname=n, getScript=p1, getTm=p2})
= n : (concatMap extract [p1, p2]) | 133 | extractPArg (PTacImplicit {pname=n, getScript=p1, getTm=p2})
= n : (concatMap extract [p1, p2]) | 133 | false | false | 0 | 9 | 49 | 51 | 29 | 22 | null | null |
isovector/eden | src/Eden/TextObjs.hs | bsd-3-clause | getTextObj :: Repeatable Buffer (Maybe (Eden Buffer TextObj))
getTextObj = again $ do
remaining <- liftIO . newIORef $ M.toList textobjs
go remaining
where
go remaining = do
c <- liftIO getChar
liftIO . modifyIORef remaining $ map (first tail)
. filte... | 536 | getTextObj :: Repeatable Buffer (Maybe (Eden Buffer TextObj))
getTextObj = again $ do
remaining <- liftIO . newIORef $ M.toList textobjs
go remaining
where
go remaining = do
c <- liftIO getChar
liftIO . modifyIORef remaining $ map (first tail)
. filte... | 536 | getTextObj = again $ do
remaining <- liftIO . newIORef $ M.toList textobjs
go remaining
where
go remaining = do
c <- liftIO getChar
liftIO . modifyIORef remaining $ map (first tail)
. filter ((== c) . head . fst)
results <- liftIO $ readIORef ... | 474 | false | true | 5 | 13 | 196 | 201 | 87 | 114 | null | null |
DavidAlphaFox/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | unSwap IsSwapped f a b = f b a | 31 | unSwap IsSwapped f a b = f b a | 31 | unSwap IsSwapped f a b = f b a | 31 | false | false | 0 | 5 | 9 | 20 | 9 | 11 | null | null |
tranma/optparse-th | Options/Applicative/TH.hs | bsd-3-clause | gen readers ps (C0 name cmds) = do
subDecls <- concat <$> mapM (gen readers ps) cmds
this <- commandD ps name (map optName cmds)
return (this:subDecls) | 161 | gen readers ps (C0 name cmds) = do
subDecls <- concat <$> mapM (gen readers ps) cmds
this <- commandD ps name (map optName cmds)
return (this:subDecls) | 161 | gen readers ps (C0 name cmds) = do
subDecls <- concat <$> mapM (gen readers ps) cmds
this <- commandD ps name (map optName cmds)
return (this:subDecls) | 161 | false | false | 0 | 11 | 36 | 81 | 37 | 44 | null | null |
foreverbell/unlimited-plt-toys | tapl/untyped/Context.hs | bsd-3-clause | nameToIndex :: Context -> String -> Int
nameToIndex (Context ctx) name = case findIndex (== name) ctx of
Just index -> index
Nothing -> error $ "context error: variable " ++ name ++ " is unbound" | 199 | nameToIndex :: Context -> String -> Int
nameToIndex (Context ctx) name = case findIndex (== name) ctx of
Just index -> index
Nothing -> error $ "context error: variable " ++ name ++ " is unbound" | 199 | nameToIndex (Context ctx) name = case findIndex (== name) ctx of
Just index -> index
Nothing -> error $ "context error: variable " ++ name ++ " is unbound" | 159 | false | true | 5 | 7 | 39 | 66 | 34 | 32 | null | null |
nebasuke/CarneadesIntoDung | src/Language/CarneadesIntoDung/Translation.hs | bsd-3-clause | -- |Given a list of already translated arguments and a propositional literal,
-- an argument (pro the propositional literal) is translated into a Dung argument
-- and a possibly empty list of attackers.
transApp :: [LConcreteArg] -> PropLiteral -> Argument -> (LConcreteArg, [(LConcreteArg, LConcreteArg)])
transApp tA... | 751 | transApp :: [LConcreteArg] -> PropLiteral -> Argument -> (LConcreteArg, [(LConcreteArg, LConcreteArg)])
transApp tArgs p a@(Arg (prems, excs, c))
| accProps tArgs `intersect` prems /= prems = ((False, Right a), [(defeater, (False, Right a))])
| otherwise =
let acceptableExceptions = filter (\ (b, arg) -> b && eith... | 546 | transApp tArgs p a@(Arg (prems, excs, c))
| accProps tArgs `intersect` prems /= prems = ((False, Right a), [(defeater, (False, Right a))])
| otherwise =
let acceptableExceptions = filter (\ (b, arg) -> b && either (`elem` excs) (const False) arg) tArgs
applicableArg = (null acceptableExceptions, Right ... | 442 | true | true | 1 | 15 | 141 | 229 | 130 | 99 | null | null |
fpoli/lambda | examples/Main.hs | gpl-3.0 | main :: IO()
main = do
let one = succ zero
let two = succ one
let three = succ two
let four = succ three
let six = sum four two
let ten = sum four six
let compiled = reduceAll ten
print compiled
-- output: ...
putStrLn $ showInt compiled
-- output: succ(succ(...(succ(zero)).... | 480 | main :: IO()
main = do
let one = succ zero
let two = succ one
let three = succ two
let four = succ three
let six = sum four two
let ten = sum four six
let compiled = reduceAll ten
print compiled
-- output: ...
putStrLn $ showInt compiled
-- output: succ(succ(...(succ(zero)).... | 480 | main = do
let one = succ zero
let two = succ one
let three = succ two
let four = succ three
let six = sum four two
let ten = sum four six
let compiled = reduceAll ten
print compiled
-- output: ...
putStrLn $ showInt compiled
-- output: succ(succ(...(succ(zero))...))
let... | 467 | false | true | 1 | 12 | 139 | 160 | 68 | 92 | null | null |
gcampax/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | gHC_NUM = mkBaseModule (fsLit "GHC.Num") | 48 | gHC_NUM = mkBaseModule (fsLit "GHC.Num") | 48 | gHC_NUM = mkBaseModule (fsLit "GHC.Num") | 48 | false | false | 0 | 7 | 12 | 15 | 7 | 8 | null | null |
MaxOw/awesomium | src/Graphics/UI/Awesomium/WebView/Callbacks.hs | lgpl-3.0 | defBeginNavigationCallback :: BeginNavigationCallbackHandler -> BeginNavigationCallback
defBeginNavigationCallback convcb wv a1 a0 = do
ar1 <- fromAweString a1
ar0 <- fromAweString a0
convcb wv ar1 ar0
-- | Assign a callback function to be notified when a WebView begins
-- navigation to a certain URL. | 315 | defBeginNavigationCallback :: BeginNavigationCallbackHandler -> BeginNavigationCallback
defBeginNavigationCallback convcb wv a1 a0 = do
ar1 <- fromAweString a1
ar0 <- fromAweString a0
convcb wv ar1 ar0
-- | Assign a callback function to be notified when a WebView begins
-- navigation to a certain URL. | 315 | defBeginNavigationCallback convcb wv a1 a0 = do
ar1 <- fromAweString a1
ar0 <- fromAweString a0
convcb wv ar1 ar0
-- | Assign a callback function to be notified when a WebView begins
-- navigation to a certain URL. | 227 | false | true | 0 | 8 | 55 | 56 | 26 | 30 | null | null |
christiaanb/clash-compiler | CLaSH.hs | bsd-2-clause | doHDL :: Backend s
=> s
-> String
-> IO ()
doHDL b src = do
pd <- primDir b
primMap <- generatePrimMap [pd]
(bindingsMap,tcm) <- generateBindings primMap src Nothing
generateHDL bindingsMap (Just b) primMap tcm ghcTypeToHWType reduceConstant DebugNone | 285 | doHDL :: Backend s
=> s
-> String
-> IO ()
doHDL b src = do
pd <- primDir b
primMap <- generatePrimMap [pd]
(bindingsMap,tcm) <- generateBindings primMap src Nothing
generateHDL bindingsMap (Just b) primMap tcm ghcTypeToHWType reduceConstant DebugNone | 285 | doHDL b src = do
pd <- primDir b
primMap <- generatePrimMap [pd]
(bindingsMap,tcm) <- generateBindings primMap src Nothing
generateHDL bindingsMap (Just b) primMap tcm ghcTypeToHWType reduceConstant DebugNone | 221 | false | true | 0 | 9 | 72 | 103 | 48 | 55 | null | null |
google/ghc-source-gen | src/GHC/SourceGen/Name.hs | bsd-3-clause | moduleNameStrToString :: ModuleNameStr -> String
moduleNameStrToString = moduleNameString . unModuleNameStr | 107 | moduleNameStrToString :: ModuleNameStr -> String
moduleNameStrToString = moduleNameString . unModuleNameStr | 107 | moduleNameStrToString = moduleNameString . unModuleNameStr | 58 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
spechub/Hets | CommonLogic/Symbol.hs | gpl-2.0 | -- | Determines the symbol map of a morhpism
getSymbolMap :: Morphism.Morphism -> Map.Map Symbol Symbol
getSymbolMap f =
foldr (\ x -> Map.insert (Symbol x) (Symbol $ applyMap (propMap f) x))
Map.empty $ Set.toList $ Sign.allItems $ source f | 245 | getSymbolMap :: Morphism.Morphism -> Map.Map Symbol Symbol
getSymbolMap f =
foldr (\ x -> Map.insert (Symbol x) (Symbol $ applyMap (propMap f) x))
Map.empty $ Set.toList $ Sign.allItems $ source f | 200 | getSymbolMap f =
foldr (\ x -> Map.insert (Symbol x) (Symbol $ applyMap (propMap f) x))
Map.empty $ Set.toList $ Sign.allItems $ source f | 141 | true | true | 0 | 13 | 43 | 94 | 46 | 48 | null | null |
kyagrd/hs-nipkow-lics93 | src/Unif.hs | bsd-2-clause | -- on the fly eta-expansion
ustep ((Lam b1, Lam b2):es, s) = do Just(x,t1,_,t2) <- unbind2 b1 b2
pure ((t1,t2):es, s) | 153 | ustep ((Lam b1, Lam b2):es, s) = do Just(x,t1,_,t2) <- unbind2 b1 b2
pure ((t1,t2):es, s) | 125 | ustep ((Lam b1, Lam b2):es, s) = do Just(x,t1,_,t2) <- unbind2 b1 b2
pure ((t1,t2):es, s) | 125 | true | false | 0 | 10 | 56 | 82 | 43 | 39 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Layout/Groups/Helpers.hs | bsd-3-clause | -- | Move focus between the floating and non-floating layers
toggleFocusFloat :: X ()
toggleFocusFloat = ifFloat focusNonFloat focusFloatUp | 139 | toggleFocusFloat :: X ()
toggleFocusFloat = ifFloat focusNonFloat focusFloatUp | 78 | toggleFocusFloat = ifFloat focusNonFloat focusFloatUp | 53 | true | true | 0 | 6 | 18 | 22 | 11 | 11 | null | null |
ducis/flapjax-fixed | JsContracts-0.5.3/src/BrownPLT/JavaScript/Contracts/Compiler.hs | bsd-3-clause | exportRelease (InterfaceInstance id _ _) =
ExprStmt noPos $ AssignExpr noPos OpAssign
(LDot noPos (ThisRef noPos) id)
(DotRef noPos (VarRef noPos (Id noPos "impl")) (Id noPos id)) | 190 | exportRelease (InterfaceInstance id _ _) =
ExprStmt noPos $ AssignExpr noPos OpAssign
(LDot noPos (ThisRef noPos) id)
(DotRef noPos (VarRef noPos (Id noPos "impl")) (Id noPos id)) | 190 | exportRelease (InterfaceInstance id _ _) =
ExprStmt noPos $ AssignExpr noPos OpAssign
(LDot noPos (ThisRef noPos) id)
(DotRef noPos (VarRef noPos (Id noPos "impl")) (Id noPos id)) | 190 | false | false | 0 | 12 | 37 | 85 | 41 | 44 | null | null |
green-haskell/ghc | compiler/hsSyn/HsPat.hs | bsd-3-clause | pprPat (PArrPat pats _) = paBrackets (interpp'SP pats) | 58 | pprPat (PArrPat pats _) = paBrackets (interpp'SP pats) | 58 | pprPat (PArrPat pats _) = paBrackets (interpp'SP pats) | 58 | false | false | 0 | 7 | 11 | 27 | 12 | 15 | null | null |
kmels/dart-haskell | src/Language/Core/Interpreter/Libraries/GHC/CString.hs | bsd-3-clause | unpackCString = (id, Right val) where
id = "ghc-prim:GHC.CString.unpackCString#"
val = Fun (\i e -> evalId i e >>= return) "unpackString#" | 142 | unpackCString = (id, Right val) where
id = "ghc-prim:GHC.CString.unpackCString#"
val = Fun (\i e -> evalId i e >>= return) "unpackString#" | 142 | unpackCString = (id, Right val) where
id = "ghc-prim:GHC.CString.unpackCString#"
val = Fun (\i e -> evalId i e >>= return) "unpackString#" | 142 | false | false | 0 | 11 | 24 | 51 | 27 | 24 | null | null |
ctford/Idris-Elba-dev | src/Idris/ParseOps.hs | bsd-3-clause | -- | Backtick operator
backtick :: Operator IdrisParser PTerm
backtick = Infix (do indentPropHolds gtProp
lchar '`'; n <- fnName
lchar '`'
indentPropHolds gtProp
fc <- getFC
return (\x y -> PApp fc (PRef fc n) [pexp... | 343 | backtick :: Operator IdrisParser PTerm
backtick = Infix (do indentPropHolds gtProp
lchar '`'; n <- fnName
lchar '`'
indentPropHolds gtProp
fc <- getFC
return (\x y -> PApp fc (PRef fc n) [pexp x, pexp y])) AssocNone | 320 | backtick = Infix (do indentPropHolds gtProp
lchar '`'; n <- fnName
lchar '`'
indentPropHolds gtProp
fc <- getFC
return (\x y -> PApp fc (PRef fc n) [pexp x, pexp y])) AssocNone | 281 | true | true | 0 | 14 | 145 | 107 | 49 | 58 | null | null |
jwiegley/ghc-release | libraries/binary/tests/QC.hs | gpl-3.0 | prop_getByteString_negative :: Int -> Property
prop_getByteString_negative n =
n < 1 ==>
runGet (getByteString n) L.empty == B.empty | 138 | prop_getByteString_negative :: Int -> Property
prop_getByteString_negative n =
n < 1 ==>
runGet (getByteString n) L.empty == B.empty | 138 | prop_getByteString_negative n =
n < 1 ==>
runGet (getByteString n) L.empty == B.empty | 91 | false | true | 0 | 9 | 23 | 45 | 22 | 23 | null | null |
cjhveal/Euler | 4.hs | mit | -- Largest palindromic produdt of two n digit numbers
maxPal :: Int -> Int
maxPal 0 = 0 | 87 | maxPal :: Int -> Int
maxPal 0 = 0 | 33 | maxPal 0 = 0 | 12 | true | true | 0 | 7 | 17 | 25 | 11 | 14 | null | null |
mpickering/core-kythe | src/KythePlugin.hs | bsd-3-clause | -- Utility
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
mapMaybeM f xs = catMaybes <$> mapM f xs | 111 | mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
mapMaybeM f xs = catMaybes <$> mapM f xs | 99 | mapMaybeM f xs = catMaybes <$> mapM f xs | 40 | true | true | 0 | 11 | 26 | 66 | 33 | 33 | null | null |
nushio3/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprDo GhciStmtCtxt stmts = text "do" <+> ppr_do_stmts stmts | 61 | pprDo GhciStmtCtxt stmts = text "do" <+> ppr_do_stmts stmts | 61 | pprDo GhciStmtCtxt stmts = text "do" <+> ppr_do_stmts stmts | 61 | false | false | 0 | 6 | 10 | 21 | 9 | 12 | null | null |
athanclark/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyTTNameApp t args = fail ("Unknown reflection term name: " ++ show (t, args)) | 81 | reifyTTNameApp t args = fail ("Unknown reflection term name: " ++ show (t, args)) | 81 | reifyTTNameApp t args = fail ("Unknown reflection term name: " ++ show (t, args)) | 81 | false | false | 0 | 9 | 13 | 30 | 15 | 15 | null | null |
bergmark/hlint | src/Hint/Extensions.hs | bsd-3-clause | used DeriveTraversable = hasDerive ["Traversable"] | 50 | used DeriveTraversable = hasDerive ["Traversable"] | 50 | used DeriveTraversable = hasDerive ["Traversable"] | 50 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
jwaldmann/ceta-postproc | CeTA-2.39/generated/Haskell/IArray.hs | lgpl-3.0 | length :: IArray e -> Integer;
length (IArray v) = toInteger (Data.Ix.rangeSize (Data.Array.IArray.bounds v)) | 111 | length :: IArray e -> Integer
length (IArray v) = toInteger (Data.Ix.rangeSize (Data.Array.IArray.bounds v)) | 108 | length (IArray v) = toInteger (Data.Ix.rangeSize (Data.Array.IArray.bounds v)) | 78 | false | true | 0 | 10 | 15 | 53 | 27 | 26 | null | null |
qzchenwl/LambdaNet | AI/Layer.hs | mit | scaleLayer :: Double -> Layer -> Layer
scaleLayer factor l =
Layer (factor `scale` (weightMatrix l)) (factor `scale` (biasVector l)) (neuron l) | 145 | scaleLayer :: Double -> Layer -> Layer
scaleLayer factor l =
Layer (factor `scale` (weightMatrix l)) (factor `scale` (biasVector l)) (neuron l) | 145 | scaleLayer factor l =
Layer (factor `scale` (weightMatrix l)) (factor `scale` (biasVector l)) (neuron l) | 106 | false | true | 0 | 9 | 23 | 73 | 37 | 36 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.