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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ledyba/hs-java | JVM/Builder/Instructions.hs | lgpl-3.0 | f2i :: Generator e g => g e ()
f2i = i0 F2I | 44 | f2i :: Generator e g => g e ()
f2i = i0 F2I | 44 | f2i = i0 F2I | 13 | false | true | 0 | 7 | 13 | 33 | 15 | 18 | null | null |
adarqui/github | Github/GitData/References.hs | bsd-3-clause | createReference :: GithubAuth -> String -> String -> NewGitReference -> IO (Either Error GitReference)
createReference auth owner reqRepoName newRef =
githubPost auth ["repos", owner, reqRepoName, "git", "refs"] newRef | 220 | createReference :: GithubAuth -> String -> String -> NewGitReference -> IO (Either Error GitReference)
createReference auth owner reqRepoName newRef =
githubPost auth ["repos", owner, reqRepoName, "git", "refs"] newRef | 220 | createReference auth owner reqRepoName newRef =
githubPost auth ["repos", owner, reqRepoName, "git", "refs"] newRef | 117 | false | true | 0 | 11 | 29 | 76 | 37 | 39 | null | null |
rueshyna/gogol | gogol-adsense/gen/Network/Google/AdSense/Types/Product.hs | mpl-2.0 | -- | The codes of the projects supported by the dimension or metric this
-- reporting metadata entry describes.
rmeSupportedProducts :: Lens' ReportingMetadataEntry [Text]
rmeSupportedProducts
= lens _rmeSupportedProducts
(\ s a -> s{_rmeSupportedProducts = a})
. _Default
. _Coerce | 302 | rmeSupportedProducts :: Lens' ReportingMetadataEntry [Text]
rmeSupportedProducts
= lens _rmeSupportedProducts
(\ s a -> s{_rmeSupportedProducts = a})
. _Default
. _Coerce | 190 | rmeSupportedProducts
= lens _rmeSupportedProducts
(\ s a -> s{_rmeSupportedProducts = a})
. _Default
. _Coerce | 130 | true | true | 0 | 11 | 58 | 54 | 29 | 25 | null | null |
capn-freako/circat | src/Circat/LinearMap.hs | bsd-3-clause | mu :: (u :-* v) -> u -> v
mu (Scale s) x = s * x | 53 | mu :: (u :-* v) -> u -> v
mu (Scale s) x = s * x | 53 | mu (Scale s) x = s * x | 27 | false | true | 1 | 10 | 21 | 48 | 22 | 26 | null | null |
spechub/Hets | HasCASL/ParseItem.hs | gpl-2.0 | -- * parsing type items
commaTypeDecl :: TypePattern -> AParser st TypeItem
commaTypeDecl s = do
c <- anComma
(is, cs) <- typePattern `separatedBy` anComma
let l = s : is
p = c : cs
subTypeDecl (l, p) <|> kindedTypeDecl (l, p)
<|> return (TypeDecl l universe $ catRange p) | 305 | commaTypeDecl :: TypePattern -> AParser st TypeItem
commaTypeDecl s = do
c <- anComma
(is, cs) <- typePattern `separatedBy` anComma
let l = s : is
p = c : cs
subTypeDecl (l, p) <|> kindedTypeDecl (l, p)
<|> return (TypeDecl l universe $ catRange p) | 280 | commaTypeDecl s = do
c <- anComma
(is, cs) <- typePattern `separatedBy` anComma
let l = s : is
p = c : cs
subTypeDecl (l, p) <|> kindedTypeDecl (l, p)
<|> return (TypeDecl l universe $ catRange p) | 228 | true | true | 0 | 12 | 83 | 124 | 61 | 63 | null | null |
input-output-hk/pos-haskell-prototype | lib/test/Test/Pos/Diffusion/BlockSpec.hs | mit | someHash :: forall a . Hash a
someHash = unsafeMkAbstractHash LBS.empty | 71 | someHash :: forall a . Hash a
someHash = unsafeMkAbstractHash LBS.empty | 71 | someHash = unsafeMkAbstractHash LBS.empty | 41 | false | true | 0 | 6 | 10 | 24 | 12 | 12 | null | null |
ulikoehler/ProjectEuler | Euler30.hs | apache-2.0 | isSameAsDigitSumPower5 n = (n == digitSumPower5 n) | 50 | isSameAsDigitSumPower5 n = (n == digitSumPower5 n) | 50 | isSameAsDigitSumPower5 n = (n == digitSumPower5 n) | 50 | false | false | 1 | 8 | 6 | 23 | 9 | 14 | null | null |
rblaze/haskell-dbus | benchmarks/DBusBenchmarks.hs | apache-2.0 | benchUnmarshal :: Message msg => String -> msg -> Benchmark
benchUnmarshal name msg = bench name (whnf unmarshal bytes) where
Right bytes = marshal LittleEndian (serial 0) msg | 179 | benchUnmarshal :: Message msg => String -> msg -> Benchmark
benchUnmarshal name msg = bench name (whnf unmarshal bytes) where
Right bytes = marshal LittleEndian (serial 0) msg | 179 | benchUnmarshal name msg = bench name (whnf unmarshal bytes) where
Right bytes = marshal LittleEndian (serial 0) msg | 119 | false | true | 0 | 9 | 31 | 68 | 32 | 36 | null | null |
rueshyna/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | A postal code representing a city or a set of cities. - A single postal
-- code (e.g., 12345) - A postal code prefix followed by a star (e.g.,
-- 1234*)
aslgPostalCodes :: Lens' AccountShippingLocationGroup [Text]
aslgPostalCodes
= lens _aslgPostalCodes
(\ s a -> s{_aslgPostalCodes = a})
. _Default
. _Coerce | 334 | aslgPostalCodes :: Lens' AccountShippingLocationGroup [Text]
aslgPostalCodes
= lens _aslgPostalCodes
(\ s a -> s{_aslgPostalCodes = a})
. _Default
. _Coerce | 176 | aslgPostalCodes
= lens _aslgPostalCodes
(\ s a -> s{_aslgPostalCodes = a})
. _Default
. _Coerce | 115 | true | true | 2 | 8 | 72 | 59 | 30 | 29 | null | null |
bergey/plots | examples/area.hs | bsd-3-clause | mydata2 = mydata1 & each . _1 *~ 0.5 | 36 | mydata2 = mydata1 & each . _1 *~ 0.5 | 36 | mydata2 = mydata1 & each . _1 *~ 0.5 | 36 | false | false | 0 | 7 | 8 | 18 | 9 | 9 | null | null |
itsuart/fdc_archivist | src/ZipThreadFeature.hs | mit | mkHandler :: AppGlobalState -> (Wai.Request -> IO (Maybe Wai.Response))
mkHandler state = tryHandleRequest state | 112 | mkHandler :: AppGlobalState -> (Wai.Request -> IO (Maybe Wai.Response))
mkHandler state = tryHandleRequest state | 112 | mkHandler state = tryHandleRequest state | 40 | false | true | 0 | 11 | 13 | 41 | 20 | 21 | null | null |
laszlopandy/elm-package | src/Elm/Package/Constraint.hs | bsd-3-clause | opToString :: Op -> String
opToString op =
case op of
Less -> "<"
LessOrEqual -> "<=" | 95 | opToString :: Op -> String
opToString op =
case op of
Less -> "<"
LessOrEqual -> "<=" | 95 | opToString op =
case op of
Less -> "<"
LessOrEqual -> "<=" | 68 | false | true | 0 | 8 | 26 | 40 | 18 | 22 | null | null |
parapluu/encore | src/ir/AST/Meta.hs | bsd-3-clause | newPos :: SourcePos -> Position
newPos = SingletonPos | 53 | newPos :: SourcePos -> Position
newPos = SingletonPos | 53 | newPos = SingletonPos | 21 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
ghc-android/ghc | utils/compare_sizes/Main.hs | bsd-3-clause | compareTree :: Tree -> Tree -> [Difference]
compareTree (Directory _ ts1) (Directory _ ts2) = compareTrees ts1 ts2 | 114 | compareTree :: Tree -> Tree -> [Difference]
compareTree (Directory _ ts1) (Directory _ ts2) = compareTrees ts1 ts2 | 114 | compareTree (Directory _ ts1) (Directory _ ts2) = compareTrees ts1 ts2 | 70 | false | true | 0 | 10 | 17 | 53 | 25 | 28 | null | null |
plumlife/cabal | Cabal/Distribution/PackageDescription.hs | bsd-3-clause | knownTestTypes :: [TestType]
knownTestTypes = [ TestTypeExe (Version [1,0] [])
, TestTypeLib (Version [0,9] []) ] | 130 | knownTestTypes :: [TestType]
knownTestTypes = [ TestTypeExe (Version [1,0] [])
, TestTypeLib (Version [0,9] []) ] | 130 | knownTestTypes = [ TestTypeExe (Version [1,0] [])
, TestTypeLib (Version [0,9] []) ] | 101 | false | true | 0 | 9 | 32 | 58 | 32 | 26 | null | null |
liuyang1/euler | square.091.hs | mit | -- right triangles
isRight a b = r (nrm2 a) (nrm2 b) (nrm2 (vec a b)) | 69 | isRight a b = r (nrm2 a) (nrm2 b) (nrm2 (vec a b)) | 50 | isRight a b = r (nrm2 a) (nrm2 b) (nrm2 (vec a b)) | 50 | true | false | 0 | 9 | 15 | 45 | 22 | 23 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/SSP/GenDefs.hs | bsd-2-clause | srfWtrFDerivHeightSentence = [S "The", phrase specWeight, S "in this case is",
S "the" +:+. getTandS waterWeight,
S "The", phrase height, S "in this case is the height from the", phrase slice,
S "surface to the" +:+. phrase waterTable,
S "This", phrase height, S "is measured from", S "midpoint" `ofThe`
phrase slice, S "because the resultant hydrostatic", phrase force,
S "is assumed to act at the", phrase slice, S "midpoint" +:+.
sParen (makeRef2S assumpHFSM),
S "The", phrase height, S "at the midpoint is the average of the",
phrase height, S "at", phrase slice, S "interface", ch index `andThe`
phrase height, S "at", phrase slice, S "interface", E (sy index - 1)] | 692 | srfWtrFDerivHeightSentence = [S "The", phrase specWeight, S "in this case is",
S "the" +:+. getTandS waterWeight,
S "The", phrase height, S "in this case is the height from the", phrase slice,
S "surface to the" +:+. phrase waterTable,
S "This", phrase height, S "is measured from", S "midpoint" `ofThe`
phrase slice, S "because the resultant hydrostatic", phrase force,
S "is assumed to act at the", phrase slice, S "midpoint" +:+.
sParen (makeRef2S assumpHFSM),
S "The", phrase height, S "at the midpoint is the average of the",
phrase height, S "at", phrase slice, S "interface", ch index `andThe`
phrase height, S "at", phrase slice, S "interface", E (sy index - 1)] | 692 | srfWtrFDerivHeightSentence = [S "The", phrase specWeight, S "in this case is",
S "the" +:+. getTandS waterWeight,
S "The", phrase height, S "in this case is the height from the", phrase slice,
S "surface to the" +:+. phrase waterTable,
S "This", phrase height, S "is measured from", S "midpoint" `ofThe`
phrase slice, S "because the resultant hydrostatic", phrase force,
S "is assumed to act at the", phrase slice, S "midpoint" +:+.
sParen (makeRef2S assumpHFSM),
S "The", phrase height, S "at the midpoint is the average of the",
phrase height, S "at", phrase slice, S "interface", ch index `andThe`
phrase height, S "at", phrase slice, S "interface", E (sy index - 1)] | 692 | false | false | 0 | 9 | 131 | 241 | 120 | 121 | null | null |
badp/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | pGroupNodeParams :: Field
pGroupNodeParams =
withDoc "Default node parameters for group" .
optionalField $ simpleField "ndparams" [t| JSObject JSValue |] | 157 | pGroupNodeParams :: Field
pGroupNodeParams =
withDoc "Default node parameters for group" .
optionalField $ simpleField "ndparams" [t| JSObject JSValue |] | 157 | pGroupNodeParams =
withDoc "Default node parameters for group" .
optionalField $ simpleField "ndparams" [t| JSObject JSValue |] | 131 | false | true | 0 | 7 | 23 | 31 | 17 | 14 | null | null |
projectorhq/haskell-liquid | src/Text/Liquid/Tokens.hs | bsd-3-clause | tableEnd = "endtablerow" | 24 | tableEnd = "endtablerow" | 24 | tableEnd = "endtablerow" | 24 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
allonsy/chirp | src/Command/Join.hs | bsd-3-clause | hasValidRest :: String -> Bool
hasValidRest chanName = and (map (hasValidMiddle . ord) chanName) | 96 | hasValidRest :: String -> Bool
hasValidRest chanName = and (map (hasValidMiddle . ord) chanName) | 96 | hasValidRest chanName = and (map (hasValidMiddle . ord) chanName) | 65 | false | true | 0 | 9 | 13 | 36 | 18 | 18 | null | null |
mstksg/hledger | dev.hs | gpl-3.0 | timeclock = "examples/sample.timeclock" | 39 | timeclock = "examples/sample.timeclock" | 39 | timeclock = "examples/sample.timeclock" | 39 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
keithodulaigh/Hets | CSL/GenericInterpreter.hs | gpl-2.0 | transExpr :: MonadState (ASState s) as => EXPRESSION -> as EXPRESSION
transExpr e = do
r <- get
let bm = getBMap r
(bm', e') = translateExpr bm e
put r { getBMap = bm' }
return e' | 193 | transExpr :: MonadState (ASState s) as => EXPRESSION -> as EXPRESSION
transExpr e = do
r <- get
let bm = getBMap r
(bm', e') = translateExpr bm e
put r { getBMap = bm' }
return e' | 193 | transExpr e = do
r <- get
let bm = getBMap r
(bm', e') = translateExpr bm e
put r { getBMap = bm' }
return e' | 123 | false | true | 0 | 10 | 51 | 92 | 43 | 49 | null | null |
wdanilo/data-layer | src/Old/Data/Attr.hs | apache-2.0 | -- === Utils === --
attr :: HasAttr a t => a -> Lens' t (Attr a t)
attr a = lens (getter a) (flip $ setter a) | 110 | attr :: HasAttr a t => a -> Lens' t (Attr a t)
attr a = lens (getter a) (flip $ setter a) | 89 | attr a = lens (getter a) (flip $ setter a) | 42 | true | true | 0 | 9 | 28 | 62 | 30 | 32 | null | null |
xu-hao/QueryArrow | QueryArrow-db-filesystem/src/QueryArrow/FileSystem/Interpreter.hs | bsd-3-clause | receiveDir :: String -> Handle -> String -> IO ()
receiveDir a h b = do
createDirectory a
sendMsgPack h (LocalizedCommandWrapper (LListDirDir b))
Just dirs <- receiveMsgPack h
mapM_ (\(File _ _ dir) ->
receiveDir (a </> takeFileName dir) h dir) (dirs :: [File])
sendMsgPack h (LocalizedCommandWrapper (LListDirFile b))
Just files <- receiveMsgPack h
mapM_ (\(File _ _ file) ->
receiveFile (a </> takeFileName file) h file) (files :: [File]) | 472 | receiveDir :: String -> Handle -> String -> IO ()
receiveDir a h b = do
createDirectory a
sendMsgPack h (LocalizedCommandWrapper (LListDirDir b))
Just dirs <- receiveMsgPack h
mapM_ (\(File _ _ dir) ->
receiveDir (a </> takeFileName dir) h dir) (dirs :: [File])
sendMsgPack h (LocalizedCommandWrapper (LListDirFile b))
Just files <- receiveMsgPack h
mapM_ (\(File _ _ file) ->
receiveFile (a </> takeFileName file) h file) (files :: [File]) | 471 | receiveDir a h b = do
createDirectory a
sendMsgPack h (LocalizedCommandWrapper (LListDirDir b))
Just dirs <- receiveMsgPack h
mapM_ (\(File _ _ dir) ->
receiveDir (a </> takeFileName dir) h dir) (dirs :: [File])
sendMsgPack h (LocalizedCommandWrapper (LListDirFile b))
Just files <- receiveMsgPack h
mapM_ (\(File _ _ file) ->
receiveFile (a </> takeFileName file) h file) (files :: [File]) | 421 | false | true | 0 | 13 | 101 | 211 | 101 | 110 | null | null |
molysgaard/OsmXmlTool | Arc.hs | bsd-3-clause | genCircularRange :: Double -> Double -> Double -> Bool -> Int -> [Double]
genCircularRange a b m dir fullNum =
let diff = circularDiff a b m dir
num = ceiling (diff/m*(fromIntegral fullNum))
in if dir
then let step = diff/(fromIntegral num)
in fun num step
else let step = -diff/(fromIntegral num)
in fun num step
where fun num step = map (flip floatMod m) (map (\x -> a+step*x) [0,1..(fromIntegral num)]) | 471 | genCircularRange :: Double -> Double -> Double -> Bool -> Int -> [Double]
genCircularRange a b m dir fullNum =
let diff = circularDiff a b m dir
num = ceiling (diff/m*(fromIntegral fullNum))
in if dir
then let step = diff/(fromIntegral num)
in fun num step
else let step = -diff/(fromIntegral num)
in fun num step
where fun num step = map (flip floatMod m) (map (\x -> a+step*x) [0,1..(fromIntegral num)]) | 471 | genCircularRange a b m dir fullNum =
let diff = circularDiff a b m dir
num = ceiling (diff/m*(fromIntegral fullNum))
in if dir
then let step = diff/(fromIntegral num)
in fun num step
else let step = -diff/(fromIntegral num)
in fun num step
where fun num step = map (flip floatMod m) (map (\x -> a+step*x) [0,1..(fromIntegral num)]) | 397 | false | true | 0 | 14 | 136 | 215 | 108 | 107 | null | null |
brendanhay/gogol | gogol-vault/gen/Network/Google/Vault/Types/Product.hs | mpl-2.0 | -- | Count metrics for Gmail and classic Hangouts.
carMailCountResult :: Lens' CountArtifactsResponse (Maybe MailCountResult)
carMailCountResult
= lens _carMailCountResult
(\ s a -> s{_carMailCountResult = a}) | 217 | carMailCountResult :: Lens' CountArtifactsResponse (Maybe MailCountResult)
carMailCountResult
= lens _carMailCountResult
(\ s a -> s{_carMailCountResult = a}) | 166 | carMailCountResult
= lens _carMailCountResult
(\ s a -> s{_carMailCountResult = a}) | 91 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
fumieval/jugendstil | src/Jugendstil/Doc.hs | bsd-3-clause | renderDoc k (Docs _ xs) = mapM_ (renderDoc k) xs | 48 | renderDoc k (Docs _ xs) = mapM_ (renderDoc k) xs | 48 | renderDoc k (Docs _ xs) = mapM_ (renderDoc k) xs | 48 | false | false | 0 | 7 | 9 | 33 | 14 | 19 | null | null |
ulricha/dsh | src/Database/DSH/CL/Opt/Auxiliary.hs | bsd-3-clause | tupleVars :: Ident -> Type -> Type -> (Expr, Expr)
tupleVars n t1 t2 = (v1Rep, v2Rep)
where v = Var pt n
pt = PPairT t1 t2
v1Rep = AppE1 t1 (TupElem First) v
v2Rep = AppE1 t2 (TupElem (Next First)) v
-- | Remove tuple accessor from a variable. | 277 | tupleVars :: Ident -> Type -> Type -> (Expr, Expr)
tupleVars n t1 t2 = (v1Rep, v2Rep)
where v = Var pt n
pt = PPairT t1 t2
v1Rep = AppE1 t1 (TupElem First) v
v2Rep = AppE1 t2 (TupElem (Next First)) v
-- | Remove tuple accessor from a variable. | 277 | tupleVars n t1 t2 = (v1Rep, v2Rep)
where v = Var pt n
pt = PPairT t1 t2
v1Rep = AppE1 t1 (TupElem First) v
v2Rep = AppE1 t2 (TupElem (Next First)) v
-- | Remove tuple accessor from a variable. | 226 | false | true | 4 | 10 | 84 | 131 | 57 | 74 | null | null |
serokell/time-warp | bench/Network/Receiver/ReceiverOptions.hs | mit | --TODO introduce subcommands
argsParser :: Parser Args
argsParser =
Args <$>
optional
(strOption
(long "log-config"
<> metavar "FILEPATH" <>
help "Path to logger configuration")
)
<*>
optional
(strOption $
long "logs-prefix" <> metavar "FILEPATH" <> help "Prefix to logger output path")
<*>
option
auto
(short 'p'
<> long "port"
<> metavar "INTEGER"
<> value 3000
<> showDefault <>
help "Port to work on")
<*>
switch
(long "no-pong" <>
help "Don't send pong")
<*>
option
auto
(short 'd'
<> long "duration"
<> metavar "INTEGER"
<> value 10
<> showDefault <>
help "Time to run before stopping, seconds") | 860 | argsParser :: Parser Args
argsParser =
Args <$>
optional
(strOption
(long "log-config"
<> metavar "FILEPATH" <>
help "Path to logger configuration")
)
<*>
optional
(strOption $
long "logs-prefix" <> metavar "FILEPATH" <> help "Prefix to logger output path")
<*>
option
auto
(short 'p'
<> long "port"
<> metavar "INTEGER"
<> value 3000
<> showDefault <>
help "Port to work on")
<*>
switch
(long "no-pong" <>
help "Don't send pong")
<*>
option
auto
(short 'd'
<> long "duration"
<> metavar "INTEGER"
<> value 10
<> showDefault <>
help "Time to run before stopping, seconds") | 831 | argsParser =
Args <$>
optional
(strOption
(long "log-config"
<> metavar "FILEPATH" <>
help "Path to logger configuration")
)
<*>
optional
(strOption $
long "logs-prefix" <> metavar "FILEPATH" <> help "Prefix to logger output path")
<*>
option
auto
(short 'p'
<> long "port"
<> metavar "INTEGER"
<> value 3000
<> showDefault <>
help "Port to work on")
<*>
switch
(long "no-pong" <>
help "Don't send pong")
<*>
option
auto
(short 'd'
<> long "duration"
<> metavar "INTEGER"
<> value 10
<> showDefault <>
help "Time to run before stopping, seconds") | 805 | true | true | 14 | 12 | 354 | 214 | 97 | 117 | null | null |
vipo/huskysay | src/Lib.hs | bsd-3-clause | render :: String -- ^ String to render
-> Font -- ^ Font to use
-> String -- ^ Rendered text
render txt font =
L.intercalate "\n" $
map (map pointToChar . concat)
(L.transpose (map findChar txt))
where
findChar c = M.fromMaybe (error $ "No data for char: " ++ [c])
(lookup c (mapping font))
pointToChar p =
case p of
W -> ' '
B -> filler font | 412 | render :: String -- ^ String to render
-> Font -- ^ Font to use
-> String
render txt font =
L.intercalate "\n" $
map (map pointToChar . concat)
(L.transpose (map findChar txt))
where
findChar c = M.fromMaybe (error $ "No data for char: " ++ [c])
(lookup c (mapping font))
pointToChar p =
case p of
W -> ' '
B -> filler font | 391 | render txt font =
L.intercalate "\n" $
map (map pointToChar . concat)
(L.transpose (map findChar txt))
where
findChar c = M.fromMaybe (error $ "No data for char: " ++ [c])
(lookup c (mapping font))
pointToChar p =
case p of
W -> ' '
B -> filler font | 297 | true | true | 1 | 10 | 138 | 139 | 70 | 69 | null | null |
x456/binary | tests/QC.hs | bsd-3-clause | refragment (x:xs) lbs =
let x' = fromIntegral . (+1) . abs $ x
rest = refragment xs (L.drop x' lbs) in
L.append (L.fromChunks [B.concat . L.toChunks . L.take x' $ lbs]) rest | 189 | refragment (x:xs) lbs =
let x' = fromIntegral . (+1) . abs $ x
rest = refragment xs (L.drop x' lbs) in
L.append (L.fromChunks [B.concat . L.toChunks . L.take x' $ lbs]) rest | 189 | refragment (x:xs) lbs =
let x' = fromIntegral . (+1) . abs $ x
rest = refragment xs (L.drop x' lbs) in
L.append (L.fromChunks [B.concat . L.toChunks . L.take x' $ lbs]) rest | 189 | false | false | 0 | 14 | 48 | 104 | 52 | 52 | null | null |
spockz/lhs2texhl | src/Literate/Haskell.hs | mit | searchAsst _ = [] | 31 | searchAsst _ = [] | 31 | searchAsst _ = [] | 31 | false | false | 0 | 5 | 17 | 12 | 5 | 7 | null | null |
TOSPIO/yi | src/library/Yi/Mode/Haskell/Dollarify.hs | gpl-2.0 | dollarifyTop (Block blk) = dollarifyExpr . stripComments =<< [x | Expr x <- blk] | 80 | dollarifyTop (Block blk) = dollarifyExpr . stripComments =<< [x | Expr x <- blk] | 80 | dollarifyTop (Block blk) = dollarifyExpr . stripComments =<< [x | Expr x <- blk] | 80 | false | false | 0 | 9 | 13 | 37 | 18 | 19 | null | null |
JanAhrens/yesod-oauth-demo | Application.hs | bsd-2-clause | canonicalizeKey :: (Text, val) -> (Text, val)
canonicalizeKey ("dbname", val) = ("database", val) | 97 | canonicalizeKey :: (Text, val) -> (Text, val)
canonicalizeKey ("dbname", val) = ("database", val) | 97 | canonicalizeKey ("dbname", val) = ("database", val) | 51 | false | true | 0 | 6 | 12 | 42 | 25 | 17 | null | null |
ryzhyk/cocoon | cocoon/SMT/SMTLib2.hs | apache-2.0 | ppFName :: String -> Doc
ppFName f = pp $ "__fun_" ++ f | 55 | ppFName :: String -> Doc
ppFName f = pp $ "__fun_" ++ f | 55 | ppFName f = pp $ "__fun_" ++ f | 30 | false | true | 0 | 6 | 12 | 26 | 13 | 13 | null | null |
Chattered/proplcf | Proposition.hs | mit | -- | All theorems are terms. Not all terms are theorems.
termOfTheorem :: Theorem a -> Term a
termOfTheorem (Theorem t) = t | 123 | termOfTheorem :: Theorem a -> Term a
termOfTheorem (Theorem t) = t | 66 | termOfTheorem (Theorem t) = t | 29 | true | true | 0 | 9 | 22 | 36 | 16 | 20 | null | null |
google/codeworld | codeworld-api/src/CodeWorld/Reflex.hs | apache-2.0 | zoomInButton ::
( PerformEvent t m,
TriggerEvent t m,
Adjustable t m,
NotReady t m,
MonadIO m,
MonadIO (Performable m),
PostBuild t m,
MonadHold t m,
MonadFix m
) =>
Dynamic t Double ->
Point ->
ReactiveProgram t m (Event t ())
zoomInButton hoverAlpha pos = do
systemDraw $ uncurry translated pos <$> button <$> hoverAlpha
(() <$) <$> ffilter (onRect 0.8 0.8 pos) <$> getPointerClick
where
button a =
colored
(RGBA 0 0 0 a)
( translated
(-0.05)
(0.05)
( thickCircle 0.1 0.22
<> solidRectangle 0.06 0.25
<> solidRectangle 0.25 0.06
<> rotated (- pi / 4) (translated 0.35 0 (solidRectangle 0.2 0.1))
)
)
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8) | 904 | zoomInButton ::
( PerformEvent t m,
TriggerEvent t m,
Adjustable t m,
NotReady t m,
MonadIO m,
MonadIO (Performable m),
PostBuild t m,
MonadHold t m,
MonadFix m
) =>
Dynamic t Double ->
Point ->
ReactiveProgram t m (Event t ())
zoomInButton hoverAlpha pos = do
systemDraw $ uncurry translated pos <$> button <$> hoverAlpha
(() <$) <$> ffilter (onRect 0.8 0.8 pos) <$> getPointerClick
where
button a =
colored
(RGBA 0 0 0 a)
( translated
(-0.05)
(0.05)
( thickCircle 0.1 0.22
<> solidRectangle 0.06 0.25
<> solidRectangle 0.25 0.06
<> rotated (- pi / 4) (translated 0.35 0 (solidRectangle 0.2 0.1))
)
)
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8) | 904 | zoomInButton hoverAlpha pos = do
systemDraw $ uncurry translated pos <$> button <$> hoverAlpha
(() <$) <$> ffilter (onRect 0.8 0.8 pos) <$> getPointerClick
where
button a =
colored
(RGBA 0 0 0 a)
( translated
(-0.05)
(0.05)
( thickCircle 0.1 0.22
<> solidRectangle 0.06 0.25
<> solidRectangle 0.25 0.06
<> rotated (- pi / 4) (translated 0.35 0 (solidRectangle 0.2 0.1))
)
)
<> colored (RGBA 0.2 0.2 0.2 a) (rectangle 0.8 0.8)
<> colored (RGBA 0.8 0.8 0.8 a) (solidRectangle 0.8 0.8) | 634 | false | true | 4 | 13 | 319 | 341 | 165 | 176 | null | null |
music-suite/music-score | src/Music/Time/Internal/Transform.hs | bsd-3-clause | stretched :: (Transformable a, Transformable b) => Duration -> Iso a b a b
stretched = transformed . stretching | 111 | stretched :: (Transformable a, Transformable b) => Duration -> Iso a b a b
stretched = transformed . stretching | 111 | stretched = transformed . stretching | 36 | false | true | 0 | 8 | 18 | 49 | 23 | 26 | null | null |
hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/haskell/snippet12.hs | gpl-3.0 | ra >>= k = Reader (\e -> runReader (k (runReader ra e)) e) | 58 | ra >>= k = Reader (\e -> runReader (k (runReader ra e)) e) | 58 | ra >>= k = Reader (\e -> runReader (k (runReader ra e)) e) | 58 | false | false | 2 | 12 | 12 | 42 | 21 | 21 | null | null |
RossMeikleham/GPC | src/GPC/CodeGen.hs | bsd-2-clause | genCode' :: SymbolTree -> Quoted -> Doc
genCode' (Symbol gSymbol) carryQuote = case gSymbol of
ConstSymbol quoted str -> text (strQuoted ++ str)
where strQuoted = if quoted || carryQuote then "'" else ""
GOpSymbol (MkOpSymbol quoted thread method) ->
text $ strQuoted ++ method' method ++ "[" ++ show (snd thread) ++ "]"
where strQuoted = if quoted || carryQuote then "'" else ""
method' = foldl1 (\a b -> a ++ "." ++ b)
-- | Generate Source Code for Symbol Tree | 502 | genCode' :: SymbolTree -> Quoted -> Doc
genCode' (Symbol gSymbol) carryQuote = case gSymbol of
ConstSymbol quoted str -> text (strQuoted ++ str)
where strQuoted = if quoted || carryQuote then "'" else ""
GOpSymbol (MkOpSymbol quoted thread method) ->
text $ strQuoted ++ method' method ++ "[" ++ show (snd thread) ++ "]"
where strQuoted = if quoted || carryQuote then "'" else ""
method' = foldl1 (\a b -> a ++ "." ++ b)
-- | Generate Source Code for Symbol Tree | 502 | genCode' (Symbol gSymbol) carryQuote = case gSymbol of
ConstSymbol quoted str -> text (strQuoted ++ str)
where strQuoted = if quoted || carryQuote then "'" else ""
GOpSymbol (MkOpSymbol quoted thread method) ->
text $ strQuoted ++ method' method ++ "[" ++ show (snd thread) ++ "]"
where strQuoted = if quoted || carryQuote then "'" else ""
method' = foldl1 (\a b -> a ++ "." ++ b)
-- | Generate Source Code for Symbol Tree | 462 | false | true | 12 | 10 | 123 | 162 | 85 | 77 | null | null |
amtal/soyuz | DCPU16/Assembly/Printer.hs | mit | pO (DirectLiteral w) = pW w | 27 | pO (DirectLiteral w) = pW w | 27 | pO (DirectLiteral w) = pW w | 27 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
gafiatulin/codewars | src/5 kyu/Peano.hs | mit | add p1 (Succ p2) = add (Succ p1) p2 | 35 | add p1 (Succ p2) = add (Succ p1) p2 | 35 | add p1 (Succ p2) = add (Succ p1) p2 | 35 | false | false | 0 | 6 | 8 | 31 | 13 | 18 | null | null |
fehu/hgt | core-tiles/src/Tiles/Renderer.hs | mit | cameraSize :: (Num a) => Camera a -> (a, a)
cameraSize camera = (s x, s y)
where s q = (q . bottomRight $ camera) - (q . topLeft $ camera) + 1 | 157 | cameraSize :: (Num a) => Camera a -> (a, a)
cameraSize camera = (s x, s y)
where s q = (q . bottomRight $ camera) - (q . topLeft $ camera) + 1 | 157 | cameraSize camera = (s x, s y)
where s q = (q . bottomRight $ camera) - (q . topLeft $ camera) + 1 | 112 | false | true | 1 | 9 | 48 | 98 | 47 | 51 | null | null |
portnov/dates | Data/Dates.hs | bsd-3-clause | pByWeek ∷ Stream s m Char => DateTime → ParsecT s st m DateTime
pByWeek date =
try (lastDate date) <|> nextDate date | 118 | pByWeek ∷ Stream s m Char => DateTime → ParsecT s st m DateTime
pByWeek date =
try (lastDate date) <|> nextDate date | 118 | pByWeek date =
try (lastDate date) <|> nextDate date | 54 | false | true | 0 | 8 | 24 | 54 | 25 | 29 | null | null |
siddhanathan/ghc | compiler/coreSyn/CoreUnfold.hs | bsd-3-clause | smallEnoughToInline :: DynFlags -> Unfolding -> Bool
smallEnoughToInline dflags (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}})
= size <= ufUseThreshold dflags | 176 | smallEnoughToInline :: DynFlags -> Unfolding -> Bool
smallEnoughToInline dflags (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}})
= size <= ufUseThreshold dflags | 176 | smallEnoughToInline dflags (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}})
= size <= ufUseThreshold dflags | 123 | false | true | 0 | 12 | 22 | 52 | 27 | 25 | null | null |
phischu/fragnix | tests/packages/scotty/Foreign.ForeignPtr.Compat.hs | bsd-3-clause | plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b
-- ^Advances the given address by the given offset in bytes.
--
-- The new 'ForeignPtr' shares the finalizer of the original,
-- equivalent from a finalization standpoint to just creating another
-- reference to the original. That is, the finalizer will not be
-- called before the new 'ForeignPtr' is unreachable, nor will it be
-- called an additional time due to this call, and the finalizer will
-- be called with the same address that it would have had this call
-- not happened, *not* the new address.
--
-- /Since: 4.10.0.0/
plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c | 661 | plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b
plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c | 129 | plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c | 75 | true | true | 0 | 10 | 114 | 72 | 39 | 33 | null | null |
timjb/robot-karel | haskell/square.hs | mit | main = case execKarel karelMain $ emptyFiniteWorld 6 6 of
(Left e) -> print e
(Right w) -> print w | 118 | main = case execKarel karelMain $ emptyFiniteWorld 6 6 of
(Left e) -> print e
(Right w) -> print w | 118 | main = case execKarel karelMain $ emptyFiniteWorld 6 6 of
(Left e) -> print e
(Right w) -> print w | 118 | false | false | 0 | 9 | 39 | 52 | 24 | 28 | null | null |
sgillespie/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | pprUserTypeCtxt ThBrackCtxt = text "a Template Haskell quotation [t|...|]" | 80 | pprUserTypeCtxt ThBrackCtxt = text "a Template Haskell quotation [t|...|]" | 80 | pprUserTypeCtxt ThBrackCtxt = text "a Template Haskell quotation [t|...|]" | 80 | false | false | 0 | 5 | 14 | 12 | 5 | 7 | null | null |
brendanhay/gogol | gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Topics/Get.hs | mpl-2.0 | -- | JSONP
ptgCallback :: Lens' ProjectsTopicsGet (Maybe Text)
ptgCallback
= lens _ptgCallback (\ s a -> s{_ptgCallback = a}) | 127 | ptgCallback :: Lens' ProjectsTopicsGet (Maybe Text)
ptgCallback
= lens _ptgCallback (\ s a -> s{_ptgCallback = a}) | 116 | ptgCallback
= lens _ptgCallback (\ s a -> s{_ptgCallback = a}) | 64 | true | true | 1 | 9 | 21 | 52 | 25 | 27 | null | null |
ganeti/ganeti | src/Ganeti/Lens.hs | bsd-2-clause | -- | Traverses over a composition of a monad and a functor.
-- See 'traverseOf2'.
mapMOf2 :: Over (->) (Compose (WrappedMonad m) g) s t a b
-> (a -> m (g b)) -> s -> m (g t)
mapMOf2 k f = unwrapMonad . traverseOf2 k (WrapMonad . f) | 239 | mapMOf2 :: Over (->) (Compose (WrappedMonad m) g) s t a b
-> (a -> m (g b)) -> s -> m (g t)
mapMOf2 k f = unwrapMonad . traverseOf2 k (WrapMonad . f) | 157 | mapMOf2 k f = unwrapMonad . traverseOf2 k (WrapMonad . f) | 57 | true | true | 1 | 12 | 57 | 106 | 52 | 54 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 4522 = 4521 | 11 | 4522 = 4521 | 11 | 4522 = 4521 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
google-research/dex-lang | src/lib/Err.hs | bsd-3-clause | addSrcTextContext :: Fallible m => Int -> String -> m a -> m a
addSrcTextContext offset text m =
addErrCtx (mempty {srcTextCtx = Just (offset, text)}) m | 154 | addSrcTextContext :: Fallible m => Int -> String -> m a -> m a
addSrcTextContext offset text m =
addErrCtx (mempty {srcTextCtx = Just (offset, text)}) m | 154 | addSrcTextContext offset text m =
addErrCtx (mempty {srcTextCtx = Just (offset, text)}) m | 91 | false | true | 0 | 10 | 28 | 68 | 34 | 34 | null | null |
mettekou/ghc | libraries/base/GHC/Conc/Sync.hs | bsd-3-clause | myThreadId :: IO ThreadId
myThreadId = IO $ \s ->
case (myThreadId# s) of (# s1, tid #) -> (# s1, ThreadId tid #)
-- |The 'yield' action allows (forces, in a co-operative multitasking
-- implementation) a context-switch to any other currently runnable
-- threads (if any), and is occasionally useful when implementing
-- concurrency abstractions. | 351 | myThreadId :: IO ThreadId
myThreadId = IO $ \s ->
case (myThreadId# s) of (# s1, tid #) -> (# s1, ThreadId tid #)
-- |The 'yield' action allows (forces, in a co-operative multitasking
-- implementation) a context-switch to any other currently runnable
-- threads (if any), and is occasionally useful when implementing
-- concurrency abstractions. | 351 | myThreadId = IO $ \s ->
case (myThreadId# s) of (# s1, tid #) -> (# s1, ThreadId tid #)
-- |The 'yield' action allows (forces, in a co-operative multitasking
-- implementation) a context-switch to any other currently runnable
-- threads (if any), and is occasionally useful when implementing
-- concurrency abstractions. | 325 | false | true | 0 | 11 | 60 | 56 | 31 | 25 | null | null |
Ertruby/PPFinalProject | src/Testing.hs | gpl-2.0 | getRegs sysState spid regs = getRegs' (regbank ((sprs sysState) !! spid)) regs
where getRegs' rs = map (rs !)
-- Running test logic -- | 139 | getRegs sysState spid regs = getRegs' (regbank ((sprs sysState) !! spid)) regs
where getRegs' rs = map (rs !)
-- Running test logic -- | 139 | getRegs sysState spid regs = getRegs' (regbank ((sprs sysState) !! spid)) regs
where getRegs' rs = map (rs !)
-- Running test logic -- | 139 | false | false | 0 | 11 | 28 | 56 | 28 | 28 | null | null |
JohnLato/scryptic | src/Scryptic/Language/SkelScrypt.hs | gpl-3.0 | transSKey :: SKey -> Result
transSKey x = case x of
SKey namequals id -> failure x | 85 | transSKey :: SKey -> Result
transSKey x = case x of
SKey namequals id -> failure x | 85 | transSKey x = case x of
SKey namequals id -> failure x | 57 | false | true | 2 | 5 | 19 | 35 | 17 | 18 | null | null |
epost/psc-ide | lib/Purescript/Ide.hs | bsd-3-clause | loadModule :: FilePath -> PscIde ()
loadModule fp = do
parseResult <- liftIO $ readExternFile fp
case parseResult of
Right decls ->
let (name, decls') = unsafeModuleFromDecls decls
in modify
(\x ->
x
{ pscStateModules = M.insert
name
decls'
(pscStateModules x)
})
Left _ -> liftIO $ putStrLn "The module could not be parsed" | 559 | loadModule :: FilePath -> PscIde ()
loadModule fp = do
parseResult <- liftIO $ readExternFile fp
case parseResult of
Right decls ->
let (name, decls') = unsafeModuleFromDecls decls
in modify
(\x ->
x
{ pscStateModules = M.insert
name
decls'
(pscStateModules x)
})
Left _ -> liftIO $ putStrLn "The module could not be parsed" | 559 | loadModule fp = do
parseResult <- liftIO $ readExternFile fp
case parseResult of
Right decls ->
let (name, decls') = unsafeModuleFromDecls decls
in modify
(\x ->
x
{ pscStateModules = M.insert
name
decls'
(pscStateModules x)
})
Left _ -> liftIO $ putStrLn "The module could not be parsed" | 523 | false | true | 0 | 19 | 288 | 124 | 59 | 65 | null | null |
isido/functional-morphology-for-koine-greek | greek/RulesGreek.hs | gpl-3.0 | augment :: String -> String
augment word =
if isVowel c then
case cc of
"αι" -> "ῃ" ++ drop 2 word
"ει" -> "ῃ" ++ drop 2 word
"αυ" -> "ηυ" ++ drop 2 word
"ευ" -> "ηυ" ++ drop 2 word
"οι" -> "ῳ" ++ drop 2 word
_ ->
case c of
'α' -> "η" ++ tail word
'ἀ' -> "ἠ" ++ tail word
'ἁ' -> "ἡ" ++ tail word
'ᾳ' -> "ῃ" ++ tail word
'ε' -> "η" ++ tail word
'ἐ' -> "ἠ" ++ tail word
'ἑ' -> "ἡ" ++ tail word
'ο' -> "ω" ++ tail word
_ -> word
else
case c of
'ρ' -> "ερ" ++ word
_ -> "ε" ++ word
where
c = head word
cc = dp 2 word | 760 | augment :: String -> String
augment word =
if isVowel c then
case cc of
"αι" -> "ῃ" ++ drop 2 word
"ει" -> "ῃ" ++ drop 2 word
"αυ" -> "ηυ" ++ drop 2 word
"ευ" -> "ηυ" ++ drop 2 word
"οι" -> "ῳ" ++ drop 2 word
_ ->
case c of
'α' -> "η" ++ tail word
'ἀ' -> "ἠ" ++ tail word
'ἁ' -> "ἡ" ++ tail word
'ᾳ' -> "ῃ" ++ tail word
'ε' -> "η" ++ tail word
'ἐ' -> "ἠ" ++ tail word
'ἑ' -> "ἡ" ++ tail word
'ο' -> "ω" ++ tail word
_ -> word
else
case c of
'ρ' -> "ερ" ++ word
_ -> "ε" ++ word
where
c = head word
cc = dp 2 word | 760 | augment word =
if isVowel c then
case cc of
"αι" -> "ῃ" ++ drop 2 word
"ει" -> "ῃ" ++ drop 2 word
"αυ" -> "ηυ" ++ drop 2 word
"ευ" -> "ηυ" ++ drop 2 word
"οι" -> "ῳ" ++ drop 2 word
_ ->
case c of
'α' -> "η" ++ tail word
'ἀ' -> "ἠ" ++ tail word
'ἁ' -> "ἡ" ++ tail word
'ᾳ' -> "ῃ" ++ tail word
'ε' -> "η" ++ tail word
'ἐ' -> "ἠ" ++ tail word
'ἑ' -> "ἡ" ++ tail word
'ο' -> "ω" ++ tail word
_ -> word
else
case c of
'ρ' -> "ερ" ++ word
_ -> "ε" ++ word
where
c = head word
cc = dp 2 word | 732 | false | true | 1 | 13 | 377 | 273 | 130 | 143 | null | null |
urbanslug/ghc | testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11_A.hs | bsd-3-clause | main = do
putStrLn $ "looking for " ++ show key
putStrLn $ "in space " ++ show space
putStrLn $ "Found: " ++ show (fromMaybe "Not Found!" $ lookupx space key)
let b | Just "c" <- lookupx space key = "YES"
| otherwise = "NO"
putStrLn $ "Rules Disabled: " ++ b | 308 | main = do
putStrLn $ "looking for " ++ show key
putStrLn $ "in space " ++ show space
putStrLn $ "Found: " ++ show (fromMaybe "Not Found!" $ lookupx space key)
let b | Just "c" <- lookupx space key = "YES"
| otherwise = "NO"
putStrLn $ "Rules Disabled: " ++ b | 308 | main = do
putStrLn $ "looking for " ++ show key
putStrLn $ "in space " ++ show space
putStrLn $ "Found: " ++ show (fromMaybe "Not Found!" $ lookupx space key)
let b | Just "c" <- lookupx space key = "YES"
| otherwise = "NO"
putStrLn $ "Rules Disabled: " ++ b | 308 | false | false | 1 | 14 | 103 | 114 | 48 | 66 | null | null |
jvictor0/JoSQL | Utils/RuntimeUtils.hs | mit | fromEither (Left err) = error err | 33 | fromEither (Left err) = error err | 33 | fromEither (Left err) = error err | 33 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
GaloisInc/halvm-ghc | libraries/template-haskell/Language/Haskell/TH/PprLib.hs | bsd-3-clause | lparen = return HPJ.lparen | 26 | lparen = return HPJ.lparen | 26 | lparen = return HPJ.lparen | 26 | false | false | 1 | 6 | 3 | 15 | 5 | 10 | null | null |
patperry/hs-linear-algebra | tests-old/STVector.hs | bsd-3-clause | prop_SetZero = setZero `implements` setZero_S | 45 | prop_SetZero = setZero `implements` setZero_S | 45 | prop_SetZero = setZero `implements` setZero_S | 45 | false | false | 0 | 5 | 4 | 12 | 7 | 5 | null | null |
Mahdi89/eTeak | src/Options.hs | bsd-3-clause | -- getSubOption : like findSubOption but use the given option if none is found in the list
getSubOption :: SubOption subOption => [subOption] -> subOption -> subOption
getSubOption opts opt = fromMaybe opt $ find (matchSubOption opt) opts | 246 | getSubOption :: SubOption subOption => [subOption] -> subOption -> subOption
getSubOption opts opt = fromMaybe opt $ find (matchSubOption opt) opts | 147 | getSubOption opts opt = fromMaybe opt $ find (matchSubOption opt) opts | 70 | true | true | 0 | 8 | 45 | 53 | 26 | 27 | null | null |
zaxtax/naive_bayes | GetNews.hs | bsd-3-clause | writeVec :: String -> V.Vector Int -> IO ()
writeVec file v = withFile file WriteMode $ \h -> do
V.forM_ v $ \x -> hPrint h x | 127 | writeVec :: String -> V.Vector Int -> IO ()
writeVec file v = withFile file WriteMode $ \h -> do
V.forM_ v $ \x -> hPrint h x | 127 | writeVec file v = withFile file WriteMode $ \h -> do
V.forM_ v $ \x -> hPrint h x | 83 | false | true | 0 | 11 | 29 | 70 | 33 | 37 | null | null |
achernyak/stack | src/Stack/Types/Config.hs | bsd-3-clause | configMonoidExtraIncludeDirsName :: Text
configMonoidExtraIncludeDirsName = "extra-include-dirs" | 96 | configMonoidExtraIncludeDirsName :: Text
configMonoidExtraIncludeDirsName = "extra-include-dirs" | 96 | configMonoidExtraIncludeDirsName = "extra-include-dirs" | 55 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
enolan/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | runIdeModeCommand h id orig fn mods (IdeMode.CaseSplit line name) =
process fn (CaseSplitAt False line (sUN name)) | 116 | runIdeModeCommand h id orig fn mods (IdeMode.CaseSplit line name) =
process fn (CaseSplitAt False line (sUN name)) | 116 | runIdeModeCommand h id orig fn mods (IdeMode.CaseSplit line name) =
process fn (CaseSplitAt False line (sUN name)) | 116 | false | false | 0 | 9 | 18 | 50 | 24 | 26 | null | null |
yigitozkavci/glow | src/Emit.hs | mit | liftError :: ExceptT String IO a -> IO a
liftError = runExceptT >=> either fail return | 86 | liftError :: ExceptT String IO a -> IO a
liftError = runExceptT >=> either fail return | 86 | liftError = runExceptT >=> either fail return | 45 | false | true | 2 | 7 | 15 | 41 | 18 | 23 | null | null |
mgsloan/slogger | Selector.hs | bsd-3-clause | stringLit :: Parser String
stringLit = string1 <|> string2
where
string1 =
char '"' *>
many (noneOf "\n\r\f\\\"" <|> nl <|> nonascii {- <|> escape -})
<* char '*'
string2 =
char '\'' *>
many (noneOf "\n\r\f\\'" <|> nl <|> nonascii {- <|> escape -})
<* char '\'' | 344 | stringLit :: Parser String
stringLit = string1 <|> string2
where
string1 =
char '"' *>
many (noneOf "\n\r\f\\\"" <|> nl <|> nonascii {- <|> escape -})
<* char '*'
string2 =
char '\'' *>
many (noneOf "\n\r\f\\'" <|> nl <|> nonascii {- <|> escape -})
<* char '\'' | 344 | stringLit = string1 <|> string2
where
string1 =
char '"' *>
many (noneOf "\n\r\f\\\"" <|> nl <|> nonascii {- <|> escape -})
<* char '*'
string2 =
char '\'' *>
many (noneOf "\n\r\f\\'" <|> nl <|> nonascii {- <|> escape -})
<* char '\'' | 317 | false | true | 13 | 8 | 130 | 118 | 53 | 65 | null | null |
picca/hkl | contrib/haskell/src/hkl.hs | gpl-3.0 | -- Actual program logic
run :: Options -> IO ()
run (Options cmd) =
case cmd of
Ca h k l-> do
print (solution /~~ degree)
dispv (computeHkl e4c solution lattice)
disp path
where
(sol, path) = computeAngles e4c angles lattice mode [h, k, l]
s = [30.0, 0.0, 0.0, 0.0, 10.0, 0.0]
d = [60.0]
angles = (s ++ d) *~~ degree
solution = fromMode mode sol angles
lattice = Cubic (1.54 *~ nano meter)
mode = ModeHklE4CConstantPhi | 597 | run :: Options -> IO ()
run (Options cmd) =
case cmd of
Ca h k l-> do
print (solution /~~ degree)
dispv (computeHkl e4c solution lattice)
disp path
where
(sol, path) = computeAngles e4c angles lattice mode [h, k, l]
s = [30.0, 0.0, 0.0, 0.0, 10.0, 0.0]
d = [60.0]
angles = (s ++ d) *~~ degree
solution = fromMode mode sol angles
lattice = Cubic (1.54 *~ nano meter)
mode = ModeHklE4CConstantPhi | 573 | run (Options cmd) =
case cmd of
Ca h k l-> do
print (solution /~~ degree)
dispv (computeHkl e4c solution lattice)
disp path
where
(sol, path) = computeAngles e4c angles lattice mode [h, k, l]
s = [30.0, 0.0, 0.0, 0.0, 10.0, 0.0]
d = [60.0]
angles = (s ++ d) *~~ degree
solution = fromMode mode sol angles
lattice = Cubic (1.54 *~ nano meter)
mode = ModeHklE4CConstantPhi | 549 | true | true | 0 | 13 | 257 | 203 | 105 | 98 | null | null |
input-output-hk/pos-haskell-prototype | binary/test/Test/Pos/Cbor/RefImpl.hs | mit | reservedTag :: Word64 -> Bool
reservedTag w = w <= 5 | 52 | reservedTag :: Word64 -> Bool
reservedTag w = w <= 5 | 52 | reservedTag w = w <= 5 | 22 | false | true | 2 | 7 | 10 | 30 | 13 | 17 | null | null |
sopvop/cabal | Cabal/Distribution/PackageDescription/PrettyPrint.hs | bsd-3-clause | ppCondition (CNot c) = char '!' <<>> (ppCondition c) | 72 | ppCondition (CNot c) = char '!' <<>> (ppCondition c) | 72 | ppCondition (CNot c) = char '!' <<>> (ppCondition c) | 72 | false | false | 0 | 7 | 28 | 28 | 13 | 15 | null | null |
builtinnya/lambdar-website | Handler/Langs.hs | mit | getLangsR :: Text -> Handler Html
getLangsR slug = do
Entity _ lang <- runDB $ getBy404 $ UniqueLanguage slug
articles <- runDB $
E.select
$ E.from $ \(article `E.InnerJoin` language) -> do
E.on $ article E.^. ArticleLang E.==. language E.^. LanguageId
E.where_ (language E.^. LanguageSlug E.==. E.val slug)
E.orderBy [ E.desc (article E.^. ArticleCreated) ]
return (article, language)
defaultLayout $ do
setTitle $ toHtml $ T.append ("Articles - " :: Text) (languageName lang)
$(widgetFile "langs") | 564 | getLangsR :: Text -> Handler Html
getLangsR slug = do
Entity _ lang <- runDB $ getBy404 $ UniqueLanguage slug
articles <- runDB $
E.select
$ E.from $ \(article `E.InnerJoin` language) -> do
E.on $ article E.^. ArticleLang E.==. language E.^. LanguageId
E.where_ (language E.^. LanguageSlug E.==. E.val slug)
E.orderBy [ E.desc (article E.^. ArticleCreated) ]
return (article, language)
defaultLayout $ do
setTitle $ toHtml $ T.append ("Articles - " :: Text) (languageName lang)
$(widgetFile "langs") | 564 | getLangsR slug = do
Entity _ lang <- runDB $ getBy404 $ UniqueLanguage slug
articles <- runDB $
E.select
$ E.from $ \(article `E.InnerJoin` language) -> do
E.on $ article E.^. ArticleLang E.==. language E.^. LanguageId
E.where_ (language E.^. LanguageSlug E.==. E.val slug)
E.orderBy [ E.desc (article E.^. ArticleCreated) ]
return (article, language)
defaultLayout $ do
setTitle $ toHtml $ T.append ("Articles - " :: Text) (languageName lang)
$(widgetFile "langs") | 530 | false | true | 0 | 16 | 140 | 222 | 107 | 115 | null | null |
atsukotakahashi/wi | src/library/Yi/Syntax/Driver.hs | gpl-2.0 | zipWithFM :: Ord k => (u -> v -> w) -> v -> Map k u -> Map k v -> [(k,w)]
zipWithFM f v0 mu mv = [ (k,f u (M.findWithDefault v0 k mv) ) | (k,u) <- M.assocs mu] | 159 | zipWithFM :: Ord k => (u -> v -> w) -> v -> Map k u -> Map k v -> [(k,w)]
zipWithFM f v0 mu mv = [ (k,f u (M.findWithDefault v0 k mv) ) | (k,u) <- M.assocs mu] | 159 | zipWithFM f v0 mu mv = [ (k,f u (M.findWithDefault v0 k mv) ) | (k,u) <- M.assocs mu] | 85 | false | true | 0 | 11 | 40 | 118 | 61 | 57 | null | null |
harrisi/on-being-better | list-expansion/Haskell/course/src/Course/List.hs | cc0-1.0 | span ::
(a -> Bool)
-> List a
-> (List a, List a)
span p x =
(takeWhile p x, dropWhile p x) | 99 | span ::
(a -> Bool)
-> List a
-> (List a, List a)
span p x =
(takeWhile p x, dropWhile p x) | 99 | span p x =
(takeWhile p x, dropWhile p x) | 43 | false | true | 0 | 10 | 30 | 64 | 31 | 33 | null | null |
abakst/liquidhaskell | src/Language/Haskell/Liquid/Bare/Measure.hs | bsd-3-clause | -- OLD isSimpleType t = null tvs && isNothing (splitFunTy_maybe tb)
-- OLD where
-- OLD (tvs, tb) = splitForAllTys t
varSpecType :: (Monoid r) => Var -> Located (RRType r)
varSpecType v = Loc l l' (ofType $ varType v)
where
l = getSourcePos v
l' = getSourcePosE v | 308 | varSpecType :: (Monoid r) => Var -> Located (RRType r)
varSpecType v = Loc l l' (ofType $ varType v)
where
l = getSourcePos v
l' = getSourcePosE v | 181 | varSpecType v = Loc l l' (ofType $ varType v)
where
l = getSourcePos v
l' = getSourcePosE v | 126 | true | true | 0 | 9 | 94 | 75 | 38 | 37 | null | null |
diku-dk/futhark | src/Futhark/Pass/ExtractKernels/Interchange.hs | isc | maybeCopyInitial ::
(MonadBuilder m) =>
(VName -> Bool) ->
SeqLoop ->
m SeqLoop
maybeCopyInitial isMapInput (SeqLoop perm loop_pat merge form body) =
SeqLoop perm loop_pat <$> mapM f merge <*> pure form <*> pure body
where
f (p, Var arg)
| isMapInput arg =
(p,) <$> letSubExp (baseString (paramName p) <> "_inter_copy") (BasicOp $ Copy arg)
f (p, arg) =
pure (p, arg) | 407 | maybeCopyInitial ::
(MonadBuilder m) =>
(VName -> Bool) ->
SeqLoop ->
m SeqLoop
maybeCopyInitial isMapInput (SeqLoop perm loop_pat merge form body) =
SeqLoop perm loop_pat <$> mapM f merge <*> pure form <*> pure body
where
f (p, Var arg)
| isMapInput arg =
(p,) <$> letSubExp (baseString (paramName p) <> "_inter_copy") (BasicOp $ Copy arg)
f (p, arg) =
pure (p, arg) | 407 | maybeCopyInitial isMapInput (SeqLoop perm loop_pat merge form body) =
SeqLoop perm loop_pat <$> mapM f merge <*> pure form <*> pure body
where
f (p, Var arg)
| isMapInput arg =
(p,) <$> letSubExp (baseString (paramName p) <> "_inter_copy") (BasicOp $ Copy arg)
f (p, arg) =
pure (p, arg) | 319 | false | true | 0 | 12 | 102 | 176 | 87 | 89 | null | null |
jaalonso/I1M-Cod-Temas | test/Tema_22a_GrafoConVectorDeAdyacencia_Spec.hs | gpl-2.0 | spec :: Spec
spec = do
describe "dirigido" $ do
it "e1" $
dirigido ejGrafoD `shouldBe` True
it "e2" $
dirigido ejGrafoND `shouldBe` False
describe "nodos" $ do
it "e1" $
nodos ejGrafoND `shouldBe` [1,2,3,4,5]
it "e2" $
nodos ejGrafoD `shouldBe` [1,2,3,4,5]
describe "adyacentes" $ do
it "e1" $
adyacentes ejGrafoND 4 `shouldBe` [2,3,5]
it "e2" $
adyacentes ejGrafoD 4 `shouldBe` [5]
describe "aristaEn" $ do
it "e1" $
aristaEn ejGrafoND (5,1) `shouldBe` True
it "e2" $
aristaEn ejGrafoND (4,1) `shouldBe` False
it "e3" $
aristaEn ejGrafoD (5,1) `shouldBe` False
it "e4" $
aristaEn ejGrafoD (1,5) `shouldBe` True
describe "peso" $ do
it "e1" $
peso 1 5 ejGrafoND `shouldBe` 78
it "e2" $
peso 1 5 ejGrafoD `shouldBe` 78
describe "aristas" $ do
it "e1" $
aristas ejGrafoD `shouldBe`
[(1,2,12),(1,3,34),(1,5,78),(2,4,55),(2,5,32),(3,4,61),
(3,5,44),(4,5,93)]
it "e2" $
aristas ejGrafoND `shouldBe`
[(1,2,12),(1,3,34),(1,5,78),(2,1,12),(2,4,55),(2,5,32),
(3,1,34),(3,4,61),(3,5,44),(4,2,55),(4,3,61),(4,5,93),
(5,1,78),(5,2,32),(5,3,44),(5,4,93)] | 1,261 | spec :: Spec
spec = do
describe "dirigido" $ do
it "e1" $
dirigido ejGrafoD `shouldBe` True
it "e2" $
dirigido ejGrafoND `shouldBe` False
describe "nodos" $ do
it "e1" $
nodos ejGrafoND `shouldBe` [1,2,3,4,5]
it "e2" $
nodos ejGrafoD `shouldBe` [1,2,3,4,5]
describe "adyacentes" $ do
it "e1" $
adyacentes ejGrafoND 4 `shouldBe` [2,3,5]
it "e2" $
adyacentes ejGrafoD 4 `shouldBe` [5]
describe "aristaEn" $ do
it "e1" $
aristaEn ejGrafoND (5,1) `shouldBe` True
it "e2" $
aristaEn ejGrafoND (4,1) `shouldBe` False
it "e3" $
aristaEn ejGrafoD (5,1) `shouldBe` False
it "e4" $
aristaEn ejGrafoD (1,5) `shouldBe` True
describe "peso" $ do
it "e1" $
peso 1 5 ejGrafoND `shouldBe` 78
it "e2" $
peso 1 5 ejGrafoD `shouldBe` 78
describe "aristas" $ do
it "e1" $
aristas ejGrafoD `shouldBe`
[(1,2,12),(1,3,34),(1,5,78),(2,4,55),(2,5,32),(3,4,61),
(3,5,44),(4,5,93)]
it "e2" $
aristas ejGrafoND `shouldBe`
[(1,2,12),(1,3,34),(1,5,78),(2,1,12),(2,4,55),(2,5,32),
(3,1,34),(3,4,61),(3,5,44),(4,2,55),(4,3,61),(4,5,93),
(5,1,78),(5,2,32),(5,3,44),(5,4,93)] | 1,261 | spec = do
describe "dirigido" $ do
it "e1" $
dirigido ejGrafoD `shouldBe` True
it "e2" $
dirigido ejGrafoND `shouldBe` False
describe "nodos" $ do
it "e1" $
nodos ejGrafoND `shouldBe` [1,2,3,4,5]
it "e2" $
nodos ejGrafoD `shouldBe` [1,2,3,4,5]
describe "adyacentes" $ do
it "e1" $
adyacentes ejGrafoND 4 `shouldBe` [2,3,5]
it "e2" $
adyacentes ejGrafoD 4 `shouldBe` [5]
describe "aristaEn" $ do
it "e1" $
aristaEn ejGrafoND (5,1) `shouldBe` True
it "e2" $
aristaEn ejGrafoND (4,1) `shouldBe` False
it "e3" $
aristaEn ejGrafoD (5,1) `shouldBe` False
it "e4" $
aristaEn ejGrafoD (1,5) `shouldBe` True
describe "peso" $ do
it "e1" $
peso 1 5 ejGrafoND `shouldBe` 78
it "e2" $
peso 1 5 ejGrafoD `shouldBe` 78
describe "aristas" $ do
it "e1" $
aristas ejGrafoD `shouldBe`
[(1,2,12),(1,3,34),(1,5,78),(2,4,55),(2,5,32),(3,4,61),
(3,5,44),(4,5,93)]
it "e2" $
aristas ejGrafoND `shouldBe`
[(1,2,12),(1,3,34),(1,5,78),(2,1,12),(2,4,55),(2,5,32),
(3,1,34),(3,4,61),(3,5,44),(4,2,55),(4,3,61),(4,5,93),
(5,1,78),(5,2,32),(5,3,44),(5,4,93)] | 1,248 | false | true | 0 | 13 | 360 | 711 | 402 | 309 | null | null |
PeterScott/haskell-kyoto-tycoon | Database/KyotoTycoon/UrlEncode.hs | bsd-3-clause | unquote :: ByteString -> ByteString
unquote str = B.pack (go str)
where go s = case B.uncons s of
Just ('%', tl) -> (w2c $ readHex2 tl) : go (unsafeDrop 3 s)
Just (c, tl) -> c : go tl
Nothing -> []
-- | Length of a quoted string | 299 | unquote :: ByteString -> ByteString
unquote str = B.pack (go str)
where go s = case B.uncons s of
Just ('%', tl) -> (w2c $ readHex2 tl) : go (unsafeDrop 3 s)
Just (c, tl) -> c : go tl
Nothing -> []
-- | Length of a quoted string | 299 | unquote str = B.pack (go str)
where go s = case B.uncons s of
Just ('%', tl) -> (w2c $ readHex2 tl) : go (unsafeDrop 3 s)
Just (c, tl) -> c : go tl
Nothing -> []
-- | Length of a quoted string | 263 | false | true | 0 | 13 | 120 | 119 | 59 | 60 | null | null |
RudolfVonKrugstein/hsVigraRF | src/VigraRF.hs | mit | getPredictionArrayValue :: PredictionArray -> Word -> Word -> IO Float
getPredictionArrayValue a x y = realToFrac <$> withForeignPtr a (\pa -> c_getPredictionArrayValue pa (fromIntegral x) (fromIntegral y)) | 206 | getPredictionArrayValue :: PredictionArray -> Word -> Word -> IO Float
getPredictionArrayValue a x y = realToFrac <$> withForeignPtr a (\pa -> c_getPredictionArrayValue pa (fromIntegral x) (fromIntegral y)) | 206 | getPredictionArrayValue a x y = realToFrac <$> withForeignPtr a (\pa -> c_getPredictionArrayValue pa (fromIntegral x) (fromIntegral y)) | 135 | false | true | 0 | 11 | 26 | 69 | 34 | 35 | null | null |
IreneKnapp/Faction | libfaction/Distribution/Verbosity.hs | bsd-3-clause | lessVerbose Silent = Silent | 30 | lessVerbose Silent = Silent | 30 | lessVerbose Silent = Silent | 30 | false | false | 1 | 5 | 6 | 13 | 4 | 9 | null | null |
thomie/vector | Data/Vector/Storable.hs | bsd-3-clause | postscanr' = G.postscanr' | 25 | postscanr' = G.postscanr' | 25 | postscanr' = G.postscanr' | 25 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
bravit/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reflectErr (CantResolveAlts ss) =
raw_apply (Var $ reflErrName "CantResolveAlts")
[rawList (Var $ reflm "TTName") (map reflectName ss)] | 149 | reflectErr (CantResolveAlts ss) =
raw_apply (Var $ reflErrName "CantResolveAlts")
[rawList (Var $ reflm "TTName") (map reflectName ss)] | 149 | reflectErr (CantResolveAlts ss) =
raw_apply (Var $ reflErrName "CantResolveAlts")
[rawList (Var $ reflm "TTName") (map reflectName ss)] | 149 | false | false | 0 | 9 | 30 | 58 | 27 | 31 | null | null |
sjakobi/brick | src/Brick/Widgets/List.hs | bsd-3-clause | listClear :: (Monoid (t e)) => GenericList n t e -> GenericList n t e
listClear l = l & listElementsL .~ mempty & listSelectedL .~ Nothing | 138 | listClear :: (Monoid (t e)) => GenericList n t e -> GenericList n t e
listClear l = l & listElementsL .~ mempty & listSelectedL .~ Nothing | 138 | listClear l = l & listElementsL .~ mempty & listSelectedL .~ Nothing | 68 | false | true | 2 | 9 | 26 | 69 | 32 | 37 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_INT_IMAGE_2D_MULTISAMPLE_EXT :: GLenum
gl_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060 | 82 | gl_INT_IMAGE_2D_MULTISAMPLE_EXT :: GLenum
gl_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060 | 82 | gl_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060 | 40 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
eklavya/Idris-dev | src/Idris/Erasure.hs | bsd-3-clause | minimalUsage :: Deps -> (Deps, (Set Name, UseMap))
minimalUsage = second gather . forwardChain
where
gather :: DepSet -> (Set Name, UseMap)
gather = foldr ins (S.empty, M.empty) . M.toList
where
ins :: (Node, Set Reason) -> (Set Name, UseMap) -> (Set Name, UseMap)
ins ((n, Result), rs) (ns, umap) = (S.insert n ns, umap)
ins ((n, Arg i ), rs) (ns, umap) = (ns, M.insertWith (IM.unionWith S.union) n (IM.singleton i rs) umap) | 466 | minimalUsage :: Deps -> (Deps, (Set Name, UseMap))
minimalUsage = second gather . forwardChain
where
gather :: DepSet -> (Set Name, UseMap)
gather = foldr ins (S.empty, M.empty) . M.toList
where
ins :: (Node, Set Reason) -> (Set Name, UseMap) -> (Set Name, UseMap)
ins ((n, Result), rs) (ns, umap) = (S.insert n ns, umap)
ins ((n, Arg i ), rs) (ns, umap) = (ns, M.insertWith (IM.unionWith S.union) n (IM.singleton i rs) umap) | 466 | minimalUsage = second gather . forwardChain
where
gather :: DepSet -> (Set Name, UseMap)
gather = foldr ins (S.empty, M.empty) . M.toList
where
ins :: (Node, Set Reason) -> (Set Name, UseMap) -> (Set Name, UseMap)
ins ((n, Result), rs) (ns, umap) = (S.insert n ns, umap)
ins ((n, Arg i ), rs) (ns, umap) = (ns, M.insertWith (IM.unionWith S.union) n (IM.singleton i rs) umap) | 415 | false | true | 0 | 9 | 113 | 236 | 129 | 107 | null | null |
DaMSL/K3 | src/Language/K3/Parser/SQL.hs | apache-2.0 | isAggregate :: ScalarExpr -> SQLParseM Bool
isAggregate (FunCall _ nm args) = do
let fn = sqlnm nm
case (fn, args) of
("sum" , [_]) -> return True
("count", [_]) -> return True
("min" , [_]) -> return True
("max" , [_]) -> return True
(_, _) -> return False | 284 | isAggregate :: ScalarExpr -> SQLParseM Bool
isAggregate (FunCall _ nm args) = do
let fn = sqlnm nm
case (fn, args) of
("sum" , [_]) -> return True
("count", [_]) -> return True
("min" , [_]) -> return True
("max" , [_]) -> return True
(_, _) -> return False | 284 | isAggregate (FunCall _ nm args) = do
let fn = sqlnm nm
case (fn, args) of
("sum" , [_]) -> return True
("count", [_]) -> return True
("min" , [_]) -> return True
("max" , [_]) -> return True
(_, _) -> return False | 240 | false | true | 0 | 11 | 76 | 143 | 75 | 68 | null | null |
jameshsmith/HRL | Server/Abyss/Monster.hs | mit | monMove :: (Row, Col) -> ARef -> [Dir4] -> Game () Level ()
monMove _ _ [] = return () | 95 | monMove :: (Row, Col) -> ARef -> [Dir4] -> Game () Level ()
monMove _ _ [] = return () | 95 | monMove _ _ [] = return () | 35 | false | true | 0 | 10 | 28 | 61 | 30 | 31 | null | null |
isido/functional-morphology-for-koine-greek | lib/Dictionary.hs | gpl-3.0 | is_equal_entry :: Entry -> Entry -> Bool
is_equal_entry e1 e2 = f e1 == f e2
where f (_,d,_,c,inhs,infl,e) = (d,c,inhs,infl,e)
-- | Empty Dictionary | 150 | is_equal_entry :: Entry -> Entry -> Bool
is_equal_entry e1 e2 = f e1 == f e2
where f (_,d,_,c,inhs,infl,e) = (d,c,inhs,infl,e)
-- | Empty Dictionary | 150 | is_equal_entry e1 e2 = f e1 == f e2
where f (_,d,_,c,inhs,infl,e) = (d,c,inhs,infl,e)
-- | Empty Dictionary | 109 | false | true | 0 | 6 | 26 | 81 | 46 | 35 | null | null |
gridaphobe/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprSkolInfo ArrowSkol = text "an arrow form" | 52 | pprSkolInfo ArrowSkol = text "an arrow form" | 52 | pprSkolInfo ArrowSkol = text "an arrow form" | 52 | false | false | 0 | 5 | 14 | 13 | 5 | 8 | null | null |
vedgar/mlr | 2016 Kolokvij/L1r.hs | unlicense | fi1 = fa x (p[x] --> q[x]) --> (fa x (p[x]) --> fa x (q[x])) | 60 | fi1 = fa x (p[x] --> q[x]) --> (fa x (p[x]) --> fa x (q[x])) | 60 | fi1 = fa x (p[x] --> q[x]) --> (fa x (p[x]) --> fa x (q[x])) | 60 | false | false | 1 | 12 | 14 | 74 | 35 | 39 | null | null |
kmate/HaRe | old/refactorer/RefacUnfoldAsPatterns.hs | bsd-3-clause | refacUnfoldAsPatterns args
= do let
fileName = args!!0
beginRow = read (args!!1)::Int
beginCol = read (args!!2)::Int
endRow = read (args!!3)::Int
endCol = read (args!!4)::Int
AbstractIO.putStrLn "refacUnfoldAsPatterns"
-- Parse the input file.
modInfo@(inscps, exps, mod, tokList) <- parseSourceFile fileName
let (pat, term) = findPattern tokList (beginRow, beginCol) (endRow, endCol) mod
case pat of
Pat (HsPId (HsVar defaultPNT))
-> do
-- writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
-- Allow the highlighting of a particular expression
-- rather than a pattern. (For Some).
let exp = locToExp (beginRow, beginCol) (endRow, endCol) tokList mod
let (pat, term) = patDefinesExp exp mod
patsInTerm <- getPats term
let patsPNT = hsPNTs pat
let patsPNT2 = hsPNTs patsInTerm
when (patsPNT `myElem` patsPNT2) $ error "There are conflicts in the binding analysis! Please do a renaming"
((_,m), (newToks, (newMod, _))) <- applyRefac (changeExpression True exp pat)
(Just (inscps, exps, mod, tokList)) fileName
when (newMod == mod)
$ AbstractIO.putStrLn
( "Warning: the expression:\n" ++ ((render.ppi) exp) ++ "\nis not associated with a pattern!" )
writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
AbstractIO.putStrLn "Completed.\n"
_ -> do
-- Allow the highlighting of a particular as-pattern
-- t@p
-- this should substitute all t for p in scope.
-- derive the patterns defined in the term (the RHS of the selected pattern)
patsInTerm <- getPats term
let patsPNT = hsPNTs pat
let patsPNT2 = hsPNTs patsInTerm
when (patsPNT `myElem` patsPNT2) $ error "There are conflicts in the binding analysis! Please do a renaming"
exp <- getExpAssociatedPat pat mod
let patWOParen = convertPat pat
((_,m), (newToks, newMod)) <- doRefac True changeExpression exp patWOParen inscps exps mod tokList fileName
writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
AbstractIO.putStrLn "Completed.\n" | 3,003 | refacUnfoldAsPatterns args
= do let
fileName = args!!0
beginRow = read (args!!1)::Int
beginCol = read (args!!2)::Int
endRow = read (args!!3)::Int
endCol = read (args!!4)::Int
AbstractIO.putStrLn "refacUnfoldAsPatterns"
-- Parse the input file.
modInfo@(inscps, exps, mod, tokList) <- parseSourceFile fileName
let (pat, term) = findPattern tokList (beginRow, beginCol) (endRow, endCol) mod
case pat of
Pat (HsPId (HsVar defaultPNT))
-> do
-- writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
-- Allow the highlighting of a particular expression
-- rather than a pattern. (For Some).
let exp = locToExp (beginRow, beginCol) (endRow, endCol) tokList mod
let (pat, term) = patDefinesExp exp mod
patsInTerm <- getPats term
let patsPNT = hsPNTs pat
let patsPNT2 = hsPNTs patsInTerm
when (patsPNT `myElem` patsPNT2) $ error "There are conflicts in the binding analysis! Please do a renaming"
((_,m), (newToks, (newMod, _))) <- applyRefac (changeExpression True exp pat)
(Just (inscps, exps, mod, tokList)) fileName
when (newMod == mod)
$ AbstractIO.putStrLn
( "Warning: the expression:\n" ++ ((render.ppi) exp) ++ "\nis not associated with a pattern!" )
writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
AbstractIO.putStrLn "Completed.\n"
_ -> do
-- Allow the highlighting of a particular as-pattern
-- t@p
-- this should substitute all t for p in scope.
-- derive the patterns defined in the term (the RHS of the selected pattern)
patsInTerm <- getPats term
let patsPNT = hsPNTs pat
let patsPNT2 = hsPNTs patsInTerm
when (patsPNT `myElem` patsPNT2) $ error "There are conflicts in the binding analysis! Please do a renaming"
exp <- getExpAssociatedPat pat mod
let patWOParen = convertPat pat
((_,m), (newToks, newMod)) <- doRefac True changeExpression exp patWOParen inscps exps mod tokList fileName
writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
AbstractIO.putStrLn "Completed.\n" | 3,003 | refacUnfoldAsPatterns args
= do let
fileName = args!!0
beginRow = read (args!!1)::Int
beginCol = read (args!!2)::Int
endRow = read (args!!3)::Int
endCol = read (args!!4)::Int
AbstractIO.putStrLn "refacUnfoldAsPatterns"
-- Parse the input file.
modInfo@(inscps, exps, mod, tokList) <- parseSourceFile fileName
let (pat, term) = findPattern tokList (beginRow, beginCol) (endRow, endCol) mod
case pat of
Pat (HsPId (HsVar defaultPNT))
-> do
-- writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
-- Allow the highlighting of a particular expression
-- rather than a pattern. (For Some).
let exp = locToExp (beginRow, beginCol) (endRow, endCol) tokList mod
let (pat, term) = patDefinesExp exp mod
patsInTerm <- getPats term
let patsPNT = hsPNTs pat
let patsPNT2 = hsPNTs patsInTerm
when (patsPNT `myElem` patsPNT2) $ error "There are conflicts in the binding analysis! Please do a renaming"
((_,m), (newToks, (newMod, _))) <- applyRefac (changeExpression True exp pat)
(Just (inscps, exps, mod, tokList)) fileName
when (newMod == mod)
$ AbstractIO.putStrLn
( "Warning: the expression:\n" ++ ((render.ppi) exp) ++ "\nis not associated with a pattern!" )
writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
AbstractIO.putStrLn "Completed.\n"
_ -> do
-- Allow the highlighting of a particular as-pattern
-- t@p
-- this should substitute all t for p in scope.
-- derive the patterns defined in the term (the RHS of the selected pattern)
patsInTerm <- getPats term
let patsPNT = hsPNTs pat
let patsPNT2 = hsPNTs patsInTerm
when (patsPNT `myElem` patsPNT2) $ error "There are conflicts in the binding analysis! Please do a renaming"
exp <- getExpAssociatedPat pat mod
let patWOParen = convertPat pat
((_,m), (newToks, newMod)) <- doRefac True changeExpression exp patWOParen inscps exps mod tokList fileName
writeRefactoredFiles False [((fileName, m), (newToks, newMod))]
AbstractIO.putStrLn "Completed.\n" | 3,003 | false | false | 0 | 20 | 1,355 | 621 | 321 | 300 | null | null |
tekul/cryptonite | Crypto/ECC.hs | bsd-3-clause | encodeECShared prx (Simple.Point x _) = CryptoPassed . SharedSecret $ i2ospOf_ (Simple.curveSizeBytes prx) x | 108 | encodeECShared prx (Simple.Point x _) = CryptoPassed . SharedSecret $ i2ospOf_ (Simple.curveSizeBytes prx) x | 108 | encodeECShared prx (Simple.Point x _) = CryptoPassed . SharedSecret $ i2ospOf_ (Simple.curveSizeBytes prx) x | 108 | false | false | 0 | 9 | 13 | 42 | 20 | 22 | null | null |
siddhanathan/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | lvectInstDecl :: LVectDecl name -> Bool
lvectInstDecl (L _ (HsVectInstIn _)) = True | 84 | lvectInstDecl :: LVectDecl name -> Bool
lvectInstDecl (L _ (HsVectInstIn _)) = True | 84 | lvectInstDecl (L _ (HsVectInstIn _)) = True | 44 | false | true | 0 | 8 | 13 | 39 | 18 | 21 | null | null |
c0deaddict/project-euler | src/Part1/Problem31.hs | bsd-3-clause | countChange :: [Int] -> Int -> Int
countChange _ 0 = 0 | 54 | countChange :: [Int] -> Int -> Int
countChange _ 0 = 0 | 54 | countChange _ 0 = 0 | 19 | false | true | 0 | 8 | 11 | 33 | 15 | 18 | null | null |
formrre/yi | yi-core/src/Yi/Buffer/Misc.hs | gpl-2.0 | -- | perform a @BufferM a@, and return to the current point. (by using a mark)
savingExcursionB :: BufferM a -> BufferM a
savingExcursionB f = do
m <- getMarkB Nothing
res <- f
moveTo =<< use (markPointA m)
return res | 233 | savingExcursionB :: BufferM a -> BufferM a
savingExcursionB f = do
m <- getMarkB Nothing
res <- f
moveTo =<< use (markPointA m)
return res | 154 | savingExcursionB f = do
m <- getMarkB Nothing
res <- f
moveTo =<< use (markPointA m)
return res | 111 | true | true | 0 | 10 | 56 | 64 | 28 | 36 | null | null |
puhlenbruck/hf | src/DataPointer.hs | mit | nextCell (DataPointer [] 0 (n:ns)) = DataPointer [] n ns | 68 | nextCell (DataPointer [] 0 (n:ns)) = DataPointer [] n ns | 68 | nextCell (DataPointer [] 0 (n:ns)) = DataPointer [] n ns | 68 | false | false | 0 | 9 | 21 | 37 | 18 | 19 | null | null |
databrary/databrary | src/Web/Generate.hs | agpl-3.0 | fileNewer :: RawFilePath -> WebGenerator
fileNewer f (_, Nothing) = do
e <- liftIO $ fileExist f
unless e $ fileNotFound f
return True | 140 | fileNewer :: RawFilePath -> WebGenerator
fileNewer f (_, Nothing) = do
e <- liftIO $ fileExist f
unless e $ fileNotFound f
return True | 140 | fileNewer f (_, Nothing) = do
e <- liftIO $ fileExist f
unless e $ fileNotFound f
return True | 99 | false | true | 0 | 9 | 29 | 59 | 27 | 32 | null | null |
gsdlab/clafer | src/Language/Clafer/Generator/Graph.hs | mit | rest (_:xs) = xs | 16 | rest (_:xs) = xs | 16 | rest (_:xs) = xs | 16 | false | false | 0 | 7 | 3 | 16 | 8 | 8 | null | null |
brendanhay/gogol | gogol-storage/gen/Network/Google/Resource/Storage/Objects/Patch.hs | mpl-2.0 | -- | Makes the operation conditional on whether the object\'s current
-- generation does not match the given value. If no live object exists, the
-- precondition fails. Setting to 0 makes the operation succeed only if
-- there is a live version of the object.
opIfGenerationNotMatch :: Lens' ObjectsPatch (Maybe Int64)
opIfGenerationNotMatch
= lens _opIfGenerationNotMatch
(\ s a -> s{_opIfGenerationNotMatch = a})
. mapping _Coerce | 446 | opIfGenerationNotMatch :: Lens' ObjectsPatch (Maybe Int64)
opIfGenerationNotMatch
= lens _opIfGenerationNotMatch
(\ s a -> s{_opIfGenerationNotMatch = a})
. mapping _Coerce | 186 | opIfGenerationNotMatch
= lens _opIfGenerationNotMatch
(\ s a -> s{_opIfGenerationNotMatch = a})
. mapping _Coerce | 127 | true | true | 0 | 10 | 79 | 58 | 31 | 27 | null | null |
asztal/transact-sql | Language/TransactSql/Types.hs | bsd-3-clause | len UniqueIdentifier = Fixed 16 | 31 | len UniqueIdentifier = Fixed 16 | 31 | len UniqueIdentifier = Fixed 16 | 31 | false | false | 0 | 5 | 4 | 13 | 5 | 8 | null | null |
sjfloat/dnngraph | NN/DSL.hs | bsd-3-clause | padP' = setPool PP._pad | 23 | padP' = setPool PP._pad | 23 | padP' = setPool PP._pad | 23 | false | false | 1 | 6 | 3 | 15 | 5 | 10 | null | null |