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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
keera-studios/hsQt | Qtc/Enums/Gui/QMainWindow.hs | bsd-2-clause | ifDockOptions :: Int -> DockOptions
ifDockOptions x = QFlags (CDockOptions x) | 77 | ifDockOptions :: Int -> DockOptions
ifDockOptions x = QFlags (CDockOptions x) | 77 | ifDockOptions x = QFlags (CDockOptions x) | 41 | false | true | 0 | 7 | 10 | 32 | 14 | 18 | null | null |
fredmorcos/attic | snippets/haskell/Concurrent.hs | isc | main :: IO ()
main = do id1 <- forkIO (mapM_ (putStrLn . ("foo " ++) . show) ([1..100] :: [Int]))
id2 <- forkIO (mapM_ (putStrLn . ("bar " ++) . show) ([1..100] :: [Int]))
yield
putStrLn $ show id1 ++ " " ++ show id2 | 246 | main :: IO ()
main = do id1 <- forkIO (mapM_ (putStrLn . ("foo " ++) . show) ([1..100] :: [Int]))
id2 <- forkIO (mapM_ (putStrLn . ("bar " ++) . show) ([1..100] :: [Int]))
yield
putStrLn $ show id1 ++ " " ++ show id2 | 246 | main = do id1 <- forkIO (mapM_ (putStrLn . ("foo " ++) . show) ([1..100] :: [Int]))
id2 <- forkIO (mapM_ (putStrLn . ("bar " ++) . show) ([1..100] :: [Int]))
yield
putStrLn $ show id1 ++ " " ++ show id2 | 232 | false | true | 0 | 15 | 75 | 140 | 71 | 69 | null | null |
erikd/persistent | persistent/Database/Persist/Types/Base.hs | mit | fromPersistValueText (PersistMap _) = Left "Cannot convert PersistMap to Text" | 78 | fromPersistValueText (PersistMap _) = Left "Cannot convert PersistMap to Text" | 78 | fromPersistValueText (PersistMap _) = Left "Cannot convert PersistMap to Text" | 78 | false | false | 0 | 7 | 9 | 18 | 8 | 10 | null | null |
OpenXT/idl | rpcgen/Backend/C.hs | gpl-2.0 | outputClientHFile object = object ++ "_client.h" | 54 | outputClientHFile object = object ++ "_client.h" | 54 | outputClientHFile object = object ++ "_client.h" | 54 | false | false | 0 | 5 | 11 | 13 | 6 | 7 | null | null |
kylcarte/derivation | src/Data/Derivation/Gradual.hs | bsd-3-clause | lam :: (Just a & gam |- b) -> (gam |- a :-> b)
lam e = only e ==> Lam | 69 | lam :: (Just a & gam |- b) -> (gam |- a :-> b)
lam e = only e ==> Lam | 69 | lam e = only e ==> Lam | 22 | false | true | 0 | 8 | 20 | 50 | 25 | 25 | null | null |
jfischoff/opengl-eval | src/OpenGL/Evaluator/FunctionStruct.hs | bsd-3-clause | mk_struct_type name_and_types = result where
result = [cty| struct { $sdecls:members }|]
members = map (uncurry mk_field_group) name_and_types | 150 | mk_struct_type name_and_types = result where
result = [cty| struct { $sdecls:members }|]
members = map (uncurry mk_field_group) name_and_types | 150 | mk_struct_type name_and_types = result where
result = [cty| struct { $sdecls:members }|]
members = map (uncurry mk_field_group) name_and_types | 150 | false | false | 0 | 9 | 25 | 36 | 20 | 16 | null | null |
FiveEye/playground | lang/frp.hs | gpl-2.0 | joinE :: Event (Event a) -> Event a
joinE ee = Event $ foldr merge [] $ map delayOccs (occs ee) | 95 | joinE :: Event (Event a) -> Event a
joinE ee = Event $ foldr merge [] $ map delayOccs (occs ee) | 95 | joinE ee = Event $ foldr merge [] $ map delayOccs (occs ee) | 59 | false | true | 2 | 9 | 20 | 62 | 27 | 35 | null | null |
Happstack/ixset | src/Data/IxSet/Ix.hs | bsd-3-clause | -- | Helper function to 'insert' a list of elements into a set.
insertList :: (Ord a, Ord k)
=> [(k,a)] -> Map k (Set a) -> Map k (Set a)
insertList xs index = foldl' (\m (k,v)-> insert k v m) index xs | 212 | insertList :: (Ord a, Ord k)
=> [(k,a)] -> Map k (Set a) -> Map k (Set a)
insertList xs index = foldl' (\m (k,v)-> insert k v m) index xs | 148 | insertList xs index = foldl' (\m (k,v)-> insert k v m) index xs | 63 | true | true | 0 | 10 | 54 | 101 | 53 | 48 | null | null |
pawel-n/syntax-printer | Data/Syntax/Printer/Text.hs | mit | -- | Runs the printer and discards the result.
runPrinter_ :: Printer a b -> b -> Either String Builder
runPrinter_ = (fmap fst .) . runPrinter | 143 | runPrinter_ :: Printer a b -> b -> Either String Builder
runPrinter_ = (fmap fst .) . runPrinter | 96 | runPrinter_ = (fmap fst .) . runPrinter | 39 | true | true | 1 | 8 | 26 | 48 | 22 | 26 | null | null |
nymacro/hs-kmip | src/Ttlv/Parser/Binary.hs | bsd-3-clause | parseTtlvStructure' :: Get [Ttlv]
parseTtlvStructure' = do
empty <- isEmpty
if empty -- handle empty structure
then return []
else do
ttlv <- parseTtlv
empty <- isEmpty
if empty
then return [ttlv]
else do
rest <- parseTtlvStructure'
return $ ttlv : rest | 293 | parseTtlvStructure' :: Get [Ttlv]
parseTtlvStructure' = do
empty <- isEmpty
if empty -- handle empty structure
then return []
else do
ttlv <- parseTtlv
empty <- isEmpty
if empty
then return [ttlv]
else do
rest <- parseTtlvStructure'
return $ ttlv : rest | 293 | parseTtlvStructure' = do
empty <- isEmpty
if empty -- handle empty structure
then return []
else do
ttlv <- parseTtlv
empty <- isEmpty
if empty
then return [ttlv]
else do
rest <- parseTtlvStructure'
return $ ttlv : rest | 259 | false | true | 0 | 14 | 81 | 90 | 44 | 46 | null | null |
Saulzar/reflex | src/Reflex/Query/Class.hs | bsd-3-clause | mapQuery :: QueryMorphism q q' -> q -> q'
mapQuery = _queryMorphism_mapQuery | 76 | mapQuery :: QueryMorphism q q' -> q -> q'
mapQuery = _queryMorphism_mapQuery | 76 | mapQuery = _queryMorphism_mapQuery | 34 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
olorin/amazonka | amazonka-autoscaling/gen/Network/AWS/AutoScaling/PutNotificationConfiguration.hs | mpl-2.0 | -- | The name of the Auto Scaling group.
pncAutoScalingGroupName :: Lens' PutNotificationConfiguration Text
pncAutoScalingGroupName = lens _pncAutoScalingGroupName (\ s a -> s{_pncAutoScalingGroupName = a}) | 206 | pncAutoScalingGroupName :: Lens' PutNotificationConfiguration Text
pncAutoScalingGroupName = lens _pncAutoScalingGroupName (\ s a -> s{_pncAutoScalingGroupName = a}) | 165 | pncAutoScalingGroupName = lens _pncAutoScalingGroupName (\ s a -> s{_pncAutoScalingGroupName = a}) | 98 | true | true | 1 | 9 | 24 | 45 | 22 | 23 | null | null |
colin-adams/dragonfly-website | Dragonfly/ImageGallery/ImageGallery.hs | gpl-3.0 | divImageGallery :: X.Html
divImageGallery = X.thediv << (X.anchor X.! [X.href imageGalleryURL] << "Image gallery") | 114 | divImageGallery :: X.Html
divImageGallery = X.thediv << (X.anchor X.! [X.href imageGalleryURL] << "Image gallery") | 114 | divImageGallery = X.thediv << (X.anchor X.! [X.href imageGalleryURL] << "Image gallery") | 88 | false | true | 0 | 12 | 13 | 49 | 23 | 26 | null | null |
PipocaQuemada/ermine | src/Ermine/Unification/Meta.hs | bsd-2-clause | zonkScope :: (MonadMeta s m, MonadWriter Any m, Traversable f, Monad f)
=> Scope b f (Meta s f a) -> m (Scope b f (Meta s f a))
zonkScope (Scope e) = Scope <$> (traverse.traverse) zonk e | 196 | zonkScope :: (MonadMeta s m, MonadWriter Any m, Traversable f, Monad f)
=> Scope b f (Meta s f a) -> m (Scope b f (Meta s f a))
zonkScope (Scope e) = Scope <$> (traverse.traverse) zonk e | 196 | zonkScope (Scope e) = Scope <$> (traverse.traverse) zonk e | 58 | false | true | 0 | 11 | 47 | 109 | 54 | 55 | null | null |
nushio3/formura | src/Formura/Annotation.hs | mit | -- | An annotation from a single value
singleton :: Typeable a => a -> Annotation
singleton x = [toDyn x] | 105 | singleton :: Typeable a => a -> Annotation
singleton x = [toDyn x] | 66 | singleton x = [toDyn x] | 23 | true | true | 0 | 6 | 20 | 32 | 16 | 16 | null | null |
termite2/tsl | Frontend/SpecInline.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Preprocess all statements and expressions before inlining.
-- In the preprocessed spec:
-- * Method calls can only appear in top-level expressions
-- * No method calls in return statements
-- * Local variables are declared and initialis... | 548 | specSimplify :: Spec -> Spec
specSimplify s = let ?spec = s
in s{specTemplate = [tmSimplify (head $ specTemplate s)]} | 134 | specSimplify s = let ?spec = s
in s{specTemplate = [tmSimplify (head $ specTemplate s)]} | 105 | true | true | 0 | 13 | 81 | 60 | 34 | 26 | null | null |
bitemyapp/wreq | tests/UnitTests.hs | bsd-3-clause | commonTestsWith verb site = [
testGroup "basic" [
testCase "get" $ basicGet verb site
, testCase "post" $ basicPost verb site
, testCase "head" $ basicHead verb site
, testCase "put" $ basicPut verb site
, testCase "delete" $ basicDelete verb site
, testCase "404" $ throwsStatusCode verb s... | 1,144 | commonTestsWith verb site = [
testGroup "basic" [
testCase "get" $ basicGet verb site
, testCase "post" $ basicPost verb site
, testCase "head" $ basicHead verb site
, testCase "put" $ basicPut verb site
, testCase "delete" $ basicDelete verb site
, testCase "404" $ throwsStatusCode verb s... | 1,144 | commonTestsWith verb site = [
testGroup "basic" [
testCase "get" $ basicGet verb site
, testCase "post" $ basicPost verb site
, testCase "head" $ basicHead verb site
, testCase "put" $ basicPut verb site
, testCase "delete" $ basicDelete verb site
, testCase "404" $ throwsStatusCode verb s... | 1,144 | false | false | 0 | 9 | 264 | 338 | 158 | 180 | null | null |
jaiyalas/haha | src/Lambda/DeBujin/TermSugar.hs | mit | n8 = Succ n7 | 12 | n8 = Succ n7 | 12 | n8 = Succ n7 | 12 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ibabushkin/hapstone | test/Internal/Ppc/StorableSpec.hs | bsd-3-clause | ppcOpCrxStruct :: PpcOpCrxStruct
ppcOpCrxStruct = PpcOpCrxStruct 0x01234567 PpcRegCr0 PpcBcGe | 93 | ppcOpCrxStruct :: PpcOpCrxStruct
ppcOpCrxStruct = PpcOpCrxStruct 0x01234567 PpcRegCr0 PpcBcGe | 93 | ppcOpCrxStruct = PpcOpCrxStruct 0x01234567 PpcRegCr0 PpcBcGe | 60 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
binesiyu/ifl | examples/ch11/Prettify2.hs | mit | w `fits` "" = True | 25 | w `fits` "" = True | 25 | w `fits` "" = True | 25 | false | false | 0 | 5 | 11 | 18 | 8 | 10 | null | null |
nazrhom/vcs-clojure | src/Util/PPPatch.hs | bsd-3-clause | showAtmuNegE :: (IsRecEl u, IsRecEl v) => Usingl v -> AtmuNeg u v -> String
showAtmuNegE u (FixNeg almu) = showPatchEffect almu u | 129 | showAtmuNegE :: (IsRecEl u, IsRecEl v) => Usingl v -> AtmuNeg u v -> String
showAtmuNegE u (FixNeg almu) = showPatchEffect almu u | 129 | showAtmuNegE u (FixNeg almu) = showPatchEffect almu u | 53 | false | true | 0 | 8 | 22 | 63 | 29 | 34 | null | null |
guoy34/ampersand | src/Database/Design/Ampersand/Components.hs | gpl-3.0 | doGenDocument :: FSpec -> IO()
doGenDocument fSpec =
do { verboseLn (getOpts fSpec) ("Processing "++name fSpec)
; makeOutput
; verboseLn (getOpts fSpec) $ "Document has been written to " ++ outputFile ++ "."
; when (not(null thePictures) && fspecFormat (getOpts fSpec)/=FPandoc) $
mapM_ (writePictur... | 1,113 | doGenDocument :: FSpec -> IO()
doGenDocument fSpec =
do { verboseLn (getOpts fSpec) ("Processing "++name fSpec)
; makeOutput
; verboseLn (getOpts fSpec) $ "Document has been written to " ++ outputFile ++ "."
; when (not(null thePictures) && fspecFormat (getOpts fSpec)/=FPandoc) $
mapM_ (writePictur... | 1,113 | doGenDocument fSpec =
do { verboseLn (getOpts fSpec) ("Processing "++name fSpec)
; makeOutput
; verboseLn (getOpts fSpec) $ "Document has been written to " ++ outputFile ++ "."
; when (not(null thePictures) && fspecFormat (getOpts fSpec)/=FPandoc) $
mapM_ (writePicture (getOpts fSpec)) thePictures
... | 1,082 | false | true | 1 | 14 | 271 | 239 | 122 | 117 | null | null |
dmwit/pi-eta-epsilon | src/Language/PiEtaEpsilon/Interactive/Shell.hs | bsd-3-clause | -- | Default settings for all elements of shell state.
initialShellState =
PeeShellState
{ letBindings = Map.empty
, forwards = True
, histFile = Nothing
} | 171 | initialShellState =
PeeShellState
{ letBindings = Map.empty
, forwards = True
, histFile = Nothing
} | 116 | initialShellState =
PeeShellState
{ letBindings = Map.empty
, forwards = True
, histFile = Nothing
} | 116 | true | false | 0 | 8 | 41 | 33 | 19 | 14 | null | null |
adbrowne/dynamodb-eventstore | dynamodb-eventstore/tests/DynamoDbEventStore/InMemoryDynamoTable.hs | mit | readDb :: DynamoKey -> InMemoryDynamoTable -> Maybe DynamoReadResult
readDb key@DynamoKey{..} db =
let
entry = db ^.
(inMemoryDynamoTableTable
. at dynamoKeyKey
. non mempty
. at dynamoKeyEventNumber)
buildReadResult (version, value) = DynamoReadResult {
dynamoReadResultKey = key
,... | 422 | readDb :: DynamoKey -> InMemoryDynamoTable -> Maybe DynamoReadResult
readDb key@DynamoKey{..} db =
let
entry = db ^.
(inMemoryDynamoTableTable
. at dynamoKeyKey
. non mempty
. at dynamoKeyEventNumber)
buildReadResult (version, value) = DynamoReadResult {
dynamoReadResultKey = key
,... | 422 | readDb key@DynamoKey{..} db =
let
entry = db ^.
(inMemoryDynamoTableTable
. at dynamoKeyKey
. non mempty
. at dynamoKeyEventNumber)
buildReadResult (version, value) = DynamoReadResult {
dynamoReadResultKey = key
, dynamoReadResultVersion = version
, dynamoReadResultValue = valu... | 353 | false | true | 0 | 14 | 91 | 113 | 59 | 54 | null | null |
AndrewWUw/cs9181 | Data/Array/Accelerate/C/Exp.hs | bsd-3-clause | primToC (PrimAtan2 ty) [a,b] = ccall (FloatingNumType ty `postfix` "atan2") [a,b] | 91 | primToC (PrimAtan2 ty) [a,b] = ccall (FloatingNumType ty `postfix` "atan2") [a,b] | 91 | primToC (PrimAtan2 ty) [a,b] = ccall (FloatingNumType ty `postfix` "atan2") [a,b] | 91 | false | false | 1 | 8 | 20 | 47 | 25 | 22 | null | null |
tolysz/prepare-ghcjs | spec-lts8/aeson/tests/DataFamilies/Encoders.hs | bsd-3-clause | gSomeTypeToJSONTaggedObject :: SomeType c () Int -> Value
gSomeTypeToJSONTaggedObject = genericToJSON optsTaggedObject | 118 | gSomeTypeToJSONTaggedObject :: SomeType c () Int -> Value
gSomeTypeToJSONTaggedObject = genericToJSON optsTaggedObject | 118 | gSomeTypeToJSONTaggedObject = genericToJSON optsTaggedObject | 60 | false | true | 0 | 7 | 11 | 27 | 13 | 14 | null | null |
cfgrok/dotfiles | provision/roles/xmonad/files/xmonad.hs | apache-2.0 | isDo = className =? "Do" | 24 | isDo = className =? "Do" | 24 | isDo = className =? "Do" | 24 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
zooxyt/hackerrank_solutions | fp/intro/filter_positions_in_a_list.hs | mit | f :: [Int] -> [Int]
f lst = map fst $ filter (\x->(snd x) `mod` 2 == 0) $ zip lst [1..] | 87 | f :: [Int] -> [Int]
f lst = map fst $ filter (\x->(snd x) `mod` 2 == 0) $ zip lst [1..] | 87 | f lst = map fst $ filter (\x->(snd x) `mod` 2 == 0) $ zip lst [1..] | 67 | false | true | 0 | 13 | 21 | 73 | 38 | 35 | null | null |
tlaitinen/servant-cookie-hmac-auth-example | src/Api.hs | bsd-3-clause | files :: Application
files = serveDirectory "assets" | 52 | files :: Application
files = serveDirectory "assets" | 52 | files = serveDirectory "assets" | 31 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
Daniel-Diaz/rachel | Rachel/Primitive.hs | bsd-3-clause | e_zeroSound :: Entity
e_zeroSound = prim1 "zeroSound" zeroSound | 63 | e_zeroSound :: Entity
e_zeroSound = prim1 "zeroSound" zeroSound | 63 | e_zeroSound = prim1 "zeroSound" zeroSound | 41 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
Haskell-ITA/fuga | src/Client.hs | bsd-3-clause | step :: Float -> World -> IO World
step = const return | 54 | step :: Float -> World -> IO World
step = const return | 54 | step = const return | 19 | false | true | 0 | 7 | 11 | 25 | 12 | 13 | null | null |
dmjio/aeson | src/Data/Aeson/TH.hs | bsd-3-clause | tyKind _ = starK | 25 | tyKind _ = starK | 25 | tyKind _ = starK | 25 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
mydaum/cabal | Cabal/Distribution/Simple/SrcDist.hs | bsd-3-clause | listPackageSourcesMaybeExecutable :: PackageDescription -> IO [FilePath]
listPackageSourcesMaybeExecutable pkg_descr =
-- Extra source files.
fmap concat . for (extraSrcFiles pkg_descr) $ \fpath -> matchFileGlob fpath | 221 | listPackageSourcesMaybeExecutable :: PackageDescription -> IO [FilePath]
listPackageSourcesMaybeExecutable pkg_descr =
-- Extra source files.
fmap concat . for (extraSrcFiles pkg_descr) $ \fpath -> matchFileGlob fpath | 221 | listPackageSourcesMaybeExecutable pkg_descr =
-- Extra source files.
fmap concat . for (extraSrcFiles pkg_descr) $ \fpath -> matchFileGlob fpath | 148 | false | true | 1 | 7 | 27 | 54 | 26 | 28 | null | null |
DougBurke/swish | tests/GraphTest.hs | lgpl-2.1 | t10_1, t11_1, t12_1, t20_1, t21_1, t22_1 :: Arc (ScopedLabel LabelMem)
t10_1 = makeScopedArc 1 t10 | 98 | t10_1, t11_1, t12_1, t20_1, t21_1, t22_1 :: Arc (ScopedLabel LabelMem)
t10_1 = makeScopedArc 1 t10 | 98 | t10_1 = makeScopedArc 1 t10 | 27 | false | true | 3 | 7 | 14 | 42 | 22 | 20 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/Resource/Content/Collections/Create.hs | mpl-2.0 | -- | Creates a value of 'CollectionsCreate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ccXgafv'
--
-- * 'ccMerchantId'
--
-- * 'ccUploadProtocol'
--
-- * 'ccAccessToken'
--
-- * 'ccUploadType'
--
-- * 'ccPayload'
--
-- * 'ccCallb... | 735 | collectionsCreate
:: Int64 -- ^ 'ccMerchantId'
-> Collection -- ^ 'ccPayload'
-> CollectionsCreate
collectionsCreate pCcMerchantId_ pCcPayload_ =
CollectionsCreate'
{ _ccXgafv = Nothing
, _ccMerchantId = _Coerce # pCcMerchantId_
, _ccUploadProtocol = Nothing
, _ccAccessToken = Nothing
... | 410 | collectionsCreate pCcMerchantId_ pCcPayload_ =
CollectionsCreate'
{ _ccXgafv = Nothing
, _ccMerchantId = _Coerce # pCcMerchantId_
, _ccUploadProtocol = Nothing
, _ccAccessToken = Nothing
, _ccUploadType = Nothing
, _ccPayload = pCcPayload_
, _ccCallback = Nothing
} | 299 | true | true | 0 | 8 | 152 | 100 | 64 | 36 | null | null |
minoki/jstrans | JSTrans/Parser/Prim.hs | mit | isInAllowed :: Parser Bool
isInAllowed = fmap psAllowIn getState | 64 | isInAllowed :: Parser Bool
isInAllowed = fmap psAllowIn getState | 64 | isInAllowed = fmap psAllowIn getState | 37 | false | true | 0 | 5 | 8 | 19 | 9 | 10 | null | null |
olsner/ghc | compiler/cmm/PprC.hs | bsd-3-clause | isStrangeTypeGlobal CurrentNursery = True | 46 | isStrangeTypeGlobal CurrentNursery = True | 46 | isStrangeTypeGlobal CurrentNursery = True | 46 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
DaMSL/K3 | src/Language/K3/Interpreter/Data/Accessors.hs | apache-2.0 | pushProxyFrame :: Interpretation ()
pushProxyFrame = modifyProxyStack (\ps -> ps++[Nothing]) | 92 | pushProxyFrame :: Interpretation ()
pushProxyFrame = modifyProxyStack (\ps -> ps++[Nothing]) | 92 | pushProxyFrame = modifyProxyStack (\ps -> ps++[Nothing]) | 56 | false | true | 0 | 9 | 9 | 34 | 18 | 16 | null | null |
spire/spire | src/Spire/Canonical/Checker.hs | bsd-3-clause | checkV (VArg _A _B) _ =
throwError "Ill-typed!" | 49 | checkV (VArg _A _B) _ =
throwError "Ill-typed!" | 49 | checkV (VArg _A _B) _ =
throwError "Ill-typed!" | 49 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
deggis/guesswork | src/Guesswork/Export/WriteFiles.hs | bsd-3-clause | saveExtracted :: TExtracted -> Tundra ()
saveExtracted TExtracted{..} = do
Conf{..} <- ask
let formatter (KoealaData{..},fs) = plotToString (fromIntegral $ koealaid ala, fs)
content = unlines . map formatter $ samples
fn = targetPath++"extracted_"++extractionBranch++".txt"
info l $ "Wri... | 380 | saveExtracted :: TExtracted -> Tundra ()
saveExtracted TExtracted{..} = do
Conf{..} <- ask
let formatter (KoealaData{..},fs) = plotToString (fromIntegral $ koealaid ala, fs)
content = unlines . map formatter $ samples
fn = targetPath++"extracted_"++extractionBranch++".txt"
info l $ "Wri... | 380 | saveExtracted TExtracted{..} = do
Conf{..} <- ask
let formatter (KoealaData{..},fs) = plotToString (fromIntegral $ koealaid ala, fs)
content = unlines . map formatter $ samples
fn = targetPath++"extracted_"++extractionBranch++".txt"
info l $ "Writing featureset to " ++ fn
liftIO $ w... | 339 | false | true | 0 | 13 | 84 | 141 | 68 | 73 | null | null |
sharpjs/haskell-learning | before-stack/Asm.hs | gpl-3.0 | runAsm :: Asm a -> AsmState -> (a, AsmState)
runAsm = runState | 62 | runAsm :: Asm a -> AsmState -> (a, AsmState)
runAsm = runState | 62 | runAsm = runState | 17 | false | true | 0 | 9 | 11 | 35 | 16 | 19 | null | null |
mightymoose/liquidhaskell | docs/slides/NEU14/RBTree.hs | bsd-3-clause | ---------------------------------------------------------------------------
-- | Specifications -------------------------------------------------------
---------------------------------------------------------------------------
-- | Red-Black Trees
{-@ type RBT a = {v: ORBT a | isRB v && isBH v } @-}
{-@ type RBTN... | 2,825 | inv Leaf = Leaf | 25 | inv Leaf = Leaf | 25 | true | false | 1 | 5 | 841 | 49 | 40 | 9 | null | null |
lrassaby/harmlang | src/HarmLang/Probability.hs | mit | regroup (a:as) =
let r [] y = [y]
r ((v1, p1):xs) (v2, p2) =
if v1 == v2
then ((v1, p1 + p2):xs)
else ((v1, p1):(r xs (v2, p2)))
in r (regroup as) a | 200 | regroup (a:as) =
let r [] y = [y]
r ((v1, p1):xs) (v2, p2) =
if v1 == v2
then ((v1, p1 + p2):xs)
else ((v1, p1):(r xs (v2, p2)))
in r (regroup as) a | 200 | regroup (a:as) =
let r [] y = [y]
r ((v1, p1):xs) (v2, p2) =
if v1 == v2
then ((v1, p1 + p2):xs)
else ((v1, p1):(r xs (v2, p2)))
in r (regroup as) a | 200 | false | false | 0 | 14 | 86 | 135 | 73 | 62 | null | null |
jordanemedlock/fungen | examples/pong/pong.hs | bsd-3-clause | moveBarToLeft :: Modifiers -> Position -> IOGame GameAttribute () () () ()
moveBarToLeft _ _ = do
obj <- findObject "bar" "barGroup"
(Point2D pX pY) <- getObjectPosition obj
(Point2D sX _) <- getObjectSize obj
if (pX - (sX/2) - 5 >= 0)
then (setObjectPosition (Point2D (pX - 5) pY) obj)
else (set... | 359 | moveBarToLeft :: Modifiers -> Position -> IOGame GameAttribute () () () ()
moveBarToLeft _ _ = do
obj <- findObject "bar" "barGroup"
(Point2D pX pY) <- getObjectPosition obj
(Point2D sX _) <- getObjectSize obj
if (pX - (sX/2) - 5 >= 0)
then (setObjectPosition (Point2D (pX - 5) pY) obj)
else (setO... | 358 | moveBarToLeft _ _ = do
obj <- findObject "bar" "barGroup"
(Point2D pX pY) <- getObjectPosition obj
(Point2D sX _) <- getObjectSize obj
if (pX - (sX/2) - 5 >= 0)
then (setObjectPosition (Point2D (pX - 5) pY) obj)
else (setObjectPosition (Point2D (sX/2) pY) obj) | 283 | false | true | 0 | 13 | 79 | 170 | 84 | 86 | null | null |
geraldus/lambdacms | lambdacms-core/LambdaCms/Core/Message.hs | mit | dutchMessage UserIndex = "Gebruikers overzicht" | 69 | dutchMessage UserIndex = "Gebruikers overzicht" | 69 | dutchMessage UserIndex = "Gebruikers overzicht" | 69 | false | false | 0 | 5 | 26 | 9 | 4 | 5 | null | null |
avieth/Manifest | examples/User.hs | bsd-3-clause | example3 :: PFStrategy f => Function ReadWrite User (Maybe Email) -> M f (f ())
example3 f = do
(f, ada) .:= Just adasEmail
(f, richard) .:= Just richardsEmail | 167 | example3 :: PFStrategy f => Function ReadWrite User (Maybe Email) -> M f (f ())
example3 f = do
(f, ada) .:= Just adasEmail
(f, richard) .:= Just richardsEmail | 167 | example3 f = do
(f, ada) .:= Just adasEmail
(f, richard) .:= Just richardsEmail | 87 | false | true | 0 | 10 | 36 | 83 | 40 | 43 | null | null |
facebookincubator/duckling | Duckling/Time/KA/Rules.hs | bsd-3-clause | ruleIntervalBetween :: Rule
ruleIntervalBetween = Rule
{ name = "between <time> and <time>"
, pattern =
[ dimension Time
, regex "-ი?დან ?|ი?დან ?| ი?დან ?"
, dimension Time
, regex "-ა?მდე ?|ა?მდე ?| ა?მდე ?"
]
, prod = \case
(Token Time td1:_:Token Time td2:_) ->
Token Time <$>... | 373 | ruleIntervalBetween :: Rule
ruleIntervalBetween = Rule
{ name = "between <time> and <time>"
, pattern =
[ dimension Time
, regex "-ი?დან ?|ი?დან ?| ი?დან ?"
, dimension Time
, regex "-ა?მდე ?|ა?მდე ?| ა?მდე ?"
]
, prod = \case
(Token Time td1:_:Token Time td2:_) ->
Token Time <$>... | 373 | ruleIntervalBetween = Rule
{ name = "between <time> and <time>"
, pattern =
[ dimension Time
, regex "-ი?დან ?|ი?დან ?| ი?დან ?"
, dimension Time
, regex "-ა?მდე ?|ა?მდე ?| ა?მდე ?"
]
, prod = \case
(Token Time td1:_:Token Time td2:_) ->
Token Time <$> interval TTime.Closed td1 t... | 345 | false | true | 0 | 15 | 105 | 114 | 58 | 56 | null | null |
ekmett/ghc | compiler/nativeGen/PIC.hs | bsd-3-clause | -- PowerPC Linux:
-- The PIC base register points to our fake GOT. Use a label difference
-- to get the offset.
-- We have made sure that *everything* is accessed indirectly, so this
-- is only used for offsets from the GOT to symbol pointers inside the
-- GOT.
picRelative ArchPPC os lbl
| osElfTarget os
... | 354 | picRelative ArchPPC os lbl
| osElfTarget os
= CmmLabelDiffOff lbl gotLabel 0 | 92 | picRelative ArchPPC os lbl
| osElfTarget os
= CmmLabelDiffOff lbl gotLabel 0 | 92 | true | false | 0 | 8 | 77 | 35 | 18 | 17 | null | null |
samvher/translatethenews | app/TTN/View/Shared.hs | mit | h :: Monad m => Text -> HtmlT m ()
h = toHtml | 45 | h :: Monad m => Text -> HtmlT m ()
h = toHtml | 45 | h = toHtml | 10 | false | true | 0 | 9 | 12 | 35 | 15 | 20 | null | null |
edsko/hackage-server | Distribution/Server/Framework/CacheControl.hs | bsd-3-clause | ormatCacheControl :: CacheControl -> String
formatCacheControl (MaxAge n) = "max-age=" ++ show n
| 98 | formatCacheControl :: CacheControl -> String
formatCacheControl (MaxAge n) = "max-age=" ++ show n | 98 | formatCacheControl (MaxAge n) = "max-age=" ++ show n | 53 | false | true | 2 | 9 | 14 | 37 | 16 | 21 | null | null |
dmuneras/LambdaMethods | src/Interpolacion.hs | gpl-2.0 | --Funcion que convierte la lista de valores de x en una lista de funciones de la forma (x - xi)
makeRes :: [Double] -> [Func]
makeRes [] = [] | 141 | makeRes :: [Double] -> [Func]
makeRes [] = [] | 45 | makeRes [] = [] | 15 | true | true | 0 | 8 | 28 | 35 | 17 | 18 | null | null |
individkid/sidegeo | src/AffTopo/Naive.hs | gpl-3.0 | placeToDual :: Place -> Dual
placeToDual = plualToDual . placeToPlual | 69 | placeToDual :: Place -> Dual
placeToDual = plualToDual . placeToPlual | 69 | placeToDual = plualToDual . placeToPlual | 40 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
sol/aeson | Data/Aeson/TH.hs | bsd-3-clause | parseArgs _ _ tName _
ConstructorInfo { constructorName = conName
, constructorVariant = NormalConstructor
, constructorFields = [] }
(Right valName) =
caseE (varE valName) $ parseNullaryMatches tName conName | 256 | parseArgs _ _ tName _
ConstructorInfo { constructorName = conName
, constructorVariant = NormalConstructor
, constructorFields = [] }
(Right valName) =
caseE (varE valName) $ parseNullaryMatches tName conName | 256 | parseArgs _ _ tName _
ConstructorInfo { constructorName = conName
, constructorVariant = NormalConstructor
, constructorFields = [] }
(Right valName) =
caseE (varE valName) $ parseNullaryMatches tName conName | 256 | false | false | 0 | 9 | 76 | 66 | 34 | 32 | null | null |
mettekou/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Perform the given action and call the exception handler if the action
-- throws a 'SourceError'. See 'SourceError' for more information.
handleSourceError :: (ExceptionMonad m) =>
(SourceError -> m a) -- ^ exception handler
-> m a -- ^ action to perform
-> ... | 403 | handleSourceError :: (ExceptionMonad m) =>
(SourceError -> m a) -- ^ exception handler
-> m a -- ^ action to perform
-> m a
handleSourceError handler act =
gcatch act (\(e :: SourceError) -> handler e) | 260 | handleSourceError handler act =
gcatch act (\(e :: SourceError) -> handler e) | 79 | true | true | 0 | 9 | 118 | 76 | 40 | 36 | null | null |
jrockway/c2hs | src/C2HS/C/Attrs.hs | gpl-2.0 | -- | creating a new definition table
--
cDefTable :: CDefTable
cDefTable = newAttrTable "C General Definition Table for Idents" | 128 | cDefTable :: CDefTable
cDefTable = newAttrTable "C General Definition Table for Idents" | 88 | cDefTable = newAttrTable "C General Definition Table for Idents" | 65 | true | true | 0 | 5 | 20 | 16 | 9 | 7 | null | null |
oldmanmike/ghc | compiler/simplCore/SimplEnv.hs | bsd-3-clause | setFloats :: SimplEnv -> SimplEnv -> SimplEnv
-- Set the in-scope set *and* the floats
setFloats env env_with_floats
= env { seInScope = seInScope env_with_floats,
seFloats = seFloats env_with_floats } | 215 | setFloats :: SimplEnv -> SimplEnv -> SimplEnv
setFloats env env_with_floats
= env { seInScope = seInScope env_with_floats,
seFloats = seFloats env_with_floats } | 174 | setFloats env env_with_floats
= env { seInScope = seInScope env_with_floats,
seFloats = seFloats env_with_floats } | 128 | true | true | 0 | 8 | 43 | 54 | 26 | 28 | null | null |
kishoredbn/barrelfish | tools/flounder/Loopback.hs | mit | -- Name of the init function
loopback_init_fn_name n = ifscope n "loopback_init" | 80 | loopback_init_fn_name n = ifscope n "loopback_init" | 51 | loopback_init_fn_name n = ifscope n "loopback_init" | 51 | true | false | 0 | 5 | 11 | 15 | 7 | 8 | null | null |
mtolly/rail | src/Language/Rail/Generate.hs | gpl-3.0 | -- | The number of leaf nodes in a path's tree, equal to the number of branches
-- plus 1.
leaves :: Path c () Result Command -> Int
leaves g = case g of
Branch () x y -> leaves x + leaves y
_ :>> xs -> leaves xs
_ -> 1
{-
Here is the kind of Rail code we will generate:
$ 'function'
\
-[st... | 1,150 | leaves :: Path c () Result Command -> Int
leaves g = case g of
Branch () x y -> leaves x + leaves y
_ :>> xs -> leaves xs
_ -> 1
{-
Here is the kind of Rail code we will generate:
$ 'function'
\
-[starting path]-\
|
/-[next path]-----+-\
| | |
\-------... | 1,059 | leaves g = case g of
Branch () x y -> leaves x + leaves y
_ :>> xs -> leaves xs
_ -> 1
{-
Here is the kind of Rail code we will generate:
$ 'function'
\
-[starting path]-\
|
/-[next path]-----+-\
| | |
\-----------------/-+-\
| |
... | 1,017 | true | true | 3 | 7 | 355 | 72 | 37 | 35 | null | null |
HIPERFIT/futhark | src/Futhark/Internalise/TypesValues.hs | isc | -- | Convert an external primitive value to an internal primitive value.
internalisePrimValue :: E.PrimValue -> I.PrimValue
internalisePrimValue (E.SignedValue v) = I.IntValue v | 177 | internalisePrimValue :: E.PrimValue -> I.PrimValue
internalisePrimValue (E.SignedValue v) = I.IntValue v | 104 | internalisePrimValue (E.SignedValue v) = I.IntValue v | 53 | true | true | 0 | 7 | 22 | 40 | 19 | 21 | null | null |
k0001/gtk2hs | tools/c2hs/base/state/CIO.hs | gpl-3.0 | mktempCIO :: FilePath -> FilePath -> PreCST e s (Handle, FilePath)
mktempCIO pre post = liftIO $ mktemp pre post | 112 | mktempCIO :: FilePath -> FilePath -> PreCST e s (Handle, FilePath)
mktempCIO pre post = liftIO $ mktemp pre post | 112 | mktempCIO pre post = liftIO $ mktemp pre post | 45 | false | true | 0 | 8 | 19 | 46 | 23 | 23 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Attrs/Globals.hs | bsd-3-clause | contextMenu :: AttrHasContextMenu a => Text -> a -> a
contextMenu t = attrSetContextMenu (ContextMenu t) | 104 | contextMenu :: AttrHasContextMenu a => Text -> a -> a
contextMenu t = attrSetContextMenu (ContextMenu t) | 104 | contextMenu t = attrSetContextMenu (ContextMenu t) | 50 | false | true | 0 | 7 | 15 | 38 | 18 | 20 | null | null |
sjfloat/accelerate | Data/Array/Accelerate/Trafo/Base.hs | bsd-3-clause | subApply _ _ = error "subApply: inconsistent evaluation" | 71 | subApply _ _ = error "subApply: inconsistent evaluation" | 71 | subApply _ _ = error "subApply: inconsistent evaluation" | 71 | false | false | 0 | 5 | 22 | 14 | 6 | 8 | null | null |
input-output-hk/rscoin-haskell | src/RSCoin/Explorer/Storage.hs | gpl-3.0 | -- | Get subset of transactions referring to given address. Index of
-- the most recent transaction is 0. Returns indexed list of
-- transactions in range [lo, min (hi, txNum)). Result is timestamped
-- with id of ongoing period.
getAddressTransactions :: C.Address
-> (Word, Word)
... | 579 | getAddressTransactions :: C.Address
-> (Word, Word)
-> Query (C.PeriodId, [(Word, TransactionExtended)])
getAddressTransactions addr indices =
addTimestamp $
indexedSubList indices . catMaybes <$>
(mapM txIdxToTxExtended =<<
views (addresses . at addr) (may... | 349 | getAddressTransactions addr indices =
addTimestamp $
indexedSubList indices . catMaybes <$>
(mapM txIdxToTxExtended =<<
views (addresses . at addr) (maybe [] (view adTransactions))) | 198 | true | true | 2 | 13 | 136 | 114 | 60 | 54 | null | null |
tomtitchener/RealSimpleMusic | tests/Music/UtilsTest.hs | cc0-1.0 | getIntervalForScale :: Scale -> Pitch -> Pitch -> Interval
getIntervalForScale scale' (Pitch pc1 _) (Pitch pc2 _) =
if p2Idx > p1Idx
then
p2Idx - p1Idx
else
scaleLen + p1Idx - p2Idx
where
scale'' = ascendingScale scale'
p1Idx = fromJust $ elemIndex pc1 scale''
p2Idx = fromJust $ elemI... | 366 | getIntervalForScale :: Scale -> Pitch -> Pitch -> Interval
getIntervalForScale scale' (Pitch pc1 _) (Pitch pc2 _) =
if p2Idx > p1Idx
then
p2Idx - p1Idx
else
scaleLen + p1Idx - p2Idx
where
scale'' = ascendingScale scale'
p1Idx = fromJust $ elemIndex pc1 scale''
p2Idx = fromJust $ elemI... | 366 | getIntervalForScale scale' (Pitch pc1 _) (Pitch pc2 _) =
if p2Idx > p1Idx
then
p2Idx - p1Idx
else
scaleLen + p1Idx - p2Idx
where
scale'' = ascendingScale scale'
p1Idx = fromJust $ elemIndex pc1 scale''
p2Idx = fromJust $ elemIndex pc2 scale''
scaleLen = length scale'' | 307 | false | true | 8 | 11 | 93 | 131 | 60 | 71 | null | null |
mainland/dph | icebox/examples/lib/Bench/Benchmark.hs | bsd-3-clause | benchmark' :: Options -> (a -> b) -> a -> (b -> ()) -> (b -> String) -> IO [Time]
benchmark' opts f x nf outp = sequence $ map bench1 [1 .. optRuns opts]
where
bench1 n =
do
message msgRun opts n
performGC
(x, t) <- timeFn f nf x
message msgResult opts (t, outp x)
ret... | 325 | benchmark' :: Options -> (a -> b) -> a -> (b -> ()) -> (b -> String) -> IO [Time]
benchmark' opts f x nf outp = sequence $ map bench1 [1 .. optRuns opts]
where
bench1 n =
do
message msgRun opts n
performGC
(x, t) <- timeFn f nf x
message msgResult opts (t, outp x)
ret... | 325 | benchmark' opts f x nf outp = sequence $ map bench1 [1 .. optRuns opts]
where
bench1 n =
do
message msgRun opts n
performGC
(x, t) <- timeFn f nf x
message msgResult opts (t, outp x)
return t | 243 | false | true | 0 | 11 | 111 | 158 | 77 | 81 | null | null |
jb55/cassava | Data/Csv/Incremental.hs | bsd-3-clause | -- | Like 'encodeByName', but header and field order is dictated by
-- the 'Conversion.headerOrder' method.
encodeDefaultOrderedByName :: (DefaultOrdered a, ToNamedRecord a) =>
NamedBuilder a -> L.ByteString
encodeDefaultOrderedByName =
encodeDefaultOrderedByNameWith Encoding.defaultEn... | 331 | encodeDefaultOrderedByName :: (DefaultOrdered a, ToNamedRecord a) =>
NamedBuilder a -> L.ByteString
encodeDefaultOrderedByName =
encodeDefaultOrderedByNameWith Encoding.defaultEncodeOptions | 223 | encodeDefaultOrderedByName =
encodeDefaultOrderedByNameWith Encoding.defaultEncodeOptions | 93 | true | true | 0 | 7 | 64 | 42 | 22 | 20 | null | null |
prowdsponsor/yesod-auth-deskcom | src/Yesod/Auth/DeskCom.hs | bsd-3-clause | redirectToMultipass :: YesodDeskCom master
=> AuthId master
-> HandlerT DeskCom (HandlerT master IO) ()
redirectToMultipass uid = do
-- Get generic info.
y <- lift getYesod
DeskComCredentials {..} <- lift deskComCredentials
-- Get the expires timestamp.
expires <- TI.a... | 2,267 | redirectToMultipass :: YesodDeskCom master
=> AuthId master
-> HandlerT DeskCom (HandlerT master IO) ()
redirectToMultipass uid = do
-- Get generic info.
y <- lift getYesod
DeskComCredentials {..} <- lift deskComCredentials
-- Get the expires timestamp.
expires <- TI.a... | 2,267 | redirectToMultipass uid = do
-- Get generic info.
y <- lift getYesod
DeskComCredentials {..} <- lift deskComCredentials
-- Get the expires timestamp.
expires <- TI.addUTCTime (deskComTokenTimeout y) <$> liftIO TI.getCurrentTime
-- Get information about the currently logged user.
DeskComUser {..} <- lift... | 2,123 | false | true | 0 | 19 | 852 | 480 | 247 | 233 | null | null |
A1kmm/declarative-fieldml-prototype | src/Data/FieldML/InitialModel.hs | bsd-3-clause | vRealTanh = L2ValueID 22 | 31 | vRealTanh = L2ValueID 22 | 31 | vRealTanh = L2ValueID 22 | 31 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
sboosali/Haskell-DragonNaturallySpeaking | sources/Commands.hs | mit | touch 'e' = Press [ ] EKey | 32 | touch 'e' = Press [ ] EKey | 32 | touch 'e' = Press [ ] EKey | 32 | false | false | 0 | 6 | 12 | 16 | 7 | 9 | null | null |
isomorphism/csound-expression | examples/Gm.hs | bsd-3-clause | rhp' (a, b, c) = rhp $ trip c (b, a) | 36 | rhp' (a, b, c) = rhp $ trip c (b, a) | 36 | rhp' (a, b, c) = rhp $ trip c (b, a) | 36 | false | false | 2 | 6 | 10 | 35 | 18 | 17 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2013-11-nicta/src/Course/List.hs | unlicense | testList :: IO T.Counts
testList =
T.runTestTT P.$ T.TestList P.$ tho1 P.++ tho2 P.++ tp1 P.++ tp2 P.++ tlc P.++ tfm P.++ tft P.++ tsq P.++ trv | 147 | testList :: IO T.Counts
testList =
T.runTestTT P.$ T.TestList P.$ tho1 P.++ tho2 P.++ tp1 P.++ tp2 P.++ tlc P.++ tfm P.++ tft P.++ tsq P.++ trv | 147 | testList =
T.runTestTT P.$ T.TestList P.$ tho1 P.++ tho2 P.++ tp1 P.++ tp2 P.++ tlc P.++ tfm P.++ tft P.++ tsq P.++ trv | 123 | false | true | 6 | 13 | 30 | 88 | 41 | 47 | null | null |
glguy/advent2016 | Day12.hs | isc | main :: IO ()
main =
do program <- Vector.fromList . parseLines parseFile <$> readInputFile 12
print (execute program 0)
print (execute program 1) | 158 | main :: IO ()
main =
do program <- Vector.fromList . parseLines parseFile <$> readInputFile 12
print (execute program 0)
print (execute program 1) | 158 | main =
do program <- Vector.fromList . parseLines parseFile <$> readInputFile 12
print (execute program 0)
print (execute program 1) | 144 | false | true | 0 | 11 | 35 | 73 | 31 | 42 | null | null |
nyirog/cis194 | lec06.hs | unlicense | maze3 (C 4 (-5)) = Wall | 26 | maze3 (C 4 (-5)) = Wall | 26 | maze3 (C 4 (-5)) = Wall | 26 | false | false | 0 | 8 | 8 | 23 | 11 | 12 | null | null |
kmels/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | -- can fail
parseAmountQueryTerm :: String -> (OrdPlus, Quantity)
parseAmountQueryTerm s' =
case s' of
-- feel free to do this a smarter way
"" -> err
'<':'+':s -> (Lt, readDef err s)
'<':'=':'+':s -> (LtEq, readDef err s)
'>':'+':s -> (Gt, readDef err s)
'>':'=':'+'... | 1,566 | parseAmountQueryTerm :: String -> (OrdPlus, Quantity)
parseAmountQueryTerm s' =
case s' of
-- feel free to do this a smarter way
"" -> err
'<':'+':s -> (Lt, readDef err s)
'<':'=':'+':s -> (LtEq, readDef err s)
'>':'+':s -> (Gt, readDef err s)
'>':'=':'+':s -> (GtE... | 1,554 | parseAmountQueryTerm s' =
case s' of
-- feel free to do this a smarter way
"" -> err
'<':'+':s -> (Lt, readDef err s)
'<':'=':'+':s -> (LtEq, readDef err s)
'>':'+':s -> (Gt, readDef err s)
'>':'=':'+':s -> (GtEq, readDef err s)
'=':'+':s -> (Eq, readDef ... | 1,500 | true | true | 3 | 13 | 679 | 655 | 337 | 318 | null | null |
ice1000/OI-codes | codewars/101-200/algebraic-isomorphism.hs | agpl-3.0 | -- a ^ (S b) = a * (a ^ b)
powS :: ISO (Maybe b -> a) (a, b -> a)
powS = (\f -> (f Nothing, f . Just),
\(a, f) -> (\b -> fromMaybe a $ f <$> b)) | 152 | powS :: ISO (Maybe b -> a) (a, b -> a)
powS = (\f -> (f Nothing, f . Just),
\(a, f) -> (\b -> fromMaybe a $ f <$> b)) | 125 | powS = (\f -> (f Nothing, f . Just),
\(a, f) -> (\b -> fromMaybe a $ f <$> b)) | 86 | true | true | 0 | 12 | 49 | 97 | 52 | 45 | null | null |
nushio3/ghc | compiler/profiling/SCCfinal.hs | bsd-3-clause | thenMM_ :: MassageM a -> (MassageM b) -> MassageM b
thenMM expr cont = MassageM $ \mod ccs ->
case unMassageM expr mod ccs of { (ccs2, result) ->
unMassageM (cont result) mod ccs2 } | 190 | thenMM_ :: MassageM a -> (MassageM b) -> MassageM b
thenMM expr cont = MassageM $ \mod ccs ->
case unMassageM expr mod ccs of { (ccs2, result) ->
unMassageM (cont result) mod ccs2 } | 189 | thenMM expr cont = MassageM $ \mod ccs ->
case unMassageM expr mod ccs of { (ccs2, result) ->
unMassageM (cont result) mod ccs2 } | 137 | false | true | 0 | 12 | 43 | 85 | 43 | 42 | null | null |
seppeljordan/geimskell | Stage.hs | gpl-3.0 | emptyStage :: Stage
emptyStage =
Stage
{ stageWidth = 0
, stageHeight = 0
, stageData = listArray ((0,0), (0,0)) []
, stageAssetCache = emptyAssetCache
} | 165 | emptyStage :: Stage
emptyStage =
Stage
{ stageWidth = 0
, stageHeight = 0
, stageData = listArray ((0,0), (0,0)) []
, stageAssetCache = emptyAssetCache
} | 165 | emptyStage =
Stage
{ stageWidth = 0
, stageHeight = 0
, stageData = listArray ((0,0), (0,0)) []
, stageAssetCache = emptyAssetCache
} | 145 | false | true | 0 | 10 | 37 | 66 | 39 | 27 | null | null |
reinh/Hask8080 | src/Hask8080/Instructions.hs | mit | lhld = error "fatal: lhld not yet implemented" | 53 | lhld = error "fatal: lhld not yet implemented" | 53 | lhld = error "fatal: lhld not yet implemented" | 53 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
punitrathore/haskell-first-principles | src/FunctionWithLet.hs | bsd-3-clause | waxOn = x * 5 where z = 7
y = z + 8
x = y ^ 2 | 85 | waxOn = x * 5 where z = 7
y = z + 8
x = y ^ 2 | 85 | waxOn = x * 5 where z = 7
y = z + 8
x = y ^ 2 | 85 | false | false | 9 | 5 | 58 | 52 | 19 | 33 | null | null |
lamefun/haddock | haddock-api/src/Haddock/Interface/Create.hs | bsd-2-clause | extractRecSel :: Name -> Module -> Name -> [LHsType Name] -> [LConDecl Name]
-> LSig Name
extractRecSel _ _ _ _ [] = error "extractRecSel: selector not found" | 172 | extractRecSel :: Name -> Module -> Name -> [LHsType Name] -> [LConDecl Name]
-> LSig Name
extractRecSel _ _ _ _ [] = error "extractRecSel: selector not found" | 172 | extractRecSel _ _ _ _ [] = error "extractRecSel: selector not found" | 68 | false | true | 0 | 11 | 41 | 62 | 30 | 32 | null | null |
tejon/diagrams-contrib | src/Diagrams/TwoD/Path/Metafont/Internal.hs | bsd-3-clause | beta s = 1 / s^.pj.j.to fromLeft.t2.to getTension | 50 | beta s = 1 / s^.pj.j.to fromLeft.t2.to getTension | 50 | beta s = 1 / s^.pj.j.to fromLeft.t2.to getTension | 50 | false | false | 7 | 7 | 8 | 45 | 16 | 29 | null | null |
ezyang/ghc | compiler/prelude/PrimOp.hs | bsd-3-clause | -- CoreUnfold.primOpSize already takes into account primOpOutOfLine
-- and adds some further costs for the args in that case.
primOpCodeSizeForeignCall :: Int
primOpCodeSizeForeignCall = 4 | 191 | primOpCodeSizeForeignCall :: Int
primOpCodeSizeForeignCall = 4 | 62 | primOpCodeSizeForeignCall = 4 | 29 | true | true | 0 | 4 | 27 | 13 | 8 | 5 | null | null |
jeroennoels/exact-real | test/Ternary/TestTernary.hs | mit | testBasicTernary :: TestBatch
testBasicTernary =
("Basic properties of redundant ternary representation",
[("Invariant under redundancy", property qcFiddle),
("Convert between triad and exact", qcTriadExactConversion),
("Add ternary digits", property qcAddT2),
("Multiply ternary digits", property qcMul... | 491 | testBasicTernary :: TestBatch
testBasicTernary =
("Basic properties of redundant ternary representation",
[("Invariant under redundancy", property qcFiddle),
("Convert between triad and exact", qcTriadExactConversion),
("Add ternary digits", property qcAddT2),
("Multiply ternary digits", property qcMul... | 491 | testBasicTernary =
("Basic properties of redundant ternary representation",
[("Invariant under redundancy", property qcFiddle),
("Convert between triad and exact", qcTriadExactConversion),
("Add ternary digits", property qcAddT2),
("Multiply ternary digits", property qcMultiplyT2),
("Combined prope... | 461 | false | true | 0 | 8 | 72 | 95 | 57 | 38 | null | null |
tamarin-prover/tamarin-prover | lib/theory/src/Theory/Proof.hs | gpl-3.0 | annotateProof :: (ProofStep a -> [b] -> b) -> Proof a -> Proof b
annotateProof f =
go
where
go (LNode step@(ProofStep method _) cs) =
LNode (ProofStep method info') cs'
where
cs' = M.map go cs
info' = f step (map (psInfo . root . snd) (M.toList cs'))
-- | Annotate a proof in a b... | 337 | annotateProof :: (ProofStep a -> [b] -> b) -> Proof a -> Proof b
annotateProof f =
go
where
go (LNode step@(ProofStep method _) cs) =
LNode (ProofStep method info') cs'
where
cs' = M.map go cs
info' = f step (map (psInfo . root . snd) (M.toList cs'))
-- | Annotate a proof in a b... | 337 | annotateProof f =
go
where
go (LNode step@(ProofStep method _) cs) =
LNode (ProofStep method info') cs'
where
cs' = M.map go cs
info' = f step (map (psInfo . root . snd) (M.toList cs'))
-- | Annotate a proof in a bottom-up fashion. | 272 | false | true | 0 | 12 | 98 | 140 | 70 | 70 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Text/Greek/IO/Render.hs | mit | renderVowelChar :: Abstract.Vowel -> Lazy.Text
renderVowelChar Abstract.V_α = "α" | 81 | renderVowelChar :: Abstract.Vowel -> Lazy.Text
renderVowelChar Abstract.V_α = "α" | 81 | renderVowelChar Abstract.V_α = "α" | 34 | false | true | 0 | 6 | 8 | 26 | 13 | 13 | null | null |
anton-k/sharc-timbre | src/Sharc/Instruments/Tuba.hs | bsd-3-clause | tuba :: Instr
tuba = Instr
"tuba"
"Tuba"
(Legend "McGill" "2" "25")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 65.4 24 "c2"))
(Pitch 65.4 24 "c2")
(Amplitude 9754.2 (HarmonicFreq 79 (Pitch 123.471 35 "b2")) 0.0))
(InstrRange
(HarmonicFreq 10... | 822 | tuba :: Instr
tuba = Instr
"tuba"
"Tuba"
(Legend "McGill" "2" "25")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 65.4 24 "c2"))
(Pitch 65.4 24 "c2")
(Amplitude 9754.2 (HarmonicFreq 79 (Pitch 123.471 35 "b2")) 0.0))
(InstrRange
(HarmonicFreq 10... | 822 | tuba = Instr
"tuba"
"Tuba"
(Legend "McGill" "2" "25")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 65.4 24 "c2"))
(Pitch 65.4 24 "c2")
(Amplitude 9754.2 (HarmonicFreq 79 (Pitch 123.471 35 "b2")) 0.0))
(InstrRange
(HarmonicFreq 102 (Pitch 9995.... | 808 | false | true | 0 | 14 | 311 | 275 | 149 | 126 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/BiFlux/Trans/Translation.hs | mit | cpath2UPat CPathDoS _ _ _ = throwError $ text "CPathDoS not support yet" | 106 | cpath2UPat CPathDoS _ _ _ = throwError $ text "CPathDoS not support yet" | 106 | cpath2UPat CPathDoS _ _ _ = throwError $ text "CPathDoS not support yet" | 106 | false | false | 0 | 6 | 46 | 22 | 10 | 12 | null | null |
AlexanderPankiv/ghc | compiler/cmm/PprC.hs | bsd-3-clause | te_Static _ = return () | 23 | te_Static _ = return () | 23 | te_Static _ = return () | 23 | false | false | 0 | 5 | 4 | 15 | 6 | 9 | null | null |
Philonous/hexpat-internals | Text/XML/Expat/Internal/IO.hs | bsd-3-clause | getError :: ParserPtr -> IO XMLParseError
getError pp = do
code <- xmlGetErrorCode pp
cerr <- xmlErrorString code
err <- peekCString cerr
loc <- getParseLocation pp
return $ XMLParseError err loc | 215 | getError :: ParserPtr -> IO XMLParseError
getError pp = do
code <- xmlGetErrorCode pp
cerr <- xmlErrorString code
err <- peekCString cerr
loc <- getParseLocation pp
return $ XMLParseError err loc | 215 | getError pp = do
code <- xmlGetErrorCode pp
cerr <- xmlErrorString code
err <- peekCString cerr
loc <- getParseLocation pp
return $ XMLParseError err loc | 173 | false | true | 0 | 9 | 50 | 78 | 32 | 46 | null | null |
noschinl/cyp | src/Test/Info2/Cyp/Term.hs | mit | unparseAbsProp :: UnparseMode a -> AbsProp a -> Doc
unparseAbsProp mode (Prop l r) = unparseAbsTerm mode l <+> text symPropEq <+> unparseAbsTerm mode r | 151 | unparseAbsProp :: UnparseMode a -> AbsProp a -> Doc
unparseAbsProp mode (Prop l r) = unparseAbsTerm mode l <+> text symPropEq <+> unparseAbsTerm mode r | 151 | unparseAbsProp mode (Prop l r) = unparseAbsTerm mode l <+> text symPropEq <+> unparseAbsTerm mode r | 99 | false | true | 0 | 7 | 24 | 59 | 27 | 32 | null | null |
narurien/ganeti-ceph | src/Ganeti/HTools/Program/Hail.hs | gpl-2.0 | -- | The list of arguments supported by the program.
arguments :: [ArgCompletion]
arguments = [ArgCompletion OptComplFile 1 (Just 1)] | 133 | arguments :: [ArgCompletion]
arguments = [ArgCompletion OptComplFile 1 (Just 1)] | 80 | arguments = [ArgCompletion OptComplFile 1 (Just 1)] | 51 | true | true | 0 | 9 | 19 | 38 | 18 | 20 | null | null |
HaskellCNOrg/snap-web | src/Controllers/Topic.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | View topics per particular tag
--
viewTopicsByTagH :: AppHandler ()
viewTopicsByTagH = do
tagId <- decodedParamText tagIdParam
page <- decodedParamNum "p"
let oid' = textToObjectIdMaybe tagId
result <- case oid' of
Just... | 446 | viewTopicsByTagH :: AppHandler ()
viewTopicsByTagH = do
tagId <- decodedParamText tagIdParam
page <- decodedParamNum "p"
let oid' = textToObjectIdMaybe tagId
result <- case oid' of
Just tagId' -> try (findTopicByTag tagId')
_ -> redirect' "/tags" 301
either exceptionH (toTopicListPerTagPage page) ... | 326 | viewTopicsByTagH = do
tagId <- decodedParamText tagIdParam
page <- decodedParamNum "p"
let oid' = textToObjectIdMaybe tagId
result <- case oid' of
Just tagId' -> try (findTopicByTag tagId')
_ -> redirect' "/tags" 301
either exceptionH (toTopicListPerTagPage page) result | 292 | true | true | 1 | 14 | 73 | 111 | 49 | 62 | null | null |
alphalambda/codeworld | codeworld-base/src/Internal/Color.hs | apache-2.0 | -- | The color grey
--
-- This is the same color as 'gray', but with a non-US
-- spelling.
grey :: Color
grey = Color CW.grey | 127 | grey :: Color
grey = Color CW.grey | 36 | grey = Color CW.grey | 22 | true | true | 0 | 6 | 28 | 20 | 12 | 8 | null | null |
kavigupta/N-programming-language | src/Interpreter.hs | gpl-3.0 | interpret Index = do
index <- pop
case index of
Number n -> indexStack n >>= push
o -> indexWithNoNumber o | 130 | interpret Index = do
index <- pop
case index of
Number n -> indexStack n >>= push
o -> indexWithNoNumber o | 130 | interpret Index = do
index <- pop
case index of
Number n -> indexStack n >>= push
o -> indexWithNoNumber o | 130 | false | false | 0 | 11 | 44 | 48 | 21 | 27 | null | null |
sgillespie/ghc | compiler/stgSyn/StgSyn.hs | bsd-3-clause | exprHasCafRefs (StgLam _ body)
= exprHasCafRefs body | 54 | exprHasCafRefs (StgLam _ body)
= exprHasCafRefs body | 54 | exprHasCafRefs (StgLam _ body)
= exprHasCafRefs body | 54 | false | false | 0 | 7 | 8 | 20 | 9 | 11 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_333 (60#) = happyGoto action_25 | 38 | action_333 (60#) = happyGoto action_25 | 38 | action_333 (60#) = happyGoto action_25 | 38 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
bravit/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs) | 89 | mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs) | 89 | mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs) | 89 | false | false | 0 | 11 | 29 | 47 | 21 | 26 | null | null |
ulricha/dsh-example-queries | Queries/TPCH/Standard/Q21.hs | bsd-3-clause | -- | TPC-H Q21 (quantifiers based on 'null')
q21c :: Text -> Q [(Text, Integer)]
q21c nationName =
take 100 $
sortWith (\(view -> (name, nw)) -> pair (-1 * nw) name) $
groupAggr id id length
[ s_nameQ s
| s <- suppliers
, l1 <- lineitems
, o <- orders
, n <- nations
, s_suppkeyQ s == l_suppkeyQ l1
... | 879 | q21c :: Text -> Q [(Text, Integer)]
q21c nationName =
take 100 $
sortWith (\(view -> (name, nw)) -> pair (-1 * nw) name) $
groupAggr id id length
[ s_nameQ s
| s <- suppliers
, l1 <- lineitems
, o <- orders
, n <- nations
, s_suppkeyQ s == l_suppkeyQ l1
, o_orderkeyQ o == l_orderkeyQ l1
, o_ord... | 834 | q21c nationName =
take 100 $
sortWith (\(view -> (name, nw)) -> pair (-1 * nw) name) $
groupAggr id id length
[ s_nameQ s
| s <- suppliers
, l1 <- lineitems
, o <- orders
, n <- nations
, s_suppkeyQ s == l_suppkeyQ l1
, o_orderkeyQ o == l_orderkeyQ l1
, o_orderstatusQ o == toQ "F"
, l_receipt... | 798 | true | true | 0 | 13 | 290 | 334 | 158 | 176 | null | null |
ekmett/generic-deriving | src/Generics/Deriving/TH.hs | bsd-3-clause | -- | Given a datatype name, derive datatypes and
-- instances of class 'Constructor'.
deriveConstructors :: Name -> Q [Dec]
deriveConstructors = constrInstance | 160 | deriveConstructors :: Name -> Q [Dec]
deriveConstructors = constrInstance | 73 | deriveConstructors = constrInstance | 35 | true | true | 0 | 7 | 23 | 23 | 13 | 10 | null | null |
capitanbatata/sandbox | hedgehog-vs-qc/test/qc/Main.hs | gpl-3.0 | evensAreEven :: EvenInt -> Bool
evensAreEven (EvenInt i) =
i `mod` 2 == 0 && i <= 4 | 85 | evensAreEven :: EvenInt -> Bool
evensAreEven (EvenInt i) =
i `mod` 2 == 0 && i <= 4 | 85 | evensAreEven (EvenInt i) =
i `mod` 2 == 0 && i <= 4 | 53 | false | true | 1 | 6 | 19 | 52 | 25 | 27 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.