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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
peterokagey/haskellOEIS
|
src/Sandbox/compositions.hs
|
apache-2.0
|
compositions n = concatMap (\k -> map (k:) $ compositions (n-k)) [1..n]
| 71
|
compositions n = concatMap (\k -> map (k:) $ compositions (n-k)) [1..n]
| 71
|
compositions n = concatMap (\k -> map (k:) $ compositions (n-k)) [1..n]
| 71
| false
| false
| 0
| 11
| 11
| 48
| 25
| 23
| null | null |
Melvar/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
nsroot n = n
| 12
|
nsroot n = n
| 12
|
nsroot n = n
| 12
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
GaloisInc/hpb
|
src/Data/HPB.hs
|
apache-2.0
|
fixed64Field :: Text -> Required Word64 -> FieldDef a Word64
fixed64Field = fixedField fixed64Type 8 word64LE word64le
| 118
|
fixed64Field :: Text -> Required Word64 -> FieldDef a Word64
fixed64Field = fixedField fixed64Type 8 word64LE word64le
| 118
|
fixed64Field = fixedField fixed64Type 8 word64LE word64le
| 57
| false
| true
| 0
| 8
| 16
| 42
| 18
| 24
| null | null |
AlexanderPankiv/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
symbol_RDR = dataQual_RDR lEX (fsLit "Symbol")
| 59
|
symbol_RDR = dataQual_RDR lEX (fsLit "Symbol")
| 59
|
symbol_RDR = dataQual_RDR lEX (fsLit "Symbol")
| 59
| false
| false
| 0
| 7
| 18
| 17
| 8
| 9
| null | null |
seppeljordan/sdl2
|
src/SDL/Video.hs
|
bsd-3-clause
|
getWindowAbsolutePosition :: MonadIO m => Window -> m (V2 CInt)
getWindowAbsolutePosition (Window w) =
liftIO $
alloca $ \wPtr ->
alloca $ \hPtr -> do
Raw.getWindowPosition w wPtr hPtr
V2 <$> peek wPtr <*> peek hPtr
-- | Get or set the size of a window's client area. Values beyond the maximum supported size are clamped.
--
-- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
--
-- See @<https://wiki.libsdl.org/SDL_SetWindowSize SDL_SetWindowSize>@ and @<https://wiki.libsdl.org/SDL_GetWindowSize SDL_GetWindowSize>@ for C documentation.
| 607
|
getWindowAbsolutePosition :: MonadIO m => Window -> m (V2 CInt)
getWindowAbsolutePosition (Window w) =
liftIO $
alloca $ \wPtr ->
alloca $ \hPtr -> do
Raw.getWindowPosition w wPtr hPtr
V2 <$> peek wPtr <*> peek hPtr
-- | Get or set the size of a window's client area. Values beyond the maximum supported size are clamped.
--
-- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
--
-- See @<https://wiki.libsdl.org/SDL_SetWindowSize SDL_SetWindowSize>@ and @<https://wiki.libsdl.org/SDL_GetWindowSize SDL_GetWindowSize>@ for C documentation.
| 607
|
getWindowAbsolutePosition (Window w) =
liftIO $
alloca $ \wPtr ->
alloca $ \hPtr -> do
Raw.getWindowPosition w wPtr hPtr
V2 <$> peek wPtr <*> peek hPtr
-- | Get or set the size of a window's client area. Values beyond the maximum supported size are clamped.
--
-- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
--
-- See @<https://wiki.libsdl.org/SDL_SetWindowSize SDL_SetWindowSize>@ and @<https://wiki.libsdl.org/SDL_GetWindowSize SDL_GetWindowSize>@ for C documentation.
| 543
| false
| true
| 0
| 13
| 112
| 96
| 48
| 48
| null | null |
mbakke/ganeti
|
test/hs/Test/Ganeti/Utils.hs
|
bsd-2-clause
|
-- | Tests that 'niceSort' and 'niceSortKey' are equivalent.
prop_niceSortKey_equiv :: Property
prop_niceSortKey_equiv =
forAll (resize 20 arbitrary) $ \names ->
forAll (vectorOf (length names) (arbitrary::Gen Int)) $ \numbers ->
let n_sorted = niceSort names in
conjoin
[ counterexample "key id" $ n_sorted ==? niceSortKey id names
, counterexample "key rev" $ niceSort (map reverse names) ==?
map reverse (niceSortKey reverse names)
, counterexample "key snd" $ n_sorted ==? map snd (niceSortKey snd $
zip numbers names)
]
| 624
|
prop_niceSortKey_equiv :: Property
prop_niceSortKey_equiv =
forAll (resize 20 arbitrary) $ \names ->
forAll (vectorOf (length names) (arbitrary::Gen Int)) $ \numbers ->
let n_sorted = niceSort names in
conjoin
[ counterexample "key id" $ n_sorted ==? niceSortKey id names
, counterexample "key rev" $ niceSort (map reverse names) ==?
map reverse (niceSortKey reverse names)
, counterexample "key snd" $ n_sorted ==? map snd (niceSortKey snd $
zip numbers names)
]
| 563
|
prop_niceSortKey_equiv =
forAll (resize 20 arbitrary) $ \names ->
forAll (vectorOf (length names) (arbitrary::Gen Int)) $ \numbers ->
let n_sorted = niceSort names in
conjoin
[ counterexample "key id" $ n_sorted ==? niceSortKey id names
, counterexample "key rev" $ niceSort (map reverse names) ==?
map reverse (niceSortKey reverse names)
, counterexample "key snd" $ n_sorted ==? map snd (niceSortKey snd $
zip numbers names)
]
| 528
| true
| true
| 0
| 13
| 177
| 175
| 85
| 90
| null | null |
cocreature/leksah
|
src/IDE/ImportTool.hs
|
gpl-2.0
|
addImport' :: NotInScopeParseResult -> FilePath -> Descr -> [Descr] -> ((Bool,[Descr]) -> IDEAction) -> IDEAction
addImport' nis filePath descr descrList continuation = do
mbBuf <- selectSourceBuf filePath
let mbMod = case dsMbModu descr of
Nothing -> Nothing
Just pm -> Just (modu pm)
case (mbBuf,mbMod) of
(Just buf,Just mod) ->
inActiveBufContext () $ \ nb _ gtkbuf idebuf n -> do
ideMessage Normal $ "addImport " <> T.pack (show $ dscName descr) <> " from "
<> T.pack (render $ disp mod)
doServerCommand (ParseHeaderCommand filePath) $ \ res ->
case res of
ServerHeader (Left imports) ->
case filter (qualifyAsImportStatement mod) imports of
[] -> let newLine = prettyPrint (newImpDecl mod) <> "\n"
lastLine = F.foldr (max . locationELine . importLoc) 0 imports
in do
i1 <- getIterAtLine gtkbuf lastLine
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
l@(impDecl:_) ->
let newDecl = addToDecl impDecl
newLine = prettyPrint newDecl <> "\n"
myLoc = importLoc impDecl
lineStart = locationSLine myLoc
lineEnd = locationELine myLoc
in do
i1 <- getIterAtLine gtkbuf (lineStart - 1)
i2 <- getIterAtLine gtkbuf lineEnd
delete gtkbuf i1 i2
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
ServerHeader (Right lastLine) ->
let newLine = prettyPrint (newImpDecl mod) <> "\n"
in do
i1 <- getIterAtLine gtkbuf lastLine
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
ServerFailed string -> do
ideMessage Normal ("Can't parse module header " <> T.pack filePath <>
" failed with: " <> string)
continuation (False,[])
_ -> do
ideMessage Normal "ImportTool>>addImport: Impossible server answer"
continuation (False,[])
_ -> return ()
where
qualifyAsImportStatement :: D.ModuleName -> ImportDecl -> Bool
qualifyAsImportStatement moduleName impDecl =
let importName = importModule impDecl
getHiding (ImportSpecList isHiding _) = isHiding
in importName == T.pack (display moduleName)
&& ((isNothing (mbQual' nis) && not (importQualified impDecl)) ||
(isJust (mbQual' nis) && importQualified impDecl
&& fromJust (mbQual' nis) == qualString impDecl))
&& (isNothing (importSpecs impDecl) || not (getHiding (fromJust (importSpecs impDecl))))
newImpDecl :: D.ModuleName -> ImportDecl
newImpDecl mod = ImportDecl {
importLoc = noLocation,
importModule = T.pack $ display mod,
importQualified = isJust (mbQual' nis),
importSrc = False,
importPkg = Nothing,
importAs = mplus (mbQual' nis) Nothing,
importSpecs = Just (ImportSpecList False [newImportSpec])}
newImportSpec :: ImportSpec
newImportSpec = getRealId descr (id' nis)
addToDecl :: ImportDecl -> ImportDecl
addToDecl impDecl = case importSpecs impDecl of
Just (ImportSpecList True listIE) -> throwIDE "ImportTool>>addToDecl: ImpList is hiding"
Just (ImportSpecList False listIE) ->
impDecl{importSpecs = Just (ImportSpecList False (nub (newImportSpec : listIE)))}
Nothing ->
impDecl{importSpecs = Just (ImportSpecList False [newImportSpec])}
noLocation = Location "" 0 0 0 0
| 5,531
|
addImport' :: NotInScopeParseResult -> FilePath -> Descr -> [Descr] -> ((Bool,[Descr]) -> IDEAction) -> IDEAction
addImport' nis filePath descr descrList continuation = do
mbBuf <- selectSourceBuf filePath
let mbMod = case dsMbModu descr of
Nothing -> Nothing
Just pm -> Just (modu pm)
case (mbBuf,mbMod) of
(Just buf,Just mod) ->
inActiveBufContext () $ \ nb _ gtkbuf idebuf n -> do
ideMessage Normal $ "addImport " <> T.pack (show $ dscName descr) <> " from "
<> T.pack (render $ disp mod)
doServerCommand (ParseHeaderCommand filePath) $ \ res ->
case res of
ServerHeader (Left imports) ->
case filter (qualifyAsImportStatement mod) imports of
[] -> let newLine = prettyPrint (newImpDecl mod) <> "\n"
lastLine = F.foldr (max . locationELine . importLoc) 0 imports
in do
i1 <- getIterAtLine gtkbuf lastLine
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
l@(impDecl:_) ->
let newDecl = addToDecl impDecl
newLine = prettyPrint newDecl <> "\n"
myLoc = importLoc impDecl
lineStart = locationSLine myLoc
lineEnd = locationELine myLoc
in do
i1 <- getIterAtLine gtkbuf (lineStart - 1)
i2 <- getIterAtLine gtkbuf lineEnd
delete gtkbuf i1 i2
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
ServerHeader (Right lastLine) ->
let newLine = prettyPrint (newImpDecl mod) <> "\n"
in do
i1 <- getIterAtLine gtkbuf lastLine
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
ServerFailed string -> do
ideMessage Normal ("Can't parse module header " <> T.pack filePath <>
" failed with: " <> string)
continuation (False,[])
_ -> do
ideMessage Normal "ImportTool>>addImport: Impossible server answer"
continuation (False,[])
_ -> return ()
where
qualifyAsImportStatement :: D.ModuleName -> ImportDecl -> Bool
qualifyAsImportStatement moduleName impDecl =
let importName = importModule impDecl
getHiding (ImportSpecList isHiding _) = isHiding
in importName == T.pack (display moduleName)
&& ((isNothing (mbQual' nis) && not (importQualified impDecl)) ||
(isJust (mbQual' nis) && importQualified impDecl
&& fromJust (mbQual' nis) == qualString impDecl))
&& (isNothing (importSpecs impDecl) || not (getHiding (fromJust (importSpecs impDecl))))
newImpDecl :: D.ModuleName -> ImportDecl
newImpDecl mod = ImportDecl {
importLoc = noLocation,
importModule = T.pack $ display mod,
importQualified = isJust (mbQual' nis),
importSrc = False,
importPkg = Nothing,
importAs = mplus (mbQual' nis) Nothing,
importSpecs = Just (ImportSpecList False [newImportSpec])}
newImportSpec :: ImportSpec
newImportSpec = getRealId descr (id' nis)
addToDecl :: ImportDecl -> ImportDecl
addToDecl impDecl = case importSpecs impDecl of
Just (ImportSpecList True listIE) -> throwIDE "ImportTool>>addToDecl: ImpList is hiding"
Just (ImportSpecList False listIE) ->
impDecl{importSpecs = Just (ImportSpecList False (nub (newImportSpec : listIE)))}
Nothing ->
impDecl{importSpecs = Just (ImportSpecList False [newImportSpec])}
noLocation = Location "" 0 0 0 0
| 5,531
|
addImport' nis filePath descr descrList continuation = do
mbBuf <- selectSourceBuf filePath
let mbMod = case dsMbModu descr of
Nothing -> Nothing
Just pm -> Just (modu pm)
case (mbBuf,mbMod) of
(Just buf,Just mod) ->
inActiveBufContext () $ \ nb _ gtkbuf idebuf n -> do
ideMessage Normal $ "addImport " <> T.pack (show $ dscName descr) <> " from "
<> T.pack (render $ disp mod)
doServerCommand (ParseHeaderCommand filePath) $ \ res ->
case res of
ServerHeader (Left imports) ->
case filter (qualifyAsImportStatement mod) imports of
[] -> let newLine = prettyPrint (newImpDecl mod) <> "\n"
lastLine = F.foldr (max . locationELine . importLoc) 0 imports
in do
i1 <- getIterAtLine gtkbuf lastLine
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
l@(impDecl:_) ->
let newDecl = addToDecl impDecl
newLine = prettyPrint newDecl <> "\n"
myLoc = importLoc impDecl
lineStart = locationSLine myLoc
lineEnd = locationELine myLoc
in do
i1 <- getIterAtLine gtkbuf (lineStart - 1)
i2 <- getIterAtLine gtkbuf lineEnd
delete gtkbuf i1 i2
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
ServerHeader (Right lastLine) ->
let newLine = prettyPrint (newImpDecl mod) <> "\n"
in do
i1 <- getIterAtLine gtkbuf lastLine
editInsertCode gtkbuf i1 newLine
fileSave False
setModified gtkbuf True
continuation (True, descr : descrList)
ServerFailed string -> do
ideMessage Normal ("Can't parse module header " <> T.pack filePath <>
" failed with: " <> string)
continuation (False,[])
_ -> do
ideMessage Normal "ImportTool>>addImport: Impossible server answer"
continuation (False,[])
_ -> return ()
where
qualifyAsImportStatement :: D.ModuleName -> ImportDecl -> Bool
qualifyAsImportStatement moduleName impDecl =
let importName = importModule impDecl
getHiding (ImportSpecList isHiding _) = isHiding
in importName == T.pack (display moduleName)
&& ((isNothing (mbQual' nis) && not (importQualified impDecl)) ||
(isJust (mbQual' nis) && importQualified impDecl
&& fromJust (mbQual' nis) == qualString impDecl))
&& (isNothing (importSpecs impDecl) || not (getHiding (fromJust (importSpecs impDecl))))
newImpDecl :: D.ModuleName -> ImportDecl
newImpDecl mod = ImportDecl {
importLoc = noLocation,
importModule = T.pack $ display mod,
importQualified = isJust (mbQual' nis),
importSrc = False,
importPkg = Nothing,
importAs = mplus (mbQual' nis) Nothing,
importSpecs = Just (ImportSpecList False [newImportSpec])}
newImportSpec :: ImportSpec
newImportSpec = getRealId descr (id' nis)
addToDecl :: ImportDecl -> ImportDecl
addToDecl impDecl = case importSpecs impDecl of
Just (ImportSpecList True listIE) -> throwIDE "ImportTool>>addToDecl: ImpList is hiding"
Just (ImportSpecList False listIE) ->
impDecl{importSpecs = Just (ImportSpecList False (nub (newImportSpec : listIE)))}
Nothing ->
impDecl{importSpecs = Just (ImportSpecList False [newImportSpec])}
noLocation = Location "" 0 0 0 0
| 5,417
| false
| true
| 27
| 29
| 2,869
| 1,131
| 545
| 586
| null | null |
snoyberg/ghc
|
compiler/basicTypes/OccName.hs
|
bsd-3-clause
|
-- Type constructors
clsName = TcClsName
| 42
|
clsName = TcClsName
| 21
|
clsName = TcClsName
| 21
| true
| false
| 0
| 4
| 7
| 7
| 4
| 3
| null | null |
christiaanb/clash-tryout
|
src/CLaSH/Util/Core/Tools.hs
|
bsd-3-clause
|
viewVarOrApp (CoreSyn.Cast e _) = viewVarOrApp e
| 48
|
viewVarOrApp (CoreSyn.Cast e _) = viewVarOrApp e
| 48
|
viewVarOrApp (CoreSyn.Cast e _) = viewVarOrApp e
| 48
| false
| false
| 0
| 8
| 6
| 22
| 10
| 12
| null | null |
cauterize-tools/caut-erl-ref
|
src/Cauterize/ErlangRef/Generate.hs
|
bsd-3-clause
|
tag2str C.T8 = "tag64"
| 22
|
tag2str C.T8 = "tag64"
| 22
|
tag2str C.T8 = "tag64"
| 22
| false
| false
| 1
| 5
| 3
| 15
| 5
| 10
| null | null |
megantti/rtorrent-rpc
|
Network/RTorrent/CommandList.hs
|
mit
|
-- | Run a command with no arguments.
commandSimple :: XmlRpcType a => String -> Global a
commandSimple cmd = commandArgs cmd []
| 128
|
commandSimple :: XmlRpcType a => String -> Global a
commandSimple cmd = commandArgs cmd []
| 90
|
commandSimple cmd = commandArgs cmd []
| 38
| true
| true
| 0
| 7
| 22
| 36
| 17
| 19
| null | null |
Davorak/conduit-lift
|
src/Data/Conduit/Lift.hs
|
bsd-3-clause
|
-- | Catch an error in the base monad
catchError
:: (Monad m, E.Error e) =>
ConduitM i o (E.ErrorT e m) ()
-> (e -> ConduitM i o (E.ErrorT e m) ())
-> ConduitM i o (E.ErrorT e m) ()
catchError e h = errorC $ E.runErrorT $
E.catchError (distribute e) (distribute . h)
| 287
|
catchError
:: (Monad m, E.Error e) =>
ConduitM i o (E.ErrorT e m) ()
-> (e -> ConduitM i o (E.ErrorT e m) ())
-> ConduitM i o (E.ErrorT e m) ()
catchError e h = errorC $ E.runErrorT $
E.catchError (distribute e) (distribute . h)
| 249
|
catchError e h = errorC $ E.runErrorT $
E.catchError (distribute e) (distribute . h)
| 88
| true
| true
| 0
| 14
| 75
| 146
| 72
| 74
| null | null |
rueshyna/gogol
|
gogol-youtube-reporting/gen/Network/Google/YouTubeReporting/Types/Product.hs
|
mpl-2.0
|
-- | The date\/time when this report type was\/will be deprecated.
rtDeprecateTime :: Lens' ReportType (Maybe UTCTime)
rtDeprecateTime
= lens _rtDeprecateTime
(\ s a -> s{_rtDeprecateTime = a})
. mapping _DateTime
| 227
|
rtDeprecateTime :: Lens' ReportType (Maybe UTCTime)
rtDeprecateTime
= lens _rtDeprecateTime
(\ s a -> s{_rtDeprecateTime = a})
. mapping _DateTime
| 160
|
rtDeprecateTime
= lens _rtDeprecateTime
(\ s a -> s{_rtDeprecateTime = a})
. mapping _DateTime
| 108
| true
| true
| 0
| 10
| 44
| 55
| 28
| 27
| null | null |
alonho/bottle
|
src/Graphics/DrawingCombinators/Utils.hs
|
gpl-3.0
|
textHeight :: Draw.R
textHeight = 2
| 35
|
textHeight :: Draw.R
textHeight = 2
| 35
|
textHeight = 2
| 14
| false
| true
| 0
| 7
| 5
| 20
| 8
| 12
| null | null |
Stratege/Coevolutionary-Neural-Network
|
globalthermonuclearwar.hs
|
mit
|
combatRound att (d0,d1,d2) t1 t2 = (t1''',t2''')
where (t1',t2') = combat att d0 t1 t2 combatCounter
(t1'',t2'') = combat att d1 t1' t2' combatEven
(t1''',t2''') = combat att d2 t1'' t2'' combatBad
| 239
|
combatRound att (d0,d1,d2) t1 t2 = (t1''',t2''')
where (t1',t2') = combat att d0 t1 t2 combatCounter
(t1'',t2'') = combat att d1 t1' t2' combatEven
(t1''',t2''') = combat att d2 t1'' t2'' combatBad
| 239
|
combatRound att (d0,d1,d2) t1 t2 = (t1''',t2''')
where (t1',t2') = combat att d0 t1 t2 combatCounter
(t1'',t2'') = combat att d1 t1' t2' combatEven
(t1''',t2''') = combat att d2 t1'' t2'' combatBad
| 239
| false
| false
| 0
| 7
| 73
| 101
| 54
| 47
| null | null |
bitemyapp/ghc
|
compiler/basicTypes/BasicTypes.hs
|
bsd-3-clause
|
isNeverActive _ = False
| 33
|
isNeverActive _ = False
| 33
|
isNeverActive _ = False
| 33
| false
| false
| 0
| 4
| 13
| 10
| 4
| 6
| null | null |
nullobject/flatland-haskell
|
src/Geometry.hs
|
bsd-3-clause
|
intersectLines :: Point -> Point -> Point -> Point -> Point
intersectLines p r q s = p ^+^ ((r ^-^ p) ^* t)
where t = (q ^-^ p) <*> (s ^-^ q) / (r ^-^ p) <*> (s ^-^ q)
-- 2D vector cross product.
| 198
|
intersectLines :: Point -> Point -> Point -> Point -> Point
intersectLines p r q s = p ^+^ ((r ^-^ p) ^* t)
where t = (q ^-^ p) <*> (s ^-^ q) / (r ^-^ p) <*> (s ^-^ q)
-- 2D vector cross product.
| 198
|
intersectLines p r q s = p ^+^ ((r ^-^ p) ^* t)
where t = (q ^-^ p) <*> (s ^-^ q) / (r ^-^ p) <*> (s ^-^ q)
-- 2D vector cross product.
| 138
| false
| true
| 0
| 9
| 49
| 103
| 55
| 48
| null | null |
csrhodes/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
macron 'a' = "ā"
| 16
|
macron 'a' = "ā"
| 16
|
macron 'a' = "ā"
| 16
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
mstksg/hledger
|
hledger-ui/Hledger/UI/ErrorScreen.hs
|
gpl-3.0
|
uiReloadJournal :: CliOpts -> Day -> UIState -> IO UIState
uiReloadJournal copts d ui = do
ej <- journalReload copts
return $ case ej of
Right j -> regenerateScreens j d ui{aopts=(aopts ui){cliopts_=copts}}
Left err ->
case ui of
UIState{aScreen=s@ErrorScreen{}} -> ui{aScreen=s{esError=err}}
_ -> screenEnter d errorScreen{esError=err} ui
-- Like uiReloadJournal, but does not bother re-parsing the journal if
-- the file(s) have not changed since last loaded. Always regenerates
-- the current and previous screens though, since opts or date may have changed.
| 628
|
uiReloadJournal :: CliOpts -> Day -> UIState -> IO UIState
uiReloadJournal copts d ui = do
ej <- journalReload copts
return $ case ej of
Right j -> regenerateScreens j d ui{aopts=(aopts ui){cliopts_=copts}}
Left err ->
case ui of
UIState{aScreen=s@ErrorScreen{}} -> ui{aScreen=s{esError=err}}
_ -> screenEnter d errorScreen{esError=err} ui
-- Like uiReloadJournal, but does not bother re-parsing the journal if
-- the file(s) have not changed since last loaded. Always regenerates
-- the current and previous screens though, since opts or date may have changed.
| 628
|
uiReloadJournal copts d ui = do
ej <- journalReload copts
return $ case ej of
Right j -> regenerateScreens j d ui{aopts=(aopts ui){cliopts_=copts}}
Left err ->
case ui of
UIState{aScreen=s@ErrorScreen{}} -> ui{aScreen=s{esError=err}}
_ -> screenEnter d errorScreen{esError=err} ui
-- Like uiReloadJournal, but does not bother re-parsing the journal if
-- the file(s) have not changed since last loaded. Always regenerates
-- the current and previous screens though, since opts or date may have changed.
| 569
| false
| true
| 0
| 18
| 150
| 167
| 87
| 80
| null | null |
brendanhay/gogol
|
gogol-container/gen/Network/Google/Resource/Container/Projects/Zones/Clusters/NodePools/SetManagement.hs
|
mpl-2.0
|
-- | V1 error format.
pzcnpsmXgafv :: Lens' ProjectsZonesClustersNodePoolsSetManagement (Maybe Xgafv)
pzcnpsmXgafv
= lens _pzcnpsmXgafv (\ s a -> s{_pzcnpsmXgafv = a})
| 169
|
pzcnpsmXgafv :: Lens' ProjectsZonesClustersNodePoolsSetManagement (Maybe Xgafv)
pzcnpsmXgafv
= lens _pzcnpsmXgafv (\ s a -> s{_pzcnpsmXgafv = a})
| 147
|
pzcnpsmXgafv
= lens _pzcnpsmXgafv (\ s a -> s{_pzcnpsmXgafv = a})
| 67
| true
| true
| 1
| 9
| 23
| 52
| 25
| 27
| null | null |
gafiatulin/codewars
|
src/7 kyu/ABC.hs
|
mit
|
alphabetize :: String -> String
alphabetize = sort
| 50
|
alphabetize :: String -> String
alphabetize = sort
| 50
|
alphabetize = sort
| 18
| false
| true
| 0
| 5
| 7
| 15
| 8
| 7
| null | null |
k0001/gtk2hs
|
tools/c2hs/gen/GenBind.hs
|
gpl-3.0
|
variadicErr :: Position -> Position -> GB a
variadicErr pos cpos =
raiseErrorCTExc pos
["Variadic function!",
"Calling variadic functions is not supported by the FFI; the function",
"is defined at " ++ show cpos ++ "."]
| 246
|
variadicErr :: Position -> Position -> GB a
variadicErr pos cpos =
raiseErrorCTExc pos
["Variadic function!",
"Calling variadic functions is not supported by the FFI; the function",
"is defined at " ++ show cpos ++ "."]
| 246
|
variadicErr pos cpos =
raiseErrorCTExc pos
["Variadic function!",
"Calling variadic functions is not supported by the FFI; the function",
"is defined at " ++ show cpos ++ "."]
| 193
| false
| true
| 0
| 8
| 62
| 53
| 26
| 27
| null | null |
phaazon/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
|
bsd-3-clause
|
gl_COMPRESSED_SIGNED_RED_RGTC1 :: GLenum
gl_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC
| 80
|
gl_COMPRESSED_SIGNED_RED_RGTC1 :: GLenum
gl_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC
| 80
|
gl_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC
| 39
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
MarcoSero/gruber
|
Haskeleton.hs
|
mit
|
writeLibraryFile :: String -> IO ()
writeLibraryFile m = writeFile (libraryPath m) (libraryTemplate m)
| 102
|
writeLibraryFile :: String -> IO ()
writeLibraryFile m = writeFile (libraryPath m) (libraryTemplate m)
| 102
|
writeLibraryFile m = writeFile (libraryPath m) (libraryTemplate m)
| 66
| false
| true
| 0
| 7
| 13
| 40
| 19
| 21
| null | null |
carliros/Simple-San-Simon-Functional-Web-Browser
|
src/Parser/PropertyParser.hs
|
bsd-3-clause
|
pFontFamilyList :: Parser Value
pFontFamilyList
= ListValue <$> pList1Sep_ng (pSimboloAmb ",") pFontFamilyValue
| 115
|
pFontFamilyList :: Parser Value
pFontFamilyList
= ListValue <$> pList1Sep_ng (pSimboloAmb ",") pFontFamilyValue
| 115
|
pFontFamilyList
= ListValue <$> pList1Sep_ng (pSimboloAmb ",") pFontFamilyValue
| 83
| false
| true
| 0
| 8
| 15
| 29
| 14
| 15
| null | null |
ghcjs/ghcjs
|
src/Gen2/Compactor.hs
|
mit
|
exprsS f (TryStat s1 i s2 s3) = TryStat <$> exprsS f s1 <*> pure i <*> exprsS f s2 <*> exprsS f s3
| 105
|
exprsS f (TryStat s1 i s2 s3) = TryStat <$> exprsS f s1 <*> pure i <*> exprsS f s2 <*> exprsS f s3
| 105
|
exprsS f (TryStat s1 i s2 s3) = TryStat <$> exprsS f s1 <*> pure i <*> exprsS f s2 <*> exprsS f s3
| 105
| false
| false
| 0
| 9
| 30
| 59
| 26
| 33
| null | null |
vincenthz/tvm
|
tvm.hs
|
bsd-3-clause
|
doGetQemu _ list = "not supported"
| 55
|
doGetQemu _ list = "not supported"
| 55
|
doGetQemu _ list = "not supported"
| 55
| false
| false
| 0
| 5
| 26
| 11
| 5
| 6
| null | null |
dylex/blaze-markup
|
src/Text/Blaze/Internal.hs
|
bsd-3-clause
|
preEscapedLazyTextValue :: LT.Text -- ^ The actual value
-> AttributeValue -- ^ Resulting attribute value
preEscapedLazyTextValue = mconcat . map preEscapedTextValue . LT.toChunks
| 212
|
preEscapedLazyTextValue :: LT.Text -- ^ The actual value
-> AttributeValue
preEscapedLazyTextValue = mconcat . map preEscapedTextValue . LT.toChunks
| 180
|
preEscapedLazyTextValue = mconcat . map preEscapedTextValue . LT.toChunks
| 73
| true
| true
| 0
| 7
| 55
| 32
| 17
| 15
| null | null |
spockwangs/scheme.in.haskell
|
list10.hs
|
unlicense
|
writeProc :: [LispVal] -> IOThrowsError LispVal
writeProc [obj] = writeProc [obj, Port stdout]
| 94
|
writeProc :: [LispVal] -> IOThrowsError LispVal
writeProc [obj] = writeProc [obj, Port stdout]
| 94
|
writeProc [obj] = writeProc [obj, Port stdout]
| 46
| false
| true
| 0
| 7
| 12
| 43
| 21
| 22
| null | null |
wiggly/functional-pokering
|
src/Cards/Output.hs
|
mit
|
putCards :: [Card] -> IO ()
putCards xs = putChunks $ map chunkCard xs
| 70
|
putCards :: [Card] -> IO ()
putCards xs = putChunks $ map chunkCard xs
| 70
|
putCards xs = putChunks $ map chunkCard xs
| 42
| false
| true
| 0
| 7
| 13
| 38
| 18
| 20
| null | null |
GaloisInc/msf-haskell
|
src/MSF/Commands.hs
|
bsd-3-clause
|
-- |Kills all running jobs as when running /jobs -K/ in msfconsole.
kill_jobs :: (QuietCxt s) => MSF s ()
kill_jobs = console_write "jobs -K\n"
| 143
|
kill_jobs :: (QuietCxt s) => MSF s ()
kill_jobs = console_write "jobs -K\n"
| 75
|
kill_jobs = console_write "jobs -K\n"
| 37
| true
| true
| 0
| 7
| 24
| 31
| 16
| 15
| null | null |
ocramz/optimization
|
Test.hs
|
bsd-3-clause
|
helicalX = V3 (-1) 0 0
| 22
|
helicalX = V3 (-1) 0 0
| 22
|
helicalX = V3 (-1) 0 0
| 22
| false
| false
| 0
| 7
| 5
| 18
| 9
| 9
| null | null |
jerhoud/true-real
|
src/Data/TrueReal.hs
|
gpl-3.0
|
logAgm :: R -> R
logAgm x = s *. (pi / agm u v - k *. ln2)
where
x0 = reduce x
(s, ax) | approx x0 > 1 = (1, 1 / x0)
| otherwise = (-1, x0)
t = 1e-4
ra = approx ax
k | ra < t = 0
| otherwise = round (log (ra / t) / log 2)
r = ax `shift` (-k)
rn = powerList r
rno = map (\x -> r * sqr x) rn
rn2 = scanl (*) 1 rno
rnn = zipWith (*) rn2 rn
u = sqr (2 *. series rn2 - 1)
v = sqrt r * sqr (2 *. series rnn)
| 476
|
logAgm :: R -> R
logAgm x = s *. (pi / agm u v - k *. ln2)
where
x0 = reduce x
(s, ax) | approx x0 > 1 = (1, 1 / x0)
| otherwise = (-1, x0)
t = 1e-4
ra = approx ax
k | ra < t = 0
| otherwise = round (log (ra / t) / log 2)
r = ax `shift` (-k)
rn = powerList r
rno = map (\x -> r * sqr x) rn
rn2 = scanl (*) 1 rno
rnn = zipWith (*) rn2 rn
u = sqr (2 *. series rn2 - 1)
v = sqrt r * sqr (2 *. series rnn)
| 476
|
logAgm x = s *. (pi / agm u v - k *. ln2)
where
x0 = reduce x
(s, ax) | approx x0 > 1 = (1, 1 / x0)
| otherwise = (-1, x0)
t = 1e-4
ra = approx ax
k | ra < t = 0
| otherwise = round (log (ra / t) / log 2)
r = ax `shift` (-k)
rn = powerList r
rno = map (\x -> r * sqr x) rn
rn2 = scanl (*) 1 rno
rnn = zipWith (*) rn2 rn
u = sqr (2 *. series rn2 - 1)
v = sqrt r * sqr (2 *. series rnn)
| 459
| false
| true
| 12
| 13
| 190
| 292
| 148
| 144
| null | null |
sol/pandoc
|
src/Text/Pandoc/Readers/Markdown.hs
|
gpl-2.0
|
classAttr :: GenParser Char st ([Char], [[Char]], [a])
classAttr = try $ do
char '.'
result <- identifier
return ("",[result],[])
| 135
|
classAttr :: GenParser Char st ([Char], [[Char]], [a])
classAttr = try $ do
char '.'
result <- identifier
return ("",[result],[])
| 135
|
classAttr = try $ do
char '.'
result <- identifier
return ("",[result],[])
| 80
| false
| true
| 0
| 10
| 25
| 76
| 41
| 35
| null | null |
nymacro/hs-kmip
|
src/Ttlv/Parser/Binary.hs
|
bsd-3-clause
|
unparseTtlvData (TtlvLongInt x) = putWord64be $ fromIntegral x
| 62
|
unparseTtlvData (TtlvLongInt x) = putWord64be $ fromIntegral x
| 62
|
unparseTtlvData (TtlvLongInt x) = putWord64be $ fromIntegral x
| 62
| false
| false
| 0
| 7
| 7
| 22
| 10
| 12
| null | null |
aopp-pred/fp-truncate
|
test/Truncate/Test/Truncatable/Operator.hs
|
apache-2.0
|
test_zeroBin32 :: Assertion
test_zeroBin32 = all (== b) (map (b <#) [0..23]) @?= True
where
b = Bin32 "0"
| 111
|
test_zeroBin32 :: Assertion
test_zeroBin32 = all (== b) (map (b <#) [0..23]) @?= True
where
b = Bin32 "0"
| 111
|
test_zeroBin32 = all (== b) (map (b <#) [0..23]) @?= True
where
b = Bin32 "0"
| 83
| false
| true
| 0
| 9
| 24
| 52
| 28
| 24
| null | null |
romanb/amazonka
|
amazonka-elb/gen/Network/AWS/ELB/SetLoadBalancerListenerSSLCertificate.hs
|
mpl-2.0
|
-- | 'SetLoadBalancerListenerSSLCertificate' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'slblsslcLoadBalancerName' @::@ 'Text'
--
-- * 'slblsslcLoadBalancerPort' @::@ 'Int'
--
-- * 'slblsslcSSLCertificateId' @::@ 'Text'
--
setLoadBalancerListenerSSLCertificate :: Text -- ^ 'slblsslcLoadBalancerName'
-> Int -- ^ 'slblsslcLoadBalancerPort'
-> Text -- ^ 'slblsslcSSLCertificateId'
-> SetLoadBalancerListenerSSLCertificate
setLoadBalancerListenerSSLCertificate p1 p2 p3 = SetLoadBalancerListenerSSLCertificate
{ _slblsslcLoadBalancerName = p1
, _slblsslcLoadBalancerPort = p2
, _slblsslcSSLCertificateId = p3
}
| 778
|
setLoadBalancerListenerSSLCertificate :: Text -- ^ 'slblsslcLoadBalancerName'
-> Int -- ^ 'slblsslcLoadBalancerPort'
-> Text -- ^ 'slblsslcSSLCertificateId'
-> SetLoadBalancerListenerSSLCertificate
setLoadBalancerListenerSSLCertificate p1 p2 p3 = SetLoadBalancerListenerSSLCertificate
{ _slblsslcLoadBalancerName = p1
, _slblsslcLoadBalancerPort = p2
, _slblsslcSSLCertificateId = p3
}
| 515
|
setLoadBalancerListenerSSLCertificate p1 p2 p3 = SetLoadBalancerListenerSSLCertificate
{ _slblsslcLoadBalancerName = p1
, _slblsslcLoadBalancerPort = p2
, _slblsslcSSLCertificateId = p3
}
| 203
| true
| true
| 0
| 9
| 198
| 72
| 43
| 29
| null | null |
parapluu/encore
|
src/ir/AST/AST.hs
|
bsd-3-clause
|
isImpure Suspend {} = True
| 26
|
isImpure Suspend {} = True
| 26
|
isImpure Suspend {} = True
| 26
| false
| false
| 0
| 6
| 4
| 13
| 6
| 7
| null | null |
mzero/barley
|
seed/Chapter03.hs
|
apache-2.0
|
fruit = map (li <<) $ words "apple banana kiki"
| 47
|
fruit = map (li <<) $ words "apple banana kiki"
| 47
|
fruit = map (li <<) $ words "apple banana kiki"
| 47
| false
| false
| 0
| 7
| 9
| 20
| 10
| 10
| null | null |
Melvar/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
sMN :: Int -> String -> Name
sMN i s = MN i (txt s)
| 51
|
sMN :: Int -> String -> Name
sMN i s = MN i (txt s)
| 51
|
sMN i s = MN i (txt s)
| 22
| false
| true
| 0
| 8
| 14
| 42
| 18
| 24
| null | null |
OS2World/DEV-UTIL-HUGS
|
oldlib/AssocList.hs
|
bsd-3-clause
|
toSeq E = S.empty
| 17
|
toSeq E = S.empty
| 17
|
toSeq E = S.empty
| 17
| false
| false
| 0
| 5
| 3
| 11
| 5
| 6
| null | null |
christiaanb/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
eqDataConKey = mkPreludeDataConUnique 28
| 67
|
eqDataConKey = mkPreludeDataConUnique 28
| 67
|
eqDataConKey = mkPreludeDataConUnique 28
| 67
| false
| false
| 0
| 5
| 30
| 9
| 4
| 5
| null | null |
michalkonecny/aern
|
aern-order/src/Numeric/AERN/Misc/List.hs
|
bsd-3-clause
|
sortUsing :: (Ord b) => (a -> b) -> [a] -> [a]
sortUsing f =
List.sortBy compareF
where
compareF a b = compare (f a) (f b)
{-|
Eg: @combinations [[1,2,3],[4,5],[7]] = [[1,4,7], [1,5,7], [2,4,7], [2,5,7], [3,4,7], [3,5,7]]@
-}
| 242
|
sortUsing :: (Ord b) => (a -> b) -> [a] -> [a]
sortUsing f =
List.sortBy compareF
where
compareF a b = compare (f a) (f b)
{-|
Eg: @combinations [[1,2,3],[4,5],[7]] = [[1,4,7], [1,5,7], [2,4,7], [2,5,7], [3,4,7], [3,5,7]]@
-}
| 242
|
sortUsing f =
List.sortBy compareF
where
compareF a b = compare (f a) (f b)
{-|
Eg: @combinations [[1,2,3],[4,5],[7]] = [[1,4,7], [1,5,7], [2,4,7], [2,5,7], [3,4,7], [3,5,7]]@
-}
| 195
| false
| true
| 1
| 10
| 55
| 89
| 42
| 47
| null | null |
rfranek/duckling
|
Duckling/Numeral/SV/Rules.hs
|
bsd-3-clause
|
ruleDecimalWithThousandsSeparator :: Rule
ruleDecimalWithThousandsSeparator = Rule
{ name = "decimal with thousands separator"
, pattern =
[ regex "(\\d+(\\.\\d\\d\\d)+\\,\\d+)"
]
, prod = \tokens -> case tokens of
(Token RegexMatch (GroupMatch (match:_)):_) ->
let dot = Text.singleton '.'
comma = Text.singleton ','
fmt = Text.replace comma dot $ Text.replace dot Text.empty match
in parseDouble fmt >>= double
_ -> Nothing
}
| 495
|
ruleDecimalWithThousandsSeparator :: Rule
ruleDecimalWithThousandsSeparator = Rule
{ name = "decimal with thousands separator"
, pattern =
[ regex "(\\d+(\\.\\d\\d\\d)+\\,\\d+)"
]
, prod = \tokens -> case tokens of
(Token RegexMatch (GroupMatch (match:_)):_) ->
let dot = Text.singleton '.'
comma = Text.singleton ','
fmt = Text.replace comma dot $ Text.replace dot Text.empty match
in parseDouble fmt >>= double
_ -> Nothing
}
| 495
|
ruleDecimalWithThousandsSeparator = Rule
{ name = "decimal with thousands separator"
, pattern =
[ regex "(\\d+(\\.\\d\\d\\d)+\\,\\d+)"
]
, prod = \tokens -> case tokens of
(Token RegexMatch (GroupMatch (match:_)):_) ->
let dot = Text.singleton '.'
comma = Text.singleton ','
fmt = Text.replace comma dot $ Text.replace dot Text.empty match
in parseDouble fmt >>= double
_ -> Nothing
}
| 453
| false
| true
| 0
| 18
| 128
| 147
| 75
| 72
| null | null |
DavidAlphaFox/ghc
|
utils/hsc2hs/HSCParser.hs
|
bsd-3-clause
|
hsString :: Char -> Parser ()
hsString quote = do
s <- lookAhead
case s of
[] -> return ()
c:_ | c == quote -> anyChar_
'\\':c:_
| isSpace c -> do
anyChar_
manySatisfy_ isSpace
char_ '\\' `mplus` return ()
hsString quote
| otherwise -> do any2Chars_; hsString quote
_:_ -> do anyChar_; hsString quote
| 457
|
hsString :: Char -> Parser ()
hsString quote = do
s <- lookAhead
case s of
[] -> return ()
c:_ | c == quote -> anyChar_
'\\':c:_
| isSpace c -> do
anyChar_
manySatisfy_ isSpace
char_ '\\' `mplus` return ()
hsString quote
| otherwise -> do any2Chars_; hsString quote
_:_ -> do anyChar_; hsString quote
| 457
|
hsString quote = do
s <- lookAhead
case s of
[] -> return ()
c:_ | c == quote -> anyChar_
'\\':c:_
| isSpace c -> do
anyChar_
manySatisfy_ isSpace
char_ '\\' `mplus` return ()
hsString quote
| otherwise -> do any2Chars_; hsString quote
_:_ -> do anyChar_; hsString quote
| 427
| false
| true
| 0
| 15
| 212
| 164
| 72
| 92
| null | null |
JobaerChowdhury/release-note-generator
|
src/WreqTest.hs
|
apache-2.0
|
-- We expect this to succeed.
basic_asJSON :: IO ()
basic_asJSON = do
let opts = defaults & param "foo" .~ ["bar"]
r <- asJSON =<< getWith opts "http://httpbin.org/get"
-- The fact that we want a GetBody here will be inferred by our use
-- of the "headers" accessor function.
putStrLn $ "args: " ++ show (args (r ^. responseBody))
-- The response we expect here is valid JSON, but cannot be converted
-- to an [Int], so this will throw a JSONError.
| 464
|
basic_asJSON :: IO ()
basic_asJSON = do
let opts = defaults & param "foo" .~ ["bar"]
r <- asJSON =<< getWith opts "http://httpbin.org/get"
-- The fact that we want a GetBody here will be inferred by our use
-- of the "headers" accessor function.
putStrLn $ "args: " ++ show (args (r ^. responseBody))
-- The response we expect here is valid JSON, but cannot be converted
-- to an [Int], so this will throw a JSONError.
| 433
|
basic_asJSON = do
let opts = defaults & param "foo" .~ ["bar"]
r <- asJSON =<< getWith opts "http://httpbin.org/get"
-- The fact that we want a GetBody here will be inferred by our use
-- of the "headers" accessor function.
putStrLn $ "args: " ++ show (args (r ^. responseBody))
-- The response we expect here is valid JSON, but cannot be converted
-- to an [Int], so this will throw a JSONError.
| 411
| true
| true
| 0
| 12
| 98
| 87
| 44
| 43
| null | null |
jqpeterson/roc-translator
|
src/Protocol/ROC/PointTypes.hs
|
bsd-3-clause
|
decodePTID (PTID10 _) = 10
| 26
|
decodePTID (PTID10 _) = 10
| 26
|
decodePTID (PTID10 _) = 10
| 26
| false
| false
| 0
| 6
| 4
| 16
| 7
| 9
| null | null |
TachoMex/MiniSequel
|
src/MiniSequel/Model.hs
|
mit
|
showType _ _ (SequelVarchar size) = "VARCHAR(" `mappend` show size `mappend` ")"
| 80
|
showType _ _ (SequelVarchar size) = "VARCHAR(" `mappend` show size `mappend` ")"
| 80
|
showType _ _ (SequelVarchar size) = "VARCHAR(" `mappend` show size `mappend` ")"
| 80
| false
| false
| 0
| 7
| 11
| 34
| 18
| 16
| null | null |
yiannist/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- | List of resources which can be queried using Local UniX Interface
qrViaLuxi :: FrozenSet String
qrViaLuxi = ConstantUtils.mkSet [qrGroup,
qrExport,
qrInstance,
qrJob,
qrLock,
qrNetwork,
qrNode,
qrFilter]
| 439
|
qrViaLuxi :: FrozenSet String
qrViaLuxi = ConstantUtils.mkSet [qrGroup,
qrExport,
qrInstance,
qrJob,
qrLock,
qrNetwork,
qrNode,
qrFilter]
| 368
|
qrViaLuxi = ConstantUtils.mkSet [qrGroup,
qrExport,
qrInstance,
qrJob,
qrLock,
qrNetwork,
qrNode,
qrFilter]
| 338
| true
| true
| 0
| 6
| 258
| 44
| 26
| 18
| null | null |
fmapfmapfmap/amazonka
|
amazonka-efs/gen/Network/AWS/ElasticFileSystem/DescribeFileSystems.hs
|
mpl-2.0
|
-- | 'DescribeFileSystemsResponse' smart constructor.
describeFileSystemsResponse :: Int -> DescribeFileSystemsResponse
describeFileSystemsResponse pStatus =
DescribeFileSystemsResponse'
{ _dfsrFileSystems = Nothing
, _dfsrMarker = Nothing
, _dfsrNextMarker = Nothing
, _dfsrStatus = pStatus
}
| 317
|
describeFileSystemsResponse :: Int -> DescribeFileSystemsResponse
describeFileSystemsResponse pStatus =
DescribeFileSystemsResponse'
{ _dfsrFileSystems = Nothing
, _dfsrMarker = Nothing
, _dfsrNextMarker = Nothing
, _dfsrStatus = pStatus
}
| 263
|
describeFileSystemsResponse pStatus =
DescribeFileSystemsResponse'
{ _dfsrFileSystems = Nothing
, _dfsrMarker = Nothing
, _dfsrNextMarker = Nothing
, _dfsrStatus = pStatus
}
| 197
| true
| true
| 0
| 6
| 54
| 45
| 27
| 18
| null | null |
SamRoberts/holumn-experimental
|
Main.hs
|
bsd-3-clause
|
main = putStrLn "let the tests begin!"
| 38
|
main = putStrLn "let the tests begin!"
| 38
|
main = putStrLn "let the tests begin!"
| 38
| false
| false
| 1
| 5
| 6
| 13
| 4
| 9
| null | null |
plietar/super-user-spark
|
test/Parser/Test.hs
|
mit
|
parseItselfs :: Parser String -> [String] -> Assertion
parseItselfs p strs = sequence_ $ map (parseItself p) strs
| 113
|
parseItselfs :: Parser String -> [String] -> Assertion
parseItselfs p strs = sequence_ $ map (parseItself p) strs
| 113
|
parseItselfs p strs = sequence_ $ map (parseItself p) strs
| 58
| false
| true
| 0
| 8
| 17
| 50
| 23
| 27
| null | null |
spinda/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
strengthen (RAppTy t1 t2 r) r' = RAppTy t1 t2 (r `meet` r')
| 60
|
strengthen (RAppTy t1 t2 r) r' = RAppTy t1 t2 (r `meet` r')
| 60
|
strengthen (RAppTy t1 t2 r) r' = RAppTy t1 t2 (r `meet` r')
| 60
| false
| false
| 1
| 7
| 13
| 39
| 19
| 20
| null | null |
ibotty/animalcase
|
src/Text/AnimalCase.hs
|
mit
|
toSnakeCaseB8 :: B8.ByteString -> B8.ByteString
toSnakeCaseB8 = useLazyB8 toSnakeCaseL
| 86
|
toSnakeCaseB8 :: B8.ByteString -> B8.ByteString
toSnakeCaseB8 = useLazyB8 toSnakeCaseL
| 86
|
toSnakeCaseB8 = useLazyB8 toSnakeCaseL
| 38
| false
| true
| 0
| 8
| 8
| 29
| 12
| 17
| null | null |
fmthoma/ghc
|
compiler/rename/RnBinds.hs
|
bsd-3-clause
|
rnBindLHS name_maker _ bind@(FunBind { fun_id = rdr_name })
= do { name <- applyNameMaker name_maker rdr_name
; return (bind { fun_id = name
, bind_fvs = placeHolderNamesTc }) }
| 210
|
rnBindLHS name_maker _ bind@(FunBind { fun_id = rdr_name })
= do { name <- applyNameMaker name_maker rdr_name
; return (bind { fun_id = name
, bind_fvs = placeHolderNamesTc }) }
| 210
|
rnBindLHS name_maker _ bind@(FunBind { fun_id = rdr_name })
= do { name <- applyNameMaker name_maker rdr_name
; return (bind { fun_id = name
, bind_fvs = placeHolderNamesTc }) }
| 210
| false
| false
| 0
| 10
| 62
| 67
| 36
| 31
| null | null |
ahushh/Monaba
|
monaba/src/Handler/Posting.hs
|
mit
|
takeBanner :: Text -> Handler (Maybe (String, String))
takeBanner b = do
let board = unpack b
AppSettings{..} <- appSettings <$> getYesod
liftIO $ unlessM (doesDirectoryExist (appStaticDir </> "banners")) $ createDirectory (appStaticDir </> "banners")
dirExists <- liftIO $ doesDirectoryExist (appStaticDir </> "banners" </> board)
if dirExists
then do
banners <- filter (\b'->b'/="."&&b'/="..") <$> liftIO (getDirectoryContents (appStaticDir </> "banners" </> board))
mBanner <- liftIO $ pick banners
case mBanner of
Just banner -> return $ Just ("/" ++ appStaticDir </> "banners" </> board </> banner, "/" ++ board)
Nothing -> return Nothing
else return Nothing
| 717
|
takeBanner :: Text -> Handler (Maybe (String, String))
takeBanner b = do
let board = unpack b
AppSettings{..} <- appSettings <$> getYesod
liftIO $ unlessM (doesDirectoryExist (appStaticDir </> "banners")) $ createDirectory (appStaticDir </> "banners")
dirExists <- liftIO $ doesDirectoryExist (appStaticDir </> "banners" </> board)
if dirExists
then do
banners <- filter (\b'->b'/="."&&b'/="..") <$> liftIO (getDirectoryContents (appStaticDir </> "banners" </> board))
mBanner <- liftIO $ pick banners
case mBanner of
Just banner -> return $ Just ("/" ++ appStaticDir </> "banners" </> board </> banner, "/" ++ board)
Nothing -> return Nothing
else return Nothing
| 717
|
takeBanner b = do
let board = unpack b
AppSettings{..} <- appSettings <$> getYesod
liftIO $ unlessM (doesDirectoryExist (appStaticDir </> "banners")) $ createDirectory (appStaticDir </> "banners")
dirExists <- liftIO $ doesDirectoryExist (appStaticDir </> "banners" </> board)
if dirExists
then do
banners <- filter (\b'->b'/="."&&b'/="..") <$> liftIO (getDirectoryContents (appStaticDir </> "banners" </> board))
mBanner <- liftIO $ pick banners
case mBanner of
Just banner -> return $ Just ("/" ++ appStaticDir </> "banners" </> board </> banner, "/" ++ board)
Nothing -> return Nothing
else return Nothing
| 662
| false
| true
| 0
| 19
| 147
| 264
| 128
| 136
| null | null |
seanparsons/podcast-chooser
|
src/Main.hs
|
bsd-3-clause
|
playPodcast :: Text -> IO Bool
playPodcast podcastFile = do
runProcessCreatingPipes ignoreTextOutput "git-annex" ["get", unpack podcastFile] ""
runProcessNoPipes ignoreTextOutput "mpv" [unpack podcastFile] ""
return True
| 226
|
playPodcast :: Text -> IO Bool
playPodcast podcastFile = do
runProcessCreatingPipes ignoreTextOutput "git-annex" ["get", unpack podcastFile] ""
runProcessNoPipes ignoreTextOutput "mpv" [unpack podcastFile] ""
return True
| 226
|
playPodcast podcastFile = do
runProcessCreatingPipes ignoreTextOutput "git-annex" ["get", unpack podcastFile] ""
runProcessNoPipes ignoreTextOutput "mpv" [unpack podcastFile] ""
return True
| 195
| false
| true
| 0
| 9
| 30
| 66
| 30
| 36
| null | null |
hxw/conlecterm
|
src/ConfigurationParser.hs
|
bsd-2-clause
|
comma :: ParsecT String UserState IO String
comma = P.comma lexer
| 80
|
comma :: ParsecT String UserState IO String
comma = P.comma lexer
| 80
|
comma = P.comma lexer
| 29
| false
| true
| 0
| 6
| 25
| 25
| 12
| 13
| null | null |
webcrank/webcrank.hs
|
test/DecisionTests.hs
|
bsd-3-clause
|
afterWith
:: FlowChart (HaltT TestCrank) Status
-> Resource TestCrank
-> Req
-> (ReqData -> ReqData)
-> (Decision', ReqData)
afterWith s r rq f = run where
run = case runReader (runCatchT $ step s r f) rq of
Left e -> error $ show e
Right a -> a
| 265
|
afterWith
:: FlowChart (HaltT TestCrank) Status
-> Resource TestCrank
-> Req
-> (ReqData -> ReqData)
-> (Decision', ReqData)
afterWith s r rq f = run where
run = case runReader (runCatchT $ step s r f) rq of
Left e -> error $ show e
Right a -> a
| 265
|
afterWith s r rq f = run where
run = case runReader (runCatchT $ step s r f) rq of
Left e -> error $ show e
Right a -> a
| 130
| false
| true
| 6
| 9
| 68
| 135
| 58
| 77
| null | null |
AlexanderPankiv/ghc
|
compiler/stgSyn/CoreToStg.hs
|
bsd-3-clause
|
myCollectBinders :: Expr Var -> ([Var], Expr Var)
myCollectBinders expr
= go [] expr
where
go bs (Lam b e) = go (b:bs) e
go bs (Cast e _) = go bs e
go bs e = (reverse bs, e)
| 223
|
myCollectBinders :: Expr Var -> ([Var], Expr Var)
myCollectBinders expr
= go [] expr
where
go bs (Lam b e) = go (b:bs) e
go bs (Cast e _) = go bs e
go bs e = (reverse bs, e)
| 223
|
myCollectBinders expr
= go [] expr
where
go bs (Lam b e) = go (b:bs) e
go bs (Cast e _) = go bs e
go bs e = (reverse bs, e)
| 173
| false
| true
| 0
| 9
| 89
| 127
| 58
| 69
| null | null |
d0kt0r0/estuary
|
client/src/Estuary/Help/Maria.hs
|
gpl-3.0
|
about :: MonadWidget t m => m ()
about = do
divClass "about primary-color code-font" $ text "María"
divClass "about primary-color code-font" $ text "A mini live coding esolang developed in Quito, Ecuador."
| 207
|
about :: MonadWidget t m => m ()
about = do
divClass "about primary-color code-font" $ text "María"
divClass "about primary-color code-font" $ text "A mini live coding esolang developed in Quito, Ecuador."
| 207
|
about = do
divClass "about primary-color code-font" $ text "María"
divClass "about primary-color code-font" $ text "A mini live coding esolang developed in Quito, Ecuador."
| 174
| false
| true
| 0
| 8
| 34
| 51
| 22
| 29
| null | null |
tjunier/mlgsc
|
test/test_mlgsc_train.hs
|
mit
|
args2 = "-B -w n ./data/firmicute_Spo0A_byGenus.msa ./data/firmicute_genera.nw"
| 79
|
args2 = "-B -w n ./data/firmicute_Spo0A_byGenus.msa ./data/firmicute_genera.nw"
| 79
|
args2 = "-B -w n ./data/firmicute_Spo0A_byGenus.msa ./data/firmicute_genera.nw"
| 79
| false
| false
| 0
| 4
| 6
| 6
| 3
| 3
| null | null |
scan/yampa-sdl
|
src/FRP/Yampa/SDL/Event.hs
|
mit
|
mousePosition :: SF Events (Int, Int)
mousePosition = hold (0,0) <<< arr f
where
f ev | null e = NoEvent
| otherwise = Event $ c $ last e
where
e = filter f' ev
f' (MouseMotion _ _ _ _) = True
f' _ = False
c (MouseMotion x y _ _) = (fromIntegral x, fromIntegral y)
| 366
|
mousePosition :: SF Events (Int, Int)
mousePosition = hold (0,0) <<< arr f
where
f ev | null e = NoEvent
| otherwise = Event $ c $ last e
where
e = filter f' ev
f' (MouseMotion _ _ _ _) = True
f' _ = False
c (MouseMotion x y _ _) = (fromIntegral x, fromIntegral y)
| 366
|
mousePosition = hold (0,0) <<< arr f
where
f ev | null e = NoEvent
| otherwise = Event $ c $ last e
where
e = filter f' ev
f' (MouseMotion _ _ _ _) = True
f' _ = False
c (MouseMotion x y _ _) = (fromIntegral x, fromIntegral y)
| 328
| false
| true
| 0
| 9
| 160
| 149
| 73
| 76
| null | null |
mimi1vx/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkComparisonAgainstGlob = verify checkComparisonAgainstGlob "[[ $cow == $bar ]]"
| 88
|
prop_checkComparisonAgainstGlob = verify checkComparisonAgainstGlob "[[ $cow == $bar ]]"
| 88
|
prop_checkComparisonAgainstGlob = verify checkComparisonAgainstGlob "[[ $cow == $bar ]]"
| 88
| false
| false
| 1
| 5
| 8
| 14
| 5
| 9
| null | null |
joshuaclayton/unused
|
src/Unused/TermSearch.hs
|
mit
|
extractSearchResults Ag (_, stdout, _) = stdout
| 47
|
extractSearchResults Ag (_, stdout, _) = stdout
| 47
|
extractSearchResults Ag (_, stdout, _) = stdout
| 47
| false
| false
| 0
| 6
| 6
| 20
| 11
| 9
| null | null |
spechub/Hets
|
OWL2/ShipSyntax.hs
|
gpl-2.0
|
binC :: ([a] -> a) -> Char -> CharParser st a -> CharParser st a
binC f c = binPP f $ skipChar c
| 96
|
binC :: ([a] -> a) -> Char -> CharParser st a -> CharParser st a
binC f c = binPP f $ skipChar c
| 96
|
binC f c = binPP f $ skipChar c
| 31
| false
| true
| 0
| 8
| 23
| 62
| 29
| 33
| null | null |
rueshyna/gogol
|
gogol-apps-reseller/gen/Network/Google/AppsReseller/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'Subscriptions' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sNextPageToken'
--
-- * 'sKind'
--
-- * 'sSubscriptions'
subscriptions
:: Subscriptions
subscriptions =
Subscriptions'
{ _sNextPageToken = Nothing
, _sKind = "reseller#subscriptions"
, _sSubscriptions = Nothing
}
| 410
|
subscriptions
:: Subscriptions
subscriptions =
Subscriptions'
{ _sNextPageToken = Nothing
, _sKind = "reseller#subscriptions"
, _sSubscriptions = Nothing
}
| 179
|
subscriptions =
Subscriptions'
{ _sNextPageToken = Nothing
, _sKind = "reseller#subscriptions"
, _sSubscriptions = Nothing
}
| 144
| true
| true
| 0
| 6
| 84
| 40
| 28
| 12
| null | null |
quakehead/haskell-scheme
|
Parse.hs
|
gpl-3.0
|
escape '\\' = '\\'
| 18
|
escape '\\' = '\\'
| 18
|
escape '\\' = '\\'
| 18
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
fumieval/audiovisual
|
src/Data/Input/Event.hs
|
bsd-3-clause
|
charToKey ' ' = KeySpace
| 24
|
charToKey ' ' = KeySpace
| 24
|
charToKey ' ' = KeySpace
| 24
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
binesiyu/ifl
|
book/utils.hs
|
mit
|
mapAccuml f acc (x:xs) = (acc2, x':xs')
where (acc1, x') = f acc x
(acc2, xs') = mapAccuml f acc1 xs
| 157
|
mapAccuml f acc (x:xs) = (acc2, x':xs')
where (acc1, x') = f acc x
(acc2, xs') = mapAccuml f acc1 xs
| 157
|
mapAccuml f acc (x:xs) = (acc2, x':xs')
where (acc1, x') = f acc x
(acc2, xs') = mapAccuml f acc1 xs
| 157
| false
| false
| 0
| 7
| 77
| 68
| 36
| 32
| null | null |
karianna/jdk8_tl
|
jdk/src/macosx/native/jobjc/src/core/PrimitiveCoder.hs
|
gpl-2.0
|
pushAddr W32 Nulong = "rt.unsafe.putInt(addr, (int) x);"
| 56
|
pushAddr W32 Nulong = "rt.unsafe.putInt(addr, (int) x);"
| 56
|
pushAddr W32 Nulong = "rt.unsafe.putInt(addr, (int) x);"
| 56
| false
| false
| 0
| 5
| 6
| 13
| 5
| 8
| null | null |
Cadasta/django-tutelary
|
experiments/Tutelary.hs
|
agpl-3.0
|
h4h_parcel_123 = readObject "H4H/PortAuPrince/parcel/123"
| 57
|
h4h_parcel_123 = readObject "H4H/PortAuPrince/parcel/123"
| 57
|
h4h_parcel_123 = readObject "H4H/PortAuPrince/parcel/123"
| 57
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
nakamuray/htig
|
HTIG/Utils.hs
|
bsd-3-clause
|
writeStatus' :: (UserSpec -> ChannelName -> CommandArg -> HTIG ())
-> MessageType
-> ChannelName -> Status -> HTIG ()
writeStatus' w t cname st = do
hook <- statusHook . gsHConfig <$> getGlobal
mst <- runHook hook (MsgCtx t cname) st
case mst of
Just st' -> let nick = BU.fromString $ usScreenName $ stUser st'
in w (Nick nick) cname $ BU.fromString $ stText st'
Nothing -> debug ("this status is dropped", st) >> return ()
| 498
|
writeStatus' :: (UserSpec -> ChannelName -> CommandArg -> HTIG ())
-> MessageType
-> ChannelName -> Status -> HTIG ()
writeStatus' w t cname st = do
hook <- statusHook . gsHConfig <$> getGlobal
mst <- runHook hook (MsgCtx t cname) st
case mst of
Just st' -> let nick = BU.fromString $ usScreenName $ stUser st'
in w (Nick nick) cname $ BU.fromString $ stText st'
Nothing -> debug ("this status is dropped", st) >> return ()
| 498
|
writeStatus' w t cname st = do
hook <- statusHook . gsHConfig <$> getGlobal
mst <- runHook hook (MsgCtx t cname) st
case mst of
Just st' -> let nick = BU.fromString $ usScreenName $ stUser st'
in w (Nick nick) cname $ BU.fromString $ stText st'
Nothing -> debug ("this status is dropped", st) >> return ()
| 354
| false
| true
| 0
| 16
| 151
| 186
| 88
| 98
| null | null |
facundominguez/package-loader
|
src/System/Loader/Package/ZEncoding.hs
|
lgpl-2.1
|
encode_ch ':' = "ZC"
| 21
|
encode_ch ':' = "ZC"
| 21
|
encode_ch ':' = "ZC"
| 21
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
kmilner/tamarin-prover
|
lib/theory/src/Theory/Constraint/System.hs
|
gpl-3.0
|
-- | Returns a node conclusion fact from a node map
nodeConcFactMap :: NodeConc -> M.Map NodeId RuleACInst -> LNFact
nodeConcFactMap (v, i) nodes = L.get (rConc i) $ nodeRuleMap v nodes
| 185
|
nodeConcFactMap :: NodeConc -> M.Map NodeId RuleACInst -> LNFact
nodeConcFactMap (v, i) nodes = L.get (rConc i) $ nodeRuleMap v nodes
| 133
|
nodeConcFactMap (v, i) nodes = L.get (rConc i) $ nodeRuleMap v nodes
| 68
| true
| true
| 0
| 8
| 31
| 62
| 30
| 32
| null | null |
nushio3/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
ppr_cmd (HsCmdDo (L _ stmts) _) = pprDo ArrowExpr stmts
| 56
|
ppr_cmd (HsCmdDo (L _ stmts) _) = pprDo ArrowExpr stmts
| 56
|
ppr_cmd (HsCmdDo (L _ stmts) _) = pprDo ArrowExpr stmts
| 56
| false
| false
| 0
| 9
| 10
| 30
| 14
| 16
| null | null |
stu-smith/Brandy
|
src/ApiUtility.hs
|
mit
|
validateDbInsert :: Maybe a -> EitherT ApiError BrandyActionM a
validateDbInsert =
validateDbInternal conflict409 "Already in use."
| 135
|
validateDbInsert :: Maybe a -> EitherT ApiError BrandyActionM a
validateDbInsert =
validateDbInternal conflict409 "Already in use."
| 135
|
validateDbInsert =
validateDbInternal conflict409 "Already in use."
| 71
| false
| true
| 0
| 6
| 19
| 30
| 14
| 16
| null | null |
UU-ComputerScience/uu-cco
|
uu-cco-hut-parsing/src/CCO/Parsing/UU.hs
|
bsd-3-clause
|
ppMessage :: (Eq s, Show s) => Message s (Maybe s) -> Doc
ppMessage (Msg exp pos action)
= above [ppHeader, ppUnexpected, ppExpected]
where
ppHeader = wrapped "Parse error."
ppUnexpected = text "*** Unexpected : " >|< wrapped (describePosition pos)
ppExpected = text "*** Expected : " >|< wrapped (describeExpecting exp)
-- | Describes a symbol or the end of input.
| 391
|
ppMessage :: (Eq s, Show s) => Message s (Maybe s) -> Doc
ppMessage (Msg exp pos action)
= above [ppHeader, ppUnexpected, ppExpected]
where
ppHeader = wrapped "Parse error."
ppUnexpected = text "*** Unexpected : " >|< wrapped (describePosition pos)
ppExpected = text "*** Expected : " >|< wrapped (describeExpecting exp)
-- | Describes a symbol or the end of input.
| 391
|
ppMessage (Msg exp pos action)
= above [ppHeader, ppUnexpected, ppExpected]
where
ppHeader = wrapped "Parse error."
ppUnexpected = text "*** Unexpected : " >|< wrapped (describePosition pos)
ppExpected = text "*** Expected : " >|< wrapped (describeExpecting exp)
-- | Describes a symbol or the end of input.
| 333
| false
| true
| 2
| 9
| 86
| 129
| 61
| 68
| null | null |
JAnthelme/relation-tool
|
test/Spec.hs
|
bsd-3-clause
|
rndtys = [tyB,tyC,tyS, tyT,tyI,tyJ,tyD,tyDD,tyDT]
| 53
|
rndtys = [tyB,tyC,tyS, tyT,tyI,tyJ,tyD,tyDD,tyDT]
| 53
|
rndtys = [tyB,tyC,tyS, tyT,tyI,tyJ,tyD,tyDD,tyDT]
| 53
| false
| false
| 1
| 5
| 7
| 36
| 21
| 15
| null | null |
vTurbine/ghc
|
compiler/basicTypes/Name.hs
|
bsd-3-clause
|
ppr_occ_name :: OccName -> SDoc
ppr_occ_name occ = ftext (occNameFS occ)
| 72
|
ppr_occ_name :: OccName -> SDoc
ppr_occ_name occ = ftext (occNameFS occ)
| 72
|
ppr_occ_name occ = ftext (occNameFS occ)
| 40
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
input-output-hk/pos-haskell-prototype
|
wallet/test/unit/InputSelection/Evaluation/Generic.hs
|
mit
|
-- | Render a complete set of plot instructions
writePlotInstrs :: CoinSelDom dom
=> EvalOptions -> FilePath -> Bounds dom -> [PlotInstr] -> IO ()
writePlotInstrs EvalOptions{..} script bounds is = do
withFile script WriteMode $ \h -> do
Text.hPutStrLn h $ sformat
( "set grid\n"
% "set term png size " % build % ", " % build % "\n"
% build
)
width height
splitPrelude
forM_ is $ Text.hPutStrLn h
. renderPlotInstr
utxoBinSize
bounds
setupSplitAxis
resetSplitAxis
where
Resolution width height = resolution
(splitPrelude, setupSplitAxis, resetSplitAxis) =
Range.renderSplitAxis (binSizeToInt utxoBinSize) 25
(bounds ^. boundsUtxoHistogram . Range.splitXRanges)
{-------------------------------------------------------------------------------
Render observations
-------------------------------------------------------------------------------}
-- | Sink that writes statistics to disk
| 1,098
|
writePlotInstrs :: CoinSelDom dom
=> EvalOptions -> FilePath -> Bounds dom -> [PlotInstr] -> IO ()
writePlotInstrs EvalOptions{..} script bounds is = do
withFile script WriteMode $ \h -> do
Text.hPutStrLn h $ sformat
( "set grid\n"
% "set term png size " % build % ", " % build % "\n"
% build
)
width height
splitPrelude
forM_ is $ Text.hPutStrLn h
. renderPlotInstr
utxoBinSize
bounds
setupSplitAxis
resetSplitAxis
where
Resolution width height = resolution
(splitPrelude, setupSplitAxis, resetSplitAxis) =
Range.renderSplitAxis (binSizeToInt utxoBinSize) 25
(bounds ^. boundsUtxoHistogram . Range.splitXRanges)
{-------------------------------------------------------------------------------
Render observations
-------------------------------------------------------------------------------}
-- | Sink that writes statistics to disk
| 1,050
|
writePlotInstrs EvalOptions{..} script bounds is = do
withFile script WriteMode $ \h -> do
Text.hPutStrLn h $ sformat
( "set grid\n"
% "set term png size " % build % ", " % build % "\n"
% build
)
width height
splitPrelude
forM_ is $ Text.hPutStrLn h
. renderPlotInstr
utxoBinSize
bounds
setupSplitAxis
resetSplitAxis
where
Resolution width height = resolution
(splitPrelude, setupSplitAxis, resetSplitAxis) =
Range.renderSplitAxis (binSizeToInt utxoBinSize) 25
(bounds ^. boundsUtxoHistogram . Range.splitXRanges)
{-------------------------------------------------------------------------------
Render observations
-------------------------------------------------------------------------------}
-- | Sink that writes statistics to disk
| 935
| true
| true
| 1
| 20
| 323
| 220
| 105
| 115
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F23.hs
|
bsd-3-clause
|
-- glRectxvOES -----------------------------------------------------------------
glRectxvOES
:: MonadIO m
=> Ptr GLfixed -- ^ @v1@ pointing to @2@ elements of type @GLfixed@.
-> Ptr GLfixed -- ^ @v2@ pointing to @2@ elements of type @GLfixed@.
-> m ()
glRectxvOES v1 v2 = liftIO $ dyn716 ptr_glRectxvOES v1 v2
| 318
|
glRectxvOES
:: MonadIO m
=> Ptr GLfixed -- ^ @v1@ pointing to @2@ elements of type @GLfixed@.
-> Ptr GLfixed -- ^ @v2@ pointing to @2@ elements of type @GLfixed@.
-> m ()
glRectxvOES v1 v2 = liftIO $ dyn716 ptr_glRectxvOES v1 v2
| 236
|
glRectxvOES v1 v2 = liftIO $ dyn716 ptr_glRectxvOES v1 v2
| 57
| true
| true
| 0
| 10
| 54
| 60
| 28
| 32
| null | null |
mightymoose/liquidhaskell
|
benchmarks/containers-0.5.0.0/tests/set-properties.hs
|
bsd-3-clause
|
prop_List :: [Int] -> Bool
prop_List xs = (sort (nub xs) == toList (fromList xs))
| 81
|
prop_List :: [Int] -> Bool
prop_List xs = (sort (nub xs) == toList (fromList xs))
| 81
|
prop_List xs = (sort (nub xs) == toList (fromList xs))
| 54
| false
| true
| 0
| 9
| 14
| 46
| 23
| 23
| null | null |
jrclogic/SMCDEL
|
src/SMCDEL/Symbolic/S5.hs
|
gpl-2.0
|
bddOf kns (Conj forms) = conSet $ map (bddOf kns) forms
| 56
|
bddOf kns (Conj forms) = conSet $ map (bddOf kns) forms
| 56
|
bddOf kns (Conj forms) = conSet $ map (bddOf kns) forms
| 56
| false
| false
| 0
| 8
| 11
| 33
| 15
| 18
| null | null |
igor720/postgis-simple
|
src/Postgis/Simple/Types/Default.hs
|
mit
|
putPointND :: Putter PointND
putPointND (Point2D x y) = putPoint (x, y, Nothing, Nothing)
| 94
|
putPointND :: Putter PointND
putPointND (Point2D x y) = putPoint (x, y, Nothing, Nothing)
| 94
|
putPointND (Point2D x y) = putPoint (x, y, Nothing, Nothing)
| 65
| false
| true
| 0
| 7
| 18
| 40
| 21
| 19
| null | null |
FPtje/LuaAnalysis
|
analysis/src/GLua/Lexer.hs
|
lgpl-2.1
|
parseString :: LParser Token
parseString = DQString <$> parseLineString '"' <<|>
SQString <$> parseLineString '\'' <<|>
-- Parse either a multiline string or just a bracket.
-- Placed here because they have the first token '[' in common
pSym '[' <**> ((\_ -> MLString . (:) '[') <$$> nestedString <<|>
const <$> pReturn LSquare)
| 408
|
parseString :: LParser Token
parseString = DQString <$> parseLineString '"' <<|>
SQString <$> parseLineString '\'' <<|>
-- Parse either a multiline string or just a bracket.
-- Placed here because they have the first token '[' in common
pSym '[' <**> ((\_ -> MLString . (:) '[') <$$> nestedString <<|>
const <$> pReturn LSquare)
| 408
|
parseString = DQString <$> parseLineString '"' <<|>
SQString <$> parseLineString '\'' <<|>
-- Parse either a multiline string or just a bracket.
-- Placed here because they have the first token '[' in common
pSym '[' <**> ((\_ -> MLString . (:) '[') <$$> nestedString <<|>
const <$> pReturn LSquare)
| 379
| false
| true
| 1
| 14
| 133
| 84
| 41
| 43
| null | null |
spechub/Hets
|
CASL/CCC/OnePoint.hs
|
gpl-2.0
|
evaluateOnePointFORMULA _ (Mixfix_formula _) = error "Fehler Mixfix_formula"
| 76
|
evaluateOnePointFORMULA _ (Mixfix_formula _) = error "Fehler Mixfix_formula"
| 76
|
evaluateOnePointFORMULA _ (Mixfix_formula _) = error "Fehler Mixfix_formula"
| 76
| false
| false
| 0
| 7
| 7
| 20
| 9
| 11
| null | null |
bennofs/cabal
|
cabal-install/Distribution/Client/ProjectPlanning.hs
|
bsd-3-clause
|
programsMonitorFiles :: ProgramDb -> [MonitorFilePath]
programsMonitorFiles progdb =
[ monitor
| prog <- configuredPrograms progdb
, monitor <- monitorFileSearchPath (programMonitorFiles prog)
(programPath prog)
]
| 271
|
programsMonitorFiles :: ProgramDb -> [MonitorFilePath]
programsMonitorFiles progdb =
[ monitor
| prog <- configuredPrograms progdb
, monitor <- monitorFileSearchPath (programMonitorFiles prog)
(programPath prog)
]
| 271
|
programsMonitorFiles progdb =
[ monitor
| prog <- configuredPrograms progdb
, monitor <- monitorFileSearchPath (programMonitorFiles prog)
(programPath prog)
]
| 216
| false
| true
| 0
| 11
| 81
| 66
| 31
| 35
| null | null |
ihc/futhark
|
src/Futhark/Optimise/Simplifier/Engine.hs
|
isc
|
isInPlaceBound :: BlockPred m
isInPlaceBound _ = not . all ((==BindVar) . patElemBindage) .
patternElements . stmPattern
| 139
|
isInPlaceBound :: BlockPred m
isInPlaceBound _ = not . all ((==BindVar) . patElemBindage) .
patternElements . stmPattern
| 139
|
isInPlaceBound _ = not . all ((==BindVar) . patElemBindage) .
patternElements . stmPattern
| 109
| false
| true
| 0
| 11
| 35
| 43
| 22
| 21
| null | null |
mpickering/ghc-exactprint
|
src/Language/Haskell/GHC/ExactPrint/Parsers.hs
|
bsd-3-clause
|
parsePattern :: Parser (GHC.LPat GHC.RdrName)
parsePattern df fp = parseWith df fp GHC.parsePattern
| 99
|
parsePattern :: Parser (GHC.LPat GHC.RdrName)
parsePattern df fp = parseWith df fp GHC.parsePattern
| 99
|
parsePattern df fp = parseWith df fp GHC.parsePattern
| 53
| false
| true
| 2
| 7
| 12
| 47
| 18
| 29
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Smart.hs
|
bsd-3-clause
|
mkBAnd :: (Elt t, IsIntegral t) => Exp t -> Exp t -> Exp t
mkBAnd x y = Exp $ PrimBAnd integralType `PrimApp` tup2 (x, y)
| 121
|
mkBAnd :: (Elt t, IsIntegral t) => Exp t -> Exp t -> Exp t
mkBAnd x y = Exp $ PrimBAnd integralType `PrimApp` tup2 (x, y)
| 121
|
mkBAnd x y = Exp $ PrimBAnd integralType `PrimApp` tup2 (x, y)
| 62
| false
| true
| 0
| 8
| 26
| 70
| 35
| 35
| null | null |
nyson/colourcomp
|
ColComp.hs
|
mit
|
main = do
url <- urlHash
let table = urlTable $ drop 1 url
elems <- mapM elemById ["left", "right", "leftCol", "rightCol"]
case catMaybes elems of
[left, right, leftCol, rightCol] -> do
setCol left leftCol
case lookup 'l' table of
Just col -> setProp left "value" col
Nothing -> do col <- randomColour
setProp left "value" col
case lookup 'r' table of
Just col -> setProp right "value" col
Nothing -> do col <- randomColour
setProp right "value" col
setCol left leftCol
setCol right rightCol
left `onEvent` KeyUp $ \_ -> setCol left leftCol
right `onEvent` KeyUp $ \_ -> setCol right rightCol
return ()
_ -> alert $ "I'm missing some elements here! Make sure you have "
++ "'left', 'right', 'leftCol' and 'rightCol'!"
| 869
|
main = do
url <- urlHash
let table = urlTable $ drop 1 url
elems <- mapM elemById ["left", "right", "leftCol", "rightCol"]
case catMaybes elems of
[left, right, leftCol, rightCol] -> do
setCol left leftCol
case lookup 'l' table of
Just col -> setProp left "value" col
Nothing -> do col <- randomColour
setProp left "value" col
case lookup 'r' table of
Just col -> setProp right "value" col
Nothing -> do col <- randomColour
setProp right "value" col
setCol left leftCol
setCol right rightCol
left `onEvent` KeyUp $ \_ -> setCol left leftCol
right `onEvent` KeyUp $ \_ -> setCol right rightCol
return ()
_ -> alert $ "I'm missing some elements here! Make sure you have "
++ "'left', 'right', 'leftCol' and 'rightCol'!"
| 869
|
main = do
url <- urlHash
let table = urlTable $ drop 1 url
elems <- mapM elemById ["left", "right", "leftCol", "rightCol"]
case catMaybes elems of
[left, right, leftCol, rightCol] -> do
setCol left leftCol
case lookup 'l' table of
Just col -> setProp left "value" col
Nothing -> do col <- randomColour
setProp left "value" col
case lookup 'r' table of
Just col -> setProp right "value" col
Nothing -> do col <- randomColour
setProp right "value" col
setCol left leftCol
setCol right rightCol
left `onEvent` KeyUp $ \_ -> setCol left leftCol
right `onEvent` KeyUp $ \_ -> setCol right rightCol
return ()
_ -> alert $ "I'm missing some elements here! Make sure you have "
++ "'left', 'right', 'leftCol' and 'rightCol'!"
| 869
| false
| false
| 1
| 18
| 276
| 282
| 129
| 153
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/enumFrom_6.hs
|
mit
|
primCmpInt (Pos x) (Neg y) = GT
| 31
|
primCmpInt (Pos x) (Neg y) = GT
| 31
|
primCmpInt (Pos x) (Neg y) = GT
| 31
| false
| false
| 0
| 6
| 6
| 25
| 11
| 14
| null | null |
GaloisInc/halvm-ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
isValueUnfolding :: Unfolding -> Bool
-- Returns False for OtherCon
isValueUnfolding (CoreUnfolding { uf_is_value = is_evald }) = is_evald
| 146
|
isValueUnfolding :: Unfolding -> Bool
isValueUnfolding (CoreUnfolding { uf_is_value = is_evald }) = is_evald
| 108
|
isValueUnfolding (CoreUnfolding { uf_is_value = is_evald }) = is_evald
| 70
| true
| true
| 3
| 7
| 26
| 38
| 18
| 20
| null | null |
swift-nav/ecstatic
|
Development/Ecstatic/BoundsCheck.hs
|
bsd-2-clause
|
-- for loop of the form: for (i = lower; i <= upper; i++) { s; }
subForU' i lower (Just (CBinary CLeqOp (CVar ii n1) upper n2)) (Just (CUnary CPostIncOp (CVar iii n3) n4)) s =
if ii == i && iii == i
-- substitute upper bound on i == upper
then subForU $ substitute i upper s
else s
| 295
|
subForU' i lower (Just (CBinary CLeqOp (CVar ii n1) upper n2)) (Just (CUnary CPostIncOp (CVar iii n3) n4)) s =
if ii == i && iii == i
-- substitute upper bound on i == upper
then subForU $ substitute i upper s
else s
| 230
|
subForU' i lower (Just (CBinary CLeqOp (CVar ii n1) upper n2)) (Just (CUnary CPostIncOp (CVar iii n3) n4)) s =
if ii == i && iii == i
-- substitute upper bound on i == upper
then subForU $ substitute i upper s
else s
| 230
| true
| false
| 0
| 11
| 75
| 100
| 51
| 49
| null | null |
xmonad/xmonad-contrib
|
XMonad/Actions/TagWindows.hs
|
bsd-3-clause
|
tagDelPrompt :: XPConfig -> X ()
tagDelPrompt c = do
sc <- tagDelComplList
when (sc /= []) $
mkXPrompt TagPrompt c (mkComplFunFromList' c sc) (withFocused . delTag)
| 172
|
tagDelPrompt :: XPConfig -> X ()
tagDelPrompt c = do
sc <- tagDelComplList
when (sc /= []) $
mkXPrompt TagPrompt c (mkComplFunFromList' c sc) (withFocused . delTag)
| 172
|
tagDelPrompt c = do
sc <- tagDelComplList
when (sc /= []) $
mkXPrompt TagPrompt c (mkComplFunFromList' c sc) (withFocused . delTag)
| 139
| false
| true
| 0
| 11
| 34
| 73
| 35
| 38
| null | null |
plumlife/cabal
|
Cabal/Distribution/PackageDescription/Configuration.hs
|
bsd-3-clause
|
benchFillInDefaults :: Benchmark -> Benchmark
benchFillInDefaults bm@(Benchmark { benchmarkBuildInfo = bi }) =
bm { benchmarkBuildInfo = biFillInDefaults bi }
| 162
|
benchFillInDefaults :: Benchmark -> Benchmark
benchFillInDefaults bm@(Benchmark { benchmarkBuildInfo = bi }) =
bm { benchmarkBuildInfo = biFillInDefaults bi }
| 162
|
benchFillInDefaults bm@(Benchmark { benchmarkBuildInfo = bi }) =
bm { benchmarkBuildInfo = biFillInDefaults bi }
| 116
| false
| true
| 3
| 5
| 23
| 39
| 21
| 18
| null | null |
djoyner/zigbee-znet25
|
src/Network/Protocol/ZigBee/ZNet25/Constants.hs
|
bsd-3-clause
|
apiIdExplicitAddressingZigBeeCommandFrame = 0x11 :: Word8
| 57
|
apiIdExplicitAddressingZigBeeCommandFrame = 0x11 :: Word8
| 57
|
apiIdExplicitAddressingZigBeeCommandFrame = 0x11 :: Word8
| 57
| false
| false
| 0
| 4
| 4
| 9
| 5
| 4
| null | null |
aaronc/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
-- Return all names, free or globally bound, in the given term.
allNamesIn :: PTerm -> [Name]
allNamesIn tm = nub $ ni 0 [] tm
where -- TODO THINK added niTacImp, but is it right?
ni 0 env (PRef _ _ n)
| not (n `elem` env) = [n]
ni 0 env (PPatvar _ n) = [n]
ni 0 env (PApp _ f as) = ni 0 env f ++ concatMap (ni 0 env) (map getTm as)
ni 0 env (PAppBind _ f as) = ni 0 env f ++ concatMap (ni 0 env) (map getTm as)
ni 0 env (PCase _ c os) = ni 0 env c ++ concatMap (ni 0 env) (map snd os)
ni 0 env (PIfThenElse _ c t f) = ni 0 env c ++ ni 0 env t ++ ni 0 env f
ni 0 env (PLam fc n _ ty sc) = ni 0 env ty ++ ni 0 (n:env) sc
ni 0 env (PPi p n _ ty sc) = niTacImp 0 env p ++ ni 0 env ty ++ ni 0 (n:env) sc
ni 0 env (PLet _ n _ ty val sc) = ni 0 env ty ++ ni 0 env val ++ ni 0 (n:env) sc
ni 0 env (PHidden tm) = ni 0 env tm
ni 0 env (PRewrite _ l r _) = ni 0 env l ++ ni 0 env r
ni 0 env (PTyped l r) = ni 0 env l ++ ni 0 env r
ni 0 env (PPair _ _ _ l r) = ni 0 env l ++ ni 0 env r
ni 0 env (PDPair _ _ _ (PRef _ _ n) Placeholder r) = n : ni 0 env r
ni 0 env (PDPair _ _ _ (PRef _ _ n) t r) = ni 0 env t ++ ni 0 (n:env) r
ni 0 env (PDPair _ _ _ l t r) = ni 0 env l ++ ni 0 env t ++ ni 0 env r
ni 0 env (PAlternative ns a ls) = concatMap (ni 0 env) ls
ni 0 env (PUnifyLog tm) = ni 0 env tm
ni 0 env (PDisamb _ tm) = ni 0 env tm
ni 0 env (PNoImplicits tm) = ni 0 env tm
ni i env (PQuasiquote tm ty) = ni (i+1) env tm ++ maybe [] (ni i env) ty
ni i env (PUnquote tm) = ni (i - 1) env tm
ni i env tm = concatMap (ni i env) (children tm)
niTacImp i env (TacImp _ _ scr) = ni i env scr
niTacImp _ _ _ = []
-- Return all names defined in binders in the given term
| 1,822
|
allNamesIn :: PTerm -> [Name]
allNamesIn tm = nub $ ni 0 [] tm
where -- TODO THINK added niTacImp, but is it right?
ni 0 env (PRef _ _ n)
| not (n `elem` env) = [n]
ni 0 env (PPatvar _ n) = [n]
ni 0 env (PApp _ f as) = ni 0 env f ++ concatMap (ni 0 env) (map getTm as)
ni 0 env (PAppBind _ f as) = ni 0 env f ++ concatMap (ni 0 env) (map getTm as)
ni 0 env (PCase _ c os) = ni 0 env c ++ concatMap (ni 0 env) (map snd os)
ni 0 env (PIfThenElse _ c t f) = ni 0 env c ++ ni 0 env t ++ ni 0 env f
ni 0 env (PLam fc n _ ty sc) = ni 0 env ty ++ ni 0 (n:env) sc
ni 0 env (PPi p n _ ty sc) = niTacImp 0 env p ++ ni 0 env ty ++ ni 0 (n:env) sc
ni 0 env (PLet _ n _ ty val sc) = ni 0 env ty ++ ni 0 env val ++ ni 0 (n:env) sc
ni 0 env (PHidden tm) = ni 0 env tm
ni 0 env (PRewrite _ l r _) = ni 0 env l ++ ni 0 env r
ni 0 env (PTyped l r) = ni 0 env l ++ ni 0 env r
ni 0 env (PPair _ _ _ l r) = ni 0 env l ++ ni 0 env r
ni 0 env (PDPair _ _ _ (PRef _ _ n) Placeholder r) = n : ni 0 env r
ni 0 env (PDPair _ _ _ (PRef _ _ n) t r) = ni 0 env t ++ ni 0 (n:env) r
ni 0 env (PDPair _ _ _ l t r) = ni 0 env l ++ ni 0 env t ++ ni 0 env r
ni 0 env (PAlternative ns a ls) = concatMap (ni 0 env) ls
ni 0 env (PUnifyLog tm) = ni 0 env tm
ni 0 env (PDisamb _ tm) = ni 0 env tm
ni 0 env (PNoImplicits tm) = ni 0 env tm
ni i env (PQuasiquote tm ty) = ni (i+1) env tm ++ maybe [] (ni i env) ty
ni i env (PUnquote tm) = ni (i - 1) env tm
ni i env tm = concatMap (ni i env) (children tm)
niTacImp i env (TacImp _ _ scr) = ni i env scr
niTacImp _ _ _ = []
-- Return all names defined in binders in the given term
| 1,757
|
allNamesIn tm = nub $ ni 0 [] tm
where -- TODO THINK added niTacImp, but is it right?
ni 0 env (PRef _ _ n)
| not (n `elem` env) = [n]
ni 0 env (PPatvar _ n) = [n]
ni 0 env (PApp _ f as) = ni 0 env f ++ concatMap (ni 0 env) (map getTm as)
ni 0 env (PAppBind _ f as) = ni 0 env f ++ concatMap (ni 0 env) (map getTm as)
ni 0 env (PCase _ c os) = ni 0 env c ++ concatMap (ni 0 env) (map snd os)
ni 0 env (PIfThenElse _ c t f) = ni 0 env c ++ ni 0 env t ++ ni 0 env f
ni 0 env (PLam fc n _ ty sc) = ni 0 env ty ++ ni 0 (n:env) sc
ni 0 env (PPi p n _ ty sc) = niTacImp 0 env p ++ ni 0 env ty ++ ni 0 (n:env) sc
ni 0 env (PLet _ n _ ty val sc) = ni 0 env ty ++ ni 0 env val ++ ni 0 (n:env) sc
ni 0 env (PHidden tm) = ni 0 env tm
ni 0 env (PRewrite _ l r _) = ni 0 env l ++ ni 0 env r
ni 0 env (PTyped l r) = ni 0 env l ++ ni 0 env r
ni 0 env (PPair _ _ _ l r) = ni 0 env l ++ ni 0 env r
ni 0 env (PDPair _ _ _ (PRef _ _ n) Placeholder r) = n : ni 0 env r
ni 0 env (PDPair _ _ _ (PRef _ _ n) t r) = ni 0 env t ++ ni 0 (n:env) r
ni 0 env (PDPair _ _ _ l t r) = ni 0 env l ++ ni 0 env t ++ ni 0 env r
ni 0 env (PAlternative ns a ls) = concatMap (ni 0 env) ls
ni 0 env (PUnifyLog tm) = ni 0 env tm
ni 0 env (PDisamb _ tm) = ni 0 env tm
ni 0 env (PNoImplicits tm) = ni 0 env tm
ni i env (PQuasiquote tm ty) = ni (i+1) env tm ++ maybe [] (ni i env) ty
ni i env (PUnquote tm) = ni (i - 1) env tm
ni i env tm = concatMap (ni i env) (children tm)
niTacImp i env (TacImp _ _ scr) = ni i env scr
niTacImp _ _ _ = []
-- Return all names defined in binders in the given term
| 1,727
| true
| true
| 0
| 10
| 626
| 1,089
| 530
| 559
| null | null |
lubomir/dot-race
|
DotRace/Track.hs
|
bsd-3-clause
|
loadTracks :: FilePath -> IO (Map Text Track)
loadTracks dir = do
files <- map fromString <$> getDirectoryContents (fpToString dir)
M.fromList <$> mapM loadTrack (filter isYaml files)
where
loadTrack :: FilePath -> IO (Text, Track)
loadTrack p = do
let name = getName p
val <- (either throw id . decodeEither') <$> readFile (dir </> p)
case fromJSON val of
Error e -> error e
Success track -> return (name, normalizeTrack track)
getName :: FilePath -> Text
getName = toTitle . replace "-" " " . either id id . toText . basename
isYaml p = p `hasExtension` "yaml"
-- | Move track so that there is no empty space on the left or above it.
--
| 720
|
loadTracks :: FilePath -> IO (Map Text Track)
loadTracks dir = do
files <- map fromString <$> getDirectoryContents (fpToString dir)
M.fromList <$> mapM loadTrack (filter isYaml files)
where
loadTrack :: FilePath -> IO (Text, Track)
loadTrack p = do
let name = getName p
val <- (either throw id . decodeEither') <$> readFile (dir </> p)
case fromJSON val of
Error e -> error e
Success track -> return (name, normalizeTrack track)
getName :: FilePath -> Text
getName = toTitle . replace "-" " " . either id id . toText . basename
isYaml p = p `hasExtension` "yaml"
-- | Move track so that there is no empty space on the left or above it.
--
| 720
|
loadTracks dir = do
files <- map fromString <$> getDirectoryContents (fpToString dir)
M.fromList <$> mapM loadTrack (filter isYaml files)
where
loadTrack :: FilePath -> IO (Text, Track)
loadTrack p = do
let name = getName p
val <- (either throw id . decodeEither') <$> readFile (dir </> p)
case fromJSON val of
Error e -> error e
Success track -> return (name, normalizeTrack track)
getName :: FilePath -> Text
getName = toTitle . replace "-" " " . either id id . toText . basename
isYaml p = p `hasExtension` "yaml"
-- | Move track so that there is no empty space on the left or above it.
--
| 674
| false
| true
| 0
| 12
| 198
| 248
| 119
| 129
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.