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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ducis/haAni | hs/common/Graphics/Rendering/OpenGL/GL/VertexSpec.hs | gpl-2.0 | vertexAttrib4IvRealFrac :: (Storable a, RealFrac a) => AttribLocation -> Ptr a -> IO ()
vertexAttrib4IvRealFrac location = peek4M $ \x y z w ->
vertexAttrib4I location (toGLint x) (toGLint y) (toGLint z) (toGLint w) | 218 | vertexAttrib4IvRealFrac :: (Storable a, RealFrac a) => AttribLocation -> Ptr a -> IO ()
vertexAttrib4IvRealFrac location = peek4M $ \x y z w ->
vertexAttrib4I location (toGLint x) (toGLint y) (toGLint z) (toGLint w) | 218 | vertexAttrib4IvRealFrac location = peek4M $ \x y z w ->
vertexAttrib4I location (toGLint x) (toGLint y) (toGLint z) (toGLint w) | 130 | false | true | 0 | 10 | 36 | 101 | 48 | 53 | null | null |
fmthoma/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprDo MDoExpr stmts = ptext (sLit "mdo") <+> ppr_do_stmts stmts | 69 | pprDo MDoExpr stmts = ptext (sLit "mdo") <+> ppr_do_stmts stmts | 69 | pprDo MDoExpr stmts = ptext (sLit "mdo") <+> ppr_do_stmts stmts | 69 | false | false | 0 | 8 | 15 | 29 | 12 | 17 | null | null |
GaloisInc/halvm-ghc | compiler/types/Type.hs | bsd-3-clause | mkAppTy :: Type -> Type -> Type
mkAppTy (TyConApp tc tys) ty2 = mkTyConApp tc (tys ++ [ty2]) | 92 | mkAppTy :: Type -> Type -> Type
mkAppTy (TyConApp tc tys) ty2 = mkTyConApp tc (tys ++ [ty2]) | 92 | mkAppTy (TyConApp tc tys) ty2 = mkTyConApp tc (tys ++ [ty2]) | 60 | false | true | 0 | 10 | 17 | 52 | 25 | 27 | null | null |
kvnesterov/IdaHaskell | src/Cli.hs | gpl-3.0 | lookupCommand :: GhcMonad m => String -> Maybe (String, (HscEnv -> String -> m HscEnv))
lookupCommand str = do
let lookupPrefix s = find $ (s `isPrefixOf`) . fst
lookupPrefix str specCommands >>= return | 206 | lookupCommand :: GhcMonad m => String -> Maybe (String, (HscEnv -> String -> m HscEnv))
lookupCommand str = do
let lookupPrefix s = find $ (s `isPrefixOf`) . fst
lookupPrefix str specCommands >>= return | 206 | lookupCommand str = do
let lookupPrefix s = find $ (s `isPrefixOf`) . fst
lookupPrefix str specCommands >>= return | 118 | false | true | 0 | 12 | 37 | 86 | 43 | 43 | null | null |
massysett/prednote | lib/Prednote/Comparisons.hs | bsd-3-clause | lessEqBy
:: Show a
=> Text
-- ^ Description of right-hand side
-> (a -> Ordering)
-- ^ How to compare an item against the right hand side. Return LT
-- if the item is less than the right hand side; GT if greater; EQ
-- if equal to the right hand side.
-> Pred a
lessEqBy desc get = lessEqByM desc (fmap return get) | 332 | lessEqBy
:: Show a
=> Text
-- ^ Description of right-hand side
-> (a -> Ordering)
-- ^ How to compare an item against the right hand side. Return LT
-- if the item is less than the right hand side; GT if greater; EQ
-- if equal to the right hand side.
-> Pred a
lessEqBy desc get = lessEqByM desc (fmap return get) | 332 | lessEqBy desc get = lessEqByM desc (fmap return get) | 52 | false | true | 0 | 10 | 82 | 62 | 31 | 31 | null | null |
brendanhay/gogol | gogol-videointelligence/gen/Network/Google/VideoIntelligence/Types/Product.hs | mpl-2.0 | -- | The recognized celebrity.
gcvvrcCelebrity :: Lens' GoogleCloudVideointelligenceV1p3beta1_RecognizedCelebrity (Maybe GoogleCloudVideointelligenceV1p3beta1_Celebrity)
gcvvrcCelebrity
= lens _gcvvrcCelebrity
(\ s a -> s{_gcvvrcCelebrity = a}) | 252 | gcvvrcCelebrity :: Lens' GoogleCloudVideointelligenceV1p3beta1_RecognizedCelebrity (Maybe GoogleCloudVideointelligenceV1p3beta1_Celebrity)
gcvvrcCelebrity
= lens _gcvvrcCelebrity
(\ s a -> s{_gcvvrcCelebrity = a}) | 221 | gcvvrcCelebrity
= lens _gcvvrcCelebrity
(\ s a -> s{_gcvvrcCelebrity = a}) | 82 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
mettekou/ghc | compiler/basicTypes/Literal.hs | bsd-3-clause | inCharRange :: Char -> Bool
inCharRange c = c >= '\0' && c <= chr tARGET_MAX_CHAR | 82 | inCharRange :: Char -> Bool
inCharRange c = c >= '\0' && c <= chr tARGET_MAX_CHAR | 82 | inCharRange c = c >= '\0' && c <= chr tARGET_MAX_CHAR | 54 | false | true | 0 | 7 | 16 | 33 | 16 | 17 | null | null |
usami-k/H-99-Ninety-Nine-Haskell-Problems | 01-10/01.hs | mit | -- Problem 1
-- (*) Find the last element of a list.
myLast :: [a] -> Maybe a
myLast [] = Nothing | 98 | myLast :: [a] -> Maybe a
myLast [] = Nothing | 44 | myLast [] = Nothing | 19 | true | true | 0 | 6 | 22 | 28 | 15 | 13 | null | null |
ibabushkin/morgue-server | src/API.hs | gpl-3.0 | -- | pulling files from a group's datastore
pullG :: PullGRequest -> Update Morgue (ApiResponse File)
pullG = run pullGProvider getFileFromGroup return id | 154 | pullG :: PullGRequest -> Update Morgue (ApiResponse File)
pullG = run pullGProvider getFileFromGroup return id | 110 | pullG = run pullGProvider getFileFromGroup return id | 52 | true | true | 0 | 8 | 22 | 36 | 18 | 18 | null | null |
zjhmale/monadme | monad/src/monad/haskell/mpc.hs | epl-1.0 | parse21 = parse space " abc" | 32 | parse21 = parse space " abc" | 32 | parse21 = parse space " abc" | 32 | false | false | 0 | 5 | 9 | 11 | 5 | 6 | null | null |
jvilar/hrows | lib/GUI/MainWindow/Update.hs | gpl-2.0 | createFieldTextView :: FieldPos -> MainWindow -> IO TextView
createFieldTextView f mWindow = do
textView <- textViewNew
set textView [ #wrapMode := WrapModeWord
, #acceptsTab := False
, #editable := False
, #sensitive := False
, #canFocus := False
, #hexpand := True
]
buffer <- textViewGetBuffer textView
_ <- buffer `on` #changed $ liftIO $ do
isActive <- (@. f) <$> readIORef (textBufferActive mWindow)
when isActive $ do
text <- readText buffer
sendInputMW mWindow $ UpdateField f (toField text)
_ <- textView `on` #buttonPressEvent $ \event -> do
button <- get event #button
if button == 3
then liftIO $ do
writeIORef (currentField mWindow) f
#popupAtPointer (fieldMenu mWindow) Nothing
return True
else return False
return textView | 1,103 | createFieldTextView :: FieldPos -> MainWindow -> IO TextView
createFieldTextView f mWindow = do
textView <- textViewNew
set textView [ #wrapMode := WrapModeWord
, #acceptsTab := False
, #editable := False
, #sensitive := False
, #canFocus := False
, #hexpand := True
]
buffer <- textViewGetBuffer textView
_ <- buffer `on` #changed $ liftIO $ do
isActive <- (@. f) <$> readIORef (textBufferActive mWindow)
when isActive $ do
text <- readText buffer
sendInputMW mWindow $ UpdateField f (toField text)
_ <- textView `on` #buttonPressEvent $ \event -> do
button <- get event #button
if button == 3
then liftIO $ do
writeIORef (currentField mWindow) f
#popupAtPointer (fieldMenu mWindow) Nothing
return True
else return False
return textView | 1,103 | createFieldTextView f mWindow = do
textView <- textViewNew
set textView [ #wrapMode := WrapModeWord
, #acceptsTab := False
, #editable := False
, #sensitive := False
, #canFocus := False
, #hexpand := True
]
buffer <- textViewGetBuffer textView
_ <- buffer `on` #changed $ liftIO $ do
isActive <- (@. f) <$> readIORef (textBufferActive mWindow)
when isActive $ do
text <- readText buffer
sendInputMW mWindow $ UpdateField f (toField text)
_ <- textView `on` #buttonPressEvent $ \event -> do
button <- get event #button
if button == 3
then liftIO $ do
writeIORef (currentField mWindow) f
#popupAtPointer (fieldMenu mWindow) Nothing
return True
else return False
return textView | 1,042 | false | true | 0 | 19 | 481 | 281 | 132 | 149 | null | null |
kawu/tag-vanilla | src/NLP/TAG/Vanilla/Earley/TreeGen.hs | bsd-2-clause | final
:: (Eq n, Eq t)
=> n -- ^ The start symbol
-> Int -- ^ The length of the input sentence
-> M.Map (Passive n t) (S.Set (Trav n t))
-- ^ Result of the earley computation
-> [Passive n t]
final start n donePassive =
[ p
| p <- S.toList $ M.keysSet donePassive
, p ^. spanP ^. beg == 0
, p ^. spanP ^. end == n
, p ^. label == NonT start Nothing ] | 429 | final
:: (Eq n, Eq t)
=> n -- ^ The start symbol
-> Int -- ^ The length of the input sentence
-> M.Map (Passive n t) (S.Set (Trav n t))
-- ^ Result of the earley computation
-> [Passive n t]
final start n donePassive =
[ p
| p <- S.toList $ M.keysSet donePassive
, p ^. spanP ^. beg == 0
, p ^. spanP ^. end == n
, p ^. label == NonT start Nothing ] | 429 | final start n donePassive =
[ p
| p <- S.toList $ M.keysSet donePassive
, p ^. spanP ^. beg == 0
, p ^. spanP ^. end == n
, p ^. label == NonT start Nothing ] | 178 | false | true | 0 | 14 | 161 | 164 | 81 | 83 | null | null |
dcreager/cabal | Distribution/PackageDescription/Configuration.hs | bsd-3-clause | mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b
mapTreeData f = mapCondTree f id id | 95 | mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b
mapTreeData f = mapCondTree f id id | 95 | mapTreeData f = mapCondTree f id id | 35 | false | true | 0 | 8 | 21 | 54 | 25 | 29 | null | null |
ltcmelo/psychec | formalism/muC.hs | bsd-3-clause | typeExpr c gam (Deref e) =
let t = typeExpr c gam e
in case t of
PtrTy t' -> t'
_ -> error $ "dereference doesn't type check"
-- | TCAdr | 149 | typeExpr c gam (Deref e) =
let t = typeExpr c gam e
in case t of
PtrTy t' -> t'
_ -> error $ "dereference doesn't type check"
-- | TCAdr | 149 | typeExpr c gam (Deref e) =
let t = typeExpr c gam e
in case t of
PtrTy t' -> t'
_ -> error $ "dereference doesn't type check"
-- | TCAdr | 149 | false | false | 0 | 10 | 44 | 61 | 29 | 32 | null | null |
sjfloat/dnngraph | NN/DSL.hs | bsd-3-clause | ty type'' = LP._type' ?~ s (asCaffe type'') | 43 | ty type'' = LP._type' ?~ s (asCaffe type'') | 43 | ty type'' = LP._type' ?~ s (asCaffe type'') | 43 | false | false | 1 | 8 | 7 | 27 | 11 | 16 | null | null |
Proclivis/wxHaskell | wxc/Setup.hs | lgpl-2.1 | eplace :: Char -- ^ Character to replace
-> Char -- ^ Character with which to replace
-> String -- ^ String in which to replace
-> String -- ^ Transformed string
replace old new = map replace'
where
replace' elem = if elem == old then new else elem
| 289 | replace :: Char -- ^ Character to replace
-> Char -- ^ Character with which to replace
-> String -- ^ String in which to replace
-> String
replace old new = map replace'
where
replace' elem = if elem == old then new else elem | 264 | replace old new = map replace'
where
replace' elem = if elem == old then new else elem | 98 | true | true | 1 | 9 | 90 | 67 | 32 | 35 | null | null |
haroldcarr/juno | test/WireFormatSpec.hs | bsd-3-clause | pubKeyLeader, pubKeyFollower, pubKeyClient :: PublicKey
pubKeyLeader = fromMaybe (error "bad leader key") $ importPublic "f\t\167y\197\140\&2c.L\209;E\181\146\157\226\137\155$\GS(\189\215\SUB\199\r\158\224\FS\190|" | 214 | pubKeyLeader, pubKeyFollower, pubKeyClient :: PublicKey
pubKeyLeader = fromMaybe (error "bad leader key") $ importPublic "f\t\167y\197\140\&2c.L\209;E\181\146\157\226\137\155$\GS(\189\215\SUB\199\r\158\224\FS\190|" | 214 | pubKeyLeader = fromMaybe (error "bad leader key") $ importPublic "f\t\167y\197\140\&2c.L\209;E\181\146\157\226\137\155$\GS(\189\215\SUB\199\r\158\224\FS\190|" | 158 | false | true | 0 | 8 | 14 | 31 | 17 | 14 | null | null |
haskell-distributed/distributed-process-platform | src/Control/Distributed/Process/Platform/Service/Monitoring.hs | bsd-3-clause | -- | The @MxAgentId@ for the node monitoring agent.
nodeMonitorAgentId :: MxAgentId
nodeMonitorAgentId = MxAgentId "service.monitoring.nodes" | 141 | nodeMonitorAgentId :: MxAgentId
nodeMonitorAgentId = MxAgentId "service.monitoring.nodes" | 89 | nodeMonitorAgentId = MxAgentId "service.monitoring.nodes" | 57 | true | true | 0 | 6 | 15 | 21 | 9 | 12 | null | null |
donnie4w/tim | protocols/gen-hs/ITim_Client.hs | apache-2.0 | timMessageList (ip,op) arg_mbeanList = do
send_timMessageList op arg_mbeanList | 80 | timMessageList (ip,op) arg_mbeanList = do
send_timMessageList op arg_mbeanList | 80 | timMessageList (ip,op) arg_mbeanList = do
send_timMessageList op arg_mbeanList | 80 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
ThoughtLeadr/Riak-Haskell-HTTP-Client | src/Network/Riak/HTTP/JSON.hs | bsd-3-clause | tryPutWithIndexes :: (ToJSON v) => [Client] -> Bucket -> Key -> [IndexTag]
-> v -> IO (Either String ())
tryPutWithIndexes clients bucket key indexTags value = tryClients clients $
\client -> putWithIndexes client bucket key indexTags value | 262 | tryPutWithIndexes :: (ToJSON v) => [Client] -> Bucket -> Key -> [IndexTag]
-> v -> IO (Either String ())
tryPutWithIndexes clients bucket key indexTags value = tryClients clients $
\client -> putWithIndexes client bucket key indexTags value | 262 | tryPutWithIndexes clients bucket key indexTags value = tryClients clients $
\client -> putWithIndexes client bucket key indexTags value | 139 | false | true | 0 | 14 | 58 | 93 | 47 | 46 | null | null |
jpotecki/LogicTableauChecker | test/FormulaTest.hs | bsd-3-clause | disjGen :: Int -> Gen (Fmla)
disjGen n = Disjunction <$> fmlaGen' n <*> fmlaGen' n | 83 | disjGen :: Int -> Gen (Fmla)
disjGen n = Disjunction <$> fmlaGen' n <*> fmlaGen' n | 83 | disjGen n = Disjunction <$> fmlaGen' n <*> fmlaGen' n | 53 | false | true | 0 | 7 | 16 | 38 | 18 | 20 | null | null |
zenhack/haskell-capnp | tests/Module/Capnp/Pointer.hs | mit | arbitraryI32, arbitraryI30, arbitraryI29 :: Gen Int32
arbitraryI32 = arbitrary | 78 | arbitraryI32, arbitraryI30, arbitraryI29 :: Gen Int32
arbitraryI32 = arbitrary | 78 | arbitraryI32 = arbitrary | 24 | false | true | 0 | 5 | 8 | 18 | 11 | 7 | null | null |
huggablemonad/smooch | app/src/Ctxt.hs | gpl-3.0 | tshow :: Int -> Text
tshow = T.pack . show | 42 | tshow :: Int -> Text
tshow = T.pack . show | 42 | tshow = T.pack . show | 21 | false | true | 1 | 7 | 9 | 29 | 12 | 17 | null | null |
dolio/irc-core | src/Client/View/Palette.hs | isc | colorBox :: Int -> [Image']
colorBox start =
[ indent $ columns
[ mconcat
[ colorBlock showPadHex k (Color240 (fromIntegral (k - 16)))
| k <- [j, j+6 .. j + 30 ] ]
| j <- [i, i + 0x24, i + 0x48 ]
]
| i <- [ start .. start + 5 ]
] | 273 | colorBox :: Int -> [Image']
colorBox start =
[ indent $ columns
[ mconcat
[ colorBlock showPadHex k (Color240 (fromIntegral (k - 16)))
| k <- [j, j+6 .. j + 30 ] ]
| j <- [i, i + 0x24, i + 0x48 ]
]
| i <- [ start .. start + 5 ]
] | 273 | colorBox start =
[ indent $ columns
[ mconcat
[ colorBlock showPadHex k (Color240 (fromIntegral (k - 16)))
| k <- [j, j+6 .. j + 30 ] ]
| j <- [i, i + 0x24, i + 0x48 ]
]
| i <- [ start .. start + 5 ]
] | 245 | false | true | 0 | 17 | 100 | 134 | 72 | 62 | null | null |
geocurnoff/nikki | src/Sorts/Robots/PathRobots/Configuration.hs | lgpl-3.0 | -- * platforms
-- | The mass of platforms.
-- (gravity has no effect on platforms
platformMass :: CpFloat = nikkiMass * 3.5 | 124 | platformMass :: CpFloat = nikkiMass * 3.5 | 41 | platformMass :: CpFloat = nikkiMass * 3.5 | 41 | true | false | 0 | 6 | 23 | 22 | 11 | 11 | null | null |
beni55/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/Prim.hs | bsd-3-clause | -- | Write a vector to specified index of mutable array of scalars; offset is in scalar elements.
writeInt8ArrayAsInt8X32# :: MutableByteArray# s -> Int# -> Int8X32# -> State# s -> State# s
writeInt8ArrayAsInt8X32# = let x = x in x | 233 | writeInt8ArrayAsInt8X32# :: MutableByteArray# s -> Int# -> Int8X32# -> State# s -> State# s
writeInt8ArrayAsInt8X32# = let x = x in x | 133 | writeInt8ArrayAsInt8X32# = let x = x in x | 41 | true | true | 0 | 10 | 41 | 54 | 24 | 30 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/Resource/YouTube/ChannelSections/List.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
cslUploadType :: Lens' ChannelSectionsList (Maybe Text)
cslUploadType
= lens _cslUploadType
(\ s a -> s{_cslUploadType = a}) | 203 | cslUploadType :: Lens' ChannelSectionsList (Maybe Text)
cslUploadType
= lens _cslUploadType
(\ s a -> s{_cslUploadType = a}) | 132 | cslUploadType
= lens _cslUploadType
(\ s a -> s{_cslUploadType = a}) | 76 | true | true | 1 | 9 | 34 | 52 | 25 | 27 | null | null |
ShivanKaul/gitmail | github/src/GitMail/OAuth.hs | mit | accessTokenUrl = "https://github.com/login/oauth/access_token" | 62 | accessTokenUrl = "https://github.com/login/oauth/access_token" | 62 | accessTokenUrl = "https://github.com/login/oauth/access_token" | 62 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
guoguo12/haskell-ptable | ptable.hs | apache-2.0 | anum "Cm" = 96 | 14 | anum "Cm" = 96 | 14 | anum "Cm" = 96 | 14 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
brendanhay/gogol | gogol-alertcenter/gen/Network/Google/AlertCenter/Types/Product.hs | mpl-2.0 | -- | Optional. The data associated with this alert, for example
-- google.apps.alertcenter.type.DeviceCompromised.
aData :: Lens' Alert (Maybe AlertData)
aData = lens _aData (\ s a -> s{_aData = a}) | 198 | aData :: Lens' Alert (Maybe AlertData)
aData = lens _aData (\ s a -> s{_aData = a}) | 83 | aData = lens _aData (\ s a -> s{_aData = a}) | 44 | true | true | 0 | 9 | 29 | 47 | 26 | 21 | null | null |
ribag/ganeti-experiments | src/Ganeti/Confd/Server.hs | gpl-2.0 | -- | Unknown entry standard response.
queryUnknownEntry :: StatusAnswer
queryUnknownEntry = (ReplyStatusError, J.showJSON ConfdErrorUnknownEntry) | 145 | queryUnknownEntry :: StatusAnswer
queryUnknownEntry = (ReplyStatusError, J.showJSON ConfdErrorUnknownEntry) | 107 | queryUnknownEntry = (ReplyStatusError, J.showJSON ConfdErrorUnknownEntry) | 73 | true | true | 0 | 8 | 13 | 30 | 14 | 16 | null | null |
mattneary/tux | src/Main.hs | mit | unlinkWorkspaceWindow w = unlinkWindow (windowTarget "workspace" w) | 67 | unlinkWorkspaceWindow w = unlinkWindow (windowTarget "workspace" w) | 67 | unlinkWorkspaceWindow w = unlinkWindow (windowTarget "workspace" w) | 67 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
skill-lang/skill | deps/haskell/WriteFields.hs | bsd-3-clause | p'f'd ((GFArray v) : r_d) = mapM_ (\(GFArray v) -> p'f'd v) ((GFArray v) : r_d) | 81 | p'f'd ((GFArray v) : r_d) = mapM_ (\(GFArray v) -> p'f'd v) ((GFArray v) : r_d) | 81 | p'f'd ((GFArray v) : r_d) = mapM_ (\(GFArray v) -> p'f'd v) ((GFArray v) : r_d) | 81 | false | false | 0 | 9 | 17 | 57 | 29 | 28 | null | null |
poiuj/pfcc | src/Parser.hs | bsd-3-clause | parseExpr :: String -> Either ParseError Expr
parseExpr = parseWith expr | 72 | parseExpr :: String -> Either ParseError Expr
parseExpr = parseWith expr | 72 | parseExpr = parseWith expr | 26 | false | true | 0 | 7 | 10 | 28 | 12 | 16 | null | null |
olsner/ghc | compiler/iface/ToIface.hs | bsd-3-clause | toIfaceCoercion (TransCo co1 co2) = IfaceTransCo (toIfaceCoercion co1)
(toIfaceCoercion co2) | 145 | toIfaceCoercion (TransCo co1 co2) = IfaceTransCo (toIfaceCoercion co1)
(toIfaceCoercion co2) | 145 | toIfaceCoercion (TransCo co1 co2) = IfaceTransCo (toIfaceCoercion co1)
(toIfaceCoercion co2) | 145 | false | false | 0 | 7 | 62 | 34 | 16 | 18 | null | null |
np/lens | src/Control/Lens/Wrapped.hs | bsd-3-clause | getRecConError :: RecConError -> String
getRecConError (RecConError x) = x | 74 | getRecConError :: RecConError -> String
getRecConError (RecConError x) = x | 74 | getRecConError (RecConError x) = x | 34 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
romanb/amazonka | amazonka-rds/gen/Network/AWS/RDS/RebootDBInstance.hs | mpl-2.0 | -- | The DB instance identifier. This parameter is stored as a lowercase string.
--
-- Constraints:
--
-- Must contain from 1 to 63 alphanumeric characters or hyphens First
-- character must be a letter Cannot end with a hyphen or contain two
-- consecutive hyphens
rdbiDBInstanceIdentifier :: Lens' RebootDBInstance Text
rdbiDBInstanceIdentifier =
lens _rdbiDBInstanceIdentifier
(\s a -> s { _rdbiDBInstanceIdentifier = a }) | 437 | rdbiDBInstanceIdentifier :: Lens' RebootDBInstance Text
rdbiDBInstanceIdentifier =
lens _rdbiDBInstanceIdentifier
(\s a -> s { _rdbiDBInstanceIdentifier = a }) | 171 | rdbiDBInstanceIdentifier =
lens _rdbiDBInstanceIdentifier
(\s a -> s { _rdbiDBInstanceIdentifier = a }) | 115 | true | true | 0 | 9 | 76 | 46 | 28 | 18 | null | null |
martinvlk/cabal | cabal-install/Distribution/Client/Sandbox.hs | bsd-3-clause | updateInstallDirs :: Flag Bool
-> (UseSandbox, SavedConfig) -> (UseSandbox, SavedConfig)
updateInstallDirs userInstallFlag (useSandbox, savedConfig) =
case useSandbox of
NoSandbox ->
let savedConfig' = savedConfig {
savedConfigureFlags = configureFlags {
configInstallDirs = installDirs
}
}
in (useSandbox, savedConfig')
_ -> (useSandbox, savedConfig)
where
configureFlags = savedConfigureFlags savedConfig
userInstallDirs = savedUserInstallDirs savedConfig
globalInstallDirs = savedGlobalInstallDirs savedConfig
installDirs | userInstall = userInstallDirs
| otherwise = globalInstallDirs
userInstall = fromFlagOrDefault defaultUserInstall
(configUserInstall configureFlags `mappend` userInstallFlag)
-- | Check which type of package environment we're in and return a
-- correctly-initialised @SavedConfig@ and a @UseSandbox@ value that indicates
-- whether we're working in a sandbox. | 1,034 | updateInstallDirs :: Flag Bool
-> (UseSandbox, SavedConfig) -> (UseSandbox, SavedConfig)
updateInstallDirs userInstallFlag (useSandbox, savedConfig) =
case useSandbox of
NoSandbox ->
let savedConfig' = savedConfig {
savedConfigureFlags = configureFlags {
configInstallDirs = installDirs
}
}
in (useSandbox, savedConfig')
_ -> (useSandbox, savedConfig)
where
configureFlags = savedConfigureFlags savedConfig
userInstallDirs = savedUserInstallDirs savedConfig
globalInstallDirs = savedGlobalInstallDirs savedConfig
installDirs | userInstall = userInstallDirs
| otherwise = globalInstallDirs
userInstall = fromFlagOrDefault defaultUserInstall
(configUserInstall configureFlags `mappend` userInstallFlag)
-- | Check which type of package environment we're in and return a
-- correctly-initialised @SavedConfig@ and a @UseSandbox@ value that indicates
-- whether we're working in a sandbox. | 1,034 | updateInstallDirs userInstallFlag (useSandbox, savedConfig) =
case useSandbox of
NoSandbox ->
let savedConfig' = savedConfig {
savedConfigureFlags = configureFlags {
configInstallDirs = installDirs
}
}
in (useSandbox, savedConfig')
_ -> (useSandbox, savedConfig)
where
configureFlags = savedConfigureFlags savedConfig
userInstallDirs = savedUserInstallDirs savedConfig
globalInstallDirs = savedGlobalInstallDirs savedConfig
installDirs | userInstall = userInstallDirs
| otherwise = globalInstallDirs
userInstall = fromFlagOrDefault defaultUserInstall
(configUserInstall configureFlags `mappend` userInstallFlag)
-- | Check which type of package environment we're in and return a
-- correctly-initialised @SavedConfig@ and a @UseSandbox@ value that indicates
-- whether we're working in a sandbox. | 927 | false | true | 7 | 15 | 248 | 170 | 93 | 77 | null | null |
reckbo/ppl | pipeline-lib/FSL.hs | bsd-3-clause | writebval :: FilePath -> [BValue] -> Action ()
writebval out arr = writeFile' out (unwords . map show $ arr) | 108 | writebval :: FilePath -> [BValue] -> Action ()
writebval out arr = writeFile' out (unwords . map show $ arr) | 108 | writebval out arr = writeFile' out (unwords . map show $ arr) | 61 | false | true | 0 | 9 | 19 | 55 | 26 | 29 | null | null |
asr/fotc | src/utils/many-axioms/ManyAxioms.hs | mit | main ∷ IO ()
main = do
header
mapM_ variable [1..totalVar]
putStr "\n"
mapM_ axiom [1..(totalVar -1)]
footer totalVar | 130 | main ∷ IO ()
main = do
header
mapM_ variable [1..totalVar]
putStr "\n"
mapM_ axiom [1..(totalVar -1)]
footer totalVar | 130 | main = do
header
mapM_ variable [1..totalVar]
putStr "\n"
mapM_ axiom [1..(totalVar -1)]
footer totalVar | 117 | false | true | 0 | 10 | 31 | 64 | 29 | 35 | null | null |
lspitzner/brittany | source/library/Language/Haskell/Brittany/Internal/PreludeUtils.hs | agpl-3.0 | errorIfNote (Just x) = error x | 30 | errorIfNote (Just x) = error x | 30 | errorIfNote (Just x) = error x | 30 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles | Monoid_Semigroup/Madness.hs | gpl-3.0 | -- Now you’re going to refactor this code a bit! Rewrite it using
-- mconcat.
madlibbinBetter' :: Exclamation
-> Adverb
-> Noun
-> Adjective
-> String
madlibbinBetter' e adv noun adj =
mconcat
[ e,
"! he said ",
adv,
" as he jumped into his car ",
noun,
" and drove off with his ",
adj,
" wife."
] | 438 | madlibbinBetter' :: Exclamation
-> Adverb
-> Noun
-> Adjective
-> String
madlibbinBetter' e adv noun adj =
mconcat
[ e,
"! he said ",
adv,
" as he jumped into his car ",
noun,
" and drove off with his ",
adj,
" wife."
] | 360 | madlibbinBetter' e adv noun adj =
mconcat
[ e,
"! he said ",
adv,
" as he jumped into his car ",
noun,
" and drove off with his ",
adj,
" wife."
] | 219 | true | true | 0 | 8 | 200 | 65 | 37 | 28 | null | null |
rahulmutt/ghcvm | compiler/Eta/SimplCore/SAT.hs | bsd-3-clause | emptyIdSATInfo :: IdSATInfo
emptyIdSATInfo = emptyUFM | 53 | emptyIdSATInfo :: IdSATInfo
emptyIdSATInfo = emptyUFM | 53 | emptyIdSATInfo = emptyUFM | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110428set4.hs | gpl-3.0 | sets :: [Int]
sets = [102,103..110] | 35 | sets :: [Int]
sets = [102,103..110] | 35 | sets = [102,103..110] | 21 | false | true | 0 | 5 | 5 | 22 | 13 | 9 | null | null |
Toxaris/pandoc-lit | src/Text/Pandoc/Lit.hs | bsd-3-clause | processProcessIncludes x
= x | 30 | processProcessIncludes x
= x | 30 | processProcessIncludes x
= x | 30 | false | false | 1 | 5 | 5 | 13 | 4 | 9 | null | null |
DavidAlphaFox/ghc | utils/haddock/html-test/src/Bug26.hs | bsd-3-clause | -- | Foo
--
-- @since 2.10.7
--
-- @since 2.10.8
f :: ()
f = () | 63 | f :: ()
f = () | 14 | f = () | 6 | true | true | 0 | 7 | 16 | 27 | 14 | 13 | null | null |
urbanslug/ghc | compiler/prelude/THNames.hs | bsd-3-clause | -- data Con = ...
normalCIdKey, recCIdKey, infixCIdKey, forallCIdKey :: Unique
normalCIdKey = mkPreludeMiscIdUnique 370 | 124 | normalCIdKey, recCIdKey, infixCIdKey, forallCIdKey :: Unique
normalCIdKey = mkPreludeMiscIdUnique 370 | 106 | normalCIdKey = mkPreludeMiscIdUnique 370 | 45 | true | true | 5 | 5 | 19 | 32 | 14 | 18 | null | null |
mcschroeder/ghc | compiler/hsSyn/HsPat.hs | bsd-3-clause | conPatNeedsParens :: HsConDetails a b -> Bool
conPatNeedsParens (PrefixCon args) = not (null args) | 98 | conPatNeedsParens :: HsConDetails a b -> Bool
conPatNeedsParens (PrefixCon args) = not (null args) | 98 | conPatNeedsParens (PrefixCon args) = not (null args) | 52 | false | true | 0 | 7 | 13 | 38 | 18 | 20 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs | bsd-3-clause | gl_REPLICATE_BORDER :: GLenum
gl_REPLICATE_BORDER = 0x8153 | 58 | gl_REPLICATE_BORDER :: GLenum
gl_REPLICATE_BORDER = 0x8153 | 58 | gl_REPLICATE_BORDER = 0x8153 | 28 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
exbb2/BlastItWithPiss | src/GtkBlast/Pasta.hs | gpl-3.0 | generatePastaGen NoPasta = do
E{..} <- ask
!postproc <- makePostProc
return $ mkFullGen $ \a b c -> fmap (TBPC False False) $
postproc a b c "" | 165 | generatePastaGen NoPasta = do
E{..} <- ask
!postproc <- makePostProc
return $ mkFullGen $ \a b c -> fmap (TBPC False False) $
postproc a b c "" | 165 | generatePastaGen NoPasta = do
E{..} <- ask
!postproc <- makePostProc
return $ mkFullGen $ \a b c -> fmap (TBPC False False) $
postproc a b c "" | 165 | false | false | 0 | 12 | 49 | 74 | 34 | 40 | null | null |
michaxm/haskell-hdfs-thrift-client | src-gen-thrift/ThriftHadoopFileSystem.hs | bsd-3-clause | process_closeWriteHandle (seqid, iprot, oprot, handler) = do
args <- read_CloseWriteHandle_args iprot
(X.catch
(X.catch
(do
val <- Iface.closeWriteHandle handler (closeWriteHandle_args_out args)
let res = default_CloseWriteHandle_result{closeWriteHandle_result_success = val}
T.writeMessageBegin oprot ("closeWriteHandle", T.M_REPLY, seqid)
write_CloseWriteHandle_result oprot res
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot))
(\e -> do
let res = default_CloseWriteHandle_result{closeWriteHandle_result_ouch = P.Just e}
T.writeMessageBegin oprot ("closeWriteHandle", T.M_REPLY, seqid)
write_CloseWriteHandle_result oprot res
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot)))
((\_ -> do
T.writeMessageBegin oprot ("closeWriteHandle", T.M_EXCEPTION, seqid)
T.writeAppExn oprot (T.AppExn T.AE_UNKNOWN "")
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot)) :: X.SomeException -> P.IO ())) | 1,046 | process_closeWriteHandle (seqid, iprot, oprot, handler) = do
args <- read_CloseWriteHandle_args iprot
(X.catch
(X.catch
(do
val <- Iface.closeWriteHandle handler (closeWriteHandle_args_out args)
let res = default_CloseWriteHandle_result{closeWriteHandle_result_success = val}
T.writeMessageBegin oprot ("closeWriteHandle", T.M_REPLY, seqid)
write_CloseWriteHandle_result oprot res
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot))
(\e -> do
let res = default_CloseWriteHandle_result{closeWriteHandle_result_ouch = P.Just e}
T.writeMessageBegin oprot ("closeWriteHandle", T.M_REPLY, seqid)
write_CloseWriteHandle_result oprot res
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot)))
((\_ -> do
T.writeMessageBegin oprot ("closeWriteHandle", T.M_EXCEPTION, seqid)
T.writeAppExn oprot (T.AppExn T.AE_UNKNOWN "")
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot)) :: X.SomeException -> P.IO ())) | 1,046 | process_closeWriteHandle (seqid, iprot, oprot, handler) = do
args <- read_CloseWriteHandle_args iprot
(X.catch
(X.catch
(do
val <- Iface.closeWriteHandle handler (closeWriteHandle_args_out args)
let res = default_CloseWriteHandle_result{closeWriteHandle_result_success = val}
T.writeMessageBegin oprot ("closeWriteHandle", T.M_REPLY, seqid)
write_CloseWriteHandle_result oprot res
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot))
(\e -> do
let res = default_CloseWriteHandle_result{closeWriteHandle_result_ouch = P.Just e}
T.writeMessageBegin oprot ("closeWriteHandle", T.M_REPLY, seqid)
write_CloseWriteHandle_result oprot res
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot)))
((\_ -> do
T.writeMessageBegin oprot ("closeWriteHandle", T.M_EXCEPTION, seqid)
T.writeAppExn oprot (T.AppExn T.AE_UNKNOWN "")
T.writeMessageEnd oprot
T.tFlush (T.getTransport oprot)) :: X.SomeException -> P.IO ())) | 1,046 | false | false | 0 | 21 | 221 | 324 | 157 | 167 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M10/D26/Solution.hs | mit | mirt [] = [] | 12 | mirt [] = [] | 12 | mirt [] = [] | 12 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
urbanslug/ghc | compiler/typecheck/TcGenGenerics.hs | bsd-3-clause | mkProd_E :: GenericKind_DC -- Generic or Generic1?
-> US -- Base for unique names
-> [(RdrName, Type)] -- List of variables matched on the lhs and their types
-> LHsExpr RdrName -- Resulting product expression
mkProd_E _ _ [] = mkM1_E (nlHsVar u1DataCon_RDR) | 309 | mkProd_E :: GenericKind_DC -- Generic or Generic1?
-> US -- Base for unique names
-> [(RdrName, Type)] -- List of variables matched on the lhs and their types
-> LHsExpr RdrName
mkProd_E _ _ [] = mkM1_E (nlHsVar u1DataCon_RDR) | 277 | mkProd_E _ _ [] = mkM1_E (nlHsVar u1DataCon_RDR) | 54 | true | true | 0 | 10 | 93 | 62 | 32 | 30 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | airDamage ZergDevourer = 25 | 27 | airDamage ZergDevourer = 25 | 27 | airDamage ZergDevourer = 25 | 27 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
paulbarbu/haskell-ground | modifiable_lists.hs | apache-2.0 | replaceNamedIndex env name (i:is) val = case lookup name env of
Nothing -> trace ("not found " ++ name) env
Just (List l) -> (name, List $ replace i (List $ replaceValueIndex (l !! i) is val) l):env | 206 | replaceNamedIndex env name (i:is) val = case lookup name env of
Nothing -> trace ("not found " ++ name) env
Just (List l) -> (name, List $ replace i (List $ replaceValueIndex (l !! i) is val) l):env | 206 | replaceNamedIndex env name (i:is) val = case lookup name env of
Nothing -> trace ("not found " ++ name) env
Just (List l) -> (name, List $ replace i (List $ replaceValueIndex (l !! i) is val) l):env | 206 | false | false | 4 | 11 | 45 | 102 | 52 | 50 | null | null |
kalhauge/vagnplayer | src/Control/Sound.hs | mit | randomElement :: [a] -> IO a
randomElement as = do
index <- getStdRandom $ randomR (0, size -1)
return $ as !! index
where size = length as | 149 | randomElement :: [a] -> IO a
randomElement as = do
index <- getStdRandom $ randomR (0, size -1)
return $ as !! index
where size = length as | 149 | randomElement as = do
index <- getStdRandom $ randomR (0, size -1)
return $ as !! index
where size = length as | 120 | false | true | 0 | 11 | 37 | 70 | 34 | 36 | null | null |
QuickChick/Luck | luck/src/Outer/Types.hs | mit | putTc :: OTcEnv' -> TcMonad ()
putTc = modifyTc . const | 55 | putTc :: OTcEnv' -> TcMonad ()
putTc = modifyTc . const | 55 | putTc = modifyTc . const | 24 | false | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
spechub/Hets | GUI/hets_cgi.hs | gpl-2.0 | anaInput :: String -> SelectedBoxes -> FilePath
-> IO (CRes.Result Output)
anaInput contents selectedBoxes outputfiles = do
CRes.Result _ (Just (ast : _)) <- runResultT
$ readLibDefn logicGraph webOpts Nothing "<stdin>" "<stdin>" contents
CRes.Result ds mres <- runResultT
$ anaLibDefn logicGraph webOpts Set.empty emptyLibEnv emptyDG ast ""
let ds1 = filter diagFilter ds
if CRes.hasErrors ds1 then return $ CRes.Result ds1 Nothing else
maybe (return $ CRes.Result ds1 Nothing)
(\ res -> do
saveLog (archive selectedBoxes)
process_result ds1 res outputfiles selectedBoxes)
mres
where
diagFilter d = case CRes.diagKind d of
CRes.Hint -> False
CRes.Debug -> False
_ -> True
process_result :: [CRes.Diagnosis]
-> (LibName, LIB_DEFN, GlobalAnnos, LibEnv)
-> FilePath
-> SelectedBoxes
-> IO (CRes.Result Output)
process_result ds (_, libDefn, gannos, _) outputfile conf = do
let fMode = foldl unionFileModes nullFileMode
[ownerReadMode, ownerWriteMode,
groupReadMode, groupWriteMode,
otherReadMode]
when (outputTex conf) $ do
let pptexFile = outputfile ++ ".pp.tex"
latexFile = outputfile ++ ".tex"
pdfFile = outputfile ++ ".pdf"
tmpFile = outputfile ++ ".tmp"
writeLibDefnLatex logicGraph False gannos pptexFile libDefn
writeFile latexFile (latexHeader ++
"\\input{" ++ pptexFile ++
"}\n \\end{document}\n")
setFileMode pptexFile fMode
setFileMode latexFile fMode
system ("(cd " ++ baseDirGenerated ++ " ; ls -lh " ++
pdflatexCmd ++ " ; " ++ pdflatexCmd ++ " " ++
latexFile ++ ") > " ++ tmpFile)
setFileMode pdfFile fMode
when (outputTxt conf) $ do
let txtFile = outputfile ++ ".txt"
writeFile txtFile $ show (renderText gannos $
prettyLG logicGraph libDefn) ++ "\n"
setFileMode txtFile fMode
when (outputTree conf) $ do
let txtFile = outputfile ++ ".pp.xml"
writeFile txtFile . ppTopElement
$ xmlLibDefn logicGraph gannos libDefn
setFileMode txtFile fMode
return (CRes.Result ds $ Just $ selectOut conf libDefn gannos)
selectOut :: SelectedBoxes -> LIB_DEFN -> GlobalAnnos -> Output
selectOut conf ld ga = defaultOutput
{ asciiTxt = if outputTxt conf
then show $ renderText ga $ prettyLG logicGraph ld else ""
, parseTree = if outputTree conf
then ppElement $ xmlLibDefn logicGraph ga ld else "" }
-- log file
saveLog :: Bool -> IO ()
saveLog willSave = when willSave $ do
fd <- openFd logFile ReadWrite Nothing
defaultFileFlags {append = True}
fSize <- sizeof fd
let filelock = (WriteLock, AbsoluteSeek, 0, fSize)
fileunlock = (Unlock, AbsoluteSeek, 0, fSize)
aktTime <- timeStamp
setLock fd filelock
fdWrite fd (aktTime ++ "\n" ++ contents ++ "\n\n")
setLock fd fileunlock
closeFd fd
timeStamp :: IO String
timeStamp = do
t <- getClockTime
ct <- toCalendarTime t
return $ calendarTimeToString ct
sizeof :: Fd -> IO FileOffset
sizeof fd = do
fstatus <- getFdStatus fd
return $ fileSize fstatus
-- Print the result | 4,039 | anaInput :: String -> SelectedBoxes -> FilePath
-> IO (CRes.Result Output)
anaInput contents selectedBoxes outputfiles = do
CRes.Result _ (Just (ast : _)) <- runResultT
$ readLibDefn logicGraph webOpts Nothing "<stdin>" "<stdin>" contents
CRes.Result ds mres <- runResultT
$ anaLibDefn logicGraph webOpts Set.empty emptyLibEnv emptyDG ast ""
let ds1 = filter diagFilter ds
if CRes.hasErrors ds1 then return $ CRes.Result ds1 Nothing else
maybe (return $ CRes.Result ds1 Nothing)
(\ res -> do
saveLog (archive selectedBoxes)
process_result ds1 res outputfiles selectedBoxes)
mres
where
diagFilter d = case CRes.diagKind d of
CRes.Hint -> False
CRes.Debug -> False
_ -> True
process_result :: [CRes.Diagnosis]
-> (LibName, LIB_DEFN, GlobalAnnos, LibEnv)
-> FilePath
-> SelectedBoxes
-> IO (CRes.Result Output)
process_result ds (_, libDefn, gannos, _) outputfile conf = do
let fMode = foldl unionFileModes nullFileMode
[ownerReadMode, ownerWriteMode,
groupReadMode, groupWriteMode,
otherReadMode]
when (outputTex conf) $ do
let pptexFile = outputfile ++ ".pp.tex"
latexFile = outputfile ++ ".tex"
pdfFile = outputfile ++ ".pdf"
tmpFile = outputfile ++ ".tmp"
writeLibDefnLatex logicGraph False gannos pptexFile libDefn
writeFile latexFile (latexHeader ++
"\\input{" ++ pptexFile ++
"}\n \\end{document}\n")
setFileMode pptexFile fMode
setFileMode latexFile fMode
system ("(cd " ++ baseDirGenerated ++ " ; ls -lh " ++
pdflatexCmd ++ " ; " ++ pdflatexCmd ++ " " ++
latexFile ++ ") > " ++ tmpFile)
setFileMode pdfFile fMode
when (outputTxt conf) $ do
let txtFile = outputfile ++ ".txt"
writeFile txtFile $ show (renderText gannos $
prettyLG logicGraph libDefn) ++ "\n"
setFileMode txtFile fMode
when (outputTree conf) $ do
let txtFile = outputfile ++ ".pp.xml"
writeFile txtFile . ppTopElement
$ xmlLibDefn logicGraph gannos libDefn
setFileMode txtFile fMode
return (CRes.Result ds $ Just $ selectOut conf libDefn gannos)
selectOut :: SelectedBoxes -> LIB_DEFN -> GlobalAnnos -> Output
selectOut conf ld ga = defaultOutput
{ asciiTxt = if outputTxt conf
then show $ renderText ga $ prettyLG logicGraph ld else ""
, parseTree = if outputTree conf
then ppElement $ xmlLibDefn logicGraph ga ld else "" }
-- log file
saveLog :: Bool -> IO ()
saveLog willSave = when willSave $ do
fd <- openFd logFile ReadWrite Nothing
defaultFileFlags {append = True}
fSize <- sizeof fd
let filelock = (WriteLock, AbsoluteSeek, 0, fSize)
fileunlock = (Unlock, AbsoluteSeek, 0, fSize)
aktTime <- timeStamp
setLock fd filelock
fdWrite fd (aktTime ++ "\n" ++ contents ++ "\n\n")
setLock fd fileunlock
closeFd fd
timeStamp :: IO String
timeStamp = do
t <- getClockTime
ct <- toCalendarTime t
return $ calendarTimeToString ct
sizeof :: Fd -> IO FileOffset
sizeof fd = do
fstatus <- getFdStatus fd
return $ fileSize fstatus
-- Print the result | 4,039 | anaInput contents selectedBoxes outputfiles = do
CRes.Result _ (Just (ast : _)) <- runResultT
$ readLibDefn logicGraph webOpts Nothing "<stdin>" "<stdin>" contents
CRes.Result ds mres <- runResultT
$ anaLibDefn logicGraph webOpts Set.empty emptyLibEnv emptyDG ast ""
let ds1 = filter diagFilter ds
if CRes.hasErrors ds1 then return $ CRes.Result ds1 Nothing else
maybe (return $ CRes.Result ds1 Nothing)
(\ res -> do
saveLog (archive selectedBoxes)
process_result ds1 res outputfiles selectedBoxes)
mres
where
diagFilter d = case CRes.diagKind d of
CRes.Hint -> False
CRes.Debug -> False
_ -> True
process_result :: [CRes.Diagnosis]
-> (LibName, LIB_DEFN, GlobalAnnos, LibEnv)
-> FilePath
-> SelectedBoxes
-> IO (CRes.Result Output)
process_result ds (_, libDefn, gannos, _) outputfile conf = do
let fMode = foldl unionFileModes nullFileMode
[ownerReadMode, ownerWriteMode,
groupReadMode, groupWriteMode,
otherReadMode]
when (outputTex conf) $ do
let pptexFile = outputfile ++ ".pp.tex"
latexFile = outputfile ++ ".tex"
pdfFile = outputfile ++ ".pdf"
tmpFile = outputfile ++ ".tmp"
writeLibDefnLatex logicGraph False gannos pptexFile libDefn
writeFile latexFile (latexHeader ++
"\\input{" ++ pptexFile ++
"}\n \\end{document}\n")
setFileMode pptexFile fMode
setFileMode latexFile fMode
system ("(cd " ++ baseDirGenerated ++ " ; ls -lh " ++
pdflatexCmd ++ " ; " ++ pdflatexCmd ++ " " ++
latexFile ++ ") > " ++ tmpFile)
setFileMode pdfFile fMode
when (outputTxt conf) $ do
let txtFile = outputfile ++ ".txt"
writeFile txtFile $ show (renderText gannos $
prettyLG logicGraph libDefn) ++ "\n"
setFileMode txtFile fMode
when (outputTree conf) $ do
let txtFile = outputfile ++ ".pp.xml"
writeFile txtFile . ppTopElement
$ xmlLibDefn logicGraph gannos libDefn
setFileMode txtFile fMode
return (CRes.Result ds $ Just $ selectOut conf libDefn gannos)
selectOut :: SelectedBoxes -> LIB_DEFN -> GlobalAnnos -> Output
selectOut conf ld ga = defaultOutput
{ asciiTxt = if outputTxt conf
then show $ renderText ga $ prettyLG logicGraph ld else ""
, parseTree = if outputTree conf
then ppElement $ xmlLibDefn logicGraph ga ld else "" }
-- log file
saveLog :: Bool -> IO ()
saveLog willSave = when willSave $ do
fd <- openFd logFile ReadWrite Nothing
defaultFileFlags {append = True}
fSize <- sizeof fd
let filelock = (WriteLock, AbsoluteSeek, 0, fSize)
fileunlock = (Unlock, AbsoluteSeek, 0, fSize)
aktTime <- timeStamp
setLock fd filelock
fdWrite fd (aktTime ++ "\n" ++ contents ++ "\n\n")
setLock fd fileunlock
closeFd fd
timeStamp :: IO String
timeStamp = do
t <- getClockTime
ct <- toCalendarTime t
return $ calendarTimeToString ct
sizeof :: Fd -> IO FileOffset
sizeof fd = do
fstatus <- getFdStatus fd
return $ fileSize fstatus
-- Print the result | 3,955 | false | true | 62 | 20 | 1,653 | 793 | 425 | 368 | null | null |
markus-git/co-feldspar | src/Feldspar/Hardware/Primitive/Backend.hs | bsd-3-clause | compFactor :: [ASTF HardwarePrimDomain a] -> ([VHDL.Primary] -> VHDL.Factor) -> VHDL Kind
compFactor as f = do
as' <- mapM compKind as
return $ Hoist.F $ f $ map lift as' | 174 | compFactor :: [ASTF HardwarePrimDomain a] -> ([VHDL.Primary] -> VHDL.Factor) -> VHDL Kind
compFactor as f = do
as' <- mapM compKind as
return $ Hoist.F $ f $ map lift as' | 174 | compFactor as f = do
as' <- mapM compKind as
return $ Hoist.F $ f $ map lift as' | 84 | false | true | 0 | 10 | 34 | 83 | 40 | 43 | null | null |
martin-kolinek/stack | src/Stack/Types/Docker.hs | bsd-3-clause | dockerEnableArgName :: Text
dockerEnableArgName = "enable" | 58 | dockerEnableArgName :: Text
dockerEnableArgName = "enable" | 58 | dockerEnableArgName = "enable" | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
uuhan/Idris-dev | src/Idris/Elab/Record.hs | bsd-3-clause | recRef = PRef emptyFC [] recName | 32 | recRef = PRef emptyFC [] recName | 32 | recRef = PRef emptyFC [] recName | 32 | false | false | 0 | 6 | 5 | 15 | 7 | 8 | null | null |
thewoolleyman/haskellbook | 10/05/maor/folds.hs | unlicense | fivee :: String
fivee = foldr ((++) . show) "" [1..5] | 53 | fivee :: String
fivee = foldr ((++) . show) "" [1..5] | 53 | fivee = foldr ((++) . show) "" [1..5] | 37 | false | true | 0 | 7 | 10 | 32 | 18 | 14 | null | null |
KirinDave/Rag | src/Rag/Types.hs | bsd-3-clause | runHandler th state = runState (execWriterT th) state | 53 | runHandler th state = runState (execWriterT th) state | 53 | runHandler th state = runState (execWriterT th) state | 53 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/CanvasRenderingContext2D.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.createLinearGradient Mozilla CanvasRenderingContext2D.createLinearGradient documentation>
createLinearGradient_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
createLinearGradient_ self x0 y0 x1 y1
= liftDOM
(void
(self ^. jsf "createLinearGradient"
[toJSVal x0, toJSVal y0, toJSVal x1, toJSVal y1])) | 523 | createLinearGradient_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
createLinearGradient_ self x0 y0 x1 y1
= liftDOM
(void
(self ^. jsf "createLinearGradient"
[toJSVal x0, toJSVal y0, toJSVal x1, toJSVal y1])) | 352 | createLinearGradient_ self x0 y0 x1 y1
= liftDOM
(void
(self ^. jsf "createLinearGradient"
[toJSVal x0, toJSVal y0, toJSVal x1, toJSVal y1])) | 170 | true | true | 0 | 12 | 145 | 102 | 51 | 51 | null | null |
sopvop/snap | test/suite/Snap/Snaplet/Test/Common/App.hs | bsd-3-clause | ------------------------------------------------------------------------------
appInit' :: Bool -> Bool -> SnapletInit App App
appInit' hInterp authConfigFile =
makeSnaplet "app" "Test application" Nothing $ do
------------------------------
-- Initial subSnaplet setup --
------------------------------
hs <- nestSnaplet "heist" heist $
heistInit'
"templates"
(HeistConfig (mempty {_scCompiledSplices = compiledSplices}) "" True)
sm <- nestSnaplet "session" session $
initCookieSessionManager "sitekey.txt" "_session" Nothing (Just (30 * 60))
fs <- nestSnaplet "foo" foo $ fooInit hs
bs <- nestSnaplet "" bar $ nameSnaplet "baz" $ barInit hs foo
ns <- embedSnaplet "embed" embedded embeddedInit
--------------------------------
-- Exercise the Heist snaplet --
--------------------------------
addTemplates hs "extraTemplates"
when hInterp $ do
modifyHeistState (addTemplate "smallTemplate" aTestTemplate Nothing)
setInterpreted hs
_lens <- getLens
addConfig hs $
mempty { _scInterpretedSplices = do
"appsplice" ## textSplice "contents of the app splice"
"appconfig" ## shConfigSplice _lens
}
---------------------------
-- Exercise Auth snaplet --
---------------------------
authSettings <- if authConfigFile
then authSettingsFromConfig
else return defAuthSettings
au <- nestSnaplet "auth" auth $ authInit authSettings
addAuthSplices hs auth -- TODO/NOTE: probably not necessary (?)
addRoutes [ ("/hello", writeText "hello world")
, ("/routeWithSplice", routeWithSplice)
, ("/routeWithConfig", routeWithConfig)
, ("/public", serveDirectory "public")
, ("/sessionDemo", sessionDemo)
, ("/sessionTest", sessionTest)
]
wrapSite (<|> heistServe)
return $ App hs (over snapletValue fooMod fs) au bs sm ns
------------------------------------------------------------------------------
-- Alternative authInit for tunable settings | 2,141 | appInit' :: Bool -> Bool -> SnapletInit App App
appInit' hInterp authConfigFile =
makeSnaplet "app" "Test application" Nothing $ do
------------------------------
-- Initial subSnaplet setup --
------------------------------
hs <- nestSnaplet "heist" heist $
heistInit'
"templates"
(HeistConfig (mempty {_scCompiledSplices = compiledSplices}) "" True)
sm <- nestSnaplet "session" session $
initCookieSessionManager "sitekey.txt" "_session" Nothing (Just (30 * 60))
fs <- nestSnaplet "foo" foo $ fooInit hs
bs <- nestSnaplet "" bar $ nameSnaplet "baz" $ barInit hs foo
ns <- embedSnaplet "embed" embedded embeddedInit
--------------------------------
-- Exercise the Heist snaplet --
--------------------------------
addTemplates hs "extraTemplates"
when hInterp $ do
modifyHeistState (addTemplate "smallTemplate" aTestTemplate Nothing)
setInterpreted hs
_lens <- getLens
addConfig hs $
mempty { _scInterpretedSplices = do
"appsplice" ## textSplice "contents of the app splice"
"appconfig" ## shConfigSplice _lens
}
---------------------------
-- Exercise Auth snaplet --
---------------------------
authSettings <- if authConfigFile
then authSettingsFromConfig
else return defAuthSettings
au <- nestSnaplet "auth" auth $ authInit authSettings
addAuthSplices hs auth -- TODO/NOTE: probably not necessary (?)
addRoutes [ ("/hello", writeText "hello world")
, ("/routeWithSplice", routeWithSplice)
, ("/routeWithConfig", routeWithConfig)
, ("/public", serveDirectory "public")
, ("/sessionDemo", sessionDemo)
, ("/sessionTest", sessionTest)
]
wrapSite (<|> heistServe)
return $ App hs (over snapletValue fooMod fs) au bs sm ns
------------------------------------------------------------------------------
-- Alternative authInit for tunable settings | 2,062 | appInit' hInterp authConfigFile =
makeSnaplet "app" "Test application" Nothing $ do
------------------------------
-- Initial subSnaplet setup --
------------------------------
hs <- nestSnaplet "heist" heist $
heistInit'
"templates"
(HeistConfig (mempty {_scCompiledSplices = compiledSplices}) "" True)
sm <- nestSnaplet "session" session $
initCookieSessionManager "sitekey.txt" "_session" Nothing (Just (30 * 60))
fs <- nestSnaplet "foo" foo $ fooInit hs
bs <- nestSnaplet "" bar $ nameSnaplet "baz" $ barInit hs foo
ns <- embedSnaplet "embed" embedded embeddedInit
--------------------------------
-- Exercise the Heist snaplet --
--------------------------------
addTemplates hs "extraTemplates"
when hInterp $ do
modifyHeistState (addTemplate "smallTemplate" aTestTemplate Nothing)
setInterpreted hs
_lens <- getLens
addConfig hs $
mempty { _scInterpretedSplices = do
"appsplice" ## textSplice "contents of the app splice"
"appconfig" ## shConfigSplice _lens
}
---------------------------
-- Exercise Auth snaplet --
---------------------------
authSettings <- if authConfigFile
then authSettingsFromConfig
else return defAuthSettings
au <- nestSnaplet "auth" auth $ authInit authSettings
addAuthSplices hs auth -- TODO/NOTE: probably not necessary (?)
addRoutes [ ("/hello", writeText "hello world")
, ("/routeWithSplice", routeWithSplice)
, ("/routeWithConfig", routeWithConfig)
, ("/public", serveDirectory "public")
, ("/sessionDemo", sessionDemo)
, ("/sessionTest", sessionTest)
]
wrapSite (<|> heistServe)
return $ App hs (over snapletValue fooMod fs) au bs sm ns
------------------------------------------------------------------------------
-- Alternative authInit for tunable settings | 2,014 | true | true | 0 | 16 | 521 | 436 | 213 | 223 | null | null |
parsonsmatt/servant-persistent | src/Api/User.hs | mit | -- | The server that runs the UserAPI
userServer :: MonadIO m => ServerT UserAPI (AppT m)
userServer = allUsers :<|> singleUser :<|> createUser :<|> waiMetrics | 159 | userServer :: MonadIO m => ServerT UserAPI (AppT m)
userServer = allUsers :<|> singleUser :<|> createUser :<|> waiMetrics | 121 | userServer = allUsers :<|> singleUser :<|> createUser :<|> waiMetrics | 69 | true | true | 0 | 8 | 25 | 42 | 21 | 21 | null | null |
ununsept/lambdaHTTP | Engine.hs | mit | parsFields (x:xs) f = parsFields xs (foundField f x)
where
foundField :: Fields -> String -> Fields
foundField fields field = parsField fields (splitTwo ' ' field)
parsField :: Fields -> (String, String) -> Fields
parsField fields ("Host:", x) =
fields { hostField = Just x }
parsField fields ("Accept:", x) =
fields { acceptField = Just x }
parsField fields ("Accept-Charset:", x) =
fields { acceptCharsetField = Just x }
parsField fields ("Accept-Encoding:", x) =
fields { acceptEncodingField = Just x }
parsField fields ("Accept-Language:", x) =
fields { acceptLanguageField = Just x }
parsField fields ("Accept-Datetime:", x) =
fields { acceptDatetimeField = Just x }
parsField fields ("User-Agent:", x) =
fields { userAgentField = Just x }
parsField fields (_, _) = fields | 1,058 | parsFields (x:xs) f = parsFields xs (foundField f x)
where
foundField :: Fields -> String -> Fields
foundField fields field = parsField fields (splitTwo ' ' field)
parsField :: Fields -> (String, String) -> Fields
parsField fields ("Host:", x) =
fields { hostField = Just x }
parsField fields ("Accept:", x) =
fields { acceptField = Just x }
parsField fields ("Accept-Charset:", x) =
fields { acceptCharsetField = Just x }
parsField fields ("Accept-Encoding:", x) =
fields { acceptEncodingField = Just x }
parsField fields ("Accept-Language:", x) =
fields { acceptLanguageField = Just x }
parsField fields ("Accept-Datetime:", x) =
fields { acceptDatetimeField = Just x }
parsField fields ("User-Agent:", x) =
fields { userAgentField = Just x }
parsField fields (_, _) = fields | 1,058 | parsFields (x:xs) f = parsFields xs (foundField f x)
where
foundField :: Fields -> String -> Fields
foundField fields field = parsField fields (splitTwo ' ' field)
parsField :: Fields -> (String, String) -> Fields
parsField fields ("Host:", x) =
fields { hostField = Just x }
parsField fields ("Accept:", x) =
fields { acceptField = Just x }
parsField fields ("Accept-Charset:", x) =
fields { acceptCharsetField = Just x }
parsField fields ("Accept-Encoding:", x) =
fields { acceptEncodingField = Just x }
parsField fields ("Accept-Language:", x) =
fields { acceptLanguageField = Just x }
parsField fields ("Accept-Datetime:", x) =
fields { acceptDatetimeField = Just x }
parsField fields ("User-Agent:", x) =
fields { userAgentField = Just x }
parsField fields (_, _) = fields | 1,058 | false | false | 33 | 9 | 405 | 309 | 159 | 150 | null | null |
nomeata/ghc | compiler/cmm/PprC.hs | bsd-3-clause | floatComparison (MO_F_Ge _) = True | 36 | floatComparison (MO_F_Ge _) = True | 36 | floatComparison (MO_F_Ge _) = True | 36 | false | false | 0 | 7 | 6 | 15 | 7 | 8 | null | null |
fpco/stackage-curator | src/Stackage/CheckBuildPlan.hs | mit | -- | Check whether the package(s) occurs within its own dependency
-- tree.
occursCheck
:: Monad m
=> Map PackageName (Version,[PackageName])
-- ^ All packages.
-> (PackageName -> Maybe Version -> m ())
-- ^ Report an erroneous package.
-> PackageName
-- ^ Starting package to check for cycles in.
-> [PackageName]
-- ^ Dependencies of the package.
-> [PackageName]
-- ^ Previously seen packages up the dependency tree.
-> m ()
occursCheck allPackages reportError =
go
where
go pkg deps seen =
case find (flip elem seen) deps of
Just cyclic ->
reportError cyclic $
fmap fst (lookup cyclic allPackages)
Nothing ->
forM_ deps $
\pkg' ->
case lookup pkg' allPackages of
Just (_v,deps')
| pkg' /= pkg -> go pkg' deps' seen'
_ -> return ()
where seen' = pkg : seen | 1,075 | occursCheck
:: Monad m
=> Map PackageName (Version,[PackageName])
-- ^ All packages.
-> (PackageName -> Maybe Version -> m ())
-- ^ Report an erroneous package.
-> PackageName
-- ^ Starting package to check for cycles in.
-> [PackageName]
-- ^ Dependencies of the package.
-> [PackageName]
-- ^ Previously seen packages up the dependency tree.
-> m ()
occursCheck allPackages reportError =
go
where
go pkg deps seen =
case find (flip elem seen) deps of
Just cyclic ->
reportError cyclic $
fmap fst (lookup cyclic allPackages)
Nothing ->
forM_ deps $
\pkg' ->
case lookup pkg' allPackages of
Just (_v,deps')
| pkg' /= pkg -> go pkg' deps' seen'
_ -> return ()
where seen' = pkg : seen | 999 | occursCheck allPackages reportError =
go
where
go pkg deps seen =
case find (flip elem seen) deps of
Just cyclic ->
reportError cyclic $
fmap fst (lookup cyclic allPackages)
Nothing ->
forM_ deps $
\pkg' ->
case lookup pkg' allPackages of
Just (_v,deps')
| pkg' /= pkg -> go pkg' deps' seen'
_ -> return ()
where seen' = pkg : seen | 599 | true | true | 4 | 16 | 449 | 251 | 119 | 132 | null | null |
fokot/battleships | src/Battleships/GUI.hs | bsd-3-clause | -- hiding
getComputersPixbuf :: Cell -> IO Pixbuf
getComputersPixbuf cell = if cell == Boat || cell == Empty
then do pix Empty
else do pix cell
-- Main function | 215 | getComputersPixbuf :: Cell -> IO Pixbuf
getComputersPixbuf cell = if cell == Boat || cell == Empty
then do pix Empty
else do pix cell
-- Main function | 205 | getComputersPixbuf cell = if cell == Boat || cell == Empty
then do pix Empty
else do pix cell
-- Main function | 165 | true | true | 0 | 9 | 84 | 60 | 28 | 32 | null | null |
np/lens | tests/hunit.hs | bsd-3-clause | case_modify_record_field_and_access_old_value =
(trig & box.low.y <<%~ (+ 2))
@?= (0, trig { _box = (trig & _box)
{ _low = (trig & _box & _low)
{ _y = ((trig & _box & _low & _y) + 2) } } }) | 256 | case_modify_record_field_and_access_old_value =
(trig & box.low.y <<%~ (+ 2))
@?= (0, trig { _box = (trig & _box)
{ _low = (trig & _box & _low)
{ _y = ((trig & _box & _low & _y) + 2) } } }) | 256 | case_modify_record_field_and_access_old_value =
(trig & box.low.y <<%~ (+ 2))
@?= (0, trig { _box = (trig & _box)
{ _low = (trig & _box & _low)
{ _y = ((trig & _box & _low & _y) + 2) } } }) | 256 | false | false | 9 | 15 | 106 | 109 | 59 | 50 | null | null |
olsner/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Recursive-do notation
monadFixClassName, mfixName :: Name
monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey | 135 | monadFixClassName, mfixName :: Name
monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey | 110 | monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey | 74 | true | true | 0 | 7 | 14 | 27 | 15 | 12 | null | null |
spl/digits | src/Properties/EnumInt.hs | bsd-3-clause | fromIntDigits_eq :: (EnumIntDigits n) => n -> [n] -> Bool
fromIntDigits_eq base digits
| base < 2 = result == Nothing
| invalid = result == Nothing
| otherwise = result == Just number
where
result = fromIntDigits' base digits
illegal n = n < 0 || n >= base
invalid = null digits || any illegal digits
number = to base $ reverse digits | 361 | fromIntDigits_eq :: (EnumIntDigits n) => n -> [n] -> Bool
fromIntDigits_eq base digits
| base < 2 = result == Nothing
| invalid = result == Nothing
| otherwise = result == Just number
where
result = fromIntDigits' base digits
illegal n = n < 0 || n >= base
invalid = null digits || any illegal digits
number = to base $ reverse digits | 361 | fromIntDigits_eq base digits
| base < 2 = result == Nothing
| invalid = result == Nothing
| otherwise = result == Just number
where
result = fromIntDigits' base digits
illegal n = n < 0 || n >= base
invalid = null digits || any illegal digits
number = to base $ reverse digits | 303 | false | true | 2 | 8 | 91 | 140 | 69 | 71 | null | null |
brooksbp/P4 | src/Language/P4/Sema.hs | apache-2.0 | extractAaSEMA :: ActionArg -> [String]
extractAaSEMA (AaSEMA s) = [s] | 69 | extractAaSEMA :: ActionArg -> [String]
extractAaSEMA (AaSEMA s) = [s] | 69 | extractAaSEMA (AaSEMA s) = [s] | 30 | false | true | 0 | 7 | 9 | 30 | 16 | 14 | null | null |
ekmett/transformers | Control/Monad/Trans/Error.hs | bsd-3-clause | -- | Handle an error.
catchError :: (Monad m, Error e) =>
ErrorT e m a -- ^ the inner computation
-> (e -> ErrorT e m a) -- ^ a handler for errors in the inner
-- computation
-> ErrorT e m a
m `catchError` h = ErrorT $ do
a <- runErrorT m
case a of
Left l -> runErrorT (h l)
Right r -> return (Right r)
-- | Lift a @callCC@ operation to the new monad. | 441 | catchError :: (Monad m, Error e) =>
ErrorT e m a -- ^ the inner computation
-> (e -> ErrorT e m a) -- ^ a handler for errors in the inner
-- computation
-> ErrorT e m a
m `catchError` h = ErrorT $ do
a <- runErrorT m
case a of
Left l -> runErrorT (h l)
Right r -> return (Right r)
-- | Lift a @callCC@ operation to the new monad. | 419 | m `catchError` h = ErrorT $ do
a <- runErrorT m
case a of
Left l -> runErrorT (h l)
Right r -> return (Right r)
-- | Lift a @callCC@ operation to the new monad. | 186 | true | true | 1 | 14 | 169 | 130 | 63 | 67 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/ShallowDeepPlugin/BindChangeArgPass.hs | bsd-3-clause | changeArgBind (Rec bs) = do
(nrbs', rbs') <- changeArgBind' bs
return $ nrbs' ++ [Rec rbs'] | 95 | changeArgBind (Rec bs) = do
(nrbs', rbs') <- changeArgBind' bs
return $ nrbs' ++ [Rec rbs'] | 95 | changeArgBind (Rec bs) = do
(nrbs', rbs') <- changeArgBind' bs
return $ nrbs' ++ [Rec rbs'] | 95 | false | false | 0 | 9 | 19 | 49 | 23 | 26 | null | null |
cutsea110/tsr-test | Quote/Parser.hs | bsd-3-clause | parseFrame :: PktHdr -> ByteString -> Quote
parseFrame ph bs = q
where
(_, bdy) = BS.splitAt 42 bs
Done _ q = parse (parseQuote pTime) bdy
pTime = toTime (hdrSeconds ph) (hdrUseconds ph)
toTime s u = posixSecondsToUTCTime $ realToFrac s + (realToFrac u / (10^6)) | 280 | parseFrame :: PktHdr -> ByteString -> Quote
parseFrame ph bs = q
where
(_, bdy) = BS.splitAt 42 bs
Done _ q = parse (parseQuote pTime) bdy
pTime = toTime (hdrSeconds ph) (hdrUseconds ph)
toTime s u = posixSecondsToUTCTime $ realToFrac s + (realToFrac u / (10^6)) | 280 | parseFrame ph bs = q
where
(_, bdy) = BS.splitAt 42 bs
Done _ q = parse (parseQuote pTime) bdy
pTime = toTime (hdrSeconds ph) (hdrUseconds ph)
toTime s u = posixSecondsToUTCTime $ realToFrac s + (realToFrac u / (10^6)) | 236 | false | true | 3 | 10 | 64 | 140 | 64 | 76 | null | null |
comonoidial/ALFIN | Alfin/FromCore.hs | mit | buildArgs :: [(String, Kind)] -> [Variable]
buildArgs = map (uncurry $ flip Var) | 80 | buildArgs :: [(String, Kind)] -> [Variable]
buildArgs = map (uncurry $ flip Var) | 80 | buildArgs = map (uncurry $ flip Var) | 36 | false | true | 0 | 8 | 12 | 40 | 22 | 18 | null | null |
Mr-Click/PFQ | user/pfq-stress/pfq-stress.hs | gpl-2.0 | options :: Mode (CmdArgs Options)
options = cmdArgsMode $ Options
{
core = 0 &= typ "NUM" &= help "core where to run the tests",
gid = 0 &= typ "NUM" &= help "PFQ group id of the tests",
seconds = 5 &= typ "NUM" &= help "Duration of each test in seconds",
device = [] &= help "List of devices where to run the tests",
run = [] &= help "List of tests to run",
skip = [] &= help "List of tests to skip",
dryRun = False &= help "Don't actually run tests"
} &= summary ("pfq-tOest " ++ version) &= program "pfq-test" | 697 | options :: Mode (CmdArgs Options)
options = cmdArgsMode $ Options
{
core = 0 &= typ "NUM" &= help "core where to run the tests",
gid = 0 &= typ "NUM" &= help "PFQ group id of the tests",
seconds = 5 &= typ "NUM" &= help "Duration of each test in seconds",
device = [] &= help "List of devices where to run the tests",
run = [] &= help "List of tests to run",
skip = [] &= help "List of tests to skip",
dryRun = False &= help "Don't actually run tests"
} &= summary ("pfq-tOest " ++ version) &= program "pfq-test" | 697 | options = cmdArgsMode $ Options
{
core = 0 &= typ "NUM" &= help "core where to run the tests",
gid = 0 &= typ "NUM" &= help "PFQ group id of the tests",
seconds = 5 &= typ "NUM" &= help "Duration of each test in seconds",
device = [] &= help "List of devices where to run the tests",
run = [] &= help "List of tests to run",
skip = [] &= help "List of tests to skip",
dryRun = False &= help "Don't actually run tests"
} &= summary ("pfq-tOest " ++ version) &= program "pfq-test" | 663 | false | true | 0 | 12 | 289 | 165 | 84 | 81 | null | null |
kishoredbn/barrelfish | tools/sockeye/SockeyeSymbolTableBuilder.hs | mit | addImportSymbol :: (String, Import) -> ST.SockeyeFile -> Checks SymbolTableFail ST.SockeyeFile
addImportSymbol (name, TypeImport i) fileSymbol = do
case Map.lookup name (ST.modules fileSymbol) of
Nothing -> return ()
Just m -> failCheck (meta m) $ ImportShadowing name "Module" "type" (meta i)
let ts = ST.types fileSymbol
case Map.lookup name ts of
Nothing -> return $ fileSymbol { ST.types = Map.insert name i ts }
Just t -> failCheck (meta t) (ImportShadowing name "Type" "type" (meta i)) >> return fileSymbol | 564 | addImportSymbol :: (String, Import) -> ST.SockeyeFile -> Checks SymbolTableFail ST.SockeyeFile
addImportSymbol (name, TypeImport i) fileSymbol = do
case Map.lookup name (ST.modules fileSymbol) of
Nothing -> return ()
Just m -> failCheck (meta m) $ ImportShadowing name "Module" "type" (meta i)
let ts = ST.types fileSymbol
case Map.lookup name ts of
Nothing -> return $ fileSymbol { ST.types = Map.insert name i ts }
Just t -> failCheck (meta t) (ImportShadowing name "Type" "type" (meta i)) >> return fileSymbol | 563 | addImportSymbol (name, TypeImport i) fileSymbol = do
case Map.lookup name (ST.modules fileSymbol) of
Nothing -> return ()
Just m -> failCheck (meta m) $ ImportShadowing name "Module" "type" (meta i)
let ts = ST.types fileSymbol
case Map.lookup name ts of
Nothing -> return $ fileSymbol { ST.types = Map.insert name i ts }
Just t -> failCheck (meta t) (ImportShadowing name "Type" "type" (meta i)) >> return fileSymbol | 468 | false | true | 0 | 15 | 129 | 220 | 105 | 115 | null | null |
romanb/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/Scan.hs | mpl-2.0 | -- | The attributes to be returned in the result. You can retrieve all item
-- attributes, specific item attributes, or the count of matching items.
--
-- 'ALL_ATTRIBUTES' - Returns all of the item attributes.
--
-- 'COUNT' - Returns the number of matching items, rather than the matching
-- items themselves.
--
-- 'SPECIFIC_ATTRIBUTES' - Returns only the attributes listed in /AttributesToGet/. This return value is equivalent to specifying /AttributesToGet/ without
-- specifying any value for /Select/.
--
-- If neither /Select/ nor /AttributesToGet/ are specified, DynamoDB defaults to 'ALL_ATTRIBUTES'. You cannot use both /AttributesToGet/ and /Select/ together in a single
-- request, unless the value for /Select/ is 'SPECIFIC_ATTRIBUTES'. (This usage is
-- equivalent to specifying /AttributesToGet/ without any value for /Select/.)
sSelect :: Lens' Scan (Maybe Select)
sSelect = lens _sSelect (\s a -> s { _sSelect = a }) | 932 | sSelect :: Lens' Scan (Maybe Select)
sSelect = lens _sSelect (\s a -> s { _sSelect = a }) | 89 | sSelect = lens _sSelect (\s a -> s { _sSelect = a }) | 52 | true | true | 1 | 9 | 143 | 64 | 38 | 26 | null | null |
nevrenato/HetsAlloy | CASL/Freeness.hs | gpl-2.0 | free_op_sym :: OP_SYMB -> OP_SYMB
free_op_sym (Op_name on) = Op_name $ mkFreeName on | 84 | free_op_sym :: OP_SYMB -> OP_SYMB
free_op_sym (Op_name on) = Op_name $ mkFreeName on | 84 | free_op_sym (Op_name on) = Op_name $ mkFreeName on | 50 | false | true | 0 | 6 | 12 | 35 | 16 | 19 | null | null |
vikraman/ghc | compiler/types/Type.hs | bsd-3-clause | typeLiteralKind :: TyLit -> Kind
typeLiteralKind l =
case l of
NumTyLit _ -> typeNatKind
StrTyLit _ -> typeSymbolKind
-- | Print a tyvar with its kind | 161 | typeLiteralKind :: TyLit -> Kind
typeLiteralKind l =
case l of
NumTyLit _ -> typeNatKind
StrTyLit _ -> typeSymbolKind
-- | Print a tyvar with its kind | 161 | typeLiteralKind l =
case l of
NumTyLit _ -> typeNatKind
StrTyLit _ -> typeSymbolKind
-- | Print a tyvar with its kind | 128 | false | true | 0 | 8 | 37 | 47 | 21 | 26 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Databases/SetIAMPolicy.hs | mpl-2.0 | -- | Creates a value of 'ProjectsInstancesDatabasesSetIAMPolicy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pidsipXgafv'
--
-- * 'pidsipUploadProtocol'
--
-- * 'pidsipAccessToken'
--
-- * 'pidsipUploadType'
--
-- * 'pidsipPayload'
--
-- * 'pidsipResource'
--
-- * 'pidsipCallback'
projectsInstancesDatabasesSetIAMPolicy
:: SetIAMPolicyRequest -- ^ 'pidsipPayload'
-> Text -- ^ 'pidsipResource'
-> ProjectsInstancesDatabasesSetIAMPolicy
projectsInstancesDatabasesSetIAMPolicy pPidsipPayload_ pPidsipResource_ =
ProjectsInstancesDatabasesSetIAMPolicy'
{ _pidsipXgafv = Nothing
, _pidsipUploadProtocol = Nothing
, _pidsipAccessToken = Nothing
, _pidsipUploadType = Nothing
, _pidsipPayload = pPidsipPayload_
, _pidsipResource = pPidsipResource_
, _pidsipCallback = Nothing
} | 908 | projectsInstancesDatabasesSetIAMPolicy
:: SetIAMPolicyRequest -- ^ 'pidsipPayload'
-> Text -- ^ 'pidsipResource'
-> ProjectsInstancesDatabasesSetIAMPolicy
projectsInstancesDatabasesSetIAMPolicy pPidsipPayload_ pPidsipResource_ =
ProjectsInstancesDatabasesSetIAMPolicy'
{ _pidsipXgafv = Nothing
, _pidsipUploadProtocol = Nothing
, _pidsipAccessToken = Nothing
, _pidsipUploadType = Nothing
, _pidsipPayload = pPidsipPayload_
, _pidsipResource = pPidsipResource_
, _pidsipCallback = Nothing
} | 536 | projectsInstancesDatabasesSetIAMPolicy pPidsipPayload_ pPidsipResource_ =
ProjectsInstancesDatabasesSetIAMPolicy'
{ _pidsipXgafv = Nothing
, _pidsipUploadProtocol = Nothing
, _pidsipAccessToken = Nothing
, _pidsipUploadType = Nothing
, _pidsipPayload = pPidsipPayload_
, _pidsipResource = pPidsipResource_
, _pidsipCallback = Nothing
} | 369 | true | true | 0 | 6 | 150 | 87 | 60 | 27 | null | null |
fffej/sql-server-gen | src/Database/SqlServer/Create/DataType.hs | bsd-2-clause | renderDataType SmallDateTime {} = text "smalldatetime" | 54 | renderDataType SmallDateTime {} = text "smalldatetime" | 54 | renderDataType SmallDateTime {} = text "smalldatetime" | 54 | false | false | 0 | 6 | 5 | 16 | 7 | 9 | null | null |
stgm/prac-testing | week5/Week5Sol_Q3_NRC.hs | mit | --UPDATED: definition of NRC subgrids
blocksNRC :: [[Int]]
blocksNRC = [[2..4],[6..8]] | 86 | blocksNRC :: [[Int]]
blocksNRC = [[2..4],[6..8]] | 48 | blocksNRC = [[2..4],[6..8]] | 27 | true | true | 0 | 6 | 10 | 34 | 21 | 13 | null | null |
snoyberg/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtOrigin (InstProvidedOrigin mod cls_inst)
= vcat [ text "arising when attempting to show that"
, ppr cls_inst
, text "is provided by" <+> quotes (ppr mod)] | 179 | pprCtOrigin (InstProvidedOrigin mod cls_inst)
= vcat [ text "arising when attempting to show that"
, ppr cls_inst
, text "is provided by" <+> quotes (ppr mod)] | 179 | pprCtOrigin (InstProvidedOrigin mod cls_inst)
= vcat [ text "arising when attempting to show that"
, ppr cls_inst
, text "is provided by" <+> quotes (ppr mod)] | 179 | false | false | 0 | 9 | 45 | 52 | 24 | 28 | null | null |
webcrank/webcrank.hs | src/Webcrank.hs | bsd-3-clause | -- | Creates a resource that provides a single content type.
resourceWithBody :: Monad m => MediaType -> m Body -> Resource m
resourceWithBody t b = resource { contentTypesProvided = return [(t, lift b)] } | 205 | resourceWithBody :: Monad m => MediaType -> m Body -> Resource m
resourceWithBody t b = resource { contentTypesProvided = return [(t, lift b)] } | 144 | resourceWithBody t b = resource { contentTypesProvided = return [(t, lift b)] } | 79 | true | true | 0 | 10 | 35 | 61 | 31 | 30 | null | null |
vigoo/stack | src/Stack/Docker.hs | bsd-3-clause | -- | Name of home directory within docker sandbox.
homeDirName :: Path Rel Dir
homeDirName = $(mkRelDir "_home/") | 113 | homeDirName :: Path Rel Dir
homeDirName = $(mkRelDir "_home/") | 62 | homeDirName = $(mkRelDir "_home/") | 34 | true | true | 0 | 7 | 17 | 24 | 12 | 12 | null | null |
mitchellwrosen/Haskell-Pipes-Library | src/Pipes/Prelude.hs | bsd-3-clause | {-| Read 'String's from a 'IO.Handle' using 'IO.hGetLine'
Terminates on end of input
-}
fromHandle :: MonadIO m => IO.Handle -> Producer' String m ()
fromHandle h = go
where
go = do
eof <- liftIO $ IO.hIsEOF h
unless eof $ do
str <- liftIO $ IO.hGetLine h
yield str
go
| 332 | fromHandle :: MonadIO m => IO.Handle -> Producer' String m ()
fromHandle h = go
where
go = do
eof <- liftIO $ IO.hIsEOF h
unless eof $ do
str <- liftIO $ IO.hGetLine h
yield str
go
| 239 | fromHandle h = go
where
go = do
eof <- liftIO $ IO.hIsEOF h
unless eof $ do
str <- liftIO $ IO.hGetLine h
yield str
go
| 177 | true | true | 1 | 13 | 115 | 103 | 44 | 59 | null | null |
ion1/swtor-ui | src/SWTOR/UIProfile.hs | mit | getProfilePath :: FilePath -> IO FilePath
getProfilePath name = do
profileDir <- getAppUserDataDirectory "../Local/SWTOR/swtor/settings/GUIProfiles"
pure (profileDir ++ "/" ++ name ++ ".xml") | 195 | getProfilePath :: FilePath -> IO FilePath
getProfilePath name = do
profileDir <- getAppUserDataDirectory "../Local/SWTOR/swtor/settings/GUIProfiles"
pure (profileDir ++ "/" ++ name ++ ".xml") | 195 | getProfilePath name = do
profileDir <- getAppUserDataDirectory "../Local/SWTOR/swtor/settings/GUIProfiles"
pure (profileDir ++ "/" ++ name ++ ".xml") | 153 | false | true | 0 | 12 | 25 | 57 | 25 | 32 | null | null |
GaloisInc/ivory | ivory-examples/examples/ConstPtrRef.hs | bsd-3-clause | cmodule :: Module
cmodule = package "ConstPtrRef" $ incl test | 61 | cmodule :: Module
cmodule = package "ConstPtrRef" $ incl test | 61 | cmodule = package "ConstPtrRef" $ incl test | 43 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
jmtd/rdifffs | Rdiff.hs | bsd-3-clause | unaryLiteralCmd = do
cmd <- oneOf literalcmds1
arg1 <- anyChar
lump <- count (ord arg1) anyChar
return $ LiteralCommand lump | 141 | unaryLiteralCmd = do
cmd <- oneOf literalcmds1
arg1 <- anyChar
lump <- count (ord arg1) anyChar
return $ LiteralCommand lump | 141 | unaryLiteralCmd = do
cmd <- oneOf literalcmds1
arg1 <- anyChar
lump <- count (ord arg1) anyChar
return $ LiteralCommand lump | 141 | false | false | 0 | 10 | 36 | 51 | 22 | 29 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | mzipIdKey = mkPreludeMiscIdUnique 196 | 43 | mzipIdKey = mkPreludeMiscIdUnique 196 | 43 | mzipIdKey = mkPreludeMiscIdUnique 196 | 43 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
ciderpunx/57-exercises-for-programmers | src/P38Filter.hs | gpl-3.0 | promptXs :: String -> IO [Int]
promptXs m = do
putStr m
x <- getLine
return (map read $ words x) `catch` except
where
except e = do
putStrLn $ "Couldn't parse number. Error was: " ++ show (e::IOException)
promptXs m | 245 | promptXs :: String -> IO [Int]
promptXs m = do
putStr m
x <- getLine
return (map read $ words x) `catch` except
where
except e = do
putStrLn $ "Couldn't parse number. Error was: " ++ show (e::IOException)
promptXs m | 245 | promptXs m = do
putStr m
x <- getLine
return (map read $ words x) `catch` except
where
except e = do
putStrLn $ "Couldn't parse number. Error was: " ++ show (e::IOException)
promptXs m | 214 | false | true | 1 | 11 | 70 | 107 | 47 | 60 | null | null |
rfranek/duckling | Duckling/Numeral/JA/Rules.hs | bsd-3-clause | ruleInteger8 :: Rule
ruleInteger8 = Rule
{ name = "integer 201..999"
, pattern =
[ oneOf [300, 600, 500, 800, 200, 900, 700, 400]
, numberBetween 1 100
]
, prod = \tokens -> case tokens of
(Token Numeral (NumeralData {TNumeral.value = v1}):
Token Numeral (NumeralData {TNumeral.value = v2}):
_) -> double $ v1 + v2
_ -> Nothing
} | 375 | ruleInteger8 :: Rule
ruleInteger8 = Rule
{ name = "integer 201..999"
, pattern =
[ oneOf [300, 600, 500, 800, 200, 900, 700, 400]
, numberBetween 1 100
]
, prod = \tokens -> case tokens of
(Token Numeral (NumeralData {TNumeral.value = v1}):
Token Numeral (NumeralData {TNumeral.value = v2}):
_) -> double $ v1 + v2
_ -> Nothing
} | 375 | ruleInteger8 = Rule
{ name = "integer 201..999"
, pattern =
[ oneOf [300, 600, 500, 800, 200, 900, 700, 400]
, numberBetween 1 100
]
, prod = \tokens -> case tokens of
(Token Numeral (NumeralData {TNumeral.value = v1}):
Token Numeral (NumeralData {TNumeral.value = v2}):
_) -> double $ v1 + v2
_ -> Nothing
} | 354 | false | true | 0 | 19 | 105 | 151 | 84 | 67 | null | null |
juhp/stack | src/Stack/Coverage.hs | bsd-3-clause | generateHpcUnifiedReport :: HasEnvConfig env => RIO env ()
generateHpcUnifiedReport = do
outputDir <- hpcReportDir
ensureDir outputDir
(dirs, _) <- listDir outputDir
tixFiles0 <- liftM (concat . concat) $ forM (filter (("combined" /=) . dirnameString) dirs) $ \dir -> do
(dirs', _) <- listDir dir
forM dirs' $ \dir' -> do
(_, files) <- listDir dir'
return (filter ((".tix" `isSuffixOf`) . toFilePath) files)
extraTixFiles <- findExtraTixFiles
let tixFiles = tixFiles0 ++ extraTixFiles
reportDir = outputDir </> relDirCombined </> relDirAll
if length tixFiles < 2
then logInfo $
(if null tixFiles then "No tix files" else "Only one tix file") <>
" found in " <>
fromString (toFilePath outputDir) <>
", so not generating a unified coverage report."
else do
let report = "unified report"
mreportPath <- generateUnionReport report reportDir tixFiles
forM_ mreportPath (displayReportPath report . pretty) | 1,076 | generateHpcUnifiedReport :: HasEnvConfig env => RIO env ()
generateHpcUnifiedReport = do
outputDir <- hpcReportDir
ensureDir outputDir
(dirs, _) <- listDir outputDir
tixFiles0 <- liftM (concat . concat) $ forM (filter (("combined" /=) . dirnameString) dirs) $ \dir -> do
(dirs', _) <- listDir dir
forM dirs' $ \dir' -> do
(_, files) <- listDir dir'
return (filter ((".tix" `isSuffixOf`) . toFilePath) files)
extraTixFiles <- findExtraTixFiles
let tixFiles = tixFiles0 ++ extraTixFiles
reportDir = outputDir </> relDirCombined </> relDirAll
if length tixFiles < 2
then logInfo $
(if null tixFiles then "No tix files" else "Only one tix file") <>
" found in " <>
fromString (toFilePath outputDir) <>
", so not generating a unified coverage report."
else do
let report = "unified report"
mreportPath <- generateUnionReport report reportDir tixFiles
forM_ mreportPath (displayReportPath report . pretty) | 1,076 | generateHpcUnifiedReport = do
outputDir <- hpcReportDir
ensureDir outputDir
(dirs, _) <- listDir outputDir
tixFiles0 <- liftM (concat . concat) $ forM (filter (("combined" /=) . dirnameString) dirs) $ \dir -> do
(dirs', _) <- listDir dir
forM dirs' $ \dir' -> do
(_, files) <- listDir dir'
return (filter ((".tix" `isSuffixOf`) . toFilePath) files)
extraTixFiles <- findExtraTixFiles
let tixFiles = tixFiles0 ++ extraTixFiles
reportDir = outputDir </> relDirCombined </> relDirAll
if length tixFiles < 2
then logInfo $
(if null tixFiles then "No tix files" else "Only one tix file") <>
" found in " <>
fromString (toFilePath outputDir) <>
", so not generating a unified coverage report."
else do
let report = "unified report"
mreportPath <- generateUnionReport report reportDir tixFiles
forM_ mreportPath (displayReportPath report . pretty) | 1,017 | false | true | 0 | 21 | 311 | 311 | 153 | 158 | null | null |
jaccokrijnen/leksah | src/IDE/TextEditor/CodeMirror.hs | gpl-2.0 | charCoords = js2 "charCoords" | 36 | charCoords = js2 "charCoords" | 36 | charCoords = js2 "charCoords" | 36 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
piyush-kurur/yesod | yesod-routes/Yesod/Routes/Overlap.hs | mit | piecesOverlap _ _ = True | 24 | piecesOverlap _ _ = True | 24 | piecesOverlap _ _ = True | 24 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
urbanslug/ghc | compiler/prelude/THNames.hs | bsd-3-clause | newtypeDIdKey = mkPreludeMiscIdUnique 333 | 56 | newtypeDIdKey = mkPreludeMiscIdUnique 333 | 56 | newtypeDIdKey = mkPreludeMiscIdUnique 333 | 56 | false | false | 1 | 5 | 18 | 12 | 4 | 8 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.