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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AlexeyRaga/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR,
unpackCStringUtf8_RDR :: RdrName
eqString_RDR = nameRdrName eqStringName | 144 | eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR,
unpackCStringUtf8_RDR :: RdrName
eqString_RDR = nameRdrName eqStringName | 144 | eqString_RDR = nameRdrName eqStringName | 50 | false | true | 0 | 5 | 24 | 20 | 13 | 7 | null | null |
thewoolleyman/haskellbook | 15/14/haskell-club/chapter-exercises/src/Main.hs | unlicense | semigroupAssoc :: (Eq m, Semigroup m) => m -> m -> m -> Bool
semigroupAssoc a b c = (a <> (b <> c)) == ((a <> b) <> c) | 118 | semigroupAssoc :: (Eq m, Semigroup m) => m -> m -> m -> Bool
semigroupAssoc a b c = (a <> (b <> c)) == ((a <> b) <> c) | 118 | semigroupAssoc a b c = (a <> (b <> c)) == ((a <> b) <> c) | 57 | false | true | 0 | 9 | 29 | 77 | 41 | 36 | null | null |
rueshyna/gogol | gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Deployments/Update.hs | mpl-2.0 | -- | Sets the policy to use for creating new resources.
duCreatePolicy :: Lens' DeploymentsUpdate DeploymentsUpdateCreatePolicy
duCreatePolicy
= lens _duCreatePolicy
(\ s a -> s{_duCreatePolicy = a}) | 207 | duCreatePolicy :: Lens' DeploymentsUpdate DeploymentsUpdateCreatePolicy
duCreatePolicy
= lens _duCreatePolicy
(\ s a -> s{_duCreatePolicy = a}) | 151 | duCreatePolicy
= lens _duCreatePolicy
(\ s a -> s{_duCreatePolicy = a}) | 79 | true | true | 0 | 8 | 34 | 43 | 22 | 21 | null | null |
bgamari/pandoc | src/Text/Pandoc/Readers/Org.hs | gpl-2.0 | withRaw' :: (String -> F Blocks) -> BlockProperties -> OrgParser (F Blocks)
withRaw' f blockProp = (ignHeaders *> (f <$> rawBlockContent blockProp)) | 154 | withRaw' :: (String -> F Blocks) -> BlockProperties -> OrgParser (F Blocks)
withRaw' f blockProp = (ignHeaders *> (f <$> rawBlockContent blockProp)) | 154 | withRaw' f blockProp = (ignHeaders *> (f <$> rawBlockContent blockProp)) | 74 | false | true | 0 | 9 | 27 | 60 | 30 | 30 | null | null |
HIPERFIT/futhark | src/Language/Futhark/TypeChecker/Terms/Monad.hs | isc | withEnv :: TermEnv -> Env -> TermEnv
withEnv tenv env = tenv {termScope = termScope tenv <> envToTermScope env} | 111 | withEnv :: TermEnv -> Env -> TermEnv
withEnv tenv env = tenv {termScope = termScope tenv <> envToTermScope env} | 111 | withEnv tenv env = tenv {termScope = termScope tenv <> envToTermScope env} | 74 | false | true | 0 | 8 | 18 | 42 | 21 | 21 | null | null |
4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/FSpec/ShowHS.hs | gpl-3.0 | showL :: [String] -> String
showL xs = "["++intercalate "," xs++"]" | 67 | showL :: [String] -> String
showL xs = "["++intercalate "," xs++"]" | 67 | showL xs = "["++intercalate "," xs++"]" | 39 | false | true | 2 | 7 | 10 | 42 | 18 | 24 | null | null |
badp/ganeti | src/Ganeti/HTools/Cluster.hs | gpl-2.0 | -- | The empty solution we start with when computing allocations.
emptyAllocSolution :: AllocSolution
emptyAllocSolution = AllocSolution { asFailures = [], asAllocs = 0
, asSolution = Nothing, asLog = [] } | 240 | emptyAllocSolution :: AllocSolution
emptyAllocSolution = AllocSolution { asFailures = [], asAllocs = 0
, asSolution = Nothing, asLog = [] } | 174 | emptyAllocSolution = AllocSolution { asFailures = [], asAllocs = 0
, asSolution = Nothing, asLog = [] } | 138 | true | true | 0 | 7 | 66 | 42 | 26 | 16 | null | null |
jaapweel/bloop | PPrint.hs | gpl-2.0 | fold f [] = empty | 23 | fold f [] = empty | 23 | fold f [] = empty | 23 | false | false | 0 | 6 | 10 | 13 | 6 | 7 | null | null |
emilaxelsson/open-typerep | src/Data/TypeRep/Types/Tuple.hs | bsd-3-clause | tup7Type :: (TupleType :<: t)
=> TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e
-> TypeRep t f -> TypeRep t g -> TypeRep t (a,b,c,d,e,f,g)
tup7Type = sugarSym Tup7_t | 198 | tup7Type :: (TupleType :<: t)
=> TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e
-> TypeRep t f -> TypeRep t g -> TypeRep t (a,b,c,d,e,f,g)
tup7Type = sugarSym Tup7_t | 198 | tup7Type = sugarSym Tup7_t | 26 | false | true | 0 | 15 | 48 | 120 | 58 | 62 | null | null |
whittle/linkedin-api | Data/API/LinkedIn/Profile.hs | mit | fieldName HonorsS = "honors" | 28 | fieldName HonorsS = "honors" | 28 | fieldName HonorsS = "honors" | 28 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
olsner/ghc | compiler/typecheck/TcGenGenerics.hs | bsd-3-clause | x_RDR :: RdrName
x_RDR = mkVarUnqual (fsLit "x") | 48 | x_RDR :: RdrName
x_RDR = mkVarUnqual (fsLit "x") | 48 | x_RDR = mkVarUnqual (fsLit "x") | 31 | false | true | 0 | 7 | 7 | 27 | 11 | 16 | null | null |
cdornan/keystore | src/Data/KeyStore/Types.hs | bsd-3-clause | defaultSettings :: Settings
defaultSettings = mempty | 52 | defaultSettings :: Settings
defaultSettings = mempty | 52 | defaultSettings = mempty | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
shlevy/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | getAmode _ other
= do
(reg, code) <- getSomeReg other
let
off = ImmInt 0
return (Amode (AddrRegImm reg off) code)
-- The 'CondCode' type: Condition codes passed up the tree. | 216 | getAmode _ other
= do
(reg, code) <- getSomeReg other
let
off = ImmInt 0
return (Amode (AddrRegImm reg off) code)
-- The 'CondCode' type: Condition codes passed up the tree. | 216 | getAmode _ other
= do
(reg, code) <- getSomeReg other
let
off = ImmInt 0
return (Amode (AddrRegImm reg off) code)
-- The 'CondCode' type: Condition codes passed up the tree. | 216 | false | false | 1 | 12 | 73 | 63 | 29 | 34 | null | null |
chrisdone/ircbrowse | src/Ircbrowse/Controllers.hs | bsd-3-clause | nickCloud :: Controller Config PState ()
nickCloud = do
range <- getRange
channel <- getChannel
viewCached (NickCloud channel) $ do
nicks <- model $ getNickStats channel range
return $ V.nickCloud nicks | 216 | nickCloud :: Controller Config PState ()
nickCloud = do
range <- getRange
channel <- getChannel
viewCached (NickCloud channel) $ do
nicks <- model $ getNickStats channel range
return $ V.nickCloud nicks | 216 | nickCloud = do
range <- getRange
channel <- getChannel
viewCached (NickCloud channel) $ do
nicks <- model $ getNickStats channel range
return $ V.nickCloud nicks | 175 | false | true | 0 | 12 | 44 | 78 | 35 | 43 | null | null |
josefs/autosar | oldARSim/ARSim.hs | bsd-3-clause | shortProc (Sink a t vs) = spacesep ["Sink", show a] | 63 | shortProc (Sink a t vs) = spacesep ["Sink", show a] | 63 | shortProc (Sink a t vs) = spacesep ["Sink", show a] | 63 | false | false | 0 | 7 | 21 | 32 | 15 | 17 | null | null |
atomb/dalvik | Dalvik/Parser.hs | bsd-3-clause | loadDex :: BS.ByteString -> Either String DexFile
loadDex bs = do
h <- runGet parseDexHeader bs
itemMap <- doSection (dexMapOff h) 0 parseMap bs
strings <- doSection (dexOffStrings h) (dexNumStrings h) parseStrings bs
types <- doSection (dexOffTypes h) (dexNumTypes h) parseTypes bs
protos <- doSection (dexOffProtos h) (dexNumProtos h) parseProtos bs
fields <- doSection (dexOffFields h) (dexNumFields h) parseFields bs
methods <- doSection (dexOffMethods h) (dexNumMethods h) parseMethods bs
classes <- doSection (dexOffClassDefs h) (dexNumClassDefs h)
(parseClassDefs h) bs
{-
ddata <- doSection (dexDataOff h) (dexDataSize h) parseData bs
linkInfo <- doSection (dexLinkOff h) (dexLinkSize h) parseLinkInfo bs
-}
let dex = DexFile
{ dexHeader = h
, dexMap = itemMap
, dexStrings = strings
, dexTypeNames = types
, dexProtos = protos
, dexFields = fields
, dexMethods = methods
, dexClasses = classes
, dexThisId = maybe (-1) id $ findString dex "this"
}
return dex | 1,153 | loadDex :: BS.ByteString -> Either String DexFile
loadDex bs = do
h <- runGet parseDexHeader bs
itemMap <- doSection (dexMapOff h) 0 parseMap bs
strings <- doSection (dexOffStrings h) (dexNumStrings h) parseStrings bs
types <- doSection (dexOffTypes h) (dexNumTypes h) parseTypes bs
protos <- doSection (dexOffProtos h) (dexNumProtos h) parseProtos bs
fields <- doSection (dexOffFields h) (dexNumFields h) parseFields bs
methods <- doSection (dexOffMethods h) (dexNumMethods h) parseMethods bs
classes <- doSection (dexOffClassDefs h) (dexNumClassDefs h)
(parseClassDefs h) bs
{-
ddata <- doSection (dexDataOff h) (dexDataSize h) parseData bs
linkInfo <- doSection (dexLinkOff h) (dexLinkSize h) parseLinkInfo bs
-}
let dex = DexFile
{ dexHeader = h
, dexMap = itemMap
, dexStrings = strings
, dexTypeNames = types
, dexProtos = protos
, dexFields = fields
, dexMethods = methods
, dexClasses = classes
, dexThisId = maybe (-1) id $ findString dex "this"
}
return dex | 1,153 | loadDex bs = do
h <- runGet parseDexHeader bs
itemMap <- doSection (dexMapOff h) 0 parseMap bs
strings <- doSection (dexOffStrings h) (dexNumStrings h) parseStrings bs
types <- doSection (dexOffTypes h) (dexNumTypes h) parseTypes bs
protos <- doSection (dexOffProtos h) (dexNumProtos h) parseProtos bs
fields <- doSection (dexOffFields h) (dexNumFields h) parseFields bs
methods <- doSection (dexOffMethods h) (dexNumMethods h) parseMethods bs
classes <- doSection (dexOffClassDefs h) (dexNumClassDefs h)
(parseClassDefs h) bs
{-
ddata <- doSection (dexDataOff h) (dexDataSize h) parseData bs
linkInfo <- doSection (dexLinkOff h) (dexLinkSize h) parseLinkInfo bs
-}
let dex = DexFile
{ dexHeader = h
, dexMap = itemMap
, dexStrings = strings
, dexTypeNames = types
, dexProtos = protos
, dexFields = fields
, dexMethods = methods
, dexClasses = classes
, dexThisId = maybe (-1) id $ findString dex "this"
}
return dex | 1,103 | false | true | 0 | 16 | 333 | 328 | 162 | 166 | null | null |
nakaji-dayo/persistent | persistent/Database/Persist/Types/Base.hs | mit | keyAndEntityFields :: EntityDef -> [FieldDef]
keyAndEntityFields ent =
case entityPrimary ent of
Nothing -> entityId ent : entityFields ent
Just _ -> entityFields ent | 177 | keyAndEntityFields :: EntityDef -> [FieldDef]
keyAndEntityFields ent =
case entityPrimary ent of
Nothing -> entityId ent : entityFields ent
Just _ -> entityFields ent | 177 | keyAndEntityFields ent =
case entityPrimary ent of
Nothing -> entityId ent : entityFields ent
Just _ -> entityFields ent | 131 | false | true | 3 | 6 | 34 | 56 | 26 | 30 | null | null |
ashnikel/haskellbook | ch06/ch06.14_ex.hs | mit | s2 = Sentence "Julie" "loves" "dogs" | 36 | s2 = Sentence "Julie" "loves" "dogs" | 36 | s2 = Sentence "Julie" "loves" "dogs" | 36 | false | false | 1 | 5 | 5 | 17 | 6 | 11 | null | null |
sdiehl/ghc | compiler/GHC/Cmm/Utils.hs | bsd-3-clause | hasNoGlobalRegs (CmmLit _) = True | 49 | hasNoGlobalRegs (CmmLit _) = True | 49 | hasNoGlobalRegs (CmmLit _) = True | 49 | false | false | 0 | 7 | 20 | 15 | 7 | 8 | null | null |
ezyang/ghc | compiler/types/Type.hs | bsd-3-clause | coreView _ = Nothing | 20 | coreView _ = Nothing | 20 | coreView _ = Nothing | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
abuiles/turbinado-blog | tmp/dependencies/haskell-src-exts-0.3.9/Language/Haskell/Exts/ParseUtils.hs | bsd-3-clause | checkMethodDef :: HsDecl -> P ()
checkMethodDef (HsPatBind _ (HsPVar _) _ _) = return () | 88 | checkMethodDef :: HsDecl -> P ()
checkMethodDef (HsPatBind _ (HsPVar _) _ _) = return () | 88 | checkMethodDef (HsPatBind _ (HsPVar _) _ _) = return () | 55 | false | true | 0 | 9 | 15 | 46 | 22 | 24 | null | null |
andygill/er-systemf | Language/SystemF/Pretty.hs | bsd-3-clause | pprintBinding (RecBindings binds) = (vcat $ [ comment "-- rec group"
] ++ map pprintBind binds ++
[ comment "-- end rec group"
]) | 267 | pprintBinding (RecBindings binds) = (vcat $ [ comment "-- rec group"
] ++ map pprintBind binds ++
[ comment "-- end rec group"
]) | 267 | pprintBinding (RecBindings binds) = (vcat $ [ comment "-- rec group"
] ++ map pprintBind binds ++
[ comment "-- end rec group"
]) | 267 | false | false | 0 | 10 | 161 | 48 | 23 | 25 | null | null |
zhensydow/ptrader | src/PTrader/Portfolio.hs | gpl-3.0 | cashToValue :: CashValue -> Value
cashToValue v = Int val
where
val = round (v * fromIntegral cashResolution) | 115 | cashToValue :: CashValue -> Value
cashToValue v = Int val
where
val = round (v * fromIntegral cashResolution) | 115 | cashToValue v = Int val
where
val = round (v * fromIntegral cashResolution) | 81 | false | true | 1 | 8 | 23 | 51 | 21 | 30 | null | null |
alejandrorusso/mac-privacy | MAC/MVar.hs | bsd-3-clause | -- | Creation of an empty labeled @MVar@
newMACEmptyMVar :: Less l l' => MAC l (MACMVar l' a)
newMACEmptyMVar = create newEmptyMVar | 131 | newMACEmptyMVar :: Less l l' => MAC l (MACMVar l' a)
newMACEmptyMVar = create newEmptyMVar | 90 | newMACEmptyMVar = create newEmptyMVar | 37 | true | true | 0 | 8 | 22 | 37 | 18 | 19 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | -- | Add two vectors element-wise.
plusWord32X8# :: Word32X8# -> Word32X8# -> Word32X8#
plusWord32X8# = plusWord32X8# | 119 | plusWord32X8# :: Word32X8# -> Word32X8# -> Word32X8#
plusWord32X8# = plusWord32X8# | 82 | plusWord32X8# = plusWord32X8# | 29 | true | true | 0 | 8 | 17 | 27 | 12 | 15 | null | null |
burz/Feval | FVL/TypeAST.hs | mit | alg :: Algebra FAST.Expr (LazyFix Expr)
alg (FAST.CInt n) = Fx' $ CInt n | 72 | alg :: Algebra FAST.Expr (LazyFix Expr)
alg (FAST.CInt n) = Fx' $ CInt n | 72 | alg (FAST.CInt n) = Fx' $ CInt n | 32 | false | true | 0 | 8 | 13 | 42 | 20 | 22 | null | null |
batousik/Haskell2-Gomoku | src/Board.hs | gpl-2.0 | -- Checks if position is within bounds of board.
posWithinBounds :: Position -> Board -> Bool
posWithinBounds pos board
| fst pos < 0 = False
| snd pos < 0 = False
| fst pos >= size board = False
| snd pos >= size board = False
| otherwise = True | 313 | posWithinBounds :: Position -> Board -> Bool
posWithinBounds pos board
| fst pos < 0 = False
| snd pos < 0 = False
| fst pos >= size board = False
| snd pos >= size board = False
| otherwise = True | 264 | posWithinBounds pos board
| fst pos < 0 = False
| snd pos < 0 = False
| fst pos >= size board = False
| snd pos >= size board = False
| otherwise = True | 219 | true | true | 1 | 9 | 119 | 106 | 48 | 58 | null | null |
kmate/HaRe | old/refactorer/RefacTypeSig.hs | bsd-3-clause | doCommenting (x:xs) fileName mod tokList
= runStateT (applyTP ((once_tdTP (failTP `adhocTP` (rmInMod (x:xs) )
))) mod)
((tokList,unmodified),fileName)
where
--1. The definition to be removed is one of the module's top level declarations.
rmInMod [] mod = return mod
rmInMod (p:ps) (mod@(HsModule loc name exps imps ds):: HsModuleP)
= do ds'<-commentOutTypeSig p ds
res2 <- rmInMod ps (HsModule loc name exps imps ds')
return res2 | 682 | doCommenting (x:xs) fileName mod tokList
= runStateT (applyTP ((once_tdTP (failTP `adhocTP` (rmInMod (x:xs) )
))) mod)
((tokList,unmodified),fileName)
where
--1. The definition to be removed is one of the module's top level declarations.
rmInMod [] mod = return mod
rmInMod (p:ps) (mod@(HsModule loc name exps imps ds):: HsModuleP)
= do ds'<-commentOutTypeSig p ds
res2 <- rmInMod ps (HsModule loc name exps imps ds')
return res2 | 682 | doCommenting (x:xs) fileName mod tokList
= runStateT (applyTP ((once_tdTP (failTP `adhocTP` (rmInMod (x:xs) )
))) mod)
((tokList,unmodified),fileName)
where
--1. The definition to be removed is one of the module's top level declarations.
rmInMod [] mod = return mod
rmInMod (p:ps) (mod@(HsModule loc name exps imps ds):: HsModuleP)
= do ds'<-commentOutTypeSig p ds
res2 <- rmInMod ps (HsModule loc name exps imps ds')
return res2 | 682 | false | false | 0 | 16 | 316 | 181 | 93 | 88 | null | null |
mgold/elm-make | src/Report.hs | bsd-3-clause | errorMessage :: PackageID -> PackageID -> FilePath -> IO () -> IO ()
errorMessage rootPkg errorPkg path printMessage =
if errorPkg /= rootPkg
then
hPutStr stderr (dependencyError errorPkg)
else
do hPutStr stderr (header "ERRORS" path)
printMessage | 280 | errorMessage :: PackageID -> PackageID -> FilePath -> IO () -> IO ()
errorMessage rootPkg errorPkg path printMessage =
if errorPkg /= rootPkg
then
hPutStr stderr (dependencyError errorPkg)
else
do hPutStr stderr (header "ERRORS" path)
printMessage | 280 | errorMessage rootPkg errorPkg path printMessage =
if errorPkg /= rootPkg
then
hPutStr stderr (dependencyError errorPkg)
else
do hPutStr stderr (header "ERRORS" path)
printMessage | 211 | false | true | 0 | 10 | 68 | 88 | 42 | 46 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M05/D24/Solution.hs | mit | -- from the below SQL INSERT statement
storeUncleanArtIdStmt :: Query
storeUncleanArtIdStmt = [sql|INSERT INTO unclean (article_id) VALUES (?)|] | 145 | storeUncleanArtIdStmt :: Query
storeUncleanArtIdStmt = [sql|INSERT INTO unclean (article_id) VALUES (?)|] | 105 | storeUncleanArtIdStmt = [sql|INSERT INTO unclean (article_id) VALUES (?)|] | 74 | true | true | 0 | 4 | 18 | 16 | 11 | 5 | null | null |
praboud/regulator | lib/Regulate/Parse.hs | mit | characterClasses :: [(String, String)]
characterClasses =
[ ("\\n", "\n")
, ("\\t", "\t")
, ("\\s", " \t\n")
, ("\\w", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
, ("\\d", "0123456789")
] | 235 | characterClasses :: [(String, String)]
characterClasses =
[ ("\\n", "\n")
, ("\\t", "\t")
, ("\\s", " \t\n")
, ("\\w", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
, ("\\d", "0123456789")
] | 235 | characterClasses =
[ ("\\n", "\n")
, ("\\t", "\t")
, ("\\s", " \t\n")
, ("\\w", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
, ("\\d", "0123456789")
] | 196 | false | true | 0 | 6 | 46 | 65 | 42 | 23 | null | null |
NCrashed/JuicyPixels-blp | src/Codec/Picture/Blp/Internal/Encoder.hs | bsd-3-clause | -- | Convert indexed image to raw bytestring
convertIndexed :: Image Pixel8 -> BS.ByteString
convertIndexed img = let
(fptr, l) = VS.unsafeToForeignPtr0 . imageData $ img
in unsafePerformIO $ withForeignPtr fptr $ \ptr -> BS.unsafePackCStringLen (castPtr ptr, l) | 266 | convertIndexed :: Image Pixel8 -> BS.ByteString
convertIndexed img = let
(fptr, l) = VS.unsafeToForeignPtr0 . imageData $ img
in unsafePerformIO $ withForeignPtr fptr $ \ptr -> BS.unsafePackCStringLen (castPtr ptr, l) | 221 | convertIndexed img = let
(fptr, l) = VS.unsafeToForeignPtr0 . imageData $ img
in unsafePerformIO $ withForeignPtr fptr $ \ptr -> BS.unsafePackCStringLen (castPtr ptr, l) | 173 | true | true | 2 | 11 | 41 | 88 | 42 | 46 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/Element.hs | mit | uiElementGetMinSize :: (Parent UIElement a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to UI element
-> m IntVector2
uiElementGetMinSize p = liftIO $ do
let ptr = parentPointer p
peek =<< [C.exp| const IntVector2* { &$(UIElement* ptr)->GetMinSize() } |]
-- | Return minimum width. | 288 | uiElementGetMinSize :: (Parent UIElement a, Pointer p a, MonadIO m)
=> p -- ^ Pointer to UI element
-> m IntVector2
uiElementGetMinSize p = liftIO $ do
let ptr = parentPointer p
peek =<< [C.exp| const IntVector2* { &$(UIElement* ptr)->GetMinSize() } |]
-- | Return minimum width. | 288 | uiElementGetMinSize p = liftIO $ do
let ptr = parentPointer p
peek =<< [C.exp| const IntVector2* { &$(UIElement* ptr)->GetMinSize() } |]
-- | Return minimum width. | 168 | false | true | 0 | 11 | 55 | 82 | 41 | 41 | null | null |
Airtnp/Freshman_Simple_Haskell_Lib | Idioms/Comparison-chain.hs | mit | example2 :: Bool
example2 =
check (1 <: 5 ==: 5 <=: 10
-& (endChain :: Chain Integer)) | 102 | example2 :: Bool
example2 =
check (1 <: 5 ==: 5 <=: 10
-& (endChain :: Chain Integer)) | 102 | example2 =
check (1 <: 5 ==: 5 <=: 10
-& (endChain :: Chain Integer)) | 85 | false | true | 0 | 10 | 33 | 42 | 22 | 20 | null | null |
edsko/cabal | Cabal/src/Distribution/Simple/GHC/Internal.hs | bsd-3-clause | showOsString Solaris = "solaris2" | 33 | showOsString Solaris = "solaris2" | 33 | showOsString Solaris = "solaris2" | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
wowofbob/zmq-protobuf-toy-app | haskell/app/Main.hs | mit | processRequest (WriteReq fileName contents) =
do putStrLn "WRITE"
T.writeFile (T.unpack fileName) contents
pure $ Answer (Just False) (Just "OK") WriteRepData
-- Server. | 193 | processRequest (WriteReq fileName contents) =
do putStrLn "WRITE"
T.writeFile (T.unpack fileName) contents
pure $ Answer (Just False) (Just "OK") WriteRepData
-- Server. | 193 | processRequest (WriteReq fileName contents) =
do putStrLn "WRITE"
T.writeFile (T.unpack fileName) contents
pure $ Answer (Just False) (Just "OK") WriteRepData
-- Server. | 193 | false | false | 0 | 10 | 45 | 68 | 31 | 37 | null | null |
brendanhay/gogol | gogol-adsense/gen/Network/Google/AdSense/Types/Product.hs | mpl-2.0 | -- | Year of the date. Must be from 1 to 9999, or 0 to specify a date without
-- a year.
dYear :: Lens' Date (Maybe Int32)
dYear
= lens _dYear (\ s a -> s{_dYear = a}) .
mapping _Coerce | 193 | dYear :: Lens' Date (Maybe Int32)
dYear
= lens _dYear (\ s a -> s{_dYear = a}) .
mapping _Coerce | 104 | dYear
= lens _dYear (\ s a -> s{_dYear = a}) .
mapping _Coerce | 70 | true | true | 1 | 10 | 49 | 58 | 29 | 29 | null | null |
karamellpelle/grid | source/OpenGL/ES2/Values.hs | gpl-3.0 | gl_FRAMEBUFFER_INCOMPLETE_DIMENSIONS :: GLenum
gl_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 | 105 | gl_FRAMEBUFFER_INCOMPLETE_DIMENSIONS :: GLenum
gl_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 | 105 | gl_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 | 58 | false | true | 0 | 4 | 18 | 11 | 6 | 5 | null | null |
andyarvanitis/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | deleteDefExact :: Name -> Ctxt a -> Ctxt a
deleteDefExact n = Map.adjust (Map.delete n) (nsroot n) | 98 | deleteDefExact :: Name -> Ctxt a -> Ctxt a
deleteDefExact n = Map.adjust (Map.delete n) (nsroot n) | 98 | deleteDefExact n = Map.adjust (Map.delete n) (nsroot n) | 55 | false | true | 0 | 8 | 16 | 54 | 24 | 30 | null | null |
AccelerateHS/accelerate-cuda | Data/Array/Accelerate/CUDA/Array/Prim.hs | bsd-3-clause | useArray
:: forall e a. (PrimElt e a, DevicePtrs e ~ CUDA.DevicePtr a)
=> Context
-> MemoryTable
-> ArrayData e
-> Int
-> IO ()
useArray !ctx !mt !ad !n0 =
let src = ptrsOfArrayData ad
!n = 1 `max` n0
!bytes = n * sizeOf (undefined :: a)
run dst = transfer "useArray/malloc" bytes $ CUDA.pokeArray n src dst
in do
alloc <- malloc ctx mt ad True n
when alloc $ withDevicePtrs ctx mt ad Nothing run
-- A combination of 'mallocArray' and 'pokeArray' to allocate space on the
-- device and upload an existing array. This is specialised because if the host
-- array is shared on the heap, we do not need to do anything.
-- | 680 | useArray
:: forall e a. (PrimElt e a, DevicePtrs e ~ CUDA.DevicePtr a)
=> Context
-> MemoryTable
-> ArrayData e
-> Int
-> IO ()
useArray !ctx !mt !ad !n0 =
let src = ptrsOfArrayData ad
!n = 1 `max` n0
!bytes = n * sizeOf (undefined :: a)
run dst = transfer "useArray/malloc" bytes $ CUDA.pokeArray n src dst
in do
alloc <- malloc ctx mt ad True n
when alloc $ withDevicePtrs ctx mt ad Nothing run
-- A combination of 'mallocArray' and 'pokeArray' to allocate space on the
-- device and upload an existing array. This is specialised because if the host
-- array is shared on the heap, we do not need to do anything.
-- | 680 | useArray !ctx !mt !ad !n0 =
let src = ptrsOfArrayData ad
!n = 1 `max` n0
!bytes = n * sizeOf (undefined :: a)
run dst = transfer "useArray/malloc" bytes $ CUDA.pokeArray n src dst
in do
alloc <- malloc ctx mt ad True n
when alloc $ withDevicePtrs ctx mt ad Nothing run
-- A combination of 'mallocArray' and 'pokeArray' to allocate space on the
-- device and upload an existing array. This is specialised because if the host
-- array is shared on the heap, we do not need to do anything.
-- | 528 | false | true | 0 | 15 | 182 | 206 | 99 | 107 | null | null |
duplode/dohaskell | src/View/Resource.hs | bsd-3-clause | resTagsForm :: Maybe [TagNameText] -> AForm Handler [TagNameText]
resTagsForm = areq field "Tags (comma separated)"
where
field :: Field Handler [Text]
field = mapField nub commaSepTextField | 200 | resTagsForm :: Maybe [TagNameText] -> AForm Handler [TagNameText]
resTagsForm = areq field "Tags (comma separated)"
where
field :: Field Handler [Text]
field = mapField nub commaSepTextField | 200 | resTagsForm = areq field "Tags (comma separated)"
where
field :: Field Handler [Text]
field = mapField nub commaSepTextField | 134 | false | true | 1 | 8 | 35 | 72 | 31 | 41 | null | null |
sdiehl/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | -- | The target architectures word size
llvmWord, llvmWordPtr :: DynFlags -> LlvmType
llvmWord dflags = LMInt (wORD_SIZE dflags * 8) | 135 | llvmWord, llvmWordPtr :: DynFlags -> LlvmType
llvmWord dflags = LMInt (wORD_SIZE dflags * 8) | 95 | llvmWord dflags = LMInt (wORD_SIZE dflags * 8) | 49 | true | true | 0 | 8 | 23 | 34 | 18 | 16 | null | null |
joelburget/daily-typecheckers | src/Day18.hs | bsd-3-clause | unifyTy l r = left ("failed unification " ++ show (l, r)) | 57 | unifyTy l r = left ("failed unification " ++ show (l, r)) | 57 | unifyTy l r = left ("failed unification " ++ show (l, r)) | 57 | false | false | 0 | 9 | 11 | 30 | 15 | 15 | null | null |
olorin/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/UpdateGatewayInformation.hs | mpl-2.0 | -- | The response status code.
ugirsResponseStatus :: Lens' UpdateGatewayInformationResponse Int
ugirsResponseStatus = lens _ugirsResponseStatus (\ s a -> s{_ugirsResponseStatus = a}) | 183 | ugirsResponseStatus :: Lens' UpdateGatewayInformationResponse Int
ugirsResponseStatus = lens _ugirsResponseStatus (\ s a -> s{_ugirsResponseStatus = a}) | 152 | ugirsResponseStatus = lens _ugirsResponseStatus (\ s a -> s{_ugirsResponseStatus = a}) | 86 | true | true | 1 | 9 | 21 | 43 | 22 | 21 | null | null |
raptros/chatless-hs | src/Api/Routes.hs | bsd-3-clause | getUserRefIsLocal :: MonadChatless m => Ur.UserRef -> m Bool
getUserRefIsLocal uref = (Ur.userRefServer uref ==) <$> getServerId | 128 | getUserRefIsLocal :: MonadChatless m => Ur.UserRef -> m Bool
getUserRefIsLocal uref = (Ur.userRefServer uref ==) <$> getServerId | 128 | getUserRefIsLocal uref = (Ur.userRefServer uref ==) <$> getServerId | 67 | false | true | 0 | 8 | 16 | 43 | 21 | 22 | null | null |
fmthoma/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | nameModule (Name _ (NameG _ _ m)) = Just (modString m) | 54 | nameModule (Name _ (NameG _ _ m)) = Just (modString m) | 54 | nameModule (Name _ (NameG _ _ m)) = Just (modString m) | 54 | false | false | 0 | 9 | 10 | 36 | 17 | 19 | null | null |
snoyberg/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | nilDataConName = mkWiredInDataConName BuiltInSyntax gHC_TYPES (fsLit "[]") nilDataConKey nilDataCon | 102 | nilDataConName = mkWiredInDataConName BuiltInSyntax gHC_TYPES (fsLit "[]") nilDataConKey nilDataCon | 102 | nilDataConName = mkWiredInDataConName BuiltInSyntax gHC_TYPES (fsLit "[]") nilDataConKey nilDataCon | 102 | false | false | 0 | 7 | 11 | 23 | 11 | 12 | null | null |
nickng/gong | GoParser.hs | apache-2.0 | mainparser :: P.Parser (ProgGo)
mainparser = whiteSpace >> pparser <* P.eof | 75 | mainparser :: P.Parser (ProgGo)
mainparser = whiteSpace >> pparser <* P.eof | 75 | mainparser = whiteSpace >> pparser <* P.eof | 43 | false | true | 0 | 6 | 10 | 29 | 15 | 14 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/BinaryRandList.hs | mit | lcons x (Even ps) = Odd x ps | 28 | lcons x (Even ps) = Odd x ps | 28 | lcons x (Even ps) = Odd x ps | 28 | false | false | 0 | 6 | 7 | 25 | 10 | 15 | null | null |
kindl/Hypatia | src/Compiler.hs | mit | getAssignments _ _ p = error ("getAssignments on " ++ pretty p) | 63 | getAssignments _ _ p = error ("getAssignments on " ++ pretty p) | 63 | getAssignments _ _ p = error ("getAssignments on " ++ pretty p) | 63 | false | false | 1 | 8 | 11 | 24 | 11 | 13 | null | null |
brendanhay/gogol | gogol-people/gen/Network/Google/People/Types/Product.hs | mpl-2.0 | -- | Metadata about the locale.
locMetadata :: Lens' Locale (Maybe FieldMetadata)
locMetadata
= lens _locMetadata (\ s a -> s{_locMetadata = a}) | 146 | locMetadata :: Lens' Locale (Maybe FieldMetadata)
locMetadata
= lens _locMetadata (\ s a -> s{_locMetadata = a}) | 114 | locMetadata
= lens _locMetadata (\ s a -> s{_locMetadata = a}) | 64 | true | true | 0 | 9 | 24 | 48 | 25 | 23 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs | bsd-3-clause | gl_TEXTURE6 :: GLenum
gl_TEXTURE6 = 0x84C6 | 42 | gl_TEXTURE6 :: GLenum
gl_TEXTURE6 = 0x84C6 | 42 | gl_TEXTURE6 = 0x84C6 | 20 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
dylanmc/cryptol | sbv/Data/SBV/Compilers/C.hs | bsd-3-clause | showSizedConst i (True, 8) = integer i | 42 | showSizedConst i (True, 8) = integer i | 42 | showSizedConst i (True, 8) = integer i | 42 | false | false | 0 | 6 | 10 | 20 | 10 | 10 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/BraunSeq.hs | mit | foldrWithIndex = foldrWithIndexUsingLists | 42 | foldrWithIndex = foldrWithIndexUsingLists | 42 | foldrWithIndex = foldrWithIndexUsingLists | 42 | false | false | 0 | 4 | 3 | 6 | 3 | 3 | null | null |
kim/amazonka | amazonka-elasticache/gen/Network/AWS/ElastiCache/Types.hs | mpl-2.0 | -- | Specifies the weekly time range during which maintenance on the cache cluster
-- is performed. It is specified as a range in the format
-- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a
-- 60 minute period. Valid values for 'ddd' are:
--
-- 'sun' 'mon' 'tue' 'wed' 'thu' 'fri' 'sat' Example: 'sun:05:00-sun:09:00'
sPreferredMaintenanceWindow :: Lens' Snapshot (Maybe Text)
sPreferredMaintenanceWindow =
lens _sPreferredMaintenanceWindow
(\s a -> s { _sPreferredMaintenanceWindow = a }) | 533 | sPreferredMaintenanceWindow :: Lens' Snapshot (Maybe Text)
sPreferredMaintenanceWindow =
lens _sPreferredMaintenanceWindow
(\s a -> s { _sPreferredMaintenanceWindow = a }) | 183 | sPreferredMaintenanceWindow =
lens _sPreferredMaintenanceWindow
(\s a -> s { _sPreferredMaintenanceWindow = a }) | 124 | true | true | 0 | 8 | 88 | 52 | 30 | 22 | null | null |
Crazycolorz5/Haskell-Code | MyUsefulFunctions.hs | unlicense | asBase_helper::(Integral a)=>[a]->a->a->a
asBase_helper [] _ acc = acc | 70 | asBase_helper::(Integral a)=>[a]->a->a->a
asBase_helper [] _ acc = acc | 70 | asBase_helper [] _ acc = acc | 28 | false | true | 0 | 8 | 7 | 44 | 23 | 21 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Chapter5.hs | mit | {-
4.
a = 12 + b
b = 10000 * c
=> will not compile
-}
a' :: Int
a' = 12 + b' | 80 | a' :: Int
a' = 12 + b' | 22 | a' = 12 + b' | 12 | true | true | 0 | 5 | 28 | 16 | 9 | 7 | null | null |
ashnikel/haskellbook | ch11/ch18.11_huttons_razor_ex.hs | mit | printExpr (Add expr1 expr2) = printExpr expr1 ++ " + " ++ printExpr expr2 | 73 | printExpr (Add expr1 expr2) = printExpr expr1 ++ " + " ++ printExpr expr2 | 73 | printExpr (Add expr1 expr2) = printExpr expr1 ++ " + " ++ printExpr expr2 | 73 | false | false | 0 | 7 | 13 | 32 | 14 | 18 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Data.hs | bsd-3-clause | firmwareValCmd 0xAC = SCHED_CMD_INTERRUPTS | 42 | firmwareValCmd 0xAC = SCHED_CMD_INTERRUPTS | 42 | firmwareValCmd 0xAC = SCHED_CMD_INTERRUPTS | 42 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Parser/Combinators.hs | bsd-3-clause | -- | @range lo hi p@ parses @n@ ocurrences of @p@ where @lo <= n <= hi@
range :: (Semigroup a, Monoid a) => Int -> Int -> Parser a -> Parser a
range minimumBound maximumMatches parser =
count minimumBound parser <> loop maximumMatches
where
loop 0 = mempty
loop n = (parser <> loop (n - 1)) <|> mempty
-- | @option p@ tries to apply parser @p@ returning @mempty@ if parsing failed | 395 | range :: (Semigroup a, Monoid a) => Int -> Int -> Parser a -> Parser a
range minimumBound maximumMatches parser =
count minimumBound parser <> loop maximumMatches
where
loop 0 = mempty
loop n = (parser <> loop (n - 1)) <|> mempty
-- | @option p@ tries to apply parser @p@ returning @mempty@ if parsing failed | 323 | range minimumBound maximumMatches parser =
count minimumBound parser <> loop maximumMatches
where
loop 0 = mempty
loop n = (parser <> loop (n - 1)) <|> mempty
-- | @option p@ tries to apply parser @p@ returning @mempty@ if parsing failed | 252 | true | true | 1 | 11 | 88 | 105 | 52 | 53 | null | null |
nishiuramakoto/logiku | app/Prolog.hs | gpl-3.0 | programCheck :: Text -> Either ProgramError Program
programCheck text = either3iso $ programCheck' text | 103 | programCheck :: Text -> Either ProgramError Program
programCheck text = either3iso $ programCheck' text | 103 | programCheck text = either3iso $ programCheck' text | 51 | false | true | 0 | 7 | 13 | 34 | 15 | 19 | null | null |
altschuler/kite | src/Kite/Syntax.hs | mit | free PVoidType = [] | 22 | free PVoidType = [] | 22 | free PVoidType = [] | 22 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
mbakke/ganeti | src/Ganeti/Errors.hs | bsd-2-clause | -- | Convert from a 'Maybe' to a an 'ErrorResult'.
maybeToError :: String -> Maybe a -> ErrorResult a
maybeToError _ (Just a) = Ok a | 132 | maybeToError :: String -> Maybe a -> ErrorResult a
maybeToError _ (Just a) = Ok a | 81 | maybeToError _ (Just a) = Ok a | 30 | true | true | 0 | 10 | 25 | 44 | 20 | 24 | null | null |
haskellbr/missingh | missingh-all/src/System/Path/NameManip.hs | mit | {- | Get the last path component of a path.
>filename_part = snd . split_path
Examples:
>filename_part "foo/bar" == "bar"
>filename_part "." == "."
See 'split_path'.
-}
filename_part :: String -> String
filename_part = snd . split_path | 245 | filename_part :: String -> String
filename_part = snd . split_path | 66 | filename_part = snd . split_path | 32 | true | true | 0 | 5 | 46 | 20 | 11 | 9 | null | null |
brendanhay/gogol | gogol-slides/gen/Network/Google/Resource/Slides/Presentations/Pages/Get.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ppgUploadProtocol :: Lens' PresentationsPagesGet (Maybe Text)
ppgUploadProtocol
= lens _ppgUploadProtocol
(\ s a -> s{_ppgUploadProtocol = a}) | 212 | ppgUploadProtocol :: Lens' PresentationsPagesGet (Maybe Text)
ppgUploadProtocol
= lens _ppgUploadProtocol
(\ s a -> s{_ppgUploadProtocol = a}) | 150 | ppgUploadProtocol
= lens _ppgUploadProtocol
(\ s a -> s{_ppgUploadProtocol = a}) | 88 | true | true | 1 | 9 | 33 | 52 | 25 | 27 | null | null |
stu-smith/rendering-in-haskell | src/experiment07/Render.hs | mit | renderRay :: Ray -> Scene -> PhotonMap -> Color
renderRay !ray scene photonMap =
toColor $ renderRayAsLight ray scene photonMap | 131 | renderRay :: Ray -> Scene -> PhotonMap -> Color
renderRay !ray scene photonMap =
toColor $ renderRayAsLight ray scene photonMap | 131 | renderRay !ray scene photonMap =
toColor $ renderRayAsLight ray scene photonMap | 83 | false | true | 0 | 7 | 23 | 42 | 20 | 22 | null | null |
shayan-najd/HsParser | U/Outputable.hs | gpl-3.0 | keyword :: SDoc -> SDoc
keyword = bold | 38 | keyword :: SDoc -> SDoc
keyword = bold | 38 | keyword = bold | 14 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
mikesteele81/Win32-dhcp-server | src/System/Win32/DHCP/SEARCH_INFO.hs | bsd-3-clause | siTypeOf (ClientName _) = 2 | 27 | siTypeOf (ClientName _) = 2 | 27 | siTypeOf (ClientName _) = 2 | 27 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
li-zhirui/EoplLangs | src/ContinuationPassing/Evaluator.hs | bsd-3-clause | exprToDeno (ExprProc p) = DenoProc p | 36 | exprToDeno (ExprProc p) = DenoProc p | 36 | exprToDeno (ExprProc p) = DenoProc p | 36 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
vasily-kirichenko/haskell-book | src/Transformers/ReaderMaybe.hs | bsd-3-clause | addTwo :: String -> Maybe Int
addTwo = runReaderT $ do
x <- getx
y <- lift $ Just 2
return $ x + y | 104 | addTwo :: String -> Maybe Int
addTwo = runReaderT $ do
x <- getx
y <- lift $ Just 2
return $ x + y | 104 | addTwo = runReaderT $ do
x <- getx
y <- lift $ Just 2
return $ x + y | 74 | false | true | 0 | 10 | 30 | 54 | 25 | 29 | null | null |
snoyberg/ghc | compiler/utils/Outputable.hs | bsd-3-clause | comma = docToSDoc $ Pretty.comma | 37 | comma = docToSDoc $ Pretty.comma | 37 | comma = docToSDoc $ Pretty.comma | 37 | false | false | 0 | 6 | 9 | 12 | 6 | 6 | null | null |
goldfirere/singletons | singletons-th/src/Data/Singletons/TH/Single.hs | bsd-3-clause | singLetDecRHS :: Map Name [Name]
-> Map Name DCxt -- the context of the type signature
-- (might not be known)
-> Map Name DKind -- result kind (might not be known)
-> Name -> ALetDecRHS -> SgM DLetDec
singLetDecRHS bound_names cxts res_kis name ld_rhs = do
opts <- getOptions
bindContext (Map.findWithDefault [] name cxts) $
case ld_rhs of
AValue prom num_arrows exp ->
DValD (DVarP (singledValueName opts name)) <$>
(wrapUnSingFun num_arrows prom <$> singExp exp (Map.lookup name res_kis))
AFunction prom_fun num_arrows clauses ->
let tyvar_names = case Map.lookup name bound_names of
Nothing -> []
Just ns -> ns
res_ki = Map.lookup name res_kis
in
DFunD (singledValueName opts name) <$>
mapM (singClause prom_fun num_arrows tyvar_names res_ki) clauses | 977 | singLetDecRHS :: Map Name [Name]
-> Map Name DCxt -- the context of the type signature
-- (might not be known)
-> Map Name DKind -- result kind (might not be known)
-> Name -> ALetDecRHS -> SgM DLetDec
singLetDecRHS bound_names cxts res_kis name ld_rhs = do
opts <- getOptions
bindContext (Map.findWithDefault [] name cxts) $
case ld_rhs of
AValue prom num_arrows exp ->
DValD (DVarP (singledValueName opts name)) <$>
(wrapUnSingFun num_arrows prom <$> singExp exp (Map.lookup name res_kis))
AFunction prom_fun num_arrows clauses ->
let tyvar_names = case Map.lookup name bound_names of
Nothing -> []
Just ns -> ns
res_ki = Map.lookup name res_kis
in
DFunD (singledValueName opts name) <$>
mapM (singClause prom_fun num_arrows tyvar_names res_ki) clauses | 977 | singLetDecRHS bound_names cxts res_kis name ld_rhs = do
opts <- getOptions
bindContext (Map.findWithDefault [] name cxts) $
case ld_rhs of
AValue prom num_arrows exp ->
DValD (DVarP (singledValueName opts name)) <$>
(wrapUnSingFun num_arrows prom <$> singExp exp (Map.lookup name res_kis))
AFunction prom_fun num_arrows clauses ->
let tyvar_names = case Map.lookup name bound_names of
Nothing -> []
Just ns -> ns
res_ki = Map.lookup name res_kis
in
DFunD (singledValueName opts name) <$>
mapM (singClause prom_fun num_arrows tyvar_names res_ki) clauses | 694 | false | true | 0 | 18 | 339 | 258 | 123 | 135 | null | null |
holdenlee/fluidity | SeekWhence/agents/Generalizor.hs | mit | --can't match [?args] right now...
extendConcatMap :: Formula -> Formula -> Maybe Formula
extendConcatMap =
let
combineF f = (\li1 li2 -> do
val <- specialize (T.rootLabel (li1!!0)) (li1!!1) (li2!!0)
case (li1!!2) of
T.Node (AStr "List") li3 -> return $ _concatMap (_fun (li1!!0) (li1!!1)) (_mlist (f val li3))
_ -> Nothing)
in
makeCombineRules [(concatMapPattern, trivialPattern, combineF (\v li -> li ++ [v])),
(trivialPattern, concatMapPattern, flip $ combineF (:))] | 626 | extendConcatMap :: Formula -> Formula -> Maybe Formula
extendConcatMap =
let
combineF f = (\li1 li2 -> do
val <- specialize (T.rootLabel (li1!!0)) (li1!!1) (li2!!0)
case (li1!!2) of
T.Node (AStr "List") li3 -> return $ _concatMap (_fun (li1!!0) (li1!!1)) (_mlist (f val li3))
_ -> Nothing)
in
makeCombineRules [(concatMapPattern, trivialPattern, combineF (\v li -> li ++ [v])),
(trivialPattern, concatMapPattern, flip $ combineF (:))] | 589 | extendConcatMap =
let
combineF f = (\li1 li2 -> do
val <- specialize (T.rootLabel (li1!!0)) (li1!!1) (li2!!0)
case (li1!!2) of
T.Node (AStr "List") li3 -> return $ _concatMap (_fun (li1!!0) (li1!!1)) (_mlist (f val li3))
_ -> Nothing)
in
makeCombineRules [(concatMapPattern, trivialPattern, combineF (\v li -> li ++ [v])),
(trivialPattern, concatMapPattern, flip $ combineF (:))] | 534 | true | true | 0 | 21 | 224 | 230 | 121 | 109 | null | null |
wtanaka/haskell | testsuite/tests/NinetyNine.hs | gpl-3.0 | prop_plusRem_nonnegative num denom = denom /= 0
==> NinetyNine._plusRem num denom >= 0 | 89 | prop_plusRem_nonnegative num denom = denom /= 0
==> NinetyNine._plusRem num denom >= 0 | 89 | prop_plusRem_nonnegative num denom = denom /= 0
==> NinetyNine._plusRem num denom >= 0 | 89 | false | false | 0 | 8 | 15 | 30 | 14 | 16 | null | null |
dfordivam/lava | Lava/Operators.hs | bsd-3-clause | imax (x, y) = ifThenElse (x >>== y) (x, y) | 42 | imax (x, y) = ifThenElse (x >>== y) (x, y) | 42 | imax (x, y) = ifThenElse (x >>== y) (x, y) | 42 | false | false | 0 | 7 | 9 | 33 | 18 | 15 | null | null |
bitemyapp/ganeti | src/Ganeti/BasicTypes.hs | bsd-2-clause | -- | Generalisation of mkResultT accepting any showable failures.
mkResultT' :: (Monad m, Error e, Show s)
=> m (GenericResult s a) -> ResultT e m a
mkResultT' = mkResultT . liftM (genericResult (Bad . show) Ok) | 222 | mkResultT' :: (Monad m, Error e, Show s)
=> m (GenericResult s a) -> ResultT e m a
mkResultT' = mkResultT . liftM (genericResult (Bad . show) Ok) | 156 | mkResultT' = mkResultT . liftM (genericResult (Bad . show) Ok) | 62 | true | true | 0 | 10 | 47 | 77 | 39 | 38 | null | null |
nikivazou/hscolour | Language/Haskell/HsColour/Classify.hs | gpl-2.0 | classify :: String -> TokenType
classify s@(h:t)
| isSpace h = Space
| all (=='-') s = Comment
| "--" `isPrefixOf` s
&& any isSpace s = Comment -- not fully correct
| "{-" `isPrefixOf` s = Comment
| s `elem` keywords = Keyword
| s `elem` keyglyphs = Keyglyph
| s `elem` layoutchars = Layout
| isUpper h = Conid
| s == "[]" = Conid
| h == '(' && isTupleTail t = Conid
| h == '#' = Cpp
| isLower h = Varid
| h `elem` symbols = Varop
| h==':' = Conop
| h=='`' = Varop
| h=='"' = String
| h=='\'' = Char
| isDigit h = Number
| otherwise = Error | 813 | classify :: String -> TokenType
classify s@(h:t)
| isSpace h = Space
| all (=='-') s = Comment
| "--" `isPrefixOf` s
&& any isSpace s = Comment -- not fully correct
| "{-" `isPrefixOf` s = Comment
| s `elem` keywords = Keyword
| s `elem` keyglyphs = Keyglyph
| s `elem` layoutchars = Layout
| isUpper h = Conid
| s == "[]" = Conid
| h == '(' && isTupleTail t = Conid
| h == '#' = Cpp
| isLower h = Varid
| h `elem` symbols = Varop
| h==':' = Conop
| h=='`' = Varop
| h=='"' = String
| h=='\'' = Char
| isDigit h = Number
| otherwise = Error | 813 | classify s@(h:t)
| isSpace h = Space
| all (=='-') s = Comment
| "--" `isPrefixOf` s
&& any isSpace s = Comment -- not fully correct
| "{-" `isPrefixOf` s = Comment
| s `elem` keywords = Keyword
| s `elem` keyglyphs = Keyglyph
| s `elem` layoutchars = Layout
| isUpper h = Conid
| s == "[]" = Conid
| h == '(' && isTupleTail t = Conid
| h == '#' = Cpp
| isLower h = Varid
| h `elem` symbols = Varop
| h==':' = Conop
| h=='`' = Varop
| h=='"' = String
| h=='\'' = Char
| isDigit h = Number
| otherwise = Error | 781 | false | true | 11 | 9 | 390 | 305 | 151 | 154 | null | null |
vinit-ivar/apertium-gf | MorphAnalyser.hs | gpl-2.0 | initStream :: PGF -> Language -> String -> String -> String
initStream p l orig s
| length morph > 0 = "^" ++ s ++ buildStream p l morph orig
| otherwise = "^" ++ s ++ "/*" ++ s ++ "$ "
where morph = getMorph p l s | 235 | initStream :: PGF -> Language -> String -> String -> String
initStream p l orig s
| length morph > 0 = "^" ++ s ++ buildStream p l morph orig
| otherwise = "^" ++ s ++ "/*" ++ s ++ "$ "
where morph = getMorph p l s | 235 | initStream p l orig s
| length morph > 0 = "^" ++ s ++ buildStream p l morph orig
| otherwise = "^" ++ s ++ "/*" ++ s ++ "$ "
where morph = getMorph p l s | 175 | false | true | 1 | 9 | 71 | 104 | 50 | 54 | null | null |
thalerjonathan/phd | public/towards/SugarScape/experimental/chapter2_environment/src/test/Environment.hs | gpl-3.0 | levelLTESugarMax :: SugEnvCell -> Bool
levelLTESugarMax c = sugEnvCellSugarLevel c <= sugEnvCellSugarCapacity c | 111 | levelLTESugarMax :: SugEnvCell -> Bool
levelLTESugarMax c = sugEnvCellSugarLevel c <= sugEnvCellSugarCapacity c | 111 | levelLTESugarMax c = sugEnvCellSugarLevel c <= sugEnvCellSugarCapacity c | 72 | false | true | 0 | 7 | 12 | 33 | 14 | 19 | null | null |
kosmoskatten/synthetic-web | src/SyntheticWeb/Client/ExecM.hs | mit | getGenerator :: ExecM GenIO
getGenerator = _generator <$> ask | 61 | getGenerator :: ExecM GenIO
getGenerator = _generator <$> ask | 61 | getGenerator = _generator <$> ask | 33 | false | true | 2 | 6 | 8 | 25 | 10 | 15 | null | null |
chrisdone/fastirc | Network/FastIRC/IO.hs | bsd-3-clause | -- | Read an IRC message string.
hGetIRCLine :: Handle -> IO MsgString
hGetIRCLine h = getl B.empty
where
getl :: MsgString -> IO MsgString
getl buf = do
c <- hGetChar h
if isIRCEOLChar c
then return buf
else getl (if B.length buf >= 8192
then buf
else B.snoc buf c)
-- | Read the next valid IRC message. | 383 | hGetIRCLine :: Handle -> IO MsgString
hGetIRCLine h = getl B.empty
where
getl :: MsgString -> IO MsgString
getl buf = do
c <- hGetChar h
if isIRCEOLChar c
then return buf
else getl (if B.length buf >= 8192
then buf
else B.snoc buf c)
-- | Read the next valid IRC message. | 349 | hGetIRCLine h = getl B.empty
where
getl :: MsgString -> IO MsgString
getl buf = do
c <- hGetChar h
if isIRCEOLChar c
then return buf
else getl (if B.length buf >= 8192
then buf
else B.snoc buf c)
-- | Read the next valid IRC message. | 311 | true | true | 0 | 13 | 138 | 108 | 52 | 56 | null | null |
sakshamsharma/acehack | site.hs | mit | cleanIndexHtmls :: Item String -> Compiler (Item String)
cleanIndexHtmls = return . fmap (replaceAll pat replacement)
where
pat = "/index.html" | 153 | cleanIndexHtmls :: Item String -> Compiler (Item String)
cleanIndexHtmls = return . fmap (replaceAll pat replacement)
where
pat = "/index.html" | 153 | cleanIndexHtmls = return . fmap (replaceAll pat replacement)
where
pat = "/index.html" | 96 | false | true | 0 | 8 | 29 | 50 | 24 | 26 | null | null |
nevrenato/Hets_Fork | Comorphisms/HasCASL2Haskell.hs | gpl-2.0 | typeSynonym :: SrcLoc -> HsType -> Type -> HsDecl
typeSynonym loc hsname = hsTypeDecl loc hsname . translateType | 112 | typeSynonym :: SrcLoc -> HsType -> Type -> HsDecl
typeSynonym loc hsname = hsTypeDecl loc hsname . translateType | 112 | typeSynonym loc hsname = hsTypeDecl loc hsname . translateType | 62 | false | true | 0 | 7 | 17 | 37 | 18 | 19 | null | null |
phischu/fragnix | tests/packages/scotty/Data.HashMap.Array.hs | bsd-3-clause | -- | /O(n)/ Update the element at the given positio in this array, by
-- applying a function to it. Evaluates the element to WHNF before
-- inserting it into the array.
updateWith' :: Array e -> Int -> (e -> e) -> Array e
updateWith' ary idx f = update ary idx $! f (index ary idx) | 282 | updateWith' :: Array e -> Int -> (e -> e) -> Array e
updateWith' ary idx f = update ary idx $! f (index ary idx) | 112 | updateWith' ary idx f = update ary idx $! f (index ary idx) | 59 | true | true | 0 | 10 | 58 | 70 | 34 | 36 | null | null |
TheLastBanana/Churro | Churro/Interpreter.hs | mit | {-
Pop/peek A, B; push (B + A)
-}
add :: Bool -> ChurroState ChurroReturn
add peek =
do{ (stack, array) <- get
; case stack of
a:b:xs ->
do{ let newStack = if peek then stack else xs
; put ((b + a):newStack, array)
; return Continue
}
_ -> stackError "add"
} | 388 | add :: Bool -> ChurroState ChurroReturn
add peek =
do{ (stack, array) <- get
; case stack of
a:b:xs ->
do{ let newStack = if peek then stack else xs
; put ((b + a):newStack, array)
; return Continue
}
_ -> stackError "add"
} | 350 | add peek =
do{ (stack, array) <- get
; case stack of
a:b:xs ->
do{ let newStack = if peek then stack else xs
; put ((b + a):newStack, array)
; return Continue
}
_ -> stackError "add"
} | 310 | true | true | 0 | 17 | 183 | 123 | 63 | 60 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Syntax/Core.hs | isc | flatSliceStrides :: FlatSlice d -> [d]
flatSliceStrides (FlatSlice _ ds) = map dimStride ds
where
dimStride (FlatDimIndex _ s) = s
-- | An element of a pattern - consisting of a name and an addditional
-- parametric decoration. This decoration is what is expected to
-- contain the type of the resulting variable. | 321 | flatSliceStrides :: FlatSlice d -> [d]
flatSliceStrides (FlatSlice _ ds) = map dimStride ds
where
dimStride (FlatDimIndex _ s) = s
-- | An element of a pattern - consisting of a name and an addditional
-- parametric decoration. This decoration is what is expected to
-- contain the type of the resulting variable. | 321 | flatSliceStrides (FlatSlice _ ds) = map dimStride ds
where
dimStride (FlatDimIndex _ s) = s
-- | An element of a pattern - consisting of a name and an addditional
-- parametric decoration. This decoration is what is expected to
-- contain the type of the resulting variable. | 282 | false | true | 0 | 7 | 61 | 58 | 30 | 28 | null | null |
kavigupta/Infsabot | Infsabot/Build/Main.hs | gpl-3.0 | readWhatToDo ("-clean":rest)
= readWhatToDo rest >>= \wtd -> return (wtd {performClean=True}) | 97 | readWhatToDo ("-clean":rest)
= readWhatToDo rest >>= \wtd -> return (wtd {performClean=True}) | 97 | readWhatToDo ("-clean":rest)
= readWhatToDo rest >>= \wtd -> return (wtd {performClean=True}) | 97 | false | false | 0 | 10 | 14 | 42 | 22 | 20 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Prompt/Shell.hs | bsd-3-clause | split e l =
f : split e (rest ls)
where
(f,ls) = span (/=e) l
rest s | s == [] = []
| otherwise = tail s | 155 | split e l =
f : split e (rest ls)
where
(f,ls) = span (/=e) l
rest s | s == [] = []
| otherwise = tail s | 155 | split e l =
f : split e (rest ls)
where
(f,ls) = span (/=e) l
rest s | s == [] = []
| otherwise = tail s | 155 | false | false | 0 | 11 | 79 | 83 | 40 | 43 | null | null |
romanb/amazonka | core/src/Network/AWS/Request/Internal.hs | mpl-2.0 | defaultRequest :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a
defaultRequest x = def
& rqPath .~ Text.encodeUtf8 (toPath x)
& rqQuery .~ toQuery x
& rqHeaders .~ toHeaders x | 199 | defaultRequest :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a
defaultRequest x = def
& rqPath .~ Text.encodeUtf8 (toPath x)
& rqQuery .~ toQuery x
& rqHeaders .~ toHeaders x | 199 | defaultRequest x = def
& rqPath .~ Text.encodeUtf8 (toPath x)
& rqQuery .~ toQuery x
& rqHeaders .~ toHeaders x | 128 | false | true | 12 | 8 | 49 | 96 | 44 | 52 | null | null |
basile-henry/hs-ipfs-api | tests/Network/IPFS/API/Tests.hs | mit | tests :: IPFS TestTree
tests = testGroup "Network.IPFS.API" <$> sequence [
testCase "testCall" <$> testCall,
testCase "testCallWithContent" <$> testCallWithContent
] | 196 | tests :: IPFS TestTree
tests = testGroup "Network.IPFS.API" <$> sequence [
testCase "testCall" <$> testCall,
testCase "testCallWithContent" <$> testCallWithContent
] | 196 | tests = testGroup "Network.IPFS.API" <$> sequence [
testCase "testCall" <$> testCall,
testCase "testCallWithContent" <$> testCallWithContent
] | 173 | false | true | 2 | 8 | 50 | 50 | 22 | 28 | null | null |
alexisVallet/hachitai-haskell-shmup | Environment.hs | bsd-2-clause | defaultShipPosition :: (Float,Float)
defaultShipPosition = (realToFrac screenHeight * 3 / 4, realToFrac screenWidth / 2) | 120 | defaultShipPosition :: (Float,Float)
defaultShipPosition = (realToFrac screenHeight * 3 / 4, realToFrac screenWidth / 2) | 120 | defaultShipPosition = (realToFrac screenHeight * 3 / 4, realToFrac screenWidth / 2) | 83 | false | true | 0 | 8 | 14 | 41 | 22 | 19 | null | null |
tittoassini/flat | src/Flat/Encoder/Strict.hs | bsd-3-clause | eBits16 :: NumBits -> Word16 -> Encoding
eBits16 n f = Encoding $ eBits16F n f | 78 | eBits16 :: NumBits -> Word16 -> Encoding
eBits16 n f = Encoding $ eBits16F n f | 78 | eBits16 n f = Encoding $ eBits16F n f | 37 | false | true | 2 | 8 | 15 | 41 | 17 | 24 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 16625 = 2318 | 32 | getValueFromProduct 16625 = 2318 | 32 | getValueFromProduct 16625 = 2318 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
spechub/Hets | Comorphisms/CommonLogic2CASL.hs | gpl-2.0 | trForm :: CommonLogicSL -> Cl.TEXT -> Result CBasic.CASLFORMULA
trForm b form =
case form of
Cl.Text phrs rn -> do
phrsfrm <- mapM (phraseForm b) $ filter nonImportAndNonEmpty phrs
return $ CBasic.conjunctRange phrsfrm rn
Cl.Named_text _ t _ -> trForm b t
where nonImportAndNonEmpty :: Cl.PHRASE -> Bool
nonImportAndNonEmpty p = case p of
Cl.Importation _ -> False
Cl.Comment_text _ t _ -> not $ isTextEmpty t
_ -> True
isTextEmpty :: Cl.TEXT -> Bool
isTextEmpty txt = case txt of
Cl.Named_text _ t _ -> isTextEmpty t
Cl.Text [] _ -> True
_ -> False | 680 | trForm :: CommonLogicSL -> Cl.TEXT -> Result CBasic.CASLFORMULA
trForm b form =
case form of
Cl.Text phrs rn -> do
phrsfrm <- mapM (phraseForm b) $ filter nonImportAndNonEmpty phrs
return $ CBasic.conjunctRange phrsfrm rn
Cl.Named_text _ t _ -> trForm b t
where nonImportAndNonEmpty :: Cl.PHRASE -> Bool
nonImportAndNonEmpty p = case p of
Cl.Importation _ -> False
Cl.Comment_text _ t _ -> not $ isTextEmpty t
_ -> True
isTextEmpty :: Cl.TEXT -> Bool
isTextEmpty txt = case txt of
Cl.Named_text _ t _ -> isTextEmpty t
Cl.Text [] _ -> True
_ -> False | 680 | trForm b form =
case form of
Cl.Text phrs rn -> do
phrsfrm <- mapM (phraseForm b) $ filter nonImportAndNonEmpty phrs
return $ CBasic.conjunctRange phrsfrm rn
Cl.Named_text _ t _ -> trForm b t
where nonImportAndNonEmpty :: Cl.PHRASE -> Bool
nonImportAndNonEmpty p = case p of
Cl.Importation _ -> False
Cl.Comment_text _ t _ -> not $ isTextEmpty t
_ -> True
isTextEmpty :: Cl.TEXT -> Bool
isTextEmpty txt = case txt of
Cl.Named_text _ t _ -> isTextEmpty t
Cl.Text [] _ -> True
_ -> False | 616 | false | true | 8 | 14 | 226 | 229 | 110 | 119 | null | null |
anton-dessiatov/stack | src/Network/HTTP/StackClient.hs | bsd-3-clause | withResponseByManager :: MonadUnliftIO m => Request -> Manager -> (Response BodyReader -> m a) -> m a
withResponseByManager req man inner = withRunInIO $ \run ->
Network.HTTP.Client.withResponse (setUserAgent req) man (run . inner) | 233 | withResponseByManager :: MonadUnliftIO m => Request -> Manager -> (Response BodyReader -> m a) -> m a
withResponseByManager req man inner = withRunInIO $ \run ->
Network.HTTP.Client.withResponse (setUserAgent req) man (run . inner) | 233 | withResponseByManager req man inner = withRunInIO $ \run ->
Network.HTTP.Client.withResponse (setUserAgent req) man (run . inner) | 131 | false | true | 0 | 11 | 34 | 86 | 43 | 43 | null | null |
svenssonjoel/ObsidianGFX | Examples/FractalBench/Fractals.hs | bsd-3-clause | ymin = -1.2 :: EFloat | 21 | ymin = -1.2 :: EFloat | 21 | ymin = -1.2 :: EFloat | 21 | false | false | 0 | 5 | 4 | 11 | 6 | 5 | null | null |
tadeuzagallo/verve-lang | src/Core/Desugar.hs | mit | d_codeBlock :: CodeBlock -> ([CA.Var] -> DsM CA.Term) -> DsM CA.Term
d_codeBlock (_ :< CodeBlock stmts) k =
d_stmts stmts k | 125 | d_codeBlock :: CodeBlock -> ([CA.Var] -> DsM CA.Term) -> DsM CA.Term
d_codeBlock (_ :< CodeBlock stmts) k =
d_stmts stmts k | 125 | d_codeBlock (_ :< CodeBlock stmts) k =
d_stmts stmts k | 56 | false | true | 0 | 10 | 22 | 61 | 30 | 31 | null | null |
emwap/feldspar-language | src/Feldspar/Core/Constructs/Tuple.hs | bsd-3-clause | sel3Size Tup5Type{} = $(proj 5 2) | 34 | sel3Size Tup5Type{} = $(proj 5 2) | 34 | sel3Size Tup5Type{} = $(proj 5 2) | 34 | false | false | 0 | 7 | 6 | 22 | 10 | 12 | null | null |
hamishmack/haskell-gi | lib/Data/GI/GIR/Documentation.hs | lgpl-2.1 | -- | Parse the documentation node for the given element of the GIR file.
queryDocumentation :: Element -> Maybe Documentation
queryDocumentation element = fmap Documentation
(firstChildWithLocalName "doc" element >>= getElementContent) | 239 | queryDocumentation :: Element -> Maybe Documentation
queryDocumentation element = fmap Documentation
(firstChildWithLocalName "doc" element >>= getElementContent) | 166 | queryDocumentation element = fmap Documentation
(firstChildWithLocalName "doc" element >>= getElementContent) | 113 | true | true | 0 | 8 | 33 | 45 | 20 | 25 | null | null |
christiaanb/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | toInfoLbl (IdLabel n c LocalEntry) = IdLabel n c LocalInfoTable | 67 | toInfoLbl (IdLabel n c LocalEntry) = IdLabel n c LocalInfoTable | 67 | toInfoLbl (IdLabel n c LocalEntry) = IdLabel n c LocalInfoTable | 67 | false | false | 0 | 7 | 13 | 26 | 12 | 14 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.