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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
danidiaz/vdpq | executable/Main.hs | mit | defaultPlanFile :: String
defaultPlanFile = "plan.json" | 55 | defaultPlanFile :: String
defaultPlanFile = "plan.json" | 55 | defaultPlanFile = "plan.json" | 29 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
chadbrewbaker/shellcheck | shellcheck.hs | gpl-3.0 | getOption (_:rest) flag = getOption rest flag | 45 | getOption (_:rest) flag = getOption rest flag | 45 | getOption (_:rest) flag = getOption rest flag | 45 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
mydaum/cabal | cabal-install/Distribution/Client/TargetSelector.hs | bsd-3-clause | syntaxForm1Package :: [PackageInfo] -> Syntax
syntaxForm1Package pinfo =
syntaxForm1 render $ \str1 fstatus1 -> do
guardPackage str1 fstatus1
p <- matchPackage pinfo str1 fstatus1
return (TargetPackage TargetExplicitNamed p Nothing)
where
render (TargetPackage TargetExplicitNamed p Nothing) =
[TargetStringFileStatus1 (dispP p) noFileStatus]
render _ = []
-- | Syntax: component
--
-- > cabal build foo
-- | 448 | syntaxForm1Package :: [PackageInfo] -> Syntax
syntaxForm1Package pinfo =
syntaxForm1 render $ \str1 fstatus1 -> do
guardPackage str1 fstatus1
p <- matchPackage pinfo str1 fstatus1
return (TargetPackage TargetExplicitNamed p Nothing)
where
render (TargetPackage TargetExplicitNamed p Nothing) =
[TargetStringFileStatus1 (dispP p) noFileStatus]
render _ = []
-- | Syntax: component
--
-- > cabal build foo
-- | 448 | syntaxForm1Package pinfo =
syntaxForm1 render $ \str1 fstatus1 -> do
guardPackage str1 fstatus1
p <- matchPackage pinfo str1 fstatus1
return (TargetPackage TargetExplicitNamed p Nothing)
where
render (TargetPackage TargetExplicitNamed p Nothing) =
[TargetStringFileStatus1 (dispP p) noFileStatus]
render _ = []
-- | Syntax: component
--
-- > cabal build foo
-- | 402 | false | true | 0 | 11 | 96 | 122 | 60 | 62 | null | null |
forste/haReFork | refactorer/RefacDupTrans.hs | bsd-3-clause | callFindSafeModules destMods mods pns res
= do
-- mod is the module that everything has to import...
result <- findSafeModules destMods mods res
if result == Nothing
then error "All will introduce cyclic inclusion!"
else do let (transformation, m, fName) = fromJust result
fFile <- fileNameToModName fName
transformation' <- addImports mods res m pns fName fFile
-- we also need to transform the module we are left with
-- i.e. the module where we have added the abstraction...
return (transformation:transformation') | 684 | callFindSafeModules destMods mods pns res
= do
-- mod is the module that everything has to import...
result <- findSafeModules destMods mods res
if result == Nothing
then error "All will introduce cyclic inclusion!"
else do let (transformation, m, fName) = fromJust result
fFile <- fileNameToModName fName
transformation' <- addImports mods res m pns fName fFile
-- we also need to transform the module we are left with
-- i.e. the module where we have added the abstraction...
return (transformation:transformation') | 684 | callFindSafeModules destMods mods pns res
= do
-- mod is the module that everything has to import...
result <- findSafeModules destMods mods res
if result == Nothing
then error "All will introduce cyclic inclusion!"
else do let (transformation, m, fName) = fromJust result
fFile <- fileNameToModName fName
transformation' <- addImports mods res m pns fName fFile
-- we also need to transform the module we are left with
-- i.e. the module where we have added the abstraction...
return (transformation:transformation') | 684 | false | false | 1 | 14 | 246 | 122 | 55 | 67 | null | null |
jecisc/TP_PF_L3 | PF-TP1/.dist-buildwrapper/dist/build/autogen/Paths_TP1.hs | mit | catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception.catch | 84 | catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception.catch | 84 | catchIO = Exception.catch | 25 | false | true | 0 | 9 | 14 | 39 | 19 | 20 | null | null |
AlexeyRaga/eta | compiler/ETA/TypeCheck/TcType.hs | bsd-3-clause | pprSigCtxt :: UserTypeCtxt -> SDoc -> SDoc -> SDoc
-- (pprSigCtxt ctxt <extra> <type>)
-- prints In <extra> the type signature for 'f':
-- f :: <type>
-- The <extra> is either empty or "the ambiguity check for"
pprSigCtxt ctxt extra pp_ty
= sep [ ptext (sLit "In") <+> extra <+> pprUserTypeCtxt ctxt <> colon
, nest 2 (pp_sig ctxt) ]
where
pp_sig (FunSigCtxt n) = pp_n_colon n
pp_sig (ConArgCtxt n) = pp_n_colon n
pp_sig (ForSigCtxt n) = pp_n_colon n
pp_sig _ = pp_ty
pp_n_colon n = pprPrefixOcc n <+> dcolon <+> pp_ty
{-
************************************************************************
* *
Finding type family instances
* *
************************************************************************
-}
-- | Finds outermost type-family applications occuring in a type,
-- after expanding synonyms. | 909 | pprSigCtxt :: UserTypeCtxt -> SDoc -> SDoc -> SDoc
pprSigCtxt ctxt extra pp_ty
= sep [ ptext (sLit "In") <+> extra <+> pprUserTypeCtxt ctxt <> colon
, nest 2 (pp_sig ctxt) ]
where
pp_sig (FunSigCtxt n) = pp_n_colon n
pp_sig (ConArgCtxt n) = pp_n_colon n
pp_sig (ForSigCtxt n) = pp_n_colon n
pp_sig _ = pp_ty
pp_n_colon n = pprPrefixOcc n <+> dcolon <+> pp_ty
{-
************************************************************************
* *
Finding type family instances
* *
************************************************************************
-}
-- | Finds outermost type-family applications occuring in a type,
-- after expanding synonyms. | 733 | pprSigCtxt ctxt extra pp_ty
= sep [ ptext (sLit "In") <+> extra <+> pprUserTypeCtxt ctxt <> colon
, nest 2 (pp_sig ctxt) ]
where
pp_sig (FunSigCtxt n) = pp_n_colon n
pp_sig (ConArgCtxt n) = pp_n_colon n
pp_sig (ForSigCtxt n) = pp_n_colon n
pp_sig _ = pp_ty
pp_n_colon n = pprPrefixOcc n <+> dcolon <+> pp_ty
{-
************************************************************************
* *
Finding type family instances
* *
************************************************************************
-}
-- | Finds outermost type-family applications occuring in a type,
-- after expanding synonyms. | 682 | true | true | 0 | 11 | 224 | 162 | 81 | 81 | null | null |
solvery/lang-features | haskell/high_order_function_3.hs | gpl-2.0 | -- 会返回一个取list作参数的函数, currying
elem' :: (Eq a) => a -> [a] -> Bool
elem' y ys = foldl (\acc x -> if x == y then True else acc) False ys | 138 | elem' :: (Eq a) => a -> [a] -> Bool
elem' y ys = foldl (\acc x -> if x == y then True else acc) False ys | 104 | elem' y ys = foldl (\acc x -> if x == y then True else acc) False ys | 68 | true | true | 0 | 9 | 34 | 66 | 36 | 30 | null | null |
sjpet/quark | src/Quark/Window/TextView.hs | mit | tokenBg Selected = selectionColor | 37 | tokenBg Selected = selectionColor | 37 | tokenBg Selected = selectionColor | 37 | false | false | 1 | 5 | 7 | 13 | 4 | 9 | null | null |
pbrandwijk/chronorder | Main.hs | gpl-3.0 | -- Print a record of the old and new name of a file
printLog :: (FilePath, FilePath) -> IO ()
printLog (a,b) = putStrLn $ a ++ " -> " ++ b | 138 | printLog :: (FilePath, FilePath) -> IO ()
printLog (a,b) = putStrLn $ a ++ " -> " ++ b | 86 | printLog (a,b) = putStrLn $ a ++ " -> " ++ b | 44 | true | true | 0 | 7 | 31 | 48 | 26 | 22 | null | null |
mzini/TcT | source/Tct/Method/DP/DependencyGraph.hs | gpl-3.0 | pprintNodeSet :: [NodeId] -> Doc
pprintNodeSet ns = braces $ hcat $ punctuate (text ",") [ text $ show n | n <- ns] | 115 | pprintNodeSet :: [NodeId] -> Doc
pprintNodeSet ns = braces $ hcat $ punctuate (text ",") [ text $ show n | n <- ns] | 115 | pprintNodeSet ns = braces $ hcat $ punctuate (text ",") [ text $ show n | n <- ns] | 82 | false | true | 0 | 9 | 23 | 63 | 30 | 33 | null | null |
ony/hledger | hledger-lib/Hledger/Read/CsvReader.hs | gpl-3.0 | directivevalp :: CsvRulesParser String
directivevalp = anyChar `manyTill` lift eolof | 84 | directivevalp :: CsvRulesParser String
directivevalp = anyChar `manyTill` lift eolof | 84 | directivevalp = anyChar `manyTill` lift eolof | 45 | false | true | 1 | 6 | 9 | 29 | 13 | 16 | null | null |
ml9951/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | anyReg (Fixed rep reg fcode) = return (\dst -> fcode `snocOL` reg2reg rep reg dst) | 82 | anyReg (Fixed rep reg fcode) = return (\dst -> fcode `snocOL` reg2reg rep reg dst) | 82 | anyReg (Fixed rep reg fcode) = return (\dst -> fcode `snocOL` reg2reg rep reg dst) | 82 | false | false | 0 | 9 | 14 | 44 | 22 | 22 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AccountUserProFiles/List.hs | mpl-2.0 | -- | OAuth access token.
aupflAccessToken :: Lens' AccountUserProFilesList (Maybe Text)
aupflAccessToken
= lens _aupflAccessToken
(\ s a -> s{_aupflAccessToken = a}) | 173 | aupflAccessToken :: Lens' AccountUserProFilesList (Maybe Text)
aupflAccessToken
= lens _aupflAccessToken
(\ s a -> s{_aupflAccessToken = a}) | 148 | aupflAccessToken
= lens _aupflAccessToken
(\ s a -> s{_aupflAccessToken = a}) | 85 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
limansky/wbxml | src/Wbxml/Tables.hs | bsd-3-clause | findTag :: WbxmlTableDef -- ^ table to search the tag
-> Word8 -- ^ code page
-> Word8 -- ^ tag code
-> Maybe String -- ^ the return value
findTag (_, _, _, _, t, _, _) p c = lookup p t >>= lookup c | 251 | findTag :: WbxmlTableDef -- ^ table to search the tag
-> Word8 -- ^ code page
-> Word8 -- ^ tag code
-> Maybe String
findTag (_, _, _, _, t, _, _) p c = lookup p t >>= lookup c | 225 | findTag (_, _, _, _, t, _, _) p c = lookup p t >>= lookup c | 59 | true | true | 0 | 8 | 99 | 70 | 39 | 31 | null | null |
m-alvarez/jhc | src/FrontEnd/Lex/Fixity.hs | mit | drawParenTree :: Tree String -> String
drawParenTree t = f t [] where
f (Node t []) = showString t
f (Node "" [x,y]) = showChar '(' . f x . showChar ' ' . f y . showChar ')'
f (Node t [x,y]) = showChar '(' . f x . showChar ' ' . showString t . showChar ' ' . f y . showChar ')'
f (Node t [x]) = showChar '(' . showString t . showChar ' ' . f x . showChar ')'
f (Node t xs) = showString t . showListWith id (map f xs) | 436 | drawParenTree :: Tree String -> String
drawParenTree t = f t [] where
f (Node t []) = showString t
f (Node "" [x,y]) = showChar '(' . f x . showChar ' ' . f y . showChar ')'
f (Node t [x,y]) = showChar '(' . f x . showChar ' ' . showString t . showChar ' ' . f y . showChar ')'
f (Node t [x]) = showChar '(' . showString t . showChar ' ' . f x . showChar ')'
f (Node t xs) = showString t . showListWith id (map f xs) | 436 | drawParenTree t = f t [] where
f (Node t []) = showString t
f (Node "" [x,y]) = showChar '(' . f x . showChar ' ' . f y . showChar ')'
f (Node t [x,y]) = showChar '(' . f x . showChar ' ' . showString t . showChar ' ' . f y . showChar ')'
f (Node t [x]) = showChar '(' . showString t . showChar ' ' . f x . showChar ')'
f (Node t xs) = showString t . showListWith id (map f xs) | 397 | false | true | 0 | 11 | 119 | 268 | 121 | 147 | null | null |
nivox/halm | src/Text/Halm/NGram/Table.hs | gpl-2.0 | computeF :: FilePath -> Int -> IndexedDictionary -> IO NGramTable
computeF f order id = extendF f order $ empty id | 114 | computeF :: FilePath -> Int -> IndexedDictionary -> IO NGramTable
computeF f order id = extendF f order $ empty id | 114 | computeF f order id = extendF f order $ empty id | 48 | false | true | 0 | 8 | 20 | 45 | 21 | 24 | null | null |
abuiles/turbinado-blog | tmp/dependencies/hs-plugins-1.3.1/testsuite/makewith/mergeto0/Main.hs | bsd-3-clause | -- uesr code
b = "Bar.hs" | 28 | b = "Bar.hs" | 15 | b = "Bar.hs" | 15 | true | false | 0 | 4 | 8 | 7 | 4 | 3 | null | null |
HIPERFIT/hipermark-benchmarks | benchmarks/american_options/implementations/haskell_accelerate/AmrPutAcc.hs | mit | c *^ v = A.map (c *) v | 22 | c *^ v = A.map (c *) v | 22 | c *^ v = A.map (c *) v | 22 | false | false | 3 | 5 | 7 | 28 | 12 | 16 | null | null |
siddhanathan/ghc | compiler/nativeGen/AsmCodeGen.hs | bsd-3-clause | sparcNcgImpl :: DynFlags -> NcgImpl CmmStatics SPARC.Instr.Instr SPARC.ShortcutJump.JumpDest
sparcNcgImpl dflags
= NcgImpl {
cmmTopCodeGen = SPARC.CodeGen.cmmTopCodeGen
,generateJumpTableForInstr = SPARC.CodeGen.generateJumpTableForInstr dflags
,getJumpDestBlockId = SPARC.ShortcutJump.getJumpDestBlockId
,canShortcut = SPARC.ShortcutJump.canShortcut
,shortcutStatics = SPARC.ShortcutJump.shortcutStatics
,shortcutJump = SPARC.ShortcutJump.shortcutJump
,pprNatCmmDecl = SPARC.Ppr.pprNatCmmDecl
,maxSpillSlots = SPARC.Instr.maxSpillSlots dflags
,allocatableRegs = SPARC.Regs.allocatableRegs
,ncg_x86fp_kludge = id
,ncgAllocMoreStack = noAllocMoreStack
,ncgExpandTop = map SPARC.CodeGen.Expand.expandTop
,ncgMakeFarBranches = const id
} | 957 | sparcNcgImpl :: DynFlags -> NcgImpl CmmStatics SPARC.Instr.Instr SPARC.ShortcutJump.JumpDest
sparcNcgImpl dflags
= NcgImpl {
cmmTopCodeGen = SPARC.CodeGen.cmmTopCodeGen
,generateJumpTableForInstr = SPARC.CodeGen.generateJumpTableForInstr dflags
,getJumpDestBlockId = SPARC.ShortcutJump.getJumpDestBlockId
,canShortcut = SPARC.ShortcutJump.canShortcut
,shortcutStatics = SPARC.ShortcutJump.shortcutStatics
,shortcutJump = SPARC.ShortcutJump.shortcutJump
,pprNatCmmDecl = SPARC.Ppr.pprNatCmmDecl
,maxSpillSlots = SPARC.Instr.maxSpillSlots dflags
,allocatableRegs = SPARC.Regs.allocatableRegs
,ncg_x86fp_kludge = id
,ncgAllocMoreStack = noAllocMoreStack
,ncgExpandTop = map SPARC.CodeGen.Expand.expandTop
,ncgMakeFarBranches = const id
} | 957 | sparcNcgImpl dflags
= NcgImpl {
cmmTopCodeGen = SPARC.CodeGen.cmmTopCodeGen
,generateJumpTableForInstr = SPARC.CodeGen.generateJumpTableForInstr dflags
,getJumpDestBlockId = SPARC.ShortcutJump.getJumpDestBlockId
,canShortcut = SPARC.ShortcutJump.canShortcut
,shortcutStatics = SPARC.ShortcutJump.shortcutStatics
,shortcutJump = SPARC.ShortcutJump.shortcutJump
,pprNatCmmDecl = SPARC.Ppr.pprNatCmmDecl
,maxSpillSlots = SPARC.Instr.maxSpillSlots dflags
,allocatableRegs = SPARC.Regs.allocatableRegs
,ncg_x86fp_kludge = id
,ncgAllocMoreStack = noAllocMoreStack
,ncgExpandTop = map SPARC.CodeGen.Expand.expandTop
,ncgMakeFarBranches = const id
} | 864 | false | true | 0 | 8 | 279 | 154 | 94 | 60 | null | null |
nshepperd/funn | AI/Funn/Flat/Blob.hs | mit | zipBlob :: (Double -> Double -> Double) -> Blob n -> Blob n -> Blob n
zipBlob f a b = blob (V.zipWith f (getBlob a) (getBlob b)) | 128 | zipBlob :: (Double -> Double -> Double) -> Blob n -> Blob n -> Blob n
zipBlob f a b = blob (V.zipWith f (getBlob a) (getBlob b)) | 128 | zipBlob f a b = blob (V.zipWith f (getBlob a) (getBlob b)) | 58 | false | true | 0 | 9 | 27 | 82 | 38 | 44 | null | null |
adinapoli/xmonad | XMonad/Operations.hs | bsd-3-clause | -- | 'True' if window is under management by us
isClient :: Window -> X Bool
isClient w = withWindowSet $ return . W.member w | 125 | isClient :: Window -> X Bool
isClient w = withWindowSet $ return . W.member w | 77 | isClient w = withWindowSet $ return . W.member w | 48 | true | true | 0 | 7 | 24 | 35 | 17 | 18 | null | null |
kaoskorobase/mescaline | lib/mescaline/Mescaline/Application.hs | gpl-3.0 | updateLogger :: MonadIO m => (Log.Logger -> Log.Logger) -> String -> AppT m ()
updateLogger f n = loggerName n >>= liftIO . flip Log.updateGlobalLogger f | 153 | updateLogger :: MonadIO m => (Log.Logger -> Log.Logger) -> String -> AppT m ()
updateLogger f n = loggerName n >>= liftIO . flip Log.updateGlobalLogger f | 153 | updateLogger f n = loggerName n >>= liftIO . flip Log.updateGlobalLogger f | 74 | false | true | 0 | 9 | 25 | 67 | 32 | 35 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Primitive.hs | isc | convOp :: (Pretty from, Pretty to) => String -> from -> to -> Doc
convOp s from to = text s <> text "_" <> ppr from <> text "_" <> ppr to | 137 | convOp :: (Pretty from, Pretty to) => String -> from -> to -> Doc
convOp s from to = text s <> text "_" <> ppr from <> text "_" <> ppr to | 137 | convOp s from to = text s <> text "_" <> ppr from <> text "_" <> ppr to | 71 | false | true | 2 | 10 | 32 | 82 | 37 | 45 | null | null |
dstruthers/Pyrite | Pyrite/Compiler.hs | mit | compile v = return $ Constant v Exit | 36 | compile v = return $ Constant v Exit | 36 | compile v = return $ Constant v Exit | 36 | false | false | 0 | 6 | 7 | 18 | 8 | 10 | null | null |
kfish/scope | Scope/Types.hs | bsd-3-clause | scopeClose :: Scope ui -> IO (Scope ui)
scopeClose scope = do
mapM_ closeFd . nub . map fd' . layers $ scope
return scope{bounds=Nothing, utcBounds=Nothing, layers=[]}
where
fd' (ScopeLayer l) = fd . layerFile $ l | 233 | scopeClose :: Scope ui -> IO (Scope ui)
scopeClose scope = do
mapM_ closeFd . nub . map fd' . layers $ scope
return scope{bounds=Nothing, utcBounds=Nothing, layers=[]}
where
fd' (ScopeLayer l) = fd . layerFile $ l | 233 | scopeClose scope = do
mapM_ closeFd . nub . map fd' . layers $ scope
return scope{bounds=Nothing, utcBounds=Nothing, layers=[]}
where
fd' (ScopeLayer l) = fd . layerFile $ l | 193 | false | true | 1 | 11 | 56 | 114 | 54 | 60 | null | null |
phadej/range-set-list | src/Data/RangeSet/Internal.hs | mit | unionRangeList [] s = s | 23 | unionRangeList [] s = s | 23 | unionRangeList [] s = s | 23 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
duplode/stack | src/Stack/Dot.hs | bsd-3-clause | libVersionFromInstalled (Executable _) = Nothing | 48 | libVersionFromInstalled (Executable _) = Nothing | 48 | libVersionFromInstalled (Executable _) = Nothing | 48 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
WawerOS/Chessotron2000 | src/Chess.hs | mit | pieceVal King = 10 | 18 | pieceVal King = 10 | 18 | pieceVal King = 10 | 18 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | dddwisAttribution :: Lens' DictlayerDataDictWordsItemSource (Maybe Text)
dddwisAttribution
= lens _dddwisAttribution
(\ s a -> s{_dddwisAttribution = a}) | 161 | dddwisAttribution :: Lens' DictlayerDataDictWordsItemSource (Maybe Text)
dddwisAttribution
= lens _dddwisAttribution
(\ s a -> s{_dddwisAttribution = a}) | 161 | dddwisAttribution
= lens _dddwisAttribution
(\ s a -> s{_dddwisAttribution = a}) | 88 | false | true | 0 | 8 | 24 | 48 | 24 | 24 | null | null |
ezyang/ghc | testsuite/tests/simplCore/should_run/T13429a.hs | bsd-3-clause | addDigits0 m1 (Two a b) (One c) m2 =
appendTree1 m1 (node3 a b c) m2 | 72 | addDigits0 m1 (Two a b) (One c) m2 =
appendTree1 m1 (node3 a b c) m2 | 72 | addDigits0 m1 (Two a b) (One c) m2 =
appendTree1 m1 (node3 a b c) m2 | 72 | false | false | 1 | 7 | 19 | 54 | 22 | 32 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/src/System/CIO.hs | mit | readFile :: FilePath -> PreCST e s String
readFile fname = do
--FIXME: see encoding comment with openFile above
hnd <- openFile fname IO.ReadMode
liftIO (IO.hGetContents hnd) | 187 | readFile :: FilePath -> PreCST e s String
readFile fname = do
--FIXME: see encoding comment with openFile above
hnd <- openFile fname IO.ReadMode
liftIO (IO.hGetContents hnd) | 187 | readFile fname = do
--FIXME: see encoding comment with openFile above
hnd <- openFile fname IO.ReadMode
liftIO (IO.hGetContents hnd) | 139 | false | true | 0 | 11 | 39 | 59 | 26 | 33 | null | null |
spinningfire/aikatsu | src/Smile.hs | bsd-3-clause | allSmiles::[Unit -> Smile] -> Unit -> [Smile]
allSmiles listOfSmile unit = filter (\x -> skillSmile x /= (AuraUp 0) && skillSmile x /= (PanelScoreUp 0)
&& skillSmile x /= (LuckyMoon 0) && skillSmile x /= (PanelScoreUp 0) && skillSmile x /= (AppealGaugeUp 0) )
[f unit | f <- listOfSmile] | 289 | allSmiles::[Unit -> Smile] -> Unit -> [Smile]
allSmiles listOfSmile unit = filter (\x -> skillSmile x /= (AuraUp 0) && skillSmile x /= (PanelScoreUp 0)
&& skillSmile x /= (LuckyMoon 0) && skillSmile x /= (PanelScoreUp 0) && skillSmile x /= (AppealGaugeUp 0) )
[f unit | f <- listOfSmile] | 289 | allSmiles listOfSmile unit = filter (\x -> skillSmile x /= (AuraUp 0) && skillSmile x /= (PanelScoreUp 0)
&& skillSmile x /= (LuckyMoon 0) && skillSmile x /= (PanelScoreUp 0) && skillSmile x /= (AppealGaugeUp 0) )
[f unit | f <- listOfSmile] | 243 | false | true | 0 | 18 | 51 | 149 | 71 | 78 | null | null |
AlexanderPankiv/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | matchContextErrString PatBindRhs = ptext (sLit "pattern binding") | 81 | matchContextErrString PatBindRhs = ptext (sLit "pattern binding") | 81 | matchContextErrString PatBindRhs = ptext (sLit "pattern binding") | 81 | false | false | 0 | 7 | 22 | 19 | 8 | 11 | null | null |
sordina/wai | auto-update/test/Control/DebounceSpec.hs | bsd-2-clause | -- | Wait up to n seconds for an action to complete without throwing an HUnitFailure
waitUntil :: Int -> IO a -> IO ()
waitUntil n action = recovering policy [handler] (\_status -> void action)
where policy = constantDelay 1000 `mappend` limitRetries (n * 1000) -- 1ms * n * 1000 tries = n seconds
handler _status = Handler (\(HUnitFailure {}) -> return True) | 369 | waitUntil :: Int -> IO a -> IO ()
waitUntil n action = recovering policy [handler] (\_status -> void action)
where policy = constantDelay 1000 `mappend` limitRetries (n * 1000) -- 1ms * n * 1000 tries = n seconds
handler _status = Handler (\(HUnitFailure {}) -> return True) | 284 | waitUntil n action = recovering policy [handler] (\_status -> void action)
where policy = constantDelay 1000 `mappend` limitRetries (n * 1000) -- 1ms * n * 1000 tries = n seconds
handler _status = Handler (\(HUnitFailure {}) -> return True) | 250 | true | true | 2 | 9 | 74 | 127 | 59 | 68 | null | null |
azure-satellite/scheme-parser | src/Parser.hs | bsd-3-clause | readExpr :: String -> LispVal
readExpr input =
case parse parseExpr "lisp" input of
Left err -> String $ "No match: " ++ show err
Right val -> val | 166 | readExpr :: String -> LispVal
readExpr input =
case parse parseExpr "lisp" input of
Left err -> String $ "No match: " ++ show err
Right val -> val | 166 | readExpr input =
case parse parseExpr "lisp" input of
Left err -> String $ "No match: " ++ show err
Right val -> val | 136 | false | true | 0 | 9 | 48 | 64 | 28 | 36 | null | null |
facebookincubator/duckling | Duckling/Volume/KM/Rules.hs | bsd-3-clause | ruleIntervalMin :: Rule
ruleIntervalMin = Rule
{ name = "more than <volume>"
, pattern =
[ regex "លើស(ពី)?|មិនតិចជាង|លើ|ច្រើនជាង|យ៉ាងតិច|យ៉ាងហោច"
, Predicate isSimpleVolume
]
, prod = \case
(_:
Token Volume TVolume.VolumeData{TVolume.value = Just from
, TVolume.unit = Just u}:
_) ->
Just . Token Volume . withMin from $ unitOnly u
_ -> Nothing
} | 456 | ruleIntervalMin :: Rule
ruleIntervalMin = Rule
{ name = "more than <volume>"
, pattern =
[ regex "លើស(ពី)?|មិនតិចជាង|លើ|ច្រើនជាង|យ៉ាងតិច|យ៉ាងហោច"
, Predicate isSimpleVolume
]
, prod = \case
(_:
Token Volume TVolume.VolumeData{TVolume.value = Just from
, TVolume.unit = Just u}:
_) ->
Just . Token Volume . withMin from $ unitOnly u
_ -> Nothing
} | 456 | ruleIntervalMin = Rule
{ name = "more than <volume>"
, pattern =
[ regex "លើស(ពី)?|មិនតិចជាង|លើ|ច្រើនជាង|យ៉ាងតិច|យ៉ាងហោច"
, Predicate isSimpleVolume
]
, prod = \case
(_:
Token Volume TVolume.VolumeData{TVolume.value = Just from
, TVolume.unit = Just u}:
_) ->
Just . Token Volume . withMin from $ unitOnly u
_ -> Nothing
} | 432 | false | true | 0 | 18 | 163 | 125 | 64 | 61 | null | null |
cartazio/omega | src/Parser/ParseToken.hs | bsd-3-clause | ndent =
do { (SourcePos cs line col (p:ps)) <- getPosition
; setPosition (SourcePos cs line col ps)
}
| 114 | undent =
do { (SourcePos cs line col (p:ps)) <- getPosition
; setPosition (SourcePos cs line col ps)
} | 114 | undent =
do { (SourcePos cs line col (p:ps)) <- getPosition
; setPosition (SourcePos cs line col ps)
} | 114 | false | false | 1 | 11 | 31 | 56 | 27 | 29 | null | null |
mainland/nikola | examples/mandelbrot/Mandelbrot/NikolaV2/Implementation.hs | bsd-3-clause | mkinit :: ComplexPlane G -> MStepPlane G -> P ()
mkinit cs mzs = loadP (map f cs) mzs
where
f :: Complex -> (Complex, Exp Int32)
f z = (z,0) | 150 | mkinit :: ComplexPlane G -> MStepPlane G -> P ()
mkinit cs mzs = loadP (map f cs) mzs
where
f :: Complex -> (Complex, Exp Int32)
f z = (z,0) | 150 | mkinit cs mzs = loadP (map f cs) mzs
where
f :: Complex -> (Complex, Exp Int32)
f z = (z,0) | 101 | false | true | 0 | 8 | 40 | 83 | 41 | 42 | null | null |
alephcloud/hs-aws-kinesis-reshard | src/Aws/Kinesis/Reshard/Shards.hs | apache-2.0 | shardsSource
∷ MonadReshard m
⇒ Source m Shard
shardsSource =
CL.sourceList [Nothing]
$= fetchShardsConduit | 117 | shardsSource
∷ MonadReshard m
⇒ Source m Shard
shardsSource =
CL.sourceList [Nothing]
$= fetchShardsConduit | 117 | shardsSource =
CL.sourceList [Nothing]
$= fetchShardsConduit | 66 | false | true | 2 | 6 | 23 | 41 | 19 | 22 | null | null |
guillaume-nargeot/project-euler-haskell | src/ProjectEuler/Problem074.hs | bsd-3-clause | fact 7 = 5040 | 13 | fact 7 = 5040 | 13 | fact 7 = 5040 | 13 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ezyang/ghc | utils/testremove/checkremove.hs | bsd-3-clause | readTree :: FileInfo -> FilePath -> IO (Tree)
readTree fi fp = do xs <- readFile fp
return $ mkTree fi $ lines xs | 133 | readTree :: FileInfo -> FilePath -> IO (Tree)
readTree fi fp = do xs <- readFile fp
return $ mkTree fi $ lines xs | 133 | readTree fi fp = do xs <- readFile fp
return $ mkTree fi $ lines xs | 87 | false | true | 0 | 9 | 43 | 57 | 26 | 31 | null | null |
jfischoff/simple-c-value | tests/Main.hs | bsd-3-clause | propertyToCValue_10 :: Test10 -> Bool
propertyToCValue_10 = roundTrip | 69 | propertyToCValue_10 :: Test10 -> Bool
propertyToCValue_10 = roundTrip | 69 | propertyToCValue_10 = roundTrip | 31 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
dysinger/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | Deprecated.
lsAddressingType :: Lens' LaunchSpecification (Maybe Text)
lsAddressingType = lens _lsAddressingType (\s a -> s { _lsAddressingType = a }) | 155 | lsAddressingType :: Lens' LaunchSpecification (Maybe Text)
lsAddressingType = lens _lsAddressingType (\s a -> s { _lsAddressingType = a }) | 138 | lsAddressingType = lens _lsAddressingType (\s a -> s { _lsAddressingType = a }) | 79 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
jagg/search | src/Query.hs | apache-2.0 | spaces :: Parser ()
spaces = skipWhile (== ' ') | 47 | spaces :: Parser ()
spaces = skipWhile (== ' ') | 47 | spaces = skipWhile (== ' ') | 27 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
erochest/whatisdh | Utils.hs | bsd-2-clause | snd3 :: (a, b, c) -> b
snd3 (_, a, _) = a | 41 | snd3 :: (a, b, c) -> b
snd3 (_, a, _) = a | 41 | snd3 (_, a, _) = a | 18 | false | true | 0 | 8 | 12 | 42 | 22 | 20 | null | null |
apunktbau/co4 | src/CO4/Frontend/THPreprocess.hs | gpl-3.0 | onDecs :: [Dec] -> [Dec]
onDecs = noTypeSynonyms | 48 | onDecs :: [Dec] -> [Dec]
onDecs = noTypeSynonyms | 48 | onDecs = noTypeSynonyms | 23 | false | true | 0 | 8 | 7 | 28 | 13 | 15 | null | null |
feumilieu/sicp-haskell | src/SICP/LispParser.hs | bsd-3-clause | string :: Stream s m Char => ParsecT s u m Value
string = String <$> lexeme (between (char '\"') (char '\"') stringInternal)
where
stringEscapes = char '\"'
<|> char '\\'
<|> '\a' <$ char 'a'
<|> '\b' <$ char 'b'
<|> '\t' <$ char 't'
<|> '\n' <$ char 'n'
<|> '\r' <$ char 'r'
stringInternal = many $ noneOf "\\\"" <|> (char '\\' >> stringEscapes) | 406 | string :: Stream s m Char => ParsecT s u m Value
string = String <$> lexeme (between (char '\"') (char '\"') stringInternal)
where
stringEscapes = char '\"'
<|> char '\\'
<|> '\a' <$ char 'a'
<|> '\b' <$ char 'b'
<|> '\t' <$ char 't'
<|> '\n' <$ char 'n'
<|> '\r' <$ char 'r'
stringInternal = many $ noneOf "\\\"" <|> (char '\\' >> stringEscapes) | 406 | string = String <$> lexeme (between (char '\"') (char '\"') stringInternal)
where
stringEscapes = char '\"'
<|> char '\\'
<|> '\a' <$ char 'a'
<|> '\b' <$ char 'b'
<|> '\t' <$ char 't'
<|> '\n' <$ char 'n'
<|> '\r' <$ char 'r'
stringInternal = many $ noneOf "\\\"" <|> (char '\\' >> stringEscapes) | 357 | false | true | 1 | 18 | 126 | 160 | 75 | 85 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Chapter_14_my_note.hs | mit | depth NilT = 0 | 37 | depth NilT = 0 | 37 | depth NilT = 0 | 37 | false | false | 0 | 4 | 26 | 10 | 4 | 6 | null | null |
amnipar/hs-cvsu | examples/segment.hs | bsd-3-clause | -- Uses the distance between means relative to deviation as a measure of
-- separation between region statistics. Denominator must be at least 1. If
-- the separation is smaller than the given threshold, the regions are deemed
-- similar. Threshold value 1 seems to work well.
statSeparation s s1 s2 =
((abs $ (mean s1) - (mean s2)) / (max 1 (deviation s1 + deviation s2))) < s | 379 | statSeparation s s1 s2 =
((abs $ (mean s1) - (mean s2)) / (max 1 (deviation s1 + deviation s2))) < s | 102 | statSeparation s s1 s2 =
((abs $ (mean s1) - (mean s2)) / (max 1 (deviation s1 + deviation s2))) < s | 102 | true | false | 1 | 12 | 70 | 78 | 38 | 40 | null | null |
yjwen/hada | src/MyPpr.hs | lgpl-3.0 | myPprBind :: CoreBind -> SDoc
myPprBind (NonRec v e) = hang (myPprVar v <+> text " = ") 2 (text "NonRec" <+> myPprExpr e) | 121 | myPprBind :: CoreBind -> SDoc
myPprBind (NonRec v e) = hang (myPprVar v <+> text " = ") 2 (text "NonRec" <+> myPprExpr e) | 121 | myPprBind (NonRec v e) = hang (myPprVar v <+> text " = ") 2 (text "NonRec" <+> myPprExpr e) | 91 | false | true | 0 | 8 | 23 | 63 | 29 | 34 | null | null |
nevrenato/HetsAlloy | QBF/ProveDepQBF.hs | gpl-2.0 | runDepQBF :: QBFProverState
{- ^ logical part containing the input Sign and axioms and possibly
goals that have been proved earlier as additional axioms -}
-> GenericConfig ProofTree -- ^ configuration to use
-> Bool -- ^ True means save QDIMACS file
-> String -- ^ name of the theory in the DevGraph
-> AS_Anno.Named AS.FORMULA -- ^ goal to prove
-> IO (ATPRetval, GenericConfig ProofTree)
-- ^ (retval, configuration with proof status and complete output)
runDepQBF ps cfg saveQDIMACS thName nGoal = do
let saveFile = basename thName ++ '_' : AS_Anno.senAttr nGoal ++ ".qdimacs"
tl = configTimeLimit cfg
prob <- showQDIMACSProblem thName ps nGoal []
when saveQDIMACS (writeFile saveFile prob)
stpTmpFile <- getTempFile prob saveFile
t_start <- getHetsTime
(exitCode, stdoutC, stderrC) <- executeProcess "depqbf"
(show tl : extraOpts cfg ++ [stpTmpFile]) ""
t_end <- getHetsTime
removeFile stpTmpFile
let t_u = diffHetsTime t_end t_start
exitCode' = case exitCode of
ExitSuccess -> 0
ExitFailure i -> i
(pStat, ret) <- examineProof ps cfg stdoutC stderrC exitCode' nGoal t_u tl
return (pStat, cfg
{ proofStatus = ret
, resultOutput = lines (stdoutC ++ stderrC)
, timeUsed = usedTime ret })
-- | examine Prover output | 1,454 | runDepQBF :: QBFProverState
{- ^ logical part containing the input Sign and axioms and possibly
goals that have been proved earlier as additional axioms -}
-> GenericConfig ProofTree -- ^ configuration to use
-> Bool -- ^ True means save QDIMACS file
-> String -- ^ name of the theory in the DevGraph
-> AS_Anno.Named AS.FORMULA -- ^ goal to prove
-> IO (ATPRetval, GenericConfig ProofTree)
runDepQBF ps cfg saveQDIMACS thName nGoal = do
let saveFile = basename thName ++ '_' : AS_Anno.senAttr nGoal ++ ".qdimacs"
tl = configTimeLimit cfg
prob <- showQDIMACSProblem thName ps nGoal []
when saveQDIMACS (writeFile saveFile prob)
stpTmpFile <- getTempFile prob saveFile
t_start <- getHetsTime
(exitCode, stdoutC, stderrC) <- executeProcess "depqbf"
(show tl : extraOpts cfg ++ [stpTmpFile]) ""
t_end <- getHetsTime
removeFile stpTmpFile
let t_u = diffHetsTime t_end t_start
exitCode' = case exitCode of
ExitSuccess -> 0
ExitFailure i -> i
(pStat, ret) <- examineProof ps cfg stdoutC stderrC exitCode' nGoal t_u tl
return (pStat, cfg
{ proofStatus = ret
, resultOutput = lines (stdoutC ++ stderrC)
, timeUsed = usedTime ret })
-- | examine Prover output | 1,376 | runDepQBF ps cfg saveQDIMACS thName nGoal = do
let saveFile = basename thName ++ '_' : AS_Anno.senAttr nGoal ++ ".qdimacs"
tl = configTimeLimit cfg
prob <- showQDIMACSProblem thName ps nGoal []
when saveQDIMACS (writeFile saveFile prob)
stpTmpFile <- getTempFile prob saveFile
t_start <- getHetsTime
(exitCode, stdoutC, stderrC) <- executeProcess "depqbf"
(show tl : extraOpts cfg ++ [stpTmpFile]) ""
t_end <- getHetsTime
removeFile stpTmpFile
let t_u = diffHetsTime t_end t_start
exitCode' = case exitCode of
ExitSuccess -> 0
ExitFailure i -> i
(pStat, ret) <- examineProof ps cfg stdoutC stderrC exitCode' nGoal t_u tl
return (pStat, cfg
{ proofStatus = ret
, resultOutput = lines (stdoutC ++ stderrC)
, timeUsed = usedTime ret })
-- | examine Prover output | 908 | true | true | 0 | 13 | 430 | 330 | 163 | 167 | null | null |
olsner/ghc | compiler/utils/Util.hs | bsd-3-clause | fuzzyMatch :: String -> [String] -> [String]
fuzzyMatch key vals = fuzzyLookup key [(v,v) | v <- vals] | 102 | fuzzyMatch :: String -> [String] -> [String]
fuzzyMatch key vals = fuzzyLookup key [(v,v) | v <- vals] | 102 | fuzzyMatch key vals = fuzzyLookup key [(v,v) | v <- vals] | 57 | false | true | 0 | 8 | 17 | 56 | 29 | 27 | null | null |
sol2man2/Learn-You-A-Haskell-For-Great-Good | src/Ch03.hs | mit | factorial n = n * factorial (n-1) | 33 | factorial n = n * factorial (n-1) | 33 | factorial n = n * factorial (n-1) | 33 | false | false | 0 | 8 | 6 | 23 | 11 | 12 | null | null |
narrative/stack | src/Stack/Types/Config.hs | bsd-3-clause | configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
configPackageIndexCache = liftM (</> $(mkRelFile "00-index.cache")) . configPackageIndexRoot | 202 | configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
configPackageIndexCache = liftM (</> $(mkRelFile "00-index.cache")) . configPackageIndexRoot | 202 | configPackageIndexCache = liftM (</> $(mkRelFile "00-index.cache")) . configPackageIndexRoot | 92 | false | true | 0 | 10 | 23 | 67 | 34 | 33 | null | null |
PIWEEK/halisp | src/Core.hs | gpl-3.0 | symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~" | 58 | symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~" | 58 | symbol = oneOf "!#$%&|*+-/:<=>?@^_~" | 36 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
aniketd/learn.haskell | haskellbook/morse/src/Morse.hs | unlicense | letterToMorse :: (M.Map Char Morse)
letterToMorse = M.fromList [
('a', ".-")
, ('b', "-...")
, ('c', "-.-.")
, ('d', "-..")
, ('e', ".")
, ('f', "..-.")
, ('g', "--.")
, ('h', "....")
, ('i', "..")
, ('j', ".---")
, ('k', "-.-")
, ('l', ".-..")
, ('m', "--")
, ('n', "-.")
, ('o', "---")
, ('p', ".--.")
, ('q', "--.-")
, ('r', ".-.")
, ('s', "...")
, ('t', "-")
, ('u', "..-")
, ('v', "...-")
, ('w', ".--")
, ('x', "-..-")
, ('y', "-.--")
, ('z', "--..")
, ('1', ".----")
, ('2', "..---")
, ('3', "...--")
, ('4', "....-")
, ('5', ".....")
, ('6', "-....")
, ('7', "--...")
, ('8', "---..")
, ('9', "----.")
, ('0', "-----")
] | 710 | letterToMorse :: (M.Map Char Morse)
letterToMorse = M.fromList [
('a', ".-")
, ('b', "-...")
, ('c', "-.-.")
, ('d', "-..")
, ('e', ".")
, ('f', "..-.")
, ('g', "--.")
, ('h', "....")
, ('i', "..")
, ('j', ".---")
, ('k', "-.-")
, ('l', ".-..")
, ('m', "--")
, ('n', "-.")
, ('o', "---")
, ('p', ".--.")
, ('q', "--.-")
, ('r', ".-.")
, ('s', "...")
, ('t', "-")
, ('u', "..-")
, ('v', "...-")
, ('w', ".--")
, ('x', "-..-")
, ('y', "-.--")
, ('z', "--..")
, ('1', ".----")
, ('2', "..---")
, ('3', "...--")
, ('4', "....-")
, ('5', ".....")
, ('6', "-....")
, ('7', "--...")
, ('8', "---..")
, ('9', "----.")
, ('0', "-----")
] | 710 | letterToMorse = M.fromList [
('a', ".-")
, ('b', "-...")
, ('c', "-.-.")
, ('d', "-..")
, ('e', ".")
, ('f', "..-.")
, ('g', "--.")
, ('h', "....")
, ('i', "..")
, ('j', ".---")
, ('k', "-.-")
, ('l', ".-..")
, ('m', "--")
, ('n', "-.")
, ('o', "---")
, ('p', ".--.")
, ('q', "--.-")
, ('r', ".-.")
, ('s', "...")
, ('t', "-")
, ('u', "..-")
, ('v', "...-")
, ('w', ".--")
, ('x', "-..-")
, ('y', "-.--")
, ('z', "--..")
, ('1', ".----")
, ('2', "..---")
, ('3', "...--")
, ('4', "....-")
, ('5', ".....")
, ('6', "-....")
, ('7', "--...")
, ('8', "---..")
, ('9', "----.")
, ('0', "-----")
] | 674 | false | true | 0 | 7 | 198 | 350 | 229 | 121 | null | null |
shockkolate/containers | benchmarks/Set.hs | bsd-3-clause | member :: [Int] -> S.Set Int -> Int
member xs s = foldl' (\n x -> if S.member x s then n + 1 else n) 0 xs | 105 | member :: [Int] -> S.Set Int -> Int
member xs s = foldl' (\n x -> if S.member x s then n + 1 else n) 0 xs | 105 | member xs s = foldl' (\n x -> if S.member x s then n + 1 else n) 0 xs | 69 | false | true | 0 | 10 | 27 | 68 | 35 | 33 | null | null |
thewoolleyman/haskellbook | 05/09/maor/typeKwonDo.hs | unlicense | q :: A -> B
q = undefined | 25 | q :: A -> B
q = undefined | 25 | q = undefined | 13 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
dillonhuff/Folly | src/Folly/Formula.hs | bsd-3-clause | freeVars (N f) = freeVars f | 27 | freeVars (N f) = freeVars f | 27 | freeVars (N f) = freeVars f | 27 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
imalsogreg/reflex-dom | src-ghc/Reflex/Dom/Xhr/Foreign.hs | bsd-3-clause | toJSObject :: JSContextRef -> [Ptr OpaqueJSValue] -> IO JSObjectRef
toJSObject ctx args = do
o <- jsobjectmake ctx nullPtr nullPtr
iforM_ args $ \n a -> do
prop <- jsstringcreatewithutf8cstring $ show n
jsobjectsetproperty ctx o prop a 1 nullPtr
return o | 268 | toJSObject :: JSContextRef -> [Ptr OpaqueJSValue] -> IO JSObjectRef
toJSObject ctx args = do
o <- jsobjectmake ctx nullPtr nullPtr
iforM_ args $ \n a -> do
prop <- jsstringcreatewithutf8cstring $ show n
jsobjectsetproperty ctx o prop a 1 nullPtr
return o | 268 | toJSObject ctx args = do
o <- jsobjectmake ctx nullPtr nullPtr
iforM_ args $ \n a -> do
prop <- jsstringcreatewithutf8cstring $ show n
jsobjectsetproperty ctx o prop a 1 nullPtr
return o | 200 | false | true | 0 | 13 | 55 | 100 | 45 | 55 | null | null |
SAdams601/HaRe | old/refactorer/RefacDupTrans.hs | bsd-3-clause | foldAgainstAbsStmts pats (HsQualifier e1 s1) (HsQualifier e2 s2)
= foldAgainstAbs pats e1 e2 ++ foldAgainstAbsStmts pats s1 s2 | 127 | foldAgainstAbsStmts pats (HsQualifier e1 s1) (HsQualifier e2 s2)
= foldAgainstAbs pats e1 e2 ++ foldAgainstAbsStmts pats s1 s2 | 127 | foldAgainstAbsStmts pats (HsQualifier e1 s1) (HsQualifier e2 s2)
= foldAgainstAbs pats e1 e2 ++ foldAgainstAbsStmts pats s1 s2 | 127 | false | false | 3 | 7 | 18 | 55 | 22 | 33 | null | null |
573/leksah | src/IDE/Pane/Files.hs | gpl-2.0 | file :: FileRecord -> Text
file (FileRecord f) = T.pack $ takeFileName f | 72 | file :: FileRecord -> Text
file (FileRecord f) = T.pack $ takeFileName f | 72 | file (FileRecord f) = T.pack $ takeFileName f | 45 | false | true | 0 | 6 | 12 | 37 | 17 | 20 | null | null |
fluffynukeit/FNIStash | src/FNIStash/File/Variables.hs | bsd-3-clause | getDamage varID dType Nothing high d = Nothing | 46 | getDamage varID dType Nothing high d = Nothing | 46 | getDamage varID dType Nothing high d = Nothing | 46 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
anton-k/sharc-timbre | src/Sharc/Instruments/Tuba.hs | bsd-3-clause | note27 :: Note
note27 = Note
(Pitch 329.628 52 "e4")
28
(Range
(NoteRange
(NoteRangeAmplitude 9559.21 29 8.0e-2)
(NoteRangeHarmonicFreq 1 329.62))
(NoteRange
(NoteRangeAmplitude 329.62 1 3111.0)
(NoteRangeHarmonicFreq 30 9888.84)))
[Harmonic 1 (-1.563) 3111.0
,Harmonic 2 (-2.359) 201.43
,Harmonic 3 (-0.553) 108.5
,Harmonic 4 (-1.462) 5.96
,Harmonic 5 1.32 4.86
,Harmonic 6 (-1.577) 1.33
,Harmonic 7 (-2.422) 2.39
,Harmonic 8 2.884 1.27
,Harmonic 9 (-0.78) 0.82
,Harmonic 10 (-0.908) 0.58
,Harmonic 11 0.79 0.2
,Harmonic 12 (-2.084) 0.14
,Harmonic 13 (-1.056) 0.15
,Harmonic 14 (-1.115) 0.15
,Harmonic 15 (-0.123) 9.0e-2
,Harmonic 16 (-1.34) 0.28
,Harmonic 17 (-0.535) 0.13
,Harmonic 18 (-0.87) 0.17
,Harmonic 19 (-0.266) 0.12
,Harmonic 20 0.344 0.11
,Harmonic 21 (-0.62) 0.31
,Harmonic 22 (-0.632) 0.14
,Harmonic 23 (-0.738) 0.12
,Harmonic 24 0.827 9.0e-2
,Harmonic 25 (-1.266) 0.16
,Harmonic 26 (-0.375) 0.12
,Harmonic 27 (-1.14) 0.27
,Harmonic 28 (-0.528) 0.1
,Harmonic 29 0.989 8.0e-2
,Harmonic 30 (-0.654) 0.18] | 1,213 | note27 :: Note
note27 = Note
(Pitch 329.628 52 "e4")
28
(Range
(NoteRange
(NoteRangeAmplitude 9559.21 29 8.0e-2)
(NoteRangeHarmonicFreq 1 329.62))
(NoteRange
(NoteRangeAmplitude 329.62 1 3111.0)
(NoteRangeHarmonicFreq 30 9888.84)))
[Harmonic 1 (-1.563) 3111.0
,Harmonic 2 (-2.359) 201.43
,Harmonic 3 (-0.553) 108.5
,Harmonic 4 (-1.462) 5.96
,Harmonic 5 1.32 4.86
,Harmonic 6 (-1.577) 1.33
,Harmonic 7 (-2.422) 2.39
,Harmonic 8 2.884 1.27
,Harmonic 9 (-0.78) 0.82
,Harmonic 10 (-0.908) 0.58
,Harmonic 11 0.79 0.2
,Harmonic 12 (-2.084) 0.14
,Harmonic 13 (-1.056) 0.15
,Harmonic 14 (-1.115) 0.15
,Harmonic 15 (-0.123) 9.0e-2
,Harmonic 16 (-1.34) 0.28
,Harmonic 17 (-0.535) 0.13
,Harmonic 18 (-0.87) 0.17
,Harmonic 19 (-0.266) 0.12
,Harmonic 20 0.344 0.11
,Harmonic 21 (-0.62) 0.31
,Harmonic 22 (-0.632) 0.14
,Harmonic 23 (-0.738) 0.12
,Harmonic 24 0.827 9.0e-2
,Harmonic 25 (-1.266) 0.16
,Harmonic 26 (-0.375) 0.12
,Harmonic 27 (-1.14) 0.27
,Harmonic 28 (-0.528) 0.1
,Harmonic 29 0.989 8.0e-2
,Harmonic 30 (-0.654) 0.18] | 1,213 | note27 = Note
(Pitch 329.628 52 "e4")
28
(Range
(NoteRange
(NoteRangeAmplitude 9559.21 29 8.0e-2)
(NoteRangeHarmonicFreq 1 329.62))
(NoteRange
(NoteRangeAmplitude 329.62 1 3111.0)
(NoteRangeHarmonicFreq 30 9888.84)))
[Harmonic 1 (-1.563) 3111.0
,Harmonic 2 (-2.359) 201.43
,Harmonic 3 (-0.553) 108.5
,Harmonic 4 (-1.462) 5.96
,Harmonic 5 1.32 4.86
,Harmonic 6 (-1.577) 1.33
,Harmonic 7 (-2.422) 2.39
,Harmonic 8 2.884 1.27
,Harmonic 9 (-0.78) 0.82
,Harmonic 10 (-0.908) 0.58
,Harmonic 11 0.79 0.2
,Harmonic 12 (-2.084) 0.14
,Harmonic 13 (-1.056) 0.15
,Harmonic 14 (-1.115) 0.15
,Harmonic 15 (-0.123) 9.0e-2
,Harmonic 16 (-1.34) 0.28
,Harmonic 17 (-0.535) 0.13
,Harmonic 18 (-0.87) 0.17
,Harmonic 19 (-0.266) 0.12
,Harmonic 20 0.344 0.11
,Harmonic 21 (-0.62) 0.31
,Harmonic 22 (-0.632) 0.14
,Harmonic 23 (-0.738) 0.12
,Harmonic 24 0.827 9.0e-2
,Harmonic 25 (-1.266) 0.16
,Harmonic 26 (-0.375) 0.12
,Harmonic 27 (-1.14) 0.27
,Harmonic 28 (-0.528) 0.1
,Harmonic 29 0.989 8.0e-2
,Harmonic 30 (-0.654) 0.18] | 1,198 | false | true | 0 | 10 | 343 | 519 | 268 | 251 | null | null |
brendanhay/gogol | gogol-script/gen/Network/Google/Script/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'GoogleAppsScriptTypeExecutionAPIEntryPoint' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gasteaepEntryPointConfig'
googleAppsScriptTypeExecutionAPIEntryPoint
:: GoogleAppsScriptTypeExecutionAPIEntryPoint
googleAppsScriptTypeExecutionAPIEntryPoint =
GoogleAppsScriptTypeExecutionAPIEntryPoint'
{_gasteaepEntryPointConfig = Nothing} | 454 | googleAppsScriptTypeExecutionAPIEntryPoint
:: GoogleAppsScriptTypeExecutionAPIEntryPoint
googleAppsScriptTypeExecutionAPIEntryPoint =
GoogleAppsScriptTypeExecutionAPIEntryPoint'
{_gasteaepEntryPointConfig = Nothing} | 225 | googleAppsScriptTypeExecutionAPIEntryPoint =
GoogleAppsScriptTypeExecutionAPIEntryPoint'
{_gasteaepEntryPointConfig = Nothing} | 132 | true | true | 1 | 7 | 52 | 31 | 17 | 14 | null | null |
ezyang/ghc | testsuite/tests/codeGen/should_run/CmmSwitchTest32.hs | bsd-3-clause | al 2147483642# = 1073741863# | 28 | al 2147483642# = 1073741863# | 28 | al 2147483642# = 1073741863# | 28 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
stevely/hspirv | src/SpirV/Builder/Raw.hs | bsd-3-clause | memoryBarrier :: ExecutionScope -> [MemorySemantics] -> Builder ()
memoryBarrier es ms = zeroOp (OpMemoryBarrier es ms) | 119 | memoryBarrier :: ExecutionScope -> [MemorySemantics] -> Builder ()
memoryBarrier es ms = zeroOp (OpMemoryBarrier es ms) | 119 | memoryBarrier es ms = zeroOp (OpMemoryBarrier es ms) | 52 | false | true | 0 | 8 | 15 | 43 | 21 | 22 | null | null |
keithodulaigh/Hets | Proofs/AbstractState.hs | gpl-2.0 | getCcBatch :: G_cons_checker -> Bool
getCcBatch (G_cons_checker _ p) = ccBatch p | 80 | getCcBatch :: G_cons_checker -> Bool
getCcBatch (G_cons_checker _ p) = ccBatch p | 80 | getCcBatch (G_cons_checker _ p) = ccBatch p | 43 | false | true | 0 | 6 | 11 | 33 | 15 | 18 | null | null |
pgj/bead | snaplets/fay/src/Fay/JQueryUI.hs | bsd-3-clause | disableSpinner :: Spinner -> Fay ()
disableSpinner = spinner disableSpinner' | 76 | disableSpinner :: Spinner -> Fay ()
disableSpinner = spinner disableSpinner' | 76 | disableSpinner = spinner disableSpinner' | 40 | false | true | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
yuga/ghc-mod | Language/Haskell/GhcMod/Debug.hs | bsd-3-clause | -- | Obtaining debug information.
debug :: Options
-> Cradle
-> FilePath -- ^ A target file.
-> Ghc [String]
debug opt cradle fileName = do
CompilerOptions gopts incDir pkgs <-
if cabal then
liftIO (fromCabalFile ||> return simpleCompilerOption)
else
return simpleCompilerOption
void $ initializeFlagsWithCradle opt cradle gopts True
setTargetFiles [fileName]
return [
"Root directory: " ++ rootDir
, "Current directory: " ++ currentDir
, "Cabal file: " ++ cabalFile
, "GHC options: " ++ unwords gopts
, "Include directories: " ++ unwords incDir
, "Dependent packages: " ++ intercalate ", " (map fst pkgs)
]
where
currentDir = cradleCurrentDir cradle
mCabalFile = cradleCabalFile cradle
rootDir = cradleRootDir cradle
cabal = isJust mCabalFile
cabalFile = fromMaybe "" mCabalFile
origGopts = ghcOpts opt
simpleCompilerOption = CompilerOptions origGopts [] []
fromCabalFile = parseCabalFile file >>= getCompilerOptions origGopts cradle
where
file = fromJust mCabalFile
----------------------------------------------------------------
-- | Obtaining root information. | 1,267 | debug :: Options
-> Cradle
-> FilePath -- ^ A target file.
-> Ghc [String]
debug opt cradle fileName = do
CompilerOptions gopts incDir pkgs <-
if cabal then
liftIO (fromCabalFile ||> return simpleCompilerOption)
else
return simpleCompilerOption
void $ initializeFlagsWithCradle opt cradle gopts True
setTargetFiles [fileName]
return [
"Root directory: " ++ rootDir
, "Current directory: " ++ currentDir
, "Cabal file: " ++ cabalFile
, "GHC options: " ++ unwords gopts
, "Include directories: " ++ unwords incDir
, "Dependent packages: " ++ intercalate ", " (map fst pkgs)
]
where
currentDir = cradleCurrentDir cradle
mCabalFile = cradleCabalFile cradle
rootDir = cradleRootDir cradle
cabal = isJust mCabalFile
cabalFile = fromMaybe "" mCabalFile
origGopts = ghcOpts opt
simpleCompilerOption = CompilerOptions origGopts [] []
fromCabalFile = parseCabalFile file >>= getCompilerOptions origGopts cradle
where
file = fromJust mCabalFile
----------------------------------------------------------------
-- | Obtaining root information. | 1,233 | debug opt cradle fileName = do
CompilerOptions gopts incDir pkgs <-
if cabal then
liftIO (fromCabalFile ||> return simpleCompilerOption)
else
return simpleCompilerOption
void $ initializeFlagsWithCradle opt cradle gopts True
setTargetFiles [fileName]
return [
"Root directory: " ++ rootDir
, "Current directory: " ++ currentDir
, "Cabal file: " ++ cabalFile
, "GHC options: " ++ unwords gopts
, "Include directories: " ++ unwords incDir
, "Dependent packages: " ++ intercalate ", " (map fst pkgs)
]
where
currentDir = cradleCurrentDir cradle
mCabalFile = cradleCabalFile cradle
rootDir = cradleRootDir cradle
cabal = isJust mCabalFile
cabalFile = fromMaybe "" mCabalFile
origGopts = ghcOpts opt
simpleCompilerOption = CompilerOptions origGopts [] []
fromCabalFile = parseCabalFile file >>= getCompilerOptions origGopts cradle
where
file = fromJust mCabalFile
----------------------------------------------------------------
-- | Obtaining root information. | 1,136 | true | true | 4 | 12 | 348 | 280 | 133 | 147 | null | null |
aelve/hslibs | tests/Selenium.hs | bsd-3-clause | shouldHaveProp :: CanSelect a => a -> (Text, Text) -> WD ()
s `shouldHaveProp` (a, txt) = do
t <- cssProp s a
unless (Just txt == t) $ expectationFailure $
printf "expected property %s of %s to be %s, got %s"
a (show s) (show txt) (show t) | 258 | shouldHaveProp :: CanSelect a => a -> (Text, Text) -> WD ()
s `shouldHaveProp` (a, txt) = do
t <- cssProp s a
unless (Just txt == t) $ expectationFailure $
printf "expected property %s of %s to be %s, got %s"
a (show s) (show txt) (show t) | 258 | s `shouldHaveProp` (a, txt) = do
t <- cssProp s a
unless (Just txt == t) $ expectationFailure $
printf "expected property %s of %s to be %s, got %s"
a (show s) (show txt) (show t) | 198 | false | true | 0 | 13 | 67 | 120 | 58 | 62 | null | null |
cacay/language-sill | Language/Krill/TypeChecker/FreeVariables.hs | mit | freeChannelsSet (ERecvProv _ c e) = Set.delete c (freeChannelsSet e) | 68 | freeChannelsSet (ERecvProv _ c e) = Set.delete c (freeChannelsSet e) | 68 | freeChannelsSet (ERecvProv _ c e) = Set.delete c (freeChannelsSet e) | 68 | false | false | 0 | 7 | 9 | 33 | 15 | 18 | null | null |
mishun/tangles | src/Math/Topology/KnotTh/Algebra/Dihedral/Dn.hs | lgpl-3.0 | singleElementSubGroup :: Int -> SubGroup Dn
singleElementSubGroup n | n <= 0 = error $ printf "singleElementSubGroup: order %i is non-positive" n
| otherwise = Per n n | 196 | singleElementSubGroup :: Int -> SubGroup Dn
singleElementSubGroup n | n <= 0 = error $ printf "singleElementSubGroup: order %i is non-positive" n
| otherwise = Per n n | 196 | singleElementSubGroup n | n <= 0 = error $ printf "singleElementSubGroup: order %i is non-positive" n
| otherwise = Per n n | 152 | false | true | 0 | 8 | 56 | 54 | 24 | 30 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpHasSideEffects AtomicallyOp = True | 40 | primOpHasSideEffects AtomicallyOp = True | 40 | primOpHasSideEffects AtomicallyOp = True | 40 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mcschroeder/ghc | testsuite/tests/pmcheck/should_compile/T11195.hs | bsd-3-clause | isCohRight_maybe = undefined | 28 | isCohRight_maybe = undefined | 28 | isCohRight_maybe = undefined | 28 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
lenary/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | -- | Show a term with specific options
showTmOpts :: PPOption -> PTerm -> String
showTmOpts opt = flip (displayS . renderPretty 1.0 10000000 . prettyImp opt) "" | 161 | showTmOpts :: PPOption -> PTerm -> String
showTmOpts opt = flip (displayS . renderPretty 1.0 10000000 . prettyImp opt) "" | 121 | showTmOpts opt = flip (displayS . renderPretty 1.0 10000000 . prettyImp opt) "" | 79 | true | true | 0 | 9 | 28 | 53 | 24 | 29 | null | null |
sdiehl/ghc | compiler/GHC/Cmm/CLabel.hs | bsd-3-clause | pprCLbl (CmmLabel _ fs CmmClosure)
= ftext fs <> text "_closure" | 66 | pprCLbl (CmmLabel _ fs CmmClosure)
= ftext fs <> text "_closure" | 66 | pprCLbl (CmmLabel _ fs CmmClosure)
= ftext fs <> text "_closure" | 66 | false | false | 2 | 6 | 12 | 32 | 13 | 19 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/max_2.hs | mit | max2 x y = max1 x y (ltEsMyBool x y) | 36 | max2 x y = max1 x y (ltEsMyBool x y) | 36 | max2 x y = max1 x y (ltEsMyBool x y) | 36 | false | false | 1 | 7 | 9 | 32 | 12 | 20 | null | null |
AArkadie/Chatshire | Main.hs | mit | lexString :: [String] -> [Lexeme]
lexString [] = [] | 52 | lexString :: [String] -> [Lexeme]
lexString [] = [] | 51 | lexString [] = [] | 17 | false | true | 0 | 8 | 9 | 34 | 16 | 18 | null | null |
kawu/crf-chain1-constrained | src/Data/CRF/Chain1/Constrained/Feature/Hidden.hs | bsd-2-clause | hiddenTFeats :: AVec Lb -> [(Xs, b)] -> [Feature]
hiddenTFeats r0 ds =
concatMap (tFeats . fst) ds
where
tFeats xs = concatMap (tFeatsOn xs) [1 .. V.length xs - 1]
tFeatsOn xs k =
[ TFeature x y
| x <- unR r0 (xs V.! k)
, y <- unR r0 (xs V.! (k-1)) ]
-- | Hidden 'SFeature's which can be constructed based on the dataset.
-- The default set of potential interpretations is used for all unknown words. | 439 | hiddenTFeats :: AVec Lb -> [(Xs, b)] -> [Feature]
hiddenTFeats r0 ds =
concatMap (tFeats . fst) ds
where
tFeats xs = concatMap (tFeatsOn xs) [1 .. V.length xs - 1]
tFeatsOn xs k =
[ TFeature x y
| x <- unR r0 (xs V.! k)
, y <- unR r0 (xs V.! (k-1)) ]
-- | Hidden 'SFeature's which can be constructed based on the dataset.
-- The default set of potential interpretations is used for all unknown words. | 439 | hiddenTFeats r0 ds =
concatMap (tFeats . fst) ds
where
tFeats xs = concatMap (tFeatsOn xs) [1 .. V.length xs - 1]
tFeatsOn xs k =
[ TFeature x y
| x <- unR r0 (xs V.! k)
, y <- unR r0 (xs V.! (k-1)) ]
-- | Hidden 'SFeature's which can be constructed based on the dataset.
-- The default set of potential interpretations is used for all unknown words. | 389 | false | true | 1 | 13 | 119 | 158 | 82 | 76 | null | null |
rumblesan/proviz | src/Improviz/Runtime.hs | bsd-3-clause | resetProgram :: ImprovizRuntime eg -> ImprovizRuntime eg
resetProgram as =
let oldAst = view lastWorkingAst as
oldText = view lastProgramText as
in set programText oldText $ set currentAst oldAst as | 210 | resetProgram :: ImprovizRuntime eg -> ImprovizRuntime eg
resetProgram as =
let oldAst = view lastWorkingAst as
oldText = view lastProgramText as
in set programText oldText $ set currentAst oldAst as | 210 | resetProgram as =
let oldAst = view lastWorkingAst as
oldText = view lastProgramText as
in set programText oldText $ set currentAst oldAst as | 153 | false | true | 0 | 9 | 41 | 66 | 30 | 36 | null | null |
axhav/AFPLAB3 | Raytracer.hs | bsd-3-clause | -- | Function to determine what direction a pixel has on the screen
cameraRay :: Camera->(Int, Int) -> Int -> Int -> Ray
cameraRay r@Camera{cdir = dir, cpoint = pnt, cup =up, fov= fov'}
(maxX',maxY') x y =
Ray{dir=
normalize(R.computeUnboxedS(R.zipWith (+) pnt imagePoint)), point = pnt}
where u = crossProd dir up
v = crossProd u dir
viewPlaneHalfWith = tan fov' --(pi/4.0)
aspectRatio = (fromIntegral maxX')/(fromIntegral maxY')
viewPlaneHalfHeight = viewPlaneHalfWith * aspectRatio
viewPlaneBottomLeftPoint = R.zipWith (-) ( R.zipWith (-)
(dir) (R.map ( viewPlaneHalfHeight* ) v))
(R.map ( viewPlaneHalfWith* ) u)
yIncVector =
R.map (*(2*viewPlaneHalfHeight/ (fromIntegral maxX'))) v
xIncVector =
R.map (*(2*viewPlaneHalfWith/ (fromIntegral maxY'))) u
imagePoint =
R.zipWith (+) (R.zipWith (+) viewPlaneBottomLeftPoint
(R.map ( (fromIntegral y)* ) xIncVector))
(R.map ( ( fromIntegral x)* ) yIncVector)
-- | Function that gives a traced image exported as an array of colors for
-- further computations | 1,348 | cameraRay :: Camera->(Int, Int) -> Int -> Int -> Ray
cameraRay r@Camera{cdir = dir, cpoint = pnt, cup =up, fov= fov'}
(maxX',maxY') x y =
Ray{dir=
normalize(R.computeUnboxedS(R.zipWith (+) pnt imagePoint)), point = pnt}
where u = crossProd dir up
v = crossProd u dir
viewPlaneHalfWith = tan fov' --(pi/4.0)
aspectRatio = (fromIntegral maxX')/(fromIntegral maxY')
viewPlaneHalfHeight = viewPlaneHalfWith * aspectRatio
viewPlaneBottomLeftPoint = R.zipWith (-) ( R.zipWith (-)
(dir) (R.map ( viewPlaneHalfHeight* ) v))
(R.map ( viewPlaneHalfWith* ) u)
yIncVector =
R.map (*(2*viewPlaneHalfHeight/ (fromIntegral maxX'))) v
xIncVector =
R.map (*(2*viewPlaneHalfWith/ (fromIntegral maxY'))) u
imagePoint =
R.zipWith (+) (R.zipWith (+) viewPlaneBottomLeftPoint
(R.map ( (fromIntegral y)* ) xIncVector))
(R.map ( ( fromIntegral x)* ) yIncVector)
-- | Function that gives a traced image exported as an array of colors for
-- further computations | 1,278 | cameraRay r@Camera{cdir = dir, cpoint = pnt, cup =up, fov= fov'}
(maxX',maxY') x y =
Ray{dir=
normalize(R.computeUnboxedS(R.zipWith (+) pnt imagePoint)), point = pnt}
where u = crossProd dir up
v = crossProd u dir
viewPlaneHalfWith = tan fov' --(pi/4.0)
aspectRatio = (fromIntegral maxX')/(fromIntegral maxY')
viewPlaneHalfHeight = viewPlaneHalfWith * aspectRatio
viewPlaneBottomLeftPoint = R.zipWith (-) ( R.zipWith (-)
(dir) (R.map ( viewPlaneHalfHeight* ) v))
(R.map ( viewPlaneHalfWith* ) u)
yIncVector =
R.map (*(2*viewPlaneHalfHeight/ (fromIntegral maxX'))) v
xIncVector =
R.map (*(2*viewPlaneHalfWith/ (fromIntegral maxY'))) u
imagePoint =
R.zipWith (+) (R.zipWith (+) viewPlaneBottomLeftPoint
(R.map ( (fromIntegral y)* ) xIncVector))
(R.map ( ( fromIntegral x)* ) yIncVector)
-- | Function that gives a traced image exported as an array of colors for
-- further computations | 1,225 | true | true | 0 | 14 | 485 | 378 | 212 | 166 | null | null |
mgold/Elm | src/Generate/JavaScript/BuiltIn.hs | bsd-3-clause | -- EFFECTS
effect :: ModuleName.Canonical -> JS.Expression ()
effect effectName =
Var.coreNative "Platform" "leaf" <|
JS.StringLit () (ModuleName.canonicalToString effectName) | 183 | effect :: ModuleName.Canonical -> JS.Expression ()
effect effectName =
Var.coreNative "Platform" "leaf" <|
JS.StringLit () (ModuleName.canonicalToString effectName) | 170 | effect effectName =
Var.coreNative "Platform" "leaf" <|
JS.StringLit () (ModuleName.canonicalToString effectName) | 119 | true | true | 0 | 9 | 26 | 56 | 27 | 29 | null | null |
dsorokin/aivika-experiment-chart | examples/TruckHaulingSituation/Experiment.hs | bsd-3-clause | loaderQueueCountStats = T.tr $ T.queueCountStats loaderQueue | 60 | loaderQueueCountStats = T.tr $ T.queueCountStats loaderQueue | 60 | loaderQueueCountStats = T.tr $ T.queueCountStats loaderQueue | 60 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
ambiata/zodiac | zodiac-core/src/Zodiac/Core/Data/Request.hs | bsd-3-clause | renderCQueryString :: CQueryString -> ByteString
renderCQueryString = unCQueryString | 84 | renderCQueryString :: CQueryString -> ByteString
renderCQueryString = unCQueryString | 84 | renderCQueryString = unCQueryString | 35 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
sol/config-ng | src/Internal.hs | mit | unValue :: Value -> Text
unValue (Value v) = v | 46 | unValue :: Value -> Text
unValue (Value v) = v | 46 | unValue (Value v) = v | 21 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
davidzhulijun/TAM | PushdownAutomaton/Operations.hs | bsd-3-clause | stackoperation :: Stack s => StackCommd v -> s v -> s v
stackoperation Pop = pop | 85 | stackoperation :: Stack s => StackCommd v -> s v -> s v
stackoperation Pop = pop | 85 | stackoperation Pop = pop | 29 | false | true | 0 | 9 | 21 | 43 | 18 | 25 | null | null |
rodrigogribeiro/mptc | src/Language/Haskell/Exts/Annotated/Simplify.hs | bsd-3-clause | sModuleHead :: Maybe (ModuleHead l) -> (S.ModuleName, Maybe (S.WarningText), Maybe [S.ExportSpec])
sModuleHead mmh = case mmh of
Nothing -> (S.main_mod, Nothing, Just [S.EVar (S.UnQual S.main_name)])
Just (ModuleHead _ mn mwt mel) -> (sModuleName mn, fmap sWarningText mwt, fmap sExportSpecList mel) | 307 | sModuleHead :: Maybe (ModuleHead l) -> (S.ModuleName, Maybe (S.WarningText), Maybe [S.ExportSpec])
sModuleHead mmh = case mmh of
Nothing -> (S.main_mod, Nothing, Just [S.EVar (S.UnQual S.main_name)])
Just (ModuleHead _ mn mwt mel) -> (sModuleName mn, fmap sWarningText mwt, fmap sExportSpecList mel) | 307 | sModuleHead mmh = case mmh of
Nothing -> (S.main_mod, Nothing, Just [S.EVar (S.UnQual S.main_name)])
Just (ModuleHead _ mn mwt mel) -> (sModuleName mn, fmap sWarningText mwt, fmap sExportSpecList mel) | 208 | false | true | 7 | 12 | 47 | 139 | 71 | 68 | null | null |
google/cabal2bazel | src/Google/Google3/Tools/Cabal2Build/PackageName.hs | apache-2.0 | google3packageNameForCabalPackageId :: Cabal.PackageIdentifier
-> Google3.PackageName
google3packageNameForCabalPackageId (Cabal.PackageIdentifier name version)
= Google3.subpackageName unversionedPackageName [versionSegment]
where unversionedPackageName = google3packageNameForCabalPackageName name
versionSegment =
Text.cons 'v' $
Text.intercalate "_" $
map (Text.pack . show) branch
branch = Cabal.versionNumbers version
-- | Converts a Google3 version directory name into a Cabal version.
-- For example, "v0_3_6" becomes 0.3.6. | 632 | google3packageNameForCabalPackageId :: Cabal.PackageIdentifier
-> Google3.PackageName
google3packageNameForCabalPackageId (Cabal.PackageIdentifier name version)
= Google3.subpackageName unversionedPackageName [versionSegment]
where unversionedPackageName = google3packageNameForCabalPackageName name
versionSegment =
Text.cons 'v' $
Text.intercalate "_" $
map (Text.pack . show) branch
branch = Cabal.versionNumbers version
-- | Converts a Google3 version directory name into a Cabal version.
-- For example, "v0_3_6" becomes 0.3.6. | 632 | google3packageNameForCabalPackageId (Cabal.PackageIdentifier name version)
= Google3.subpackageName unversionedPackageName [versionSegment]
where unversionedPackageName = google3packageNameForCabalPackageName name
versionSegment =
Text.cons 'v' $
Text.intercalate "_" $
map (Text.pack . show) branch
branch = Cabal.versionNumbers version
-- | Converts a Google3 version directory name into a Cabal version.
-- For example, "v0_3_6" becomes 0.3.6. | 510 | false | true | 2 | 9 | 152 | 102 | 51 | 51 | null | null |
snoyberg/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | -- count trailing zeros
emitPrimOp _ [res] Ctz8Op [w] = emitCtzCall res w W8 | 82 | emitPrimOp _ [res] Ctz8Op [w] = emitCtzCall res w W8 | 58 | emitPrimOp _ [res] Ctz8Op [w] = emitCtzCall res w W8 | 58 | true | false | 0 | 6 | 19 | 29 | 15 | 14 | null | null |
rimmington/eclogues | eclogues/src/Eclogues/Job/Resources.hs | bsd-3-clause | mkResources :: (MonadPlus m) => Data -> Data -> Frequency -> Time -> m Resources
mkResources d r c t = case () of
_ | res `nrleq` maxBound -> fail "Resource value too large"
| minBound `nrleq` res -> fail "Resource value too small"
| otherwise -> pure res
where
nrleq a = not . rleq a
d' = mc d $ Mega Byte
r' = mc r $ Mega Byte
c' = mc c $ Mega Hertz
t' = mc t Second
res = Resources d' r' c' t'
mc v u = if v <= m then m else v `ceilToUnit` u
where
m = 1 `of'` u
-- TODO: ceilToExp can probably be smarter
ceilToUnit :: forall dim u. (SI.SharesUnit dim u, BaseUnit (BaseUnit u) ~ BaseUnit u) => SI.Quantity dim Sustific -> u -> SI.Quantity dim Sustific
ceilToUnit q _ = ofT @(BaseUnit u) . ceilToExp (baseShift10Factor @u) $ inT @(BaseUnit u) q
-- $conversions
-- The following conversion functions are guaranteed to neither overflow nor
-- underflow, due to constraints enforced by 'mkResources'.
-- TODO: Prefer an unsigned type | 1,021 | mkResources :: (MonadPlus m) => Data -> Data -> Frequency -> Time -> m Resources
mkResources d r c t = case () of
_ | res `nrleq` maxBound -> fail "Resource value too large"
| minBound `nrleq` res -> fail "Resource value too small"
| otherwise -> pure res
where
nrleq a = not . rleq a
d' = mc d $ Mega Byte
r' = mc r $ Mega Byte
c' = mc c $ Mega Hertz
t' = mc t Second
res = Resources d' r' c' t'
mc v u = if v <= m then m else v `ceilToUnit` u
where
m = 1 `of'` u
-- TODO: ceilToExp can probably be smarter
ceilToUnit :: forall dim u. (SI.SharesUnit dim u, BaseUnit (BaseUnit u) ~ BaseUnit u) => SI.Quantity dim Sustific -> u -> SI.Quantity dim Sustific
ceilToUnit q _ = ofT @(BaseUnit u) . ceilToExp (baseShift10Factor @u) $ inT @(BaseUnit u) q
-- $conversions
-- The following conversion functions are guaranteed to neither overflow nor
-- underflow, due to constraints enforced by 'mkResources'.
-- TODO: Prefer an unsigned type | 1,021 | mkResources d r c t = case () of
_ | res `nrleq` maxBound -> fail "Resource value too large"
| minBound `nrleq` res -> fail "Resource value too small"
| otherwise -> pure res
where
nrleq a = not . rleq a
d' = mc d $ Mega Byte
r' = mc r $ Mega Byte
c' = mc c $ Mega Hertz
t' = mc t Second
res = Resources d' r' c' t'
mc v u = if v <= m then m else v `ceilToUnit` u
where
m = 1 `of'` u
-- TODO: ceilToExp can probably be smarter
ceilToUnit :: forall dim u. (SI.SharesUnit dim u, BaseUnit (BaseUnit u) ~ BaseUnit u) => SI.Quantity dim Sustific -> u -> SI.Quantity dim Sustific
ceilToUnit q _ = ofT @(BaseUnit u) . ceilToExp (baseShift10Factor @u) $ inT @(BaseUnit u) q
-- $conversions
-- The following conversion functions are guaranteed to neither overflow nor
-- underflow, due to constraints enforced by 'mkResources'.
-- TODO: Prefer an unsigned type | 940 | false | true | 4 | 11 | 273 | 370 | 179 | 191 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/Defaults.hs | mit | reverseUsingReverseOnto :: Sequence s => s a -> s a
reverseUsingReverseOnto s = reverseOnto s empty | 99 | reverseUsingReverseOnto :: Sequence s => s a -> s a
reverseUsingReverseOnto s = reverseOnto s empty | 99 | reverseUsingReverseOnto s = reverseOnto s empty | 47 | false | true | 0 | 7 | 15 | 36 | 16 | 20 | null | null |
shayan-najd/Embedding-By-Normalisation | Power.hs | gpl-3.0 | l <$$> m = maybeT (abs (\ x -> justT (l `app` x))) nothingT m | 66 | l <$$> m = maybeT (abs (\ x -> justT (l `app` x))) nothingT m | 66 | l <$$> m = maybeT (abs (\ x -> justT (l `app` x))) nothingT m | 66 | false | false | 2 | 12 | 19 | 44 | 23 | 21 | null | null |
ryantm/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- 'condIntReg' and 'condFltReg': condition codes into registers
-- Turn those condition codes into integers now (when they appear on
-- the right hand side of an assignment).
--
-- (If applicable) Do not fill the delay slots here; you will confuse the
-- register allocator.
condIntReg :: Cond -> CmmExpr -> CmmExpr -> NatM Register
condIntReg cond x y = do
CondCode _ cond cond_code <- condIntCode cond x y
tmp <- getNewRegNat II8
let
code dst = cond_code `appOL` toOL [
SETCC cond (OpReg tmp),
MOVZxL II8 (OpReg tmp) (OpReg dst)
]
return (Any II32 code) | 714 | condIntReg :: Cond -> CmmExpr -> CmmExpr -> NatM Register
condIntReg cond x y = do
CondCode _ cond cond_code <- condIntCode cond x y
tmp <- getNewRegNat II8
let
code dst = cond_code `appOL` toOL [
SETCC cond (OpReg tmp),
MOVZxL II8 (OpReg tmp) (OpReg dst)
]
return (Any II32 code) | 354 | condIntReg cond x y = do
CondCode _ cond cond_code <- condIntCode cond x y
tmp <- getNewRegNat II8
let
code dst = cond_code `appOL` toOL [
SETCC cond (OpReg tmp),
MOVZxL II8 (OpReg tmp) (OpReg dst)
]
return (Any II32 code) | 296 | true | true | 0 | 16 | 176 | 147 | 71 | 76 | null | null |
input-output-hk/cardano-sl | wallet/src/Cardano/Wallet/API/V1/Swagger.hs | apache-2.0 | estimateFeesDescription :: Text
estimateFeesDescription = [text|
Estimate the fees which would incur from the input payment. This endpoint
**does not** require a _spending password_ to be supplied as it generates
under the hood an unsigned transaction.
|] | 255 | estimateFeesDescription :: Text
estimateFeesDescription = [text|
Estimate the fees which would incur from the input payment. This endpoint
**does not** require a _spending password_ to be supplied as it generates
under the hood an unsigned transaction.
|] | 255 | estimateFeesDescription = [text|
Estimate the fees which would incur from the input payment. This endpoint
**does not** require a _spending password_ to be supplied as it generates
under the hood an unsigned transaction.
|] | 223 | false | true | 0 | 4 | 36 | 15 | 10 | 5 | null | null |
siddhanathan/yi | example-configs/yi-all-static/Main.hs | gpl-2.0 | myConfig :: Maybe String -> Maybe String -> ConfigM ()
myConfig f k = do
-- Lookup f in the frontends list or pick the first element of the frontends list if
-- f is nothing or do nothing if f is not found in the frontends list.
case f of
Nothing -> snd (head frontends)
Just f' -> fromMaybe (return ()) (lookup f' frontends)
-- Same as above, but then with k and keymaps
case k of
Nothing -> snd (head keymaps)
Just k' -> fromMaybe (return ()) (lookup k' keymaps)
configureHaskellMode
configureJavaScriptMode
configureMiscModes | 560 | myConfig :: Maybe String -> Maybe String -> ConfigM ()
myConfig f k = do
-- Lookup f in the frontends list or pick the first element of the frontends list if
-- f is nothing or do nothing if f is not found in the frontends list.
case f of
Nothing -> snd (head frontends)
Just f' -> fromMaybe (return ()) (lookup f' frontends)
-- Same as above, but then with k and keymaps
case k of
Nothing -> snd (head keymaps)
Just k' -> fromMaybe (return ()) (lookup k' keymaps)
configureHaskellMode
configureJavaScriptMode
configureMiscModes | 560 | myConfig f k = do
-- Lookup f in the frontends list or pick the first element of the frontends list if
-- f is nothing or do nothing if f is not found in the frontends list.
case f of
Nothing -> snd (head frontends)
Just f' -> fromMaybe (return ()) (lookup f' frontends)
-- Same as above, but then with k and keymaps
case k of
Nothing -> snd (head keymaps)
Just k' -> fromMaybe (return ()) (lookup k' keymaps)
configureHaskellMode
configureJavaScriptMode
configureMiscModes | 505 | false | true | 0 | 13 | 126 | 151 | 70 | 81 | null | null |
mit-pdos/fscq-impl | src/hslib/Word.hs | mit | wnot :: Integer -> Coq_word -> Coq_word
wnot _ (W w) = W $ complement w | 71 | wnot :: Integer -> Coq_word -> Coq_word
wnot _ (W w) = W $ complement w | 71 | wnot _ (W w) = W $ complement w | 31 | false | true | 0 | 10 | 15 | 42 | 19 | 23 | null | null |
kim/amazonka | amazonka-kms/gen/Network/AWS/KMS/ReEncrypt.hs | mpl-2.0 | -- | Unique identifier of the key used to originally encrypt the data.
rerSourceKeyId :: Lens' ReEncryptResponse (Maybe Text)
rerSourceKeyId = lens _rerSourceKeyId (\s a -> s { _rerSourceKeyId = a }) | 199 | rerSourceKeyId :: Lens' ReEncryptResponse (Maybe Text)
rerSourceKeyId = lens _rerSourceKeyId (\s a -> s { _rerSourceKeyId = a }) | 128 | rerSourceKeyId = lens _rerSourceKeyId (\s a -> s { _rerSourceKeyId = a }) | 73 | true | true | 0 | 9 | 31 | 46 | 25 | 21 | null | null |
ghcjs/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ CopyMutableArrayArrayOp [] [a1,o1,a2,o2,n] = PrimInline $
loop 0 (.<.n) (\i -> (a2 .! (i+o2) |= a1 .! (i+o1) # preIncrS i)) | 139 | genPrim _ _ CopyMutableArrayArrayOp [] [a1,o1,a2,o2,n] = PrimInline $
loop 0 (.<.n) (\i -> (a2 .! (i+o2) |= a1 .! (i+o1) # preIncrS i)) | 139 | genPrim _ _ CopyMutableArrayArrayOp [] [a1,o1,a2,o2,n] = PrimInline $
loop 0 (.<.n) (\i -> (a2 .! (i+o2) |= a1 .! (i+o1) # preIncrS i)) | 139 | false | false | 0 | 15 | 27 | 93 | 51 | 42 | null | null |
eklavya/Idris-dev | src/Idris/Core/ProofTerm.hs | bsd-3-clause | rebuildBinder tm (LetT p t) = Let (rebuildTerm tm p) t | 54 | rebuildBinder tm (LetT p t) = Let (rebuildTerm tm p) t | 54 | rebuildBinder tm (LetT p t) = Let (rebuildTerm tm p) t | 54 | false | false | 0 | 7 | 10 | 32 | 15 | 17 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.