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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adamse/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | -------------------------------------------------------------------------------
-- * Class declarations
-------------------------------------------------------------------------------
ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName
-> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Locate... | 573 | ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName
-> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])]
-> Bool -> LaTeX
ppClassHdr summ lctxt n tvs fds unicode =
keyword "class"
<+> (if not . null . unLoc $ lctxt then ppLContext lctxt unicode else empty)
<+> ... | 387 | ppClassHdr summ lctxt n tvs fds unicode =
keyword "class"
<+> (if not . null . unLoc $ lctxt then ppLContext lctxt unicode else empty)
<+> ppAppDocNameNames summ n (tyvarNames $ tvs)
<+> ppFds fds unicode | 212 | true | true | 6 | 15 | 95 | 159 | 77 | 82 | null | null |
jetaggart/light-haskell | haskell/ReplSession.hs | gpl-3.0 | startSession :: FilePath -> IO ReplSession
startSession path = do
cabalProject <- isCabalProject path
let (cmd, args) = if cabalProject then ("cabal", ["repl"]) else ("ghci", [])
(input, out, err, process) <- runInteractiveProcess cmd args (Just path) Nothing
let session = ReplSession input out err process
pr... | 357 | startSession :: FilePath -> IO ReplSession
startSession path = do
cabalProject <- isCabalProject path
let (cmd, args) = if cabalProject then ("cabal", ["repl"]) else ("ghci", [])
(input, out, err, process) <- runInteractiveProcess cmd args (Just path) Nothing
let session = ReplSession input out err process
pr... | 357 | startSession path = do
cabalProject <- isCabalProject path
let (cmd, args) = if cabalProject then ("cabal", ["repl"]) else ("ghci", [])
(input, out, err, process) <- runInteractiveProcess cmd args (Just path) Nothing
let session = ReplSession input out err process
prepareSession session
return session | 314 | false | true | 0 | 12 | 60 | 136 | 68 | 68 | null | null |
nomeata/led-display | src/Screen.hs | bsd-3-clause | padY y = padElem (0,y) | 22 | padY y = padElem (0,y) | 22 | padY y = padElem (0,y) | 22 | false | false | 0 | 6 | 4 | 18 | 9 | 9 | null | null |
ekmett/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | selExpr64 (CmmLit (CmmInt i _)) = do
(rlo,rhi) <- getNewRegPairNat II32
let
half0 = fromIntegral (fromIntegral i :: Word16)
half1 = fromIntegral (fromIntegral (i `shiftR` 16) :: Word16)
half2 = fromIntegral (fromIntegral (i `shiftR` 32) :: Word16)
half3 = fromIntegral (fromIntegral (... | 600 | iselExpr64 (CmmLit (CmmInt i _)) = do
(rlo,rhi) <- getNewRegPairNat II32
let
half0 = fromIntegral (fromIntegral i :: Word16)
half1 = fromIntegral (fromIntegral (i `shiftR` 16) :: Word16)
half2 = fromIntegral (fromIntegral (i `shiftR` 32) :: Word16)
half3 = fromIntegral (fromIntegral ... | 600 | iselExpr64 (CmmLit (CmmInt i _)) = do
(rlo,rhi) <- getNewRegPairNat II32
let
half0 = fromIntegral (fromIntegral i :: Word16)
half1 = fromIntegral (fromIntegral (i `shiftR` 16) :: Word16)
half2 = fromIntegral (fromIntegral (i `shiftR` 32) :: Word16)
half3 = fromIntegral (fromIntegral ... | 600 | false | false | 0 | 15 | 204 | 228 | 118 | 110 | null | null |
gridaphobe/ghc | compiler/types/Coercion.hs | bsd-3-clause | -- | Like 'mkHomoForAllCos', but doesn't check if the inner coercion
-- is reflexive.
mkHomoForAllCos_NoRefl :: [TyVar] -> Coercion -> Coercion
mkHomoForAllCos_NoRefl tvs orig_co = foldr go orig_co tvs
where
go tv co = ForAllCo tv (mkNomReflCo (tyVarKind tv)) co | 268 | mkHomoForAllCos_NoRefl :: [TyVar] -> Coercion -> Coercion
mkHomoForAllCos_NoRefl tvs orig_co = foldr go orig_co tvs
where
go tv co = ForAllCo tv (mkNomReflCo (tyVarKind tv)) co | 182 | mkHomoForAllCos_NoRefl tvs orig_co = foldr go orig_co tvs
where
go tv co = ForAllCo tv (mkNomReflCo (tyVarKind tv)) co | 124 | true | true | 0 | 9 | 45 | 67 | 34 | 33 | null | null |
nevrenato/HetsAlloy | OWL2/Morphism.hs | gpl-2.0 | legalMor :: OWLMorphism -> Result ()
legalMor m = let mm = mmaps m in unless
(Set.isSubsetOf (Map.keysSet mm) (symOf $ osource m)
&& Set.isSubsetOf (Set.fromList $ inducedElems mm) (symOf $ otarget m))
$ fail "illegal OWL2 morphism" | 244 | legalMor :: OWLMorphism -> Result ()
legalMor m = let mm = mmaps m in unless
(Set.isSubsetOf (Map.keysSet mm) (symOf $ osource m)
&& Set.isSubsetOf (Set.fromList $ inducedElems mm) (symOf $ otarget m))
$ fail "illegal OWL2 morphism" | 244 | legalMor m = let mm = mmaps m in unless
(Set.isSubsetOf (Map.keysSet mm) (symOf $ osource m)
&& Set.isSubsetOf (Set.fromList $ inducedElems mm) (symOf $ otarget m))
$ fail "illegal OWL2 morphism" | 207 | false | true | 0 | 11 | 49 | 108 | 51 | 57 | null | null |
jsnajder/fer3-catalogue | src/WorkGroups.hs | bsd-3-clause | generateComponents = do
Right c <- loadCatalogue $ dir </> catFile
let og = overlapGraph c
ocs = overlapComponents og
writeFile (dir </> componentsFile) $ show ocs | 175 | generateComponents = do
Right c <- loadCatalogue $ dir </> catFile
let og = overlapGraph c
ocs = overlapComponents og
writeFile (dir </> componentsFile) $ show ocs | 175 | generateComponents = do
Right c <- loadCatalogue $ dir </> catFile
let og = overlapGraph c
ocs = overlapComponents og
writeFile (dir </> componentsFile) $ show ocs | 175 | false | false | 1 | 11 | 38 | 68 | 29 | 39 | null | null |
lpeterse/koka | src/Common/NamePrim.hs | apache-2.0 | {--------------------------------------------------------------------------
Lists
--------------------------------------------------------------------------}
nameNull = preludeName "Nil" | 195 | nameNull = preludeName "Nil" | 35 | nameNull = preludeName "Nil" | 35 | true | false | 0 | 5 | 15 | 10 | 5 | 5 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F30.hs | bsd-3-clause | -- glVertexArrayVertexBindingDivisorEXT ----------------------------------------
glVertexArrayVertexBindingDivisorEXT
:: MonadIO m
=> GLuint -- ^ @vaobj@.
-> GLuint -- ^ @bindingindex@.
-> GLuint -- ^ @divisor@.
-> m ()
glVertexArrayVertexBindingDivisorEXT v1 v2 v3 = liftIO $ dyn109 ptr_glVertexArrayVertexBi... | 344 | glVertexArrayVertexBindingDivisorEXT
:: MonadIO m
=> GLuint -- ^ @vaobj@.
-> GLuint -- ^ @bindingindex@.
-> GLuint -- ^ @divisor@.
-> m ()
glVertexArrayVertexBindingDivisorEXT v1 v2 v3 = liftIO $ dyn109 ptr_glVertexArrayVertexBindingDivisorEXT v1 v2 v3 | 262 | glVertexArrayVertexBindingDivisorEXT v1 v2 v3 = liftIO $ dyn109 ptr_glVertexArrayVertexBindingDivisorEXT v1 v2 v3 | 113 | true | true | 0 | 11 | 47 | 63 | 31 | 32 | null | null |
adityagupta1089/Project-Euler-Haskell | src/problems/Problem63.hs | bsd-3-clause | main :: IO ()
-- 10^k > x^k >= 10^(k-1), k>=1 => 1 > (x/10)^k >= 0.1
-- hence 1 > x/10 >= 0.1
main =
print
. length
. filter (\(x, k) -> (length . show $ x ^ k) == k)
$ [ (x, k)
| x <- [1 .. 9]
, k <- takeWhile (\k -> 10 ^ (k - 1) <= x ^ k && x ^ k < 10 ^ k) [1 ..]
... | 325 | main :: IO ()
main =
print
. length
. filter (\(x, k) -> (length . show $ x ^ k) == k)
$ [ (x, k)
| x <- [1 .. 9]
, k <- takeWhile (\k -> 10 ^ (k - 1) <= x ^ k && x ^ k < 10 ^ k) [1 ..]
] | 245 | main =
print
. length
. filter (\(x, k) -> (length . show $ x ^ k) == k)
$ [ (x, k)
| x <- [1 .. 9]
, k <- takeWhile (\k -> 10 ^ (k - 1) <= x ^ k && x ^ k < 10 ^ k) [1 ..]
] | 231 | true | true | 0 | 20 | 136 | 149 | 82 | 67 | null | null |
lechimp-p/json-transformer | Control/Monad/Trans/JSON.hs | mit | -- | Write the json output of the monad to the property
(<$.) :: MonadJSON m
=> Text -> m a -> m a
p <$. m = do
(res, val) <- extract m
p <: val
return res | 173 | (<$.) :: MonadJSON m
=> Text -> m a -> m a
p <$. m = do
(res, val) <- extract m
p <: val
return res | 117 | p <$. m = do
(res, val) <- extract m
p <: val
return res | 68 | true | true | 0 | 10 | 56 | 70 | 33 | 37 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/Text3D.hs | mit | text3DGetTextAttr :: (Parent Text3D a, Pointer ptr a, MonadIO m)
=> ptr -- ^ Pointer to text3D or ascentor
-> m String
text3DGetTextAttr p = liftIO $ do
let ptr = parentPointer p
peekCString =<< [C.exp| const char* {$(Text3D* ptr)->GetTextAttr().CString()} |]
-- | Get color attribute. Uses just the top-left c... | 390 | text3DGetTextAttr :: (Parent Text3D a, Pointer ptr a, MonadIO m)
=> ptr -- ^ Pointer to text3D or ascentor
-> m String
text3DGetTextAttr p = liftIO $ do
let ptr = parentPointer p
peekCString =<< [C.exp| const char* {$(Text3D* ptr)->GetTextAttr().CString()} |]
-- | Get color attribute. Uses just the top-left c... | 390 | text3DGetTextAttr p = liftIO $ do
let ptr = parentPointer p
peekCString =<< [C.exp| const char* {$(Text3D* ptr)->GetTextAttr().CString()} |]
-- | Get color attribute. Uses just the top-left color.
-- const Color& GetColorAttr() const { return text_.color_[0]; } | 267 | false | true | 0 | 11 | 69 | 79 | 41 | 38 | null | null |
diku-dk/futhark | src/Futhark/CLI/Literate.hs | isc | initialOptions :: Options
initialOptions =
Options
{ scriptBackend = "c",
scriptFuthark = Nothing,
scriptExtraOptions = [],
scriptCompilerOptions = [],
scriptSkipCompilation = False,
scriptOutput = Nothing,
scriptVerbose = 0,
scriptStopOnError = False
} | 305 | initialOptions :: Options
initialOptions =
Options
{ scriptBackend = "c",
scriptFuthark = Nothing,
scriptExtraOptions = [],
scriptCompilerOptions = [],
scriptSkipCompilation = False,
scriptOutput = Nothing,
scriptVerbose = 0,
scriptStopOnError = False
} | 305 | initialOptions =
Options
{ scriptBackend = "c",
scriptFuthark = Nothing,
scriptExtraOptions = [],
scriptCompilerOptions = [],
scriptSkipCompilation = False,
scriptOutput = Nothing,
scriptVerbose = 0,
scriptStopOnError = False
} | 279 | false | true | 0 | 8 | 83 | 69 | 42 | 27 | null | null |
rad1al/hutton_exercises | notes_ch12.hs | gpl-2.0 | conv :: Char -> Maybe Int
conv c | isDigit c = Just (digitToInt c)
| otherwise = Nothing | 95 | conv :: Char -> Maybe Int
conv c | isDigit c = Just (digitToInt c)
| otherwise = Nothing | 95 | conv c | isDigit c = Just (digitToInt c)
| otherwise = Nothing | 69 | false | true | 0 | 8 | 25 | 55 | 23 | 32 | null | null |
shmookey/pure | src/Util/Request.hs | bsd-3-clause | withPath :: [String] -> Request -> Request
withPath xs req = req { path = xs } | 78 | withPath :: [String] -> Request -> Request
withPath xs req = req { path = xs } | 78 | withPath xs req = req { path = xs } | 35 | false | true | 0 | 8 | 16 | 44 | 21 | 23 | null | null |
gridaphobe/ghc | compiler/stgSyn/CoreToStg.hs | bsd-3-clause | returnLne :: a -> LneM a
returnLne e = LneM $ \_ _ -> e | 55 | returnLne :: a -> LneM a
returnLne e = LneM $ \_ _ -> e | 55 | returnLne e = LneM $ \_ _ -> e | 30 | false | true | 0 | 6 | 14 | 32 | 16 | 16 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/playpen/blockchain/blockchain-framework-DELETE/app/Main.hs | unlicense | doIt :: PortNumber -> HostName -> PortNumber -> IO ()
doIt httpPort host port = do
configureLogging
commandDispatcher <- initializeCommandDispatcher
startNodeComm commandDispatcher host port
commandReceiver commandDispatcher "0.0.0.0" httpPort | 251 | doIt :: PortNumber -> HostName -> PortNumber -> IO ()
doIt httpPort host port = do
configureLogging
commandDispatcher <- initializeCommandDispatcher
startNodeComm commandDispatcher host port
commandReceiver commandDispatcher "0.0.0.0" httpPort | 251 | doIt httpPort host port = do
configureLogging
commandDispatcher <- initializeCommandDispatcher
startNodeComm commandDispatcher host port
commandReceiver commandDispatcher "0.0.0.0" httpPort | 197 | false | true | 0 | 9 | 35 | 65 | 29 | 36 | null | null |
wavewave/hxournal | lib/Application/HXournal/Coroutine/Default.hs | bsd-2-clause | menuEventProcess MenuZoomOut = pageZoomChangeRel ZoomOut | 56 | menuEventProcess MenuZoomOut = pageZoomChangeRel ZoomOut | 56 | menuEventProcess MenuZoomOut = pageZoomChangeRel ZoomOut | 56 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Chapter4.hs | mit | {-
Intermission: Exercises
The following lines of code may have mistakes — some of them won’t
compile! You know what you need to do.
1. not True && true
=> will not compile
=> not True && True
2. not (x = 6)
=> will not compile
=> let x = 5
=> not $ x == 6
3. (1 * 2) > 5
=> will compile
4. [Merry] > [Happy]
=> w... | 893 | awesome :: [String]
awesome = ["Papuchon", "curry", ":)"] | 57 | awesome = ["Papuchon", "curry", ":)"] | 37 | true | true | 0 | 5 | 185 | 24 | 15 | 9 | null | null |
carlostome/HCrawler | src/HTMLScrapper.hs | gpl-2.0 | parsePage :: String -> HTMLDoc
parsePage = head . runLA hread | 62 | parsePage :: String -> HTMLDoc
parsePage = head . runLA hread | 62 | parsePage = head . runLA hread | 31 | false | true | 1 | 7 | 11 | 29 | 12 | 17 | null | null |
oldmanmike/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey | 76 | eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey | 76 | eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey | 76 | false | false | 0 | 7 | 18 | 19 | 9 | 10 | null | null |
begriffs/iCalendar | src/Text/ICalendar/Component/VCalendar.hs | bsd-3-clause | toCalScale :: String -> CalScale
toCalScale "GREGORIAN" = Gregorian | 67 | toCalScale :: String -> CalScale
toCalScale "GREGORIAN" = Gregorian | 67 | toCalScale "GREGORIAN" = Gregorian | 34 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/HTools/Program/Hcheck.hs | gpl-2.0 | extractGroupData False grp = Group.name grp | 43 | extractGroupData False grp = Group.name grp | 43 | extractGroupData False grp = Group.name grp | 43 | false | false | 1 | 6 | 5 | 20 | 7 | 13 | null | null |
synsem/texhs | src/Text/TeX/Parser.hs | gpl-3.0 | -- | Run 'TeX' parser on named input 'Token' stream.
parseTeX :: String -> [Token] -> TeX
parseTeX name input = case runTeXParser texParser name input of
Left l -> error (show l)
Right r -> (normalize . resolveSyntacticTeX) r | 230 | parseTeX :: String -> [Token] -> TeX
parseTeX name input = case runTeXParser texParser name input of
Left l -> error (show l)
Right r -> (normalize . resolveSyntacticTeX) r | 177 | parseTeX name input = case runTeXParser texParser name input of
Left l -> error (show l)
Right r -> (normalize . resolveSyntacticTeX) r | 140 | true | true | 5 | 9 | 44 | 77 | 37 | 40 | null | null |
trygvis/hledger | hledger/Hledger/Cli/Register.hs | gpl-3.0 | displayExprMatches (Just d) p = (fromparse $ parsewith datedisplayexpr d) p | 75 | displayExprMatches (Just d) p = (fromparse $ parsewith datedisplayexpr d) p | 75 | displayExprMatches (Just d) p = (fromparse $ parsewith datedisplayexpr d) p | 75 | false | false | 0 | 8 | 10 | 32 | 15 | 17 | null | null |
gnn/Hets | Driver/Options.hs | gpl-2.0 | parseCounter :: String -> Flag
parseCounter = CounterSparQ . parseInt | 69 | parseCounter :: String -> Flag
parseCounter = CounterSparQ . parseInt | 69 | parseCounter = CounterSparQ . parseInt | 38 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
UoYCS-plasma/LazySmallCheck2012 | suite/performance/Benchmarks/Countdown.hs | bsd-3-clause | solutions' :: [Int] -> Int -> [Expr]
solutions' ns n = [e | ns' <- subbags ns, (e,m) <- results ns', m == n] | 124 | solutions' :: [Int] -> Int -> [Expr]
solutions' ns n = [e | ns' <- subbags ns, (e,m) <- results ns', m == n] | 124 | solutions' ns n = [e | ns' <- subbags ns, (e,m) <- results ns', m == n] | 77 | false | true | 0 | 8 | 39 | 69 | 36 | 33 | null | null |
swift-nav/plover | relics/Reduce.hs | mit | compileStep' ctxt e@(a :<= b) = do
bt <- local $ typeCheck b
case bt of
-- Avoid repeatedly calling inverse
-- TODO generalize?
VecType (len : _) _ | simpleVal b -> do
i <- freshName
let lhs = (a :! (Ref i))
return $ Vec i len (lhs :<= b :! (Ref i))
_ -> do
-- TODO call reduc... | 348 | compileStep' ctxt e@(a :<= b) = do
bt <- local $ typeCheck b
case bt of
-- Avoid repeatedly calling inverse
-- TODO generalize?
VecType (len : _) _ | simpleVal b -> do
i <- freshName
let lhs = (a :! (Ref i))
return $ Vec i len (lhs :<= b :! (Ref i))
_ -> do
-- TODO call reduc... | 348 | compileStep' ctxt e@(a :<= b) = do
bt <- local $ typeCheck b
case bt of
-- Avoid repeatedly calling inverse
-- TODO generalize?
VecType (len : _) _ | simpleVal b -> do
i <- freshName
let lhs = (a :! (Ref i))
return $ Vec i len (lhs :<= b :! (Ref i))
_ -> do
-- TODO call reduc... | 348 | false | false | 1 | 20 | 114 | 153 | 70 | 83 | null | null |
hoffmeyer/timeregger | src/Controllers/Controller.hs | bsd-3-clause | fromRequest :: ActionM User
fromRequest = do
uid <- param "user_id"
token <- header "Authorization"
case LT.words <$> token of
Just ["Token", t] -> return $ User uid (LT.unpack t) 0
_ -> raise $ LT.pack "Access denied" | 248 | fromRequest :: ActionM User
fromRequest = do
uid <- param "user_id"
token <- header "Authorization"
case LT.words <$> token of
Just ["Token", t] -> return $ User uid (LT.unpack t) 0
_ -> raise $ LT.pack "Access denied" | 248 | fromRequest = do
uid <- param "user_id"
token <- header "Authorization"
case LT.words <$> token of
Just ["Token", t] -> return $ User uid (LT.unpack t) 0
_ -> raise $ LT.pack "Access denied" | 220 | false | true | 0 | 14 | 67 | 96 | 45 | 51 | null | null |
nushio3/ghc | compiler/types/Type.hs | bsd-3-clause | eqRelRole ReprEq = Representational | 35 | eqRelRole ReprEq = Representational | 35 | eqRelRole ReprEq = Representational | 35 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
agocorona/haste-perch | Haste/Perch.hs | gpl-3.0 | menu cont = nelem "menu" `child` cont | 38 | menu cont = nelem "menu" `child` cont | 38 | menu cont = nelem "menu" `child` cont | 38 | false | false | 0 | 6 | 7 | 18 | 9 | 9 | null | null |
erikd/persistent | persistent-qq/test/Spec.hs | mit | sqlite_database :: SqliteConnectionInfo
sqlite_database = mkSqliteConnectionInfo sqlite_database_file | 101 | sqlite_database :: SqliteConnectionInfo
sqlite_database = mkSqliteConnectionInfo sqlite_database_file | 101 | sqlite_database = mkSqliteConnectionInfo sqlite_database_file | 61 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
urbanslug/ghc | compiler/main/Packages.hs | bsd-3-clause | throwErr :: DynFlags -> MaybeErr MsgDoc a -> IO a
throwErr dflags m
= case m of
Failed e -> throwGhcExceptionIO (CmdLineError (showSDoc dflags e))
Succeeded r -> return r | 219 | throwErr :: DynFlags -> MaybeErr MsgDoc a -> IO a
throwErr dflags m
= case m of
Failed e -> throwGhcExceptionIO (CmdLineError (showSDoc dflags e))
Succeeded r -> return r | 219 | throwErr dflags m
= case m of
Failed e -> throwGhcExceptionIO (CmdLineError (showSDoc dflags e))
Succeeded r -> return r | 169 | false | true | 0 | 12 | 78 | 74 | 34 | 40 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/ParserCombinators/HuttonMeijer.hs | bsd-3-clause | identifier :: [String] -> Parser String
identifier ks = token (do {x <- ident;
if not (elem x ks) then return x
else return mzero}) | 207 | identifier :: [String] -> Parser String
identifier ks = token (do {x <- ident;
if not (elem x ks) then return x
else return mzero}) | 207 | identifier ks = token (do {x <- ident;
if not (elem x ks) then return x
else return mzero}) | 160 | false | true | 0 | 12 | 100 | 73 | 35 | 38 | null | null |
nominolo/haddock2 | src/Haddock/GhcUtils.hs | bsd-2-clause | mkModuleNoPackage :: String -> Module
mkModuleNoPackage str = mkModule (stringToPackageId "") (mkModuleName str) | 112 | mkModuleNoPackage :: String -> Module
mkModuleNoPackage str = mkModule (stringToPackageId "") (mkModuleName str) | 112 | mkModuleNoPackage str = mkModule (stringToPackageId "") (mkModuleName str) | 74 | false | true | 0 | 7 | 12 | 35 | 17 | 18 | null | null |
ku-fpg/talks | blank-canvas/Utils.hs | bsd-2-clause | title :: Prose -> Slide () -> Slide ()
title txt slide = font "Gill Sans" $ do
lg <- ku_blue
background lg
$ shadows False
$ borderWidth 0
$ frame
$ scaleFont 2
$ align center
$ color "white"
$ p
$ txt
fullSlide slide | 255 | title :: Prose -> Slide () -> Slide ()
title txt slide = font "Gill Sans" $ do
lg <- ku_blue
background lg
$ shadows False
$ borderWidth 0
$ frame
$ scaleFont 2
$ align center
$ color "white"
$ p
$ txt
fullSlide slide | 255 | title txt slide = font "Gill Sans" $ do
lg <- ku_blue
background lg
$ shadows False
$ borderWidth 0
$ frame
$ scaleFont 2
$ align center
$ color "white"
$ p
$ txt
fullSlide slide | 216 | false | true | 0 | 16 | 83 | 107 | 47 | 60 | null | null |
lukexi/ghc-7.8-arm64 | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getAmode' _ (CmmMachOp (MO_Add _) [x,y])
= x86_complex_amode x y 0 0 | 70 | getAmode' _ (CmmMachOp (MO_Add _) [x,y])
= x86_complex_amode x y 0 0 | 70 | getAmode' _ (CmmMachOp (MO_Add _) [x,y])
= x86_complex_amode x y 0 0 | 70 | false | false | 1 | 8 | 13 | 46 | 20 | 26 | null | null |
trbauer/ebnf | Language/EBNF/Types.hs | mit | eSubExprs _ = [] | 16 | eSubExprs _ = [] | 16 | eSubExprs _ = [] | 16 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
thomie/vector | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | zipWith f = zipWithM (\a b -> return (f a b)) | 45 | zipWith f = zipWithM (\a b -> return (f a b)) | 45 | zipWith f = zipWithM (\a b -> return (f a b)) | 45 | false | false | 0 | 10 | 10 | 33 | 16 | 17 | null | null |
dawedawe/kripkeweb | src/LinkRing.hs | bsd-3-clause | -- |Fill up the shorter of the two lists with words containing spaces.
fillup :: [T.Text] -> [T.Text] -> ([T.Text], [T.Text])
fillup xs ys =
let
lxs = length xs
lys = length ys
mx = max lxs lys
mi = min lxs lys
fil = replicate (mx - mi) ""
in
if length xs == mi
then (... | 363 | fillup :: [T.Text] -> [T.Text] -> ([T.Text], [T.Text])
fillup xs ys =
let
lxs = length xs
lys = length ys
mx = max lxs lys
mi = min lxs lys
fil = replicate (mx - mi) ""
in
if length xs == mi
then (xs ++ fil, ys)
else (xs, ys ++ fil) | 292 | fillup xs ys =
let
lxs = length xs
lys = length ys
mx = max lxs lys
mi = min lxs lys
fil = replicate (mx - mi) ""
in
if length xs == mi
then (xs ++ fil, ys)
else (xs, ys ++ fil) | 237 | true | true | 0 | 11 | 126 | 145 | 78 | 67 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M08/D03/Exercise.hs | mit | {--
This exercise is called 'cheat sheet.'
So in the function imported above, summer, it gives you all permutations of
the solutions when you are summing to a number using x slots. Great!
Super, in fact, if you eventually build a system that combines all these sums
and slots to solve a kakuro puzzle for you.
http://... | 1,022 | cheatSheet :: Int -> Int -> [[Int]]
cheatSheet total nslots = undefined | 71 | cheatSheet total nslots = undefined | 35 | true | true | 0 | 8 | 185 | 31 | 17 | 14 | null | null |
thoughtpolice/hs-nacl | tests/BLAKE2.hs | bsd-3-clause | vector2b = blake2b plainText == expectation
where
plainText =
"When buying and selling are controlled by legislation, the first things \
\to be bought and sold are legislators."
expectation = (fst . decode)
"e75d0b0e5dfe97c7724bc052376d6bfba7ae77c0b06a988a0ab35934c86ee3bc\
\eebb6dafc2d... | 374 | vector2b = blake2b plainText == expectation
where
plainText =
"When buying and selling are controlled by legislation, the first things \
\to be bought and sold are legislators."
expectation = (fst . decode)
"e75d0b0e5dfe97c7724bc052376d6bfba7ae77c0b06a988a0ab35934c86ee3bc\
\eebb6dafc2d... | 374 | vector2b = blake2b plainText == expectation
where
plainText =
"When buying and selling are controlled by legislation, the first things \
\to be bought and sold are legislators."
expectation = (fst . decode)
"e75d0b0e5dfe97c7724bc052376d6bfba7ae77c0b06a988a0ab35934c86ee3bc\
\eebb6dafc2d... | 374 | false | false | 0 | 6 | 68 | 36 | 18 | 18 | null | null |
tensorflow/haskell | tensorflow-ops/src/TensorFlow/Gradient.hs | apache-2.0 | -- Element wise maximum gradient
-- See https://github.com/tensorflow/tensorflow/blob/e9de087fa7f59c39bbe12ac2c83c5547c83f746c/tensorflow/core/ops/math_grad.cc#L473
opGrad "Maximum" _ [toT -> x, toT -> y] [dz] =
gradForBinaryCwise (x, gx) (y, gy)
where
xmask = CoreOps.greaterEqual x y
gx = CoreOps.select ... | 428 | opGrad "Maximum" _ [toT -> x, toT -> y] [dz] =
gradForBinaryCwise (x, gx) (y, gy)
where
xmask = CoreOps.greaterEqual x y
gx = CoreOps.select xmask dz (CoreOps.zerosLike dz)
gy = CoreOps.select (CoreOps.logicalNot xmask) dz (CoreOps.zerosLike dz) | 263 | opGrad "Maximum" _ [toT -> x, toT -> y] [dz] =
gradForBinaryCwise (x, gx) (y, gy)
where
xmask = CoreOps.greaterEqual x y
gx = CoreOps.select xmask dz (CoreOps.zerosLike dz)
gy = CoreOps.select (CoreOps.logicalNot xmask) dz (CoreOps.zerosLike dz) | 263 | true | false | 5 | 8 | 62 | 127 | 62 | 65 | null | null |
k0001/gtk2hs | tools/c2hs/gen/GenBind.hs | gpl-3.0 | usualArithConv lhs rhs@(FloatResult _) = (toFloat lhs, rhs) | 75 | usualArithConv lhs rhs@(FloatResult _) = (toFloat lhs, rhs) | 75 | usualArithConv lhs rhs@(FloatResult _) = (toFloat lhs, rhs) | 75 | false | false | 0 | 8 | 23 | 29 | 15 | 14 | null | null |
andregrigon/game | src/Waterfall/Graphics.hs | mit | keyPressed :: GLFW.KeyCallback
keyPressed win GLFW.Key'Escape _ GLFW.KeyState'Pressed _ = shutdown win | 102 | keyPressed :: GLFW.KeyCallback
keyPressed win GLFW.Key'Escape _ GLFW.KeyState'Pressed _ = shutdown win | 102 | keyPressed win GLFW.Key'Escape _ GLFW.KeyState'Pressed _ = shutdown win | 71 | false | true | 0 | 6 | 11 | 31 | 15 | 16 | null | null |
nukisman/elm-format-short | parser/src/Parse/Module.hs | bsd-3-clause | mergeDetailedListing :: Module.DetailedListing -> Module.DetailedListing -> Module.DetailedListing
mergeDetailedListing left right =
Module.DetailedListing
(mergeCommentedMap (\() () -> ()) (Module.values left) (Module.values right))
(mergeCommentedMap (\() () -> ()) (Module.operators left) (Module.... | 476 | mergeDetailedListing :: Module.DetailedListing -> Module.DetailedListing -> Module.DetailedListing
mergeDetailedListing left right =
Module.DetailedListing
(mergeCommentedMap (\() () -> ()) (Module.values left) (Module.values right))
(mergeCommentedMap (\() () -> ()) (Module.operators left) (Module.... | 476 | mergeDetailedListing left right =
Module.DetailedListing
(mergeCommentedMap (\() () -> ()) (Module.values left) (Module.values right))
(mergeCommentedMap (\() () -> ()) (Module.operators left) (Module.operators right))
(mergeCommentedMap (mergePreCommented $ mergeListing $ mergeCommentedMap ... | 377 | false | true | 0 | 13 | 71 | 179 | 92 | 87 | null | null |
input-output-hk/pos-haskell-prototype | wallet/test/unit/InputSelection/FromGeneric.hs | mit | largestFirst :: (GenHash m, Dom utxo ~ DSL h a, PickFromUtxo utxo)
=> a -- ^ Change address
-> Word64 -- ^ Maximum number of inputs
-> CoinSelPolicy utxo m (DSL.Transaction h a, TxStats, utxo)
largestFirst changeAddr maxInps =
runCoinSelT changeAddr
. Generic.larges... | 350 | largestFirst :: (GenHash m, Dom utxo ~ DSL h a, PickFromUtxo utxo)
=> a -- ^ Change address
-> Word64 -- ^ Maximum number of inputs
-> CoinSelPolicy utxo m (DSL.Transaction h a, TxStats, utxo)
largestFirst changeAddr maxInps =
runCoinSelT changeAddr
. Generic.larges... | 350 | largestFirst changeAddr maxInps =
runCoinSelT changeAddr
. Generic.largestFirst maxInps
. NE.toList | 113 | false | true | 2 | 11 | 103 | 101 | 49 | 52 | null | null |
diku-dk/futhark | src/Language/Futhark/Parser/Monad.hs | isc | mustBeEmpty :: SrcLoc -> ValueType -> ParserMonad ()
mustBeEmpty _ (Array _ _ _ (ShapeDecl dims))
| 0 `elem` dims = pure () | 125 | mustBeEmpty :: SrcLoc -> ValueType -> ParserMonad ()
mustBeEmpty _ (Array _ _ _ (ShapeDecl dims))
| 0 `elem` dims = pure () | 125 | mustBeEmpty _ (Array _ _ _ (ShapeDecl dims))
| 0 `elem` dims = pure () | 72 | false | true | 0 | 9 | 24 | 64 | 31 | 33 | null | null |
DanielG/hipo | TinyDNSGenerator.hs | gpl-3.0 | genRecord :: IP -> Record -> TinyGen ()
genRecord ip Record {..} = do
labels <- ask
let fqdn = dc labels
r <- case (rType, rOpts) of
("A", []) ->
return ("=", [fqdn, show ip])
("NS",Right ns:[]) ->
let fqdn = dc $ labels ++ splitDomain rDomain in
return (".... | 701 | genRecord :: IP -> Record -> TinyGen ()
genRecord ip Record {..} = do
labels <- ask
let fqdn = dc labels
r <- case (rType, rOpts) of
("A", []) ->
return ("=", [fqdn, show ip])
("NS",Right ns:[]) ->
let fqdn = dc $ labels ++ splitDomain rDomain in
return (".... | 701 | genRecord ip Record {..} = do
labels <- ask
let fqdn = dc labels
r <- case (rType, rOpts) of
("A", []) ->
return ("=", [fqdn, show ip])
("NS",Right ns:[]) ->
let fqdn = dc $ labels ++ splitDomain rDomain in
return (".", [fqdn, show ip, ns])
("MX",L... | 661 | false | true | 0 | 17 | 236 | 319 | 163 | 156 | null | null |
jetaggart/te | src/Te/Runner.hs | gpl-3.0 | getTestRunner :: [Text] -> Sh (Maybe TestRunner)
getTestRunner args = do
runners <- mapM (getRunner args) frameworks
let validRunners = catMaybes runners
return $ case (catMaybes runners) of
[] -> Nothing
(r:_) -> Just r | 252 | getTestRunner :: [Text] -> Sh (Maybe TestRunner)
getTestRunner args = do
runners <- mapM (getRunner args) frameworks
let validRunners = catMaybes runners
return $ case (catMaybes runners) of
[] -> Nothing
(r:_) -> Just r | 252 | getTestRunner args = do
runners <- mapM (getRunner args) frameworks
let validRunners = catMaybes runners
return $ case (catMaybes runners) of
[] -> Nothing
(r:_) -> Just r | 203 | false | true | 0 | 12 | 66 | 101 | 48 | 53 | null | null |
dillonhuff/IntLang | src/Lexer.hs | bsd-3-clause | dfalse = Boolean False dummyPos | 31 | dfalse = Boolean False dummyPos | 31 | dfalse = Boolean False dummyPos | 31 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
cutsea110/aop | src/Curry.hs | bsd-3-clause | lines :: String -> [String]
lines s = case break (=='\n') s of
(ps, []) -> ps : []
(ps, _:qs) -> ps : lines qs
-- Tree | 126 | lines :: String -> [String]
lines s = case break (=='\n') s of
(ps, []) -> ps : []
(ps, _:qs) -> ps : lines qs
-- Tree | 126 | lines s = case break (=='\n') s of
(ps, []) -> ps : []
(ps, _:qs) -> ps : lines qs
-- Tree | 98 | false | true | 0 | 9 | 35 | 83 | 43 | 40 | null | null |
tinco/nanc | Nanc/IR/Types.hs | mit | simpleTypeToType Char _ = IntegerType 8 | 39 | simpleTypeToType Char _ = IntegerType 8 | 39 | simpleTypeToType Char _ = IntegerType 8 | 39 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
pranjaltale16/codeworld | codeworld-api/src/CodeWorld/Picture.hs | apache-2.0 | dotProduct :: Vector -> Vector -> Double
dotProduct (x1, y1) (x2, y2) = x1 * x2 + y1 * y2 | 89 | dotProduct :: Vector -> Vector -> Double
dotProduct (x1, y1) (x2, y2) = x1 * x2 + y1 * y2 | 89 | dotProduct (x1, y1) (x2, y2) = x1 * x2 + y1 * y2 | 48 | false | true | 0 | 7 | 19 | 48 | 26 | 22 | null | null |
minad/writer-cps-transformers | src/Control/Monad/Trans/RWS/CPS/Internal.hs | bsd-3-clause | -- | Uniform lifting of a @callCC@ operation to the new monad.
-- This version rolls back to the original state on entering the
-- continuation.
liftCallCC :: CallCC m (a,s,w) (b,s,w) -> CallCC (RWST r w s m) a b
liftCallCC callCC f = RWST $ \r s w ->
callCC $ \c -> unRWST (f (\a -> RWST $ \_ _ _ -> c (a, s, w))) r s... | 322 | liftCallCC :: CallCC m (a,s,w) (b,s,w) -> CallCC (RWST r w s m) a b
liftCallCC callCC f = RWST $ \r s w ->
callCC $ \c -> unRWST (f (\a -> RWST $ \_ _ _ -> c (a, s, w))) r s w | 177 | liftCallCC callCC f = RWST $ \r s w ->
callCC $ \c -> unRWST (f (\a -> RWST $ \_ _ _ -> c (a, s, w))) r s w | 109 | true | true | 2 | 14 | 73 | 142 | 76 | 66 | null | null |
jstolarek/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | latexMunge '~' s = "{\\char '176}" ++ s | 40 | latexMunge '~' s = "{\\char '176}" ++ s | 40 | latexMunge '~' s = "{\\char '176}" ++ s | 40 | false | false | 0 | 5 | 8 | 15 | 7 | 8 | null | null |
umairsd/course-haskell-cis194 | hw07/JoinList.hs | mit | jlToList (Single _ a) = [a] | 31 | jlToList (Single _ a) = [a] | 31 | jlToList (Single _ a) = [a] | 31 | false | false | 0 | 7 | 9 | 20 | 10 | 10 | null | null |
xpika/templateify | Main.hs | gpl-3.0 | main = domain "testinput.html" | 30 | main = domain "testinput.html" | 30 | main = domain "testinput.html" | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
nevrenato/Hets_Fork | CspCASLProver/Consts.hs | gpl-2.0 | -- | Function that takes a channel name produces the
-- CspCASLProver's constructor for that channel.
convertChannelString :: CHANNEL_NAME -> String
convertChannelString = show | 178 | convertChannelString :: CHANNEL_NAME -> String
convertChannelString = show | 74 | convertChannelString = show | 27 | true | true | 0 | 5 | 25 | 17 | 10 | 7 | null | null |
SASinestro/lil-render | src/LilRender/Color/Named.hs | isc | lightSteelBlue = RGBColor { _red=176, _green=196, _blue=222 } | 61 | lightSteelBlue = RGBColor { _red=176, _green=196, _blue=222 } | 61 | lightSteelBlue = RGBColor { _red=176, _green=196, _blue=222 } | 61 | false | false | 0 | 6 | 7 | 26 | 16 | 10 | null | null |
mcapodici/haskelllearn | stockexchangeprototype/src/SEP/Data.hs | mit | adjustQuantity :: Int -> Order -> Order
adjustQuantity q (Order d p _ t i) = Order d p q t i | 92 | adjustQuantity :: Int -> Order -> Order
adjustQuantity q (Order d p _ t i) = Order d p q t i | 92 | adjustQuantity q (Order d p _ t i) = Order d p q t i | 52 | false | true | 0 | 10 | 21 | 54 | 25 | 29 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs | mpl-2.0 | -- | A developer-specified string that contains supplemental information
-- about an order.
spDeveloperPayload :: Lens' SubscriptionPurchase (Maybe Text)
spDeveloperPayload
= lens _spDeveloperPayload
(\ s a -> s{_spDeveloperPayload = a}) | 245 | spDeveloperPayload :: Lens' SubscriptionPurchase (Maybe Text)
spDeveloperPayload
= lens _spDeveloperPayload
(\ s a -> s{_spDeveloperPayload = a}) | 153 | spDeveloperPayload
= lens _spDeveloperPayload
(\ s a -> s{_spDeveloperPayload = a}) | 91 | true | true | 0 | 9 | 37 | 49 | 26 | 23 | null | null |
mokus0/schematics | xmega-a4u-target/BOM.hs | unlicense | resetPullUpResistor = basicPart mouser "CRCW040210K0FKED"
[ (1, 0.08)
, (10, 0.044)
, (100, 0.021)
, (1000, 0.015)
] | 142 | resetPullUpResistor = basicPart mouser "CRCW040210K0FKED"
[ (1, 0.08)
, (10, 0.044)
, (100, 0.021)
, (1000, 0.015)
] | 142 | resetPullUpResistor = basicPart mouser "CRCW040210K0FKED"
[ (1, 0.08)
, (10, 0.044)
, (100, 0.021)
, (1000, 0.015)
] | 142 | false | false | 0 | 6 | 43 | 50 | 30 | 20 | null | null |
anton-k/sharc-timbre | src/Sharc/Instruments/Oboe.hs | bsd-3-clause | note5 :: Note
note5 = Note
(Pitch 311.127 51 "d#4")
6
(Range
(NoteRange
(NoteRangeAmplitude 9644.93 31 0.82)
(NoteRangeHarmonicFreq 1 311.12))
(NoteRange
(NoteRangeAmplitude 1244.5 4 6238.0)
(NoteRangeHarmonicFreq 32 9956.06)))
[Harmonic 1 ... | 1,255 | note5 :: Note
note5 = Note
(Pitch 311.127 51 "d#4")
6
(Range
(NoteRange
(NoteRangeAmplitude 9644.93 31 0.82)
(NoteRangeHarmonicFreq 1 311.12))
(NoteRange
(NoteRangeAmplitude 1244.5 4 6238.0)
(NoteRangeHarmonicFreq 32 9956.06)))
[Harmonic 1 ... | 1,255 | note5 = Note
(Pitch 311.127 51 "d#4")
6
(Range
(NoteRange
(NoteRangeAmplitude 9644.93 31 0.82)
(NoteRangeHarmonicFreq 1 311.12))
(NoteRange
(NoteRangeAmplitude 1244.5 4 6238.0)
(NoteRangeHarmonicFreq 32 9956.06)))
[Harmonic 1 (-6.0e-2) 3928... | 1,241 | false | true | 0 | 10 | 359 | 484 | 245 | 239 | null | null |
jozefg/hlf | src/Language/HLF/TC/Arity.hs | mit | arityBound :: (Functor m, MonadReader ArityMap m, MonadGen Int m)
=> (Term Fresh -> m Int)
-> Term Fresh -> Scope () Term Fresh -> m Int
arityBound f ty scope = do
tyArity <- typeArity ty
i <- gen
let term = instantiate1 (Var $ Unbound i) scope
local (at (Unbound i) .~ Just tyArity) ... | 343 | arityBound :: (Functor m, MonadReader ArityMap m, MonadGen Int m)
=> (Term Fresh -> m Int)
-> Term Fresh -> Scope () Term Fresh -> m Int
arityBound f ty scope = do
tyArity <- typeArity ty
i <- gen
let term = instantiate1 (Var $ Unbound i) scope
local (at (Unbound i) .~ Just tyArity) ... | 343 | arityBound f ty scope = do
tyArity <- typeArity ty
i <- gen
let term = instantiate1 (Var $ Unbound i) scope
local (at (Unbound i) .~ Just tyArity) $ f term
-- See note 2 | 178 | false | true | 0 | 13 | 99 | 157 | 73 | 84 | null | null |
ezyang/ghc | compiler/types/Coercion.hs | bsd-3-clause | seqProv (HoleProv _) = () | 32 | seqProv (HoleProv _) = () | 32 | seqProv (HoleProv _) = () | 32 | false | false | 0 | 7 | 11 | 17 | 8 | 9 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs | mpl-2.0 | -- | The package name of the parent app.
iapPackageName :: Lens' InAppProduct (Maybe Text)
iapPackageName
= lens _iapPackageName
(\ s a -> s{_iapPackageName = a}) | 170 | iapPackageName :: Lens' InAppProduct (Maybe Text)
iapPackageName
= lens _iapPackageName
(\ s a -> s{_iapPackageName = a}) | 129 | iapPackageName
= lens _iapPackageName
(\ s a -> s{_iapPackageName = a}) | 79 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | irresolutely = id | 17 | irresolutely = id | 17 | irresolutely = id | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
petejohanson/arachnid | src/Arachnid/Decisions.hs | mit | decision N4 = end HTTP.gone410 | 30 | decision N4 = end HTTP.gone410 | 30 | decision N4 = end HTTP.gone410 | 30 | false | false | 1 | 6 | 4 | 18 | 6 | 12 | null | null |
leroux/HaskellKoans | test/Currification.hs | mit | tests :: Spec
tests = describe "Currification" $ do
testCurrificationPlus
testCurrificationMap
testCurrificationFilter | 130 | tests :: Spec
tests = describe "Currification" $ do
testCurrificationPlus
testCurrificationMap
testCurrificationFilter | 130 | tests = describe "Currification" $ do
testCurrificationPlus
testCurrificationMap
testCurrificationFilter | 116 | false | true | 0 | 7 | 23 | 27 | 12 | 15 | null | null |
databrary/databrary | src/View/Form.hs | agpl-3.0 | inputEnum :: forall a . DBEnum a => Bool -> Maybe a -> Field
inputEnum req val =
inputSelect (bshow <$> val) $ (if req then id else (("", "") :)) $ map (\(x, v) -> (bshow (x :: a), v)) pgEnumValues
where bshow = BSC.pack . show . fromEnum | 242 | inputEnum :: forall a . DBEnum a => Bool -> Maybe a -> Field
inputEnum req val =
inputSelect (bshow <$> val) $ (if req then id else (("", "") :)) $ map (\(x, v) -> (bshow (x :: a), v)) pgEnumValues
where bshow = BSC.pack . show . fromEnum | 242 | inputEnum req val =
inputSelect (bshow <$> val) $ (if req then id else (("", "") :)) $ map (\(x, v) -> (bshow (x :: a), v)) pgEnumValues
where bshow = BSC.pack . show . fromEnum | 181 | false | true | 1 | 11 | 53 | 139 | 72 | 67 | null | null |
spacekitteh/smcghc | compiler/main/DynFlags.hs | bsd-3-clause | -- | Parses the dynamically set flags for GHC. This is the most general form of
-- the dynamic flag parser that the other methods simply wrap. It allows
-- saying which flags are valid flags and indicating if we are parsing
-- arguments from the command line or from a file pragma.
parseDynamicFlagsFull :: MonadIO m
... | 3,216 | parseDynamicFlagsFull :: MonadIO m
=> [Flag (CmdLineP DynFlags)] -- ^ valid flags to match against
-> Bool -- ^ are the arguments from the command line?
-> DynFlags -- ^ current dynamic flags
-> [Loc... | 2,934 | parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
-- XXX Legacy support code
-- We used to accept things like
-- optdep-f -optdepdepend
-- optdep-f -optdep depend
-- optdep -f -optdepdepend
-- optdep -f -optdep depend
-- but the spaces trip up proper argument handling. So get r... | 2,494 | true | true | 0 | 22 | 1,047 | 726 | 358 | 368 | null | null |
tonyday567/hdcharts | src/Data/XYZ.hs | mit | normYOnZ :: [XYZ] -> [XYZ]
normYOnZ bs = (\(XYZ x y z) -> XYZ x (y/z*avZ bs) z) <$> bs | 86 | normYOnZ :: [XYZ] -> [XYZ]
normYOnZ bs = (\(XYZ x y z) -> XYZ x (y/z*avZ bs) z) <$> bs | 86 | normYOnZ bs = (\(XYZ x y z) -> XYZ x (y/z*avZ bs) z) <$> bs | 59 | false | true | 0 | 11 | 19 | 67 | 35 | 32 | null | null |
dalaing/sdl2 | src/SDL/Raw/Event.hs | bsd-3-clause | setEventFilter :: MonadIO m => EventFilter -> Ptr () -> m ()
setEventFilter v1 v2 = liftIO $ setEventFilterFFI v1 v2 | 116 | setEventFilter :: MonadIO m => EventFilter -> Ptr () -> m ()
setEventFilter v1 v2 = liftIO $ setEventFilterFFI v1 v2 | 116 | setEventFilter v1 v2 = liftIO $ setEventFilterFFI v1 v2 | 55 | false | true | 0 | 9 | 20 | 50 | 23 | 27 | null | null |
ndmitchell/ghcid | src/Language/Haskell/Ghcid/Util.hs | bsd-3-clause | ock :: Lock
lock = unsafePerformIO newLock
| 43 | lock :: Lock
lock = unsafePerformIO newLock | 43 | lock = unsafePerformIO newLock | 30 | false | true | 0 | 6 | 7 | 20 | 8 | 12 | null | null |
uvNikita/SyntacticAnalyzer | src/Parser.hs | mit | step ExprS OpenBracket = Right (OpenBracketS, bracket) | 54 | step ExprS OpenBracket = Right (OpenBracketS, bracket) | 54 | step ExprS OpenBracket = Right (OpenBracketS, bracket) | 54 | false | false | 1 | 5 | 6 | 24 | 10 | 14 | null | null |
jrclogic/SMCDEL | src/SMCDEL/Examples/DoorMat.hs | gpl-2.0 | dmResult :: MultipointedKnowScene
dmResult = dmStart `update` tryTake | 70 | dmResult :: MultipointedKnowScene
dmResult = dmStart `update` tryTake | 70 | dmResult = dmStart `update` tryTake | 36 | false | true | 0 | 6 | 8 | 24 | 11 | 13 | null | null |
ndmitchell/hlint | misc/HLint_NoDataFiles.hs | bsd-3-clause | hints :: String
hints = $(do
let openURL x = getResponseBody =<< simpleHTTP (getRequest x)
let grab x = qRunIO $ fmap lines $ openURL $ "http://community.haskell.org/~ndm/darcs/hlint/data/" ++ x
outer <- grab "HLint.hs"
hints <- grab "Default.hs"
lift $ unlines $
filter (not . isSuffixOf "HL... | 397 | hints :: String
hints = $(do
let openURL x = getResponseBody =<< simpleHTTP (getRequest x)
let grab x = qRunIO $ fmap lines $ openURL $ "http://community.haskell.org/~ndm/darcs/hlint/data/" ++ x
outer <- grab "HLint.hs"
hints <- grab "Default.hs"
lift $ unlines $
filter (not . isSuffixOf "HL... | 397 | hints = $(do
let openURL x = getResponseBody =<< simpleHTTP (getRequest x)
let grab x = qRunIO $ fmap lines $ openURL $ "http://community.haskell.org/~ndm/darcs/hlint/data/" ++ x
outer <- grab "HLint.hs"
hints <- grab "Default.hs"
lift $ unlines $
filter (not . isSuffixOf "HLint.Default") ou... | 381 | false | true | 0 | 16 | 94 | 136 | 62 | 74 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 52390 = 5000 | 32 | getValueFromProduct 52390 = 5000 | 32 | getValueFromProduct 52390 = 5000 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
koengit/cyphy | src/Zelus.hs | mit | example2 = integ (1 `in1t` 0 `reset` (3 `when` every 10)) where ?h = 0.01 | 73 | example2 = integ (1 `in1t` 0 `reset` (3 `when` every 10)) where ?h = 0.01 | 73 | example2 = integ (1 `in1t` 0 `reset` (3 `when` every 10)) where ?h = 0.01 | 73 | false | false | 0 | 10 | 14 | 43 | 25 | 18 | null | null |
TorosFanny/kaleidoscope | src/chapter7/Codegen.hs | mit | fcmp :: FP.FloatingPointPredicate -> Operand -> Operand -> Codegen Operand
fcmp cond a b = instr $ FCmp cond a b [] | 115 | fcmp :: FP.FloatingPointPredicate -> Operand -> Operand -> Codegen Operand
fcmp cond a b = instr $ FCmp cond a b [] | 115 | fcmp cond a b = instr $ FCmp cond a b [] | 40 | false | true | 0 | 9 | 21 | 54 | 25 | 29 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Accounts/Creatives/Update.hs | mpl-2.0 | -- | V1 error format.
acucXgafv :: Lens' AccountsCreativesUpdate (Maybe Xgafv)
acucXgafv
= lens _acucXgafv (\ s a -> s{_acucXgafv = a}) | 137 | acucXgafv :: Lens' AccountsCreativesUpdate (Maybe Xgafv)
acucXgafv
= lens _acucXgafv (\ s a -> s{_acucXgafv = a}) | 115 | acucXgafv
= lens _acucXgafv (\ s a -> s{_acucXgafv = a}) | 58 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 4959 = 4958 | 11 | 4959 = 4958 | 11 | 4959 = 4958 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
jeremyong/Yaiba | Yaiba/Map.hs | bsd-3-clause | filterLt :: Ord k => (k -> Ordering) -> Map k a -> Map k a
filterLt _ Tip = Tip | 81 | filterLt :: Ord k => (k -> Ordering) -> Map k a -> Map k a
filterLt _ Tip = Tip | 81 | filterLt _ Tip = Tip | 22 | false | true | 0 | 9 | 22 | 53 | 24 | 29 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Protocol.hs | bsd-3-clause | parseQueryResult (DigitalPortRead _ _) (DigitalPortReply d) = Just d | 68 | parseQueryResult (DigitalPortRead _ _) (DigitalPortReply d) = Just d | 68 | parseQueryResult (DigitalPortRead _ _) (DigitalPortReply d) = Just d | 68 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
mcmaniac/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | dToStr :: Double -> String
dToStr d
= let bs = doubleToBytes d
hex d' = case showHex d' "" of
[] -> error "dToStr: too few hex digits for float"
[x] -> ['0',x]
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digit... | 418 | dToStr :: Double -> String
dToStr d
= let bs = doubleToBytes d
hex d' = case showHex d' "" of
[] -> error "dToStr: too few hex digits for float"
[x] -> ['0',x]
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digit... | 418 | dToStr d
= let bs = doubleToBytes d
hex d' = case showHex d' "" of
[] -> error "dToStr: too few hex digits for float"
[x] -> ['0',x]
[x,y] -> [x,y]
_ -> error "dToStr: too many hex digits for float"
str ... | 391 | false | true | 0 | 13 | 185 | 136 | 69 | 67 | null | null |
haskell/filepath | System/FilePath/Posix.hs | bsd-3-clause | -----------------------------------------------------------------------------
-- dropWhileEnd (>2) [1,2,3,4,1,2,3,4] == [1,2,3,4,1,2])
-- Note that Data.List.dropWhileEnd is only available in base >= 4.5.
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
dropWhileEnd p = reverse . dropWhile p . reverse | 295 | dropWhileEnd :: (a -> Bool) -> [a] -> [a]
dropWhileEnd p = reverse . dropWhile p . reverse | 90 | dropWhileEnd p = reverse . dropWhile p . reverse | 48 | true | true | 0 | 7 | 35 | 49 | 27 | 22 | null | null |
fmapfmapfmap/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/ListMultipartUploads.hs | mpl-2.0 | -- | Specifies the maximum number of uploads returned in the response body.
-- If this value is not specified, the List Uploads operation returns up to
-- 1,000 uploads.
lmuLimit :: Lens' ListMultipartUploads (Maybe Text)
lmuLimit = lens _lmuLimit (\ s a -> s{_lmuLimit = a}) | 275 | lmuLimit :: Lens' ListMultipartUploads (Maybe Text)
lmuLimit = lens _lmuLimit (\ s a -> s{_lmuLimit = a}) | 105 | lmuLimit = lens _lmuLimit (\ s a -> s{_lmuLimit = a}) | 53 | true | true | 1 | 9 | 46 | 52 | 27 | 25 | null | null |
tjakway/ghcjvm | compiler/hsSyn/HsBinds.hs | bsd-3-clause | hsSigDoc (PatSynSig {}) = text "pattern synonym signature" | 66 | hsSigDoc (PatSynSig {}) = text "pattern synonym signature" | 66 | hsSigDoc (PatSynSig {}) = text "pattern synonym signature" | 66 | false | false | 0 | 6 | 15 | 20 | 9 | 11 | null | null |
dmatveev/oak | Graphics/UI/Oak.hs | bsd-3-clause | handlerFor :: (Monad m, Eq i) =>
i -> Event -> OakT i u w m (Maybe (Handler i u w m))
handlerFor i e = ask >>= (return . find match)
where match (i', e', _) = i' == i && e' == e | 193 | handlerFor :: (Monad m, Eq i) =>
i -> Event -> OakT i u w m (Maybe (Handler i u w m))
handlerFor i e = ask >>= (return . find match)
where match (i', e', _) = i' == i && e' == e | 193 | handlerFor i e = ask >>= (return . find match)
where match (i', e', _) = i' == i && e' == e | 93 | false | true | 0 | 12 | 60 | 113 | 58 | 55 | null | null |
rbonifacio/funsat | etc/parse-dimacs/Language/CNF/Parse/ParseDIMACS.hs | bsd-3-clause | -- | Parse a file containing DIMACS CNF data.
parseFile :: FilePath -> IO (Either ParseError CNF)
parseFile = parseFromFile cnf | 127 | parseFile :: FilePath -> IO (Either ParseError CNF)
parseFile = parseFromFile cnf | 81 | parseFile = parseFromFile cnf | 29 | true | true | 0 | 8 | 20 | 30 | 15 | 15 | null | null |
barrucadu/cabal-info | cabal-info/Fields.hs | mit | getPackageDescriptionField "data-files" = unlines' . dataFiles | 62 | getPackageDescriptionField "data-files" = unlines' . dataFiles | 62 | getPackageDescriptionField "data-files" = unlines' . dataFiles | 62 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
bradlarsen/hs-cudd | test/DimacsCnfParser.hs | bsd-3-clause | newInput :: ByteString -> Input
newInput = map BS.words . BS.lines | 66 | newInput :: ByteString -> Input
newInput = map BS.words . BS.lines | 66 | newInput = map BS.words . BS.lines | 34 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
nikki-and-the-robots/nikki | src/Sorts/Tiles/Baking.hs | lgpl-3.0 | groupStaticH Nothing [] = [] | 28 | groupStaticH Nothing [] = [] | 28 | groupStaticH Nothing [] = [] | 28 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
clnznr/advancedprogramming | lectures/lecture11/functional.hs | apache-2.0 | -- Haskell version
main = putStrLn $ intercalate "\n" $ map show $ map (+ 10) [1, 2, 3, 4, 5] | 93 | main = putStrLn $ intercalate "\n" $ map show $ map (+ 10) [1, 2, 3, 4, 5] | 74 | main = putStrLn $ intercalate "\n" $ map show $ map (+ 10) [1, 2, 3, 4, 5] | 74 | true | false | 3 | 7 | 20 | 53 | 27 | 26 | null | null |
rumblesan/improviz | src/Language/Ast/Transformers/Globalise.hs | bsd-3-clause | globaliseElement (ElIf ifAst) = ElIf <$> globaliseIf ifAst | 58 | globaliseElement (ElIf ifAst) = ElIf <$> globaliseIf ifAst | 58 | globaliseElement (ElIf ifAst) = ElIf <$> globaliseIf ifAst | 58 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
black0range/Smutt | src/Smutt/HTTP/Server/Request/Reader.hs | mit | http10Reader :: BufferedSocket -> ServerSettings -> RequestLine ByteString -> Header -> ExceptT ReaderError IO Request
http10Reader bSocket settings (RequestLine method urlRaw url version) headers = do
when ((method == PUT || method == POST ) && not (Header.member "content-length" headers)) $
throwError $ BadR... | 852 | http10Reader :: BufferedSocket -> ServerSettings -> RequestLine ByteString -> Header -> ExceptT ReaderError IO Request
http10Reader bSocket settings (RequestLine method urlRaw url version) headers = do
when ((method == PUT || method == POST ) && not (Header.member "content-length" headers)) $
throwError $ BadR... | 852 | http10Reader bSocket settings (RequestLine method urlRaw url version) headers = do
when ((method == PUT || method == POST ) && not (Header.member "content-length" headers)) $
throwError $ BadRequest "HTTP/1.0 Requests Must have a Content-Length"
let
contentLength = getContentLength headers
bodyTyp... | 733 | false | true | 0 | 15 | 157 | 218 | 106 | 112 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs | mpl-2.0 | -- | Describe what\'s new in your APK.
apklRecentChanges :: Lens' APKListing (Maybe Text)
apklRecentChanges
= lens _apklRecentChanges
(\ s a -> s{_apklRecentChanges = a}) | 178 | apklRecentChanges :: Lens' APKListing (Maybe Text)
apklRecentChanges
= lens _apklRecentChanges
(\ s a -> s{_apklRecentChanges = a}) | 139 | apklRecentChanges
= lens _apklRecentChanges
(\ s a -> s{_apklRecentChanges = a}) | 88 | true | true | 0 | 9 | 32 | 48 | 25 | 23 | null | null |
forste/haReFork | tools/hs2isabelle/Prop2Isabelle.hs | bsd-3-clause | transType (Typ t) = transT transId transType t | 46 | transType (Typ t) = transT transId transType t | 46 | transType (Typ t) = transT transId transType t | 46 | false | false | 0 | 6 | 7 | 23 | 10 | 13 | null | null |
sdiehl/ghc | compiler/basicTypes/Predicate.hs | bsd-3-clause | getEqPredTys_maybe :: PredType -> Maybe (Role, Type, Type)
getEqPredTys_maybe ty
= case splitTyConApp_maybe ty of
Just (tc, [_, _, ty1, ty2])
| tc `hasKey` eqPrimTyConKey -> Just (Nominal, ty1, ty2)
| tc `hasKey` eqReprPrimTyConKey -> Just (Representational, ty1, ty2)
_ -> Nothing | 315 | getEqPredTys_maybe :: PredType -> Maybe (Role, Type, Type)
getEqPredTys_maybe ty
= case splitTyConApp_maybe ty of
Just (tc, [_, _, ty1, ty2])
| tc `hasKey` eqPrimTyConKey -> Just (Nominal, ty1, ty2)
| tc `hasKey` eqReprPrimTyConKey -> Just (Representational, ty1, ty2)
_ -> Nothing | 315 | getEqPredTys_maybe ty
= case splitTyConApp_maybe ty of
Just (tc, [_, _, ty1, ty2])
| tc `hasKey` eqPrimTyConKey -> Just (Nominal, ty1, ty2)
| tc `hasKey` eqReprPrimTyConKey -> Just (Representational, ty1, ty2)
_ -> Nothing | 256 | false | true | 0 | 11 | 75 | 121 | 66 | 55 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.