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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ecaustin/haskhol-math | src/HaskHOL/Lib/Arith/Base.hs | bsd-2-clause | thmADD_0 :: NumsCtxt thry => HOL cls thry HOLThm
thmADD_0 = unsafeCacheProof "thmADD_0" .
prove [txt| !m. m + 0 = m |] $
tacINDUCT `_THEN` tacASM_REWRITE [defADD] | 173 | thmADD_0 :: NumsCtxt thry => HOL cls thry HOLThm
thmADD_0 = unsafeCacheProof "thmADD_0" .
prove [txt| !m. m + 0 = m |] $
tacINDUCT `_THEN` tacASM_REWRITE [defADD] | 173 | thmADD_0 = unsafeCacheProof "thmADD_0" .
prove [txt| !m. m + 0 = m |] $
tacINDUCT `_THEN` tacASM_REWRITE [defADD] | 124 | false | true | 0 | 8 | 38 | 55 | 29 | 26 | null | null |
ghcjs/ghcjs | lib/ghc/includes/CodeGen.Platform.hs | mit | -- All other regs are considered to be "free", because we can track
-- their liveness accurately.
freeRegBase _ = True | 118 | freeRegBase _ = True | 20 | freeRegBase _ = True | 20 | true | false | 0 | 4 | 20 | 12 | 6 | 6 | null | null |
nukisman/elm-format-short | src/Flags.hs | bsd-3-clause | upgrade :: Opt.Parser Bool
upgrade =
Opt.switch $
mconcat
[ Opt.long "upgrade"
, Opt.help "Upgrade older Elm files to Elm 0.18 syntax"
] | 172 | upgrade :: Opt.Parser Bool
upgrade =
Opt.switch $
mconcat
[ Opt.long "upgrade"
, Opt.help "Upgrade older Elm files to Elm 0.18 syntax"
] | 172 | upgrade =
Opt.switch $
mconcat
[ Opt.long "upgrade"
, Opt.help "Upgrade older Elm files to Elm 0.18 syntax"
] | 145 | false | true | 0 | 9 | 58 | 41 | 20 | 21 | null | null |
frenetic-lang/nettle-openflow | src/Nettle/OpenFlow/MessagesBinary.hs | bsd-3-clause | flowModSizeInBytes' :: [Action] -> Int
flowModSizeInBytes' actions =
headerSize + matchSize + 20 + sum (map actionSizeInBytes actions) | 139 | flowModSizeInBytes' :: [Action] -> Int
flowModSizeInBytes' actions =
headerSize + matchSize + 20 + sum (map actionSizeInBytes actions) | 139 | flowModSizeInBytes' actions =
headerSize + matchSize + 20 + sum (map actionSizeInBytes actions) | 100 | false | true | 0 | 8 | 22 | 44 | 22 | 22 | null | null |
raptros/env-extractor | System/Environment/Extract.hs | bsd-3-clause | defaultSuccess :: TypeReport -> ValueReport -> EnvKey -> a -> Result a
defaultSuccess tr vr k v = valueSuccess v $ DefaultValue tr vr k | 135 | defaultSuccess :: TypeReport -> ValueReport -> EnvKey -> a -> Result a
defaultSuccess tr vr k v = valueSuccess v $ DefaultValue tr vr k | 135 | defaultSuccess tr vr k v = valueSuccess v $ DefaultValue tr vr k | 64 | false | true | 0 | 9 | 24 | 58 | 26 | 32 | null | null |
adinapoli/api-tools | src/Data/API/JSON.hs | bsd-3-clause | withRegEx :: RegEx -> String -> (T.Text -> ParserWithErrs a)
-> JS.Value -> ParserWithErrs a
withRegEx re dg f = withText dg g
where
g txt = case matchRegex (re_regex re) $ T.unpack txt of
Just _ -> f txt
Nothing -> failWith $ RegexError dg txt re | 297 | withRegEx :: RegEx -> String -> (T.Text -> ParserWithErrs a)
-> JS.Value -> ParserWithErrs a
withRegEx re dg f = withText dg g
where
g txt = case matchRegex (re_regex re) $ T.unpack txt of
Just _ -> f txt
Nothing -> failWith $ RegexError dg txt re | 297 | withRegEx re dg f = withText dg g
where
g txt = case matchRegex (re_regex re) $ T.unpack txt of
Just _ -> f txt
Nothing -> failWith $ RegexError dg txt re | 189 | false | true | 0 | 10 | 97 | 117 | 55 | 62 | null | null |
zepto-lang/zepto | src/Zepto/Types.hs | gpl-2.0 | showVal (SimpleVal (Nil _)) = "nil" | 35 | showVal (SimpleVal (Nil _)) = "nil" | 35 | showVal (SimpleVal (Nil _)) = "nil" | 35 | false | false | 0 | 9 | 5 | 21 | 10 | 11 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeSpotPriceHistory.hs | mpl-2.0 | -- | 'DescribeSpotPriceHistoryResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dsphrNextToken' @::@ 'Maybe' 'Text'
--
-- * 'dsphrSpotPriceHistory' @::@ ['SpotPrice']
--
describeSpotPriceHistoryResponse :: DescribeSpotPriceHistoryResponse
describeSpotPriceHistoryResponse = DescribeSpotPriceHistoryResponse
{ _dsphrSpotPriceHistory = mempty
, _dsphrNextToken = Nothing
} | 433 | describeSpotPriceHistoryResponse :: DescribeSpotPriceHistoryResponse
describeSpotPriceHistoryResponse = DescribeSpotPriceHistoryResponse
{ _dsphrSpotPriceHistory = mempty
, _dsphrNextToken = Nothing
} | 219 | describeSpotPriceHistoryResponse = DescribeSpotPriceHistoryResponse
{ _dsphrSpotPriceHistory = mempty
, _dsphrNextToken = Nothing
} | 150 | true | true | 0 | 6 | 60 | 33 | 23 | 10 | null | null |
kini/ghc-server | src/Server/Commands.hs | bsd-3-clause | setFlag flag = do
df <- getSessionDynFlags
(dflags,_,_) <- parseDynamicFlags df (map (mkGeneralLocated "flag") [flag])
void (setSessionDynFlags dflags)
-- | Add any GHC logs to the given result channel. | 209 | setFlag flag = do
df <- getSessionDynFlags
(dflags,_,_) <- parseDynamicFlags df (map (mkGeneralLocated "flag") [flag])
void (setSessionDynFlags dflags)
-- | Add any GHC logs to the given result channel. | 209 | setFlag flag = do
df <- getSessionDynFlags
(dflags,_,_) <- parseDynamicFlags df (map (mkGeneralLocated "flag") [flag])
void (setSessionDynFlags dflags)
-- | Add any GHC logs to the given result channel. | 209 | false | false | 1 | 13 | 35 | 71 | 33 | 38 | null | null |
pqwy/redex | src/Repr/Stringy.hs | bsd-3-clause | showsTypeParens t = parens (showsType t) | 53 | showsTypeParens t = parens (showsType t) | 53 | showsTypeParens t = parens (showsType t) | 53 | false | false | 0 | 7 | 18 | 18 | 8 | 10 | null | null |
swamp-agr/carbuyer-advisor | SessionState.hs | mit | getHypPrices :: HandlerT App IO (Text, Text, Text)
getHypPrices = do
hyp <- assignHypToIp
prices <- runDB $ do
ps <- selectList [AsParamAr ==. (Just hyp), AsParamAa ==. (toSqlKey 2)] []
prices <- selectList [AsObjectId <-. (fmap (asParamAo . entityVal) ps)] []
mapM getRelatedService prices
let guideOnly = getPriceOfObj 4 prices
advices = getPriceOfObj 5 prices
combo = getPriceOfObj 6 prices
return (guideOnly, advices, combo) | 491 | getHypPrices :: HandlerT App IO (Text, Text, Text)
getHypPrices = do
hyp <- assignHypToIp
prices <- runDB $ do
ps <- selectList [AsParamAr ==. (Just hyp), AsParamAa ==. (toSqlKey 2)] []
prices <- selectList [AsObjectId <-. (fmap (asParamAo . entityVal) ps)] []
mapM getRelatedService prices
let guideOnly = getPriceOfObj 4 prices
advices = getPriceOfObj 5 prices
combo = getPriceOfObj 6 prices
return (guideOnly, advices, combo) | 491 | getHypPrices = do
hyp <- assignHypToIp
prices <- runDB $ do
ps <- selectList [AsParamAr ==. (Just hyp), AsParamAa ==. (toSqlKey 2)] []
prices <- selectList [AsObjectId <-. (fmap (asParamAo . entityVal) ps)] []
mapM getRelatedService prices
let guideOnly = getPriceOfObj 4 prices
advices = getPriceOfObj 5 prices
combo = getPriceOfObj 6 prices
return (guideOnly, advices, combo) | 440 | false | true | 0 | 18 | 127 | 178 | 88 | 90 | null | null |
dmp1ce/Haskell-Programming-Exercises | Chapter 24/src/ChapterExercises_2_3.hs | unlicense | parseDigitSuccessCase :: String -> Char -> IO ()
parseDigitSuccessCase = parseSuccessCase parseDigit | 100 | parseDigitSuccessCase :: String -> Char -> IO ()
parseDigitSuccessCase = parseSuccessCase parseDigit | 100 | parseDigitSuccessCase = parseSuccessCase parseDigit | 51 | false | true | 0 | 9 | 11 | 32 | 14 | 18 | null | null |
dfordivam/lava | Lava/SequentialConstructive.hs | bsd-3-clause | ----------------------------------------------------------------
-- simulate
simulateCon :: (Generic a, Generic b) => (a -> b) -> [a] -> [b]
simulateCon circ inps = unsafePerformIO $
do micro <- newSet
macro <- newSet
time0 <- newIORef ()
let new =
do rwire <- newIORef (Wire{ components = [], value = Uninitialized })
return rwire
define rwire (DelayBool init next) =
do delay rwire init next
define rwire (DelayInt init next) =
do delay rwire init next
define rwire sym =
case arguments sym of
[] -> addSet macro constant
args -> sequence_ [ compWire rarg propagate | rarg <- args ]
where
propagate time =
do sym' <- mmap (`valueWire` time) sym
case evalLazy sym' of
Nothing -> return ()
Just v -> updateWire rwire time v
constant time =
do propagate time
addSet macro constant
delay rwire init next =
do compWire next nextState
compWire init initState
where
nextState time =
do mv <- valueWire next time
case mv of
Nothing -> return ()
Just v -> addSet macro (\t -> updateWire rwire t v)
initState time
| time == time0 = do mv <- valueWire init time
case mv of
Nothing -> return ()
Just v -> updateWire rwire time v
| otherwise = do return ()
compWire rwire comp =
do wire <- readIORef rwire
writeIORef rwire (wire{ components = comp : components wire })
valueWire rwire time =
do wire <- readIORef rwire
return $
case value wire of
v `At` time'
| time == time' -> Just v
_ -> Nothing
actualValueWire rwire time =
do mv <- valueWire rwire time
case mv of
Just v -> return v
Nothing -> wrong Lava.Error.UndefinedWire
updateWire rwire time v =
do wire <- readIORef rwire
mv <- valueWire rwire time
case mv of
Just v' | v =/= v' -> wrong Lava.Error.BadCombinationalLoop
| otherwise -> return ()
_ -> do writeIORef rwire (wire{ value = v `At` time })
sequence_ [ addSet micro comp | comp <- components wire ]
Bool b1 =/= Bool b2 = b1 /= b2
Int n1 =/= Int n2 = n1 /= n2
_ =/= _ = True
sr <- netlistIO new define (struct (circ (input inps)))
outs <- timedLazyLoop time0 $ \time ->
do emptySet macro ($ time)
while (emptySet micro ($ time))
s <- mmap (`actualValueWire` time) sr
return (construct (symbol `fmap` s))
let res = takes inps outs
return res
----------------------------------------------------------------
-- helper functions | 3,157 | simulateCon :: (Generic a, Generic b) => (a -> b) -> [a] -> [b]
simulateCon circ inps = unsafePerformIO $
do micro <- newSet
macro <- newSet
time0 <- newIORef ()
let new =
do rwire <- newIORef (Wire{ components = [], value = Uninitialized })
return rwire
define rwire (DelayBool init next) =
do delay rwire init next
define rwire (DelayInt init next) =
do delay rwire init next
define rwire sym =
case arguments sym of
[] -> addSet macro constant
args -> sequence_ [ compWire rarg propagate | rarg <- args ]
where
propagate time =
do sym' <- mmap (`valueWire` time) sym
case evalLazy sym' of
Nothing -> return ()
Just v -> updateWire rwire time v
constant time =
do propagate time
addSet macro constant
delay rwire init next =
do compWire next nextState
compWire init initState
where
nextState time =
do mv <- valueWire next time
case mv of
Nothing -> return ()
Just v -> addSet macro (\t -> updateWire rwire t v)
initState time
| time == time0 = do mv <- valueWire init time
case mv of
Nothing -> return ()
Just v -> updateWire rwire time v
| otherwise = do return ()
compWire rwire comp =
do wire <- readIORef rwire
writeIORef rwire (wire{ components = comp : components wire })
valueWire rwire time =
do wire <- readIORef rwire
return $
case value wire of
v `At` time'
| time == time' -> Just v
_ -> Nothing
actualValueWire rwire time =
do mv <- valueWire rwire time
case mv of
Just v -> return v
Nothing -> wrong Lava.Error.UndefinedWire
updateWire rwire time v =
do wire <- readIORef rwire
mv <- valueWire rwire time
case mv of
Just v' | v =/= v' -> wrong Lava.Error.BadCombinationalLoop
| otherwise -> return ()
_ -> do writeIORef rwire (wire{ value = v `At` time })
sequence_ [ addSet micro comp | comp <- components wire ]
Bool b1 =/= Bool b2 = b1 /= b2
Int n1 =/= Int n2 = n1 /= n2
_ =/= _ = True
sr <- netlistIO new define (struct (circ (input inps)))
outs <- timedLazyLoop time0 $ \time ->
do emptySet macro ($ time)
while (emptySet micro ($ time))
s <- mmap (`actualValueWire` time) sr
return (construct (symbol `fmap` s))
let res = takes inps outs
return res
----------------------------------------------------------------
-- helper functions | 3,079 | simulateCon circ inps = unsafePerformIO $
do micro <- newSet
macro <- newSet
time0 <- newIORef ()
let new =
do rwire <- newIORef (Wire{ components = [], value = Uninitialized })
return rwire
define rwire (DelayBool init next) =
do delay rwire init next
define rwire (DelayInt init next) =
do delay rwire init next
define rwire sym =
case arguments sym of
[] -> addSet macro constant
args -> sequence_ [ compWire rarg propagate | rarg <- args ]
where
propagate time =
do sym' <- mmap (`valueWire` time) sym
case evalLazy sym' of
Nothing -> return ()
Just v -> updateWire rwire time v
constant time =
do propagate time
addSet macro constant
delay rwire init next =
do compWire next nextState
compWire init initState
where
nextState time =
do mv <- valueWire next time
case mv of
Nothing -> return ()
Just v -> addSet macro (\t -> updateWire rwire t v)
initState time
| time == time0 = do mv <- valueWire init time
case mv of
Nothing -> return ()
Just v -> updateWire rwire time v
| otherwise = do return ()
compWire rwire comp =
do wire <- readIORef rwire
writeIORef rwire (wire{ components = comp : components wire })
valueWire rwire time =
do wire <- readIORef rwire
return $
case value wire of
v `At` time'
| time == time' -> Just v
_ -> Nothing
actualValueWire rwire time =
do mv <- valueWire rwire time
case mv of
Just v -> return v
Nothing -> wrong Lava.Error.UndefinedWire
updateWire rwire time v =
do wire <- readIORef rwire
mv <- valueWire rwire time
case mv of
Just v' | v =/= v' -> wrong Lava.Error.BadCombinationalLoop
| otherwise -> return ()
_ -> do writeIORef rwire (wire{ value = v `At` time })
sequence_ [ addSet micro comp | comp <- components wire ]
Bool b1 =/= Bool b2 = b1 /= b2
Int n1 =/= Int n2 = n1 /= n2
_ =/= _ = True
sr <- netlistIO new define (struct (circ (input inps)))
outs <- timedLazyLoop time0 $ \time ->
do emptySet macro ($ time)
while (emptySet micro ($ time))
s <- mmap (`actualValueWire` time) sr
return (construct (symbol `fmap` s))
let res = takes inps outs
return res
----------------------------------------------------------------
-- helper functions | 3,015 | true | true | 2 | 22 | 1,325 | 1,006 | 469 | 537 | null | null |
kojiromike/Idris-dev | src/Idris/Core/ProofState.hs | bsd-3-clause | prep_fill :: Name -> [Name] -> RunTactic
prep_fill f as ctxt env (Bind x (Hole ty) sc) =
do let val = mkApp (P Ref f Erased) (map (\n -> P Ref n Erased) as)
return $ Bind x (Guess ty val) sc | 201 | prep_fill :: Name -> [Name] -> RunTactic
prep_fill f as ctxt env (Bind x (Hole ty) sc) =
do let val = mkApp (P Ref f Erased) (map (\n -> P Ref n Erased) as)
return $ Bind x (Guess ty val) sc | 201 | prep_fill f as ctxt env (Bind x (Hole ty) sc) =
do let val = mkApp (P Ref f Erased) (map (\n -> P Ref n Erased) as)
return $ Bind x (Guess ty val) sc | 160 | false | true | 0 | 16 | 53 | 124 | 59 | 65 | null | null |
Mahdi89/eTeak | src/Expr.hs | bsd-3-clause | constResult :: Pos -> Integer -> Expr
constResult pos int = ValueExpr pos (typeForInt int) $ IntValue int | 109 | constResult :: Pos -> Integer -> Expr
constResult pos int = ValueExpr pos (typeForInt int) $ IntValue int | 105 | constResult pos int = ValueExpr pos (typeForInt int) $ IntValue int | 67 | false | true | 0 | 8 | 21 | 42 | 20 | 22 | null | null |
TOSPIO/yi | src/library/Yi/Keymap/Emacs/Utils.hs | gpl-2.0 | argToInt :: UnivArgument -> Int
argToInt = fromMaybe 1 | 54 | argToInt :: UnivArgument -> Int
argToInt = fromMaybe 1 | 54 | argToInt = fromMaybe 1 | 22 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
brodyberg/Notes | ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/Arith2.hs | mit | main :: IO ()
main = do
print (0 :: Int) -- 0
print (add 1 0) -- 1
print (addOne 0) -- 1
print (addOnePF 0) -- 1
print ((addOne . addOne) 0) -- 2
print ((addOnePF . addOne) 0) -- 2
print ((addOne . addOnePF) 0) -- 2
print ((addOnePF . addOnePF) 0) -- 2
print (negate (addOne 0)) -- -1
print ((negate . addOne) 0) -- -1
print ((addOne . addOne . addOne . negate . addOne) 0)
-- -2 | 512 | main :: IO ()
main = do
print (0 :: Int) -- 0
print (add 1 0) -- 1
print (addOne 0) -- 1
print (addOnePF 0) -- 1
print ((addOne . addOne) 0) -- 2
print ((addOnePF . addOne) 0) -- 2
print ((addOne . addOnePF) 0) -- 2
print ((addOnePF . addOnePF) 0) -- 2
print (negate (addOne 0)) -- -1
print ((negate . addOne) 0) -- -1
print ((addOne . addOne . addOne . negate . addOne) 0)
-- -2 | 512 | main = do
print (0 :: Int) -- 0
print (add 1 0) -- 1
print (addOne 0) -- 1
print (addOnePF 0) -- 1
print ((addOne . addOne) 0) -- 2
print ((addOnePF . addOne) 0) -- 2
print ((addOne . addOnePF) 0) -- 2
print ((addOnePF . addOnePF) 0) -- 2
print (negate (addOne 0)) -- -1
print ((negate . addOne) 0) -- -1
print ((addOne . addOne . addOne . negate . addOne) 0)
-- -2 | 498 | false | true | 0 | 14 | 215 | 221 | 109 | 112 | null | null |
dolio/vector | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | zipWith4M f sa sb sc sd
= zipWithM (\(a,b) (c,d) -> f a b c d) (zip sa sb) (zip sc sd) | 88 | zipWith4M f sa sb sc sd
= zipWithM (\(a,b) (c,d) -> f a b c d) (zip sa sb) (zip sc sd) | 88 | zipWith4M f sa sb sc sd
= zipWithM (\(a,b) (c,d) -> f a b c d) (zip sa sb) (zip sc sd) | 88 | false | false | 0 | 8 | 23 | 71 | 37 | 34 | null | null |
sol/aeson | tests/DataFamilies/Encoders.hs | bsd-3-clause | thGADTToJSONDefault :: GADT String -> Value
thGADTToJSONDefault = $(mkToJSON defaultOptions 'GADT) | 98 | thGADTToJSONDefault :: GADT String -> Value
thGADTToJSONDefault = $(mkToJSON defaultOptions 'GADT) | 98 | thGADTToJSONDefault = $(mkToJSON defaultOptions 'GADT) | 54 | false | true | 0 | 7 | 10 | 28 | 14 | 14 | null | null |
jmitchell/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSRem (ATInt ITChar)) [l, r] = doOp v (LSRem (ATInt ITNative)) [l, r] | 77 | doOp v (LSRem (ATInt ITChar)) [l, r] = doOp v (LSRem (ATInt ITNative)) [l, r] | 77 | doOp v (LSRem (ATInt ITChar)) [l, r] = doOp v (LSRem (ATInt ITNative)) [l, r] | 77 | false | false | 0 | 9 | 14 | 56 | 29 | 27 | null | null |
fmapfmapfmap/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/DescribeEnvironments.hs | mpl-2.0 | -- | Creates a value of 'DescribeEnvironments' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dEnvironmentIds'
--
-- * 'dEnvironmentNames'
--
-- * 'dVersionLabel'
--
-- * 'dApplicationName'
--
-- * 'dIncludedDeletedBackTo'
--
-- * 'dIncludeDeleted'
describeEnvironments
:: DescribeEnvironments
describeEnvironments =
DescribeEnvironments'
{ _dEnvironmentIds = Nothing
, _dEnvironmentNames = Nothing
, _dVersionLabel = Nothing
, _dApplicationName = Nothing
, _dIncludedDeletedBackTo = Nothing
, _dIncludeDeleted = Nothing
} | 645 | describeEnvironments
:: DescribeEnvironments
describeEnvironments =
DescribeEnvironments'
{ _dEnvironmentIds = Nothing
, _dEnvironmentNames = Nothing
, _dVersionLabel = Nothing
, _dApplicationName = Nothing
, _dIncludedDeletedBackTo = Nothing
, _dIncludeDeleted = Nothing
} | 309 | describeEnvironments =
DescribeEnvironments'
{ _dEnvironmentIds = Nothing
, _dEnvironmentNames = Nothing
, _dVersionLabel = Nothing
, _dApplicationName = Nothing
, _dIncludedDeletedBackTo = Nothing
, _dIncludeDeleted = Nothing
} | 260 | true | true | 1 | 7 | 120 | 71 | 47 | 24 | null | null |
ggreif/clash-compiler | clash-systemverilog/src/CLaSH/Backend/SystemVerilog.hs | bsd-2-clause | simpleFromSLV _ id_ = text id_ | 30 | simpleFromSLV _ id_ = text id_ | 30 | simpleFromSLV _ id_ = text id_ | 30 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
bredelings/BAli-Phy | haskell/Tree/Newick.hs | gpl-2.0 | label_for_node nht@(TimeTree tree _) = (\node -> sublabel_for_node node ++ branch_label (parentBranch tree node))
where sublabel_for_node = label_for_node tree
branch_label (Just b) = ":" ++ show (branch_length nht b)
branch_label Nothing = "" | 268 | label_for_node nht@(TimeTree tree _) = (\node -> sublabel_for_node node ++ branch_label (parentBranch tree node))
where sublabel_for_node = label_for_node tree
branch_label (Just b) = ":" ++ show (branch_length nht b)
branch_label Nothing = "" | 268 | label_for_node nht@(TimeTree tree _) = (\node -> sublabel_for_node node ++ branch_label (parentBranch tree node))
where sublabel_for_node = label_for_node tree
branch_label (Just b) = ":" ++ show (branch_length nht b)
branch_label Nothing = "" | 268 | false | false | 2 | 10 | 57 | 94 | 46 | 48 | null | null |
kaol/snaplet-customauth | Snap/Snaplet/CustomAuth/OAuth2/Internal.hs | bsd-3-clause | oauth2Init
:: IAuthBackend u i e b
=> OAuth2Settings u i e b
-> Initializer b (AuthManager u e b) (HashMap Text Provider)
oauth2Init s = do
cfg <- getSnapletUserConfig
root <- getSnapletRootURL
hostname <- liftIO $ C.require cfg "hostname"
scheme <- liftIO $ C.lookupDefault "https" cfg "protocol"
names <- liftIO $ C.lookupDefault [] cfg "oauth2.providers"
-- TODO: use discovery
let makeProvider name = let
name' = "oauth2." <> name
lk = MaybeT . C.lookup cfg . (name' <>)
lku n = lk n >>=
MaybeT . return . hush . parseURI strictURIParserOptions . encodeUtf8
callback = URI (Scheme scheme)
(Just $ Authority Nothing (Host hostname) Nothing)
("/" <> root <> "/oauth2callback/" <> (encodeUtf8 name))
mempty Nothing
in Provider
<$> (MaybeT $ return $ pure $ T.toLower $ name)
<*> (MaybeT $ return $ pure $ Nothing)
<*> lk ".scope"
<*> lku ".endpoint.identity"
<*> lk ".identityField"
<*> (OAuth2
<$> lk ".clientId"
<*> (lift $ runMaybeT $ lk ".clientSecret")
<*> lku ".endpoint.auth"
<*> lku ".endpoint.access"
<*> (pure $ Just callback))
addRoutes $ mapped._2 %~ (bracket s) $
[ ("oauth2createaccount", oauth2CreateAccount s)
, ("oauth2callback/:provider", oauth2Callback s)
, ("oauth2login/:provider", redirectLogin)
]
liftIO $ M.fromList . map (\x -> (providerName x, x)) . catMaybes <$>
(mapM (runMaybeT . makeProvider) names) | 1,627 | oauth2Init
:: IAuthBackend u i e b
=> OAuth2Settings u i e b
-> Initializer b (AuthManager u e b) (HashMap Text Provider)
oauth2Init s = do
cfg <- getSnapletUserConfig
root <- getSnapletRootURL
hostname <- liftIO $ C.require cfg "hostname"
scheme <- liftIO $ C.lookupDefault "https" cfg "protocol"
names <- liftIO $ C.lookupDefault [] cfg "oauth2.providers"
-- TODO: use discovery
let makeProvider name = let
name' = "oauth2." <> name
lk = MaybeT . C.lookup cfg . (name' <>)
lku n = lk n >>=
MaybeT . return . hush . parseURI strictURIParserOptions . encodeUtf8
callback = URI (Scheme scheme)
(Just $ Authority Nothing (Host hostname) Nothing)
("/" <> root <> "/oauth2callback/" <> (encodeUtf8 name))
mempty Nothing
in Provider
<$> (MaybeT $ return $ pure $ T.toLower $ name)
<*> (MaybeT $ return $ pure $ Nothing)
<*> lk ".scope"
<*> lku ".endpoint.identity"
<*> lk ".identityField"
<*> (OAuth2
<$> lk ".clientId"
<*> (lift $ runMaybeT $ lk ".clientSecret")
<*> lku ".endpoint.auth"
<*> lku ".endpoint.access"
<*> (pure $ Just callback))
addRoutes $ mapped._2 %~ (bracket s) $
[ ("oauth2createaccount", oauth2CreateAccount s)
, ("oauth2callback/:provider", oauth2Callback s)
, ("oauth2login/:provider", redirectLogin)
]
liftIO $ M.fromList . map (\x -> (providerName x, x)) . catMaybes <$>
(mapM (runMaybeT . makeProvider) names) | 1,627 | oauth2Init s = do
cfg <- getSnapletUserConfig
root <- getSnapletRootURL
hostname <- liftIO $ C.require cfg "hostname"
scheme <- liftIO $ C.lookupDefault "https" cfg "protocol"
names <- liftIO $ C.lookupDefault [] cfg "oauth2.providers"
-- TODO: use discovery
let makeProvider name = let
name' = "oauth2." <> name
lk = MaybeT . C.lookup cfg . (name' <>)
lku n = lk n >>=
MaybeT . return . hush . parseURI strictURIParserOptions . encodeUtf8
callback = URI (Scheme scheme)
(Just $ Authority Nothing (Host hostname) Nothing)
("/" <> root <> "/oauth2callback/" <> (encodeUtf8 name))
mempty Nothing
in Provider
<$> (MaybeT $ return $ pure $ T.toLower $ name)
<*> (MaybeT $ return $ pure $ Nothing)
<*> lk ".scope"
<*> lku ".endpoint.identity"
<*> lk ".identityField"
<*> (OAuth2
<$> lk ".clientId"
<*> (lift $ runMaybeT $ lk ".clientSecret")
<*> lku ".endpoint.auth"
<*> lku ".endpoint.access"
<*> (pure $ Just callback))
addRoutes $ mapped._2 %~ (bracket s) $
[ ("oauth2createaccount", oauth2CreateAccount s)
, ("oauth2callback/:provider", oauth2Callback s)
, ("oauth2login/:provider", redirectLogin)
]
liftIO $ M.fromList . map (\x -> (providerName x, x)) . catMaybes <$>
(mapM (runMaybeT . makeProvider) names) | 1,499 | false | true | 0 | 22 | 502 | 528 | 259 | 269 | null | null |
alexbiehl/hs-fst | src/Data/FST/Register.hs | bsd-3-clause | replaceOrRegister ::
UncompiledState a
-> Register a
-> (Arc, Register a)
replaceOrRegister (UncompiledState label arcs output) register =
case HashMap.lookup arcs (regStates register) of
Just (E stateRef n) | n == 1 -> (Arc label n stateRef, register)
| otherwise -> writeOutput register
_ -> (Arc label numWords (regSize register'), register')
where
register' = register {
regStates = HashMap.insert arcs
(E (regSize register + compiledSize) numWords) (regStates register)
, regSize = compiledSize + (regSize register)
, regBuilder = compiledArcs `mappend` regBuilder register
}
(numWords, compiledSize, compiledArcs) = compileArcs (regSize register) arcs | 777 | replaceOrRegister ::
UncompiledState a
-> Register a
-> (Arc, Register a)
replaceOrRegister (UncompiledState label arcs output) register =
case HashMap.lookup arcs (regStates register) of
Just (E stateRef n) | n == 1 -> (Arc label n stateRef, register)
| otherwise -> writeOutput register
_ -> (Arc label numWords (regSize register'), register')
where
register' = register {
regStates = HashMap.insert arcs
(E (regSize register + compiledSize) numWords) (regStates register)
, regSize = compiledSize + (regSize register)
, regBuilder = compiledArcs `mappend` regBuilder register
}
(numWords, compiledSize, compiledArcs) = compileArcs (regSize register) arcs | 777 | replaceOrRegister (UncompiledState label arcs output) register =
case HashMap.lookup arcs (regStates register) of
Just (E stateRef n) | n == 1 -> (Arc label n stateRef, register)
| otherwise -> writeOutput register
_ -> (Arc label numWords (regSize register'), register')
where
register' = register {
regStates = HashMap.insert arcs
(E (regSize register + compiledSize) numWords) (regStates register)
, regSize = compiledSize + (regSize register)
, regBuilder = compiledArcs `mappend` regBuilder register
}
(numWords, compiledSize, compiledArcs) = compileArcs (regSize register) arcs | 697 | false | true | 1 | 13 | 210 | 251 | 126 | 125 | null | null |
kwibus/myLang | src/TypeError.hs | bsd-3-clause | showError :: String -> TypeError SourcePos SourcePos -> Doc
showError str (UnifyAp expr t1 t2 err ) = text (showPosition (getPosition expr)) <+> text "TypeError " <$>
indent 4 ( showUnifyApError str expr t1 t2 err) | 222 | showError :: String -> TypeError SourcePos SourcePos -> Doc
showError str (UnifyAp expr t1 t2 err ) = text (showPosition (getPosition expr)) <+> text "TypeError " <$>
indent 4 ( showUnifyApError str expr t1 t2 err) | 222 | showError str (UnifyAp expr t1 t2 err ) = text (showPosition (getPosition expr)) <+> text "TypeError " <$>
indent 4 ( showUnifyApError str expr t1 t2 err) | 162 | false | true | 0 | 11 | 43 | 86 | 41 | 45 | null | null |
pparkkin/eta | compiler/ETA/Prelude/TysPrim.hs | bsd-3-clause | {-
************************************************************************
* *
\subsection[TysPrim-BCOs]{The ``bytecode object'' type}
* *
************************************************************************
-}
bcoPrimTy :: Type
bcoPrimTy = mkTyConTy bcoPrimTyCon | 413 | bcoPrimTy :: Type
bcoPrimTy = mkTyConTy bcoPrimTyCon | 58 | bcoPrimTy = mkTyConTy bcoPrimTyCon | 37 | true | true | 0 | 6 | 163 | 21 | 9 | 12 | null | null |
fmapfmapfmap/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/UpdateStack.hs | mpl-2.0 | -- | The default root device type. This value is used by default for all
-- instances in the stack, but you can override it when you create an
-- instance. For more information, see
-- <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device Storage for the Root Device>.
usDefaultRootDeviceType :: Lens' UpdateStack (Maybe RootDeviceType)
usDefaultRootDeviceType = lens _usDefaultRootDeviceType (\ s a -> s{_usDefaultRootDeviceType = a}) | 481 | usDefaultRootDeviceType :: Lens' UpdateStack (Maybe RootDeviceType)
usDefaultRootDeviceType = lens _usDefaultRootDeviceType (\ s a -> s{_usDefaultRootDeviceType = a}) | 166 | usDefaultRootDeviceType = lens _usDefaultRootDeviceType (\ s a -> s{_usDefaultRootDeviceType = a}) | 98 | true | true | 0 | 9 | 58 | 49 | 28 | 21 | null | null |
fmapfmapfmap/amazonka | amazonka-swf/gen/Network/AWS/SWF/Types/Product.hs | mpl-2.0 | -- | If set, specifies the maximum duration a worker may take to process this
-- activity task. This overrides the default start-to-close timeout
-- specified when registering the activity type using RegisterActivityType.
--
-- The duration is specified in seconds; an integer greater than or equal
-- to 0. The value \"NONE\" can be used to specify unlimited duration.
--
-- A start-to-close timeout for this activity task must be specified either
-- as a default for the activity type or through this field. If neither
-- this field is set nor a default start-to-close timeout was specified at
-- registration time then a fault will be returned.
satdaStartToCloseTimeout :: Lens' ScheduleActivityTaskDecisionAttributes (Maybe Text)
satdaStartToCloseTimeout = lens _satdaStartToCloseTimeout (\ s a -> s{_satdaStartToCloseTimeout = a}) | 835 | satdaStartToCloseTimeout :: Lens' ScheduleActivityTaskDecisionAttributes (Maybe Text)
satdaStartToCloseTimeout = lens _satdaStartToCloseTimeout (\ s a -> s{_satdaStartToCloseTimeout = a}) | 187 | satdaStartToCloseTimeout = lens _satdaStartToCloseTimeout (\ s a -> s{_satdaStartToCloseTimeout = a}) | 101 | true | true | 0 | 9 | 125 | 56 | 35 | 21 | null | null |
dtekcth/DtekPortalen | src/Handler/Document.hs | bsd-2-clause | getDocumentR :: Text -- ^ Textual ID of the document
-> Handler Html
getDocumentR tid = do
doc <- fmap entityVal $ guardExistence tid
((_, form), enctype) <- runFormPost $ documentEditForm doc
defaultLayout $ do
[whamlet|
<h1>Redigera
<p> Ingen historik (förutom backups) finns, redigera varsamt!
<article .fullpage .document>
<form enctype="#{enctype}" method="post">
<table>
^{form}
<tr>
<td>
<td .buttons>
<input type="submit" value="Spara">
|]
setDtekTitle "Redigera dokument"
-- $(widgetFile "document") -- TODO: Move out the html one day | 815 | getDocumentR :: Text -- ^ Textual ID of the document
-> Handler Html
getDocumentR tid = do
doc <- fmap entityVal $ guardExistence tid
((_, form), enctype) <- runFormPost $ documentEditForm doc
defaultLayout $ do
[whamlet|
<h1>Redigera
<p> Ingen historik (förutom backups) finns, redigera varsamt!
<article .fullpage .document>
<form enctype="#{enctype}" method="post">
<table>
^{form}
<tr>
<td>
<td .buttons>
<input type="submit" value="Spara">
|]
setDtekTitle "Redigera dokument"
-- $(widgetFile "document") -- TODO: Move out the html one day | 815 | getDocumentR tid = do
doc <- fmap entityVal $ guardExistence tid
((_, form), enctype) <- runFormPost $ documentEditForm doc
defaultLayout $ do
[whamlet|
<h1>Redigera
<p> Ingen historik (förutom backups) finns, redigera varsamt!
<article .fullpage .document>
<form enctype="#{enctype}" method="post">
<table>
^{form}
<tr>
<td>
<td .buttons>
<input type="submit" value="Spara">
|]
setDtekTitle "Redigera dokument"
-- $(widgetFile "document") -- TODO: Move out the html one day | 736 | false | true | 0 | 11 | 340 | 91 | 44 | 47 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | The snapshot ID of the disk being imported.
stdSnapshotId :: Lens' SnapshotTaskDetail (Maybe Text)
stdSnapshotId = lens _stdSnapshotId (\s a -> s { _stdSnapshotId = a }) | 174 | stdSnapshotId :: Lens' SnapshotTaskDetail (Maybe Text)
stdSnapshotId = lens _stdSnapshotId (\s a -> s { _stdSnapshotId = a }) | 125 | stdSnapshotId = lens _stdSnapshotId (\s a -> s { _stdSnapshotId = a }) | 70 | true | true | 1 | 9 | 28 | 51 | 25 | 26 | null | null |
rueshyna/gogol | gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Storelayoutclusters/Delete.hs | mpl-2.0 | -- | The ID of the cluster.
sddClusterId :: Lens' StorelayoutclustersDelete Text
sddClusterId
= lens _sddClusterId (\ s a -> s{_sddClusterId = a}) | 148 | sddClusterId :: Lens' StorelayoutclustersDelete Text
sddClusterId
= lens _sddClusterId (\ s a -> s{_sddClusterId = a}) | 120 | sddClusterId
= lens _sddClusterId (\ s a -> s{_sddClusterId = a}) | 67 | true | true | 1 | 9 | 24 | 46 | 22 | 24 | null | null |
GaloisInc/stack | src/Stack/Build/Execute.hs | bsd-3-clause | printBuildOutput :: (MonadIO m, MonadBaseControl IO m, MonadLogger m)
=> Bool -> LogLevel -> Handle -> m ()
printBuildOutput excludeTHLoading level outH = void $ fork $
CB.sourceHandle outH
$$ CB.lines
=$ CL.map stripCharacterReturn
=$ CL.filter (not . isTHLoading)
=$ CL.mapM_ (monadLoggerLog $(TH.location >>= liftLoc) "" level)
where
-- | Is this line a Template Haskell "Loading package" line
-- ByteString
isTHLoading :: S8.ByteString -> Bool
isTHLoading _ | not excludeTHLoading = False
isTHLoading bs =
"Loading package " `S8.isPrefixOf` bs &&
("done." `S8.isSuffixOf` bs || "done.\r" `S8.isSuffixOf` bs)
-- | Strip a @\r@ character from the byte vector. Used because Windows. | 764 | printBuildOutput :: (MonadIO m, MonadBaseControl IO m, MonadLogger m)
=> Bool -> LogLevel -> Handle -> m ()
printBuildOutput excludeTHLoading level outH = void $ fork $
CB.sourceHandle outH
$$ CB.lines
=$ CL.map stripCharacterReturn
=$ CL.filter (not . isTHLoading)
=$ CL.mapM_ (monadLoggerLog $(TH.location >>= liftLoc) "" level)
where
-- | Is this line a Template Haskell "Loading package" line
-- ByteString
isTHLoading :: S8.ByteString -> Bool
isTHLoading _ | not excludeTHLoading = False
isTHLoading bs =
"Loading package " `S8.isPrefixOf` bs &&
("done." `S8.isSuffixOf` bs || "done.\r" `S8.isSuffixOf` bs)
-- | Strip a @\r@ character from the byte vector. Used because Windows. | 764 | printBuildOutput excludeTHLoading level outH = void $ fork $
CB.sourceHandle outH
$$ CB.lines
=$ CL.map stripCharacterReturn
=$ CL.filter (not . isTHLoading)
=$ CL.mapM_ (monadLoggerLog $(TH.location >>= liftLoc) "" level)
where
-- | Is this line a Template Haskell "Loading package" line
-- ByteString
isTHLoading :: S8.ByteString -> Bool
isTHLoading _ | not excludeTHLoading = False
isTHLoading bs =
"Loading package " `S8.isPrefixOf` bs &&
("done." `S8.isSuffixOf` bs || "done.\r" `S8.isSuffixOf` bs)
-- | Strip a @\r@ character from the byte vector. Used because Windows. | 639 | false | true | 16 | 10 | 182 | 200 | 103 | 97 | null | null |
anthezium/fractal_flame_renderer_haskell | FractalFlame/Generator.hs | bsd-2-clause | -- | Generate a random flame symmetry parameter with behavior equivalent to Scott Draves' flam3-render
symmetryGenDraves :: Generator Int
symmetryGenDraves s =
let baseDistribution =
[ (-4), (-3)
, (-2), (-2), (-2)
, (-1), (-1), (-1)
, 2 , 2 , 2
, 3 , 3
, 4 , 4
]
baseLookup ix = baseDistribution !! (ix `mod` (length baseDistribution))
-- idk why, but he chooses a fresh random number if r1 is odd
([r1, r2, r3], s') = generatorSequence (replicate 3 $ randomR (minBound, maxBound)) s :: ([Int], StdGen)
sym = if (r1 .&. 1) /= 0 then -- half the time (8/16 probability total)
baseLookup r2 -- choose one of baseDistribution
else if (r2 .&. 31) /= 0 then -- if not base, 1/8 of the time (1/16 probability total)
r3 `mod` 13 - 6 -- -6 to 6 inclusive
else -- if not base, 7/8 of the time (7/16 probability total)
r3 `mod` 51 - 25 -- -25 to 25 inclusive
in
(sym, s') | 1,035 | symmetryGenDraves :: Generator Int
symmetryGenDraves s =
let baseDistribution =
[ (-4), (-3)
, (-2), (-2), (-2)
, (-1), (-1), (-1)
, 2 , 2 , 2
, 3 , 3
, 4 , 4
]
baseLookup ix = baseDistribution !! (ix `mod` (length baseDistribution))
-- idk why, but he chooses a fresh random number if r1 is odd
([r1, r2, r3], s') = generatorSequence (replicate 3 $ randomR (minBound, maxBound)) s :: ([Int], StdGen)
sym = if (r1 .&. 1) /= 0 then -- half the time (8/16 probability total)
baseLookup r2 -- choose one of baseDistribution
else if (r2 .&. 31) /= 0 then -- if not base, 1/8 of the time (1/16 probability total)
r3 `mod` 13 - 6 -- -6 to 6 inclusive
else -- if not base, 7/8 of the time (7/16 probability total)
r3 `mod` 51 - 25 -- -25 to 25 inclusive
in
(sym, s') | 932 | symmetryGenDraves s =
let baseDistribution =
[ (-4), (-3)
, (-2), (-2), (-2)
, (-1), (-1), (-1)
, 2 , 2 , 2
, 3 , 3
, 4 , 4
]
baseLookup ix = baseDistribution !! (ix `mod` (length baseDistribution))
-- idk why, but he chooses a fresh random number if r1 is odd
([r1, r2, r3], s') = generatorSequence (replicate 3 $ randomR (minBound, maxBound)) s :: ([Int], StdGen)
sym = if (r1 .&. 1) /= 0 then -- half the time (8/16 probability total)
baseLookup r2 -- choose one of baseDistribution
else if (r2 .&. 31) /= 0 then -- if not base, 1/8 of the time (1/16 probability total)
r3 `mod` 13 - 6 -- -6 to 6 inclusive
else -- if not base, 7/8 of the time (7/16 probability total)
r3 `mod` 51 - 25 -- -25 to 25 inclusive
in
(sym, s') | 897 | true | true | 0 | 13 | 339 | 277 | 165 | 112 | null | null |
tanakh/tanakh.jp | tools/logo-gen.hs | bsd-3-clause | rnd :: Double -> Double -> Fay Double
rnd = ffi "Math.random()*(%2-%1)+%1" | 75 | rnd :: Double -> Double -> Fay Double
rnd = ffi "Math.random()*(%2-%1)+%1" | 74 | rnd = ffi "Math.random()*(%2-%1)+%1" | 36 | false | true | 0 | 7 | 12 | 25 | 12 | 13 | null | null |
dhess/gpio | src/System/GPIO/Linux/Sysfs/Monad.hs | bsd-3-clause | -- | Export the given pin.
--
-- Note that, if the pin is already exported, this is not an error; in
-- this situation, the pin remains exported and its state unchanged.
exportPin :: (CatchSysfsM m) => Pin -> m ()
exportPin pin@(Pin n) =
catchIOError
(unlockedWriteFile exportFileName (intToBS n))
mapIOError
where
mapIOError :: (MonadThrow m) => IOError -> m ()
mapIOError e
| isAlreadyInUseError e = return ()
| isInvalidArgumentError e = throwM $ InvalidPin pin
| isPermissionError e = throwM $ PermissionDenied pin
| otherwise = throwM e
-- | Export the given pin.
--
-- Note that, unlike 'exportPin', it's an error to call this action to
-- export a pin that's already been exported. This is the standard
-- Linux @sysfs@ GPIO behavior. | 786 | exportPin :: (CatchSysfsM m) => Pin -> m ()
exportPin pin@(Pin n) =
catchIOError
(unlockedWriteFile exportFileName (intToBS n))
mapIOError
where
mapIOError :: (MonadThrow m) => IOError -> m ()
mapIOError e
| isAlreadyInUseError e = return ()
| isInvalidArgumentError e = throwM $ InvalidPin pin
| isPermissionError e = throwM $ PermissionDenied pin
| otherwise = throwM e
-- | Export the given pin.
--
-- Note that, unlike 'exportPin', it's an error to call this action to
-- export a pin that's already been exported. This is the standard
-- Linux @sysfs@ GPIO behavior. | 616 | exportPin pin@(Pin n) =
catchIOError
(unlockedWriteFile exportFileName (intToBS n))
mapIOError
where
mapIOError :: (MonadThrow m) => IOError -> m ()
mapIOError e
| isAlreadyInUseError e = return ()
| isInvalidArgumentError e = throwM $ InvalidPin pin
| isPermissionError e = throwM $ PermissionDenied pin
| otherwise = throwM e
-- | Export the given pin.
--
-- Note that, unlike 'exportPin', it's an error to call this action to
-- export a pin that's already been exported. This is the standard
-- Linux @sysfs@ GPIO behavior. | 572 | true | true | 0 | 8 | 172 | 168 | 82 | 86 | null | null |
bjpop/haskell-mpi | test/SimpleTests.hs | bsd-3-clause | syncSendRecv sendf rank
| rank == sender = sendf commWorld receiver 123 smallMsg
| rank == receiver = do (result, status) <- recv commWorld sender 123
checkStatus status sender 123
result == smallMsg @? "Got garbled result " ++ show result
| otherwise = return () | 330 | syncSendRecv sendf rank
| rank == sender = sendf commWorld receiver 123 smallMsg
| rank == receiver = do (result, status) <- recv commWorld sender 123
checkStatus status sender 123
result == smallMsg @? "Got garbled result " ++ show result
| otherwise = return () | 330 | syncSendRecv sendf rank
| rank == sender = sendf commWorld receiver 123 smallMsg
| rank == receiver = do (result, status) <- recv commWorld sender 123
checkStatus status sender 123
result == smallMsg @? "Got garbled result " ++ show result
| otherwise = return () | 330 | false | false | 0 | 11 | 112 | 114 | 49 | 65 | null | null |
kylcarte/qclib | src/.Db.hs | bsd-3-clause | wrapPar :: T.Text -> T.Text
wrapPar = T.cons '(' . flip T.snoc ')' | 66 | wrapPar :: T.Text -> T.Text
wrapPar = T.cons '(' . flip T.snoc ')' | 66 | wrapPar = T.cons '(' . flip T.snoc ')' | 38 | false | true | 0 | 7 | 12 | 35 | 17 | 18 | null | null |
anton-dessiatov/ghc | compiler/coreSyn/CoreUnfold.hs | bsd-3-clause | spec_doc :: SDoc
spec_doc = ptext (sLit "specUnfolding") | 56 | spec_doc :: SDoc
spec_doc = ptext (sLit "specUnfolding") | 56 | spec_doc = ptext (sLit "specUnfolding") | 39 | false | true | 0 | 7 | 7 | 20 | 10 | 10 | null | null |
rfranek/duckling | Duckling/Duration/KO/Rules.hs | bsd-3-clause | ruleHalfAnHour :: Rule
ruleHalfAnHour = Rule
{ name = "half an hour"
, pattern =
[ Predicate $ isGrain TG.Hour
, regex "\xbc18"
]
, prod = \_ -> Just . Token Duration $ duration TG.Minute 30
} | 212 | ruleHalfAnHour :: Rule
ruleHalfAnHour = Rule
{ name = "half an hour"
, pattern =
[ Predicate $ isGrain TG.Hour
, regex "\xbc18"
]
, prod = \_ -> Just . Token Duration $ duration TG.Minute 30
} | 212 | ruleHalfAnHour = Rule
{ name = "half an hour"
, pattern =
[ Predicate $ isGrain TG.Hour
, regex "\xbc18"
]
, prod = \_ -> Just . Token Duration $ duration TG.Minute 30
} | 189 | false | true | 0 | 11 | 57 | 76 | 40 | 36 | null | null |
remyoudompheng/hs-language-go | tests/Tests/ParseStatements.hs | gpl-3.0 | testPostfix1 = testParse "test increment"
goStatement "*p++" $
GoStmtSimple $ GoSimpInc $ Go1Op (GoOp "*") $ ident "p" | 126 | testPostfix1 = testParse "test increment"
goStatement "*p++" $
GoStmtSimple $ GoSimpInc $ Go1Op (GoOp "*") $ ident "p" | 126 | testPostfix1 = testParse "test increment"
goStatement "*p++" $
GoStmtSimple $ GoSimpInc $ Go1Op (GoOp "*") $ ident "p" | 126 | false | false | 0 | 9 | 25 | 43 | 19 | 24 | null | null |
MFire30/haskellPresidentCardgame | app/Main.hs | mit | -- Data for testing
p1 = createPlayer "P1" [] | 45 | p1 = createPlayer "P1" [] | 25 | p1 = createPlayer "P1" [] | 25 | true | false | 1 | 6 | 8 | 17 | 7 | 10 | null | null |
luisnavarrodelangel/InnerEar | src/InnerEar/Widgets/Utility.hs | gpl-3.0 | simpleTabBuilder :: (MonadWidget t m, Show a, Eq a) => Dynamic t a -> a -> m (Event t a)
simpleTabBuilder currentTab label = do
isActive <- mapDyn (==label) currentTab
cssClass <- mapDyn (bool "inactiveTab" "activeTab") isActive
attrs <- mapDyn (M.singleton "class") cssClass
(e,_) <- elDynAttr' "div" attrs $ text (show label)
clickEv <- wrapDomEvent (_el_element e) (onEventName Click) (mouseXY)
return $ label <$ clickEv | 435 | simpleTabBuilder :: (MonadWidget t m, Show a, Eq a) => Dynamic t a -> a -> m (Event t a)
simpleTabBuilder currentTab label = do
isActive <- mapDyn (==label) currentTab
cssClass <- mapDyn (bool "inactiveTab" "activeTab") isActive
attrs <- mapDyn (M.singleton "class") cssClass
(e,_) <- elDynAttr' "div" attrs $ text (show label)
clickEv <- wrapDomEvent (_el_element e) (onEventName Click) (mouseXY)
return $ label <$ clickEv | 435 | simpleTabBuilder currentTab label = do
isActive <- mapDyn (==label) currentTab
cssClass <- mapDyn (bool "inactiveTab" "activeTab") isActive
attrs <- mapDyn (M.singleton "class") cssClass
(e,_) <- elDynAttr' "div" attrs $ text (show label)
clickEv <- wrapDomEvent (_el_element e) (onEventName Click) (mouseXY)
return $ label <$ clickEv | 346 | false | true | 0 | 11 | 76 | 190 | 91 | 99 | null | null |
sol/uu-parsinglib | src/Text/ParserCombinators/UU/Demo/MergeAndPermute.hs | mit | pABC' :: Grammar String
pABC' = (\ a d -> d:a) <$> pA <*> (pDigit' >>= \d -> pB *> mkGram (pSym d) *> pC *> mkGram (pSym d)) | 126 | pABC' :: Grammar String
pABC' = (\ a d -> d:a) <$> pA <*> (pDigit' >>= \d -> pB *> mkGram (pSym d) *> pC *> mkGram (pSym d)) | 125 | pABC' = (\ a d -> d:a) <$> pA <*> (pDigit' >>= \d -> pB *> mkGram (pSym d) *> pC *> mkGram (pSym d)) | 101 | false | true | 5 | 15 | 30 | 88 | 42 | 46 | null | null |
ardumont/haskell-lab | src/Monad/StateMonadTryout.hs | gpl-2.0 | test :: MState Int Int
test = do
mput 3
mmodify (+1)
mget | 63 | test :: MState Int Int
test = do
mput 3
mmodify (+1)
mget | 63 | test = do
mput 3
mmodify (+1)
mget | 40 | false | true | 0 | 8 | 18 | 35 | 16 | 19 | null | null |
lessandro/contas | src/etc/Couch.hs | mit | getItem :: String -> IO (Maybe Item)
getItem ref = do
raw <- getRaw ref
return $ liftM decodeItem $ raw
-- Get the ref field of the current doc | 153 | getItem :: String -> IO (Maybe Item)
getItem ref = do
raw <- getRaw ref
return $ liftM decodeItem $ raw
-- Get the ref field of the current doc | 153 | getItem ref = do
raw <- getRaw ref
return $ liftM decodeItem $ raw
-- Get the ref field of the current doc | 115 | false | true | 0 | 9 | 39 | 52 | 24 | 28 | null | null |
kmate/raw-feldspar | src/Feldspar/Primitive/Representation.hs | bsd-3-clause | primTypeEq DoubleT DoubleT = Just Dict | 52 | primTypeEq DoubleT DoubleT = Just Dict | 52 | primTypeEq DoubleT DoubleT = Just Dict | 52 | false | false | 0 | 5 | 19 | 14 | 6 | 8 | null | null |
Blaisorblade/pts | src-lib/PTS/Syntax/Parser.hs | bsd-3-clause | telescopeOrArgGroup :: Parser (Telescope Term)
telescopeOrArgGroup = asum
[ do ns <- names
asum
[ do colon1
typ <- expr
return [(ns, typ)]
, do typ <- mkInfer <$> nextInfer
rest <- many argGroupOrNames
return ((ns, typ) : rest)
]
, many argGroupOrNames
] | 350 | telescopeOrArgGroup :: Parser (Telescope Term)
telescopeOrArgGroup = asum
[ do ns <- names
asum
[ do colon1
typ <- expr
return [(ns, typ)]
, do typ <- mkInfer <$> nextInfer
rest <- many argGroupOrNames
return ((ns, typ) : rest)
]
, many argGroupOrNames
] | 350 | telescopeOrArgGroup = asum
[ do ns <- names
asum
[ do colon1
typ <- expr
return [(ns, typ)]
, do typ <- mkInfer <$> nextInfer
rest <- many argGroupOrNames
return ((ns, typ) : rest)
]
, many argGroupOrNames
] | 303 | false | true | 0 | 15 | 139 | 116 | 56 | 60 | null | null |
brendanhay/gogol | gogol-servicemanagement/gen/Network/Google/ServiceManagement/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'EnumValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'evName'
--
-- * 'evOptions'
--
-- * 'evNumber'
enumValue
:: EnumValue
enumValue =
EnumValue' {_evName = Nothing, _evOptions = Nothing, _evNumber = Nothing} | 331 | enumValue
:: EnumValue
enumValue =
EnumValue' {_evName = Nothing, _evOptions = Nothing, _evNumber = Nothing} | 114 | enumValue =
EnumValue' {_evName = Nothing, _evOptions = Nothing, _evNumber = Nothing} | 87 | true | true | 1 | 7 | 62 | 44 | 28 | 16 | null | null |
nevrenato/Hets_Fork | OWL2/Parse.hs | gpl-2.0 | getNNInt :: CharParser st NNInt
getNNInt = fmap (NNInt . map digitToInt) getNumber | 82 | getNNInt :: CharParser st NNInt
getNNInt = fmap (NNInt . map digitToInt) getNumber | 82 | getNNInt = fmap (NNInt . map digitToInt) getNumber | 50 | false | true | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110404set1.hs | gpl-3.0 | processTB :: [Char]
processTB =
"\ngenerate P P > t b / g a z h w+ w- QED=99 @1\nadd process P P > t~ b~ / g a z h w+ w- QED=99 @2\n" | 138 | processTB :: [Char]
processTB =
"\ngenerate P P > t b / g a z h w+ w- QED=99 @1\nadd process P P > t~ b~ / g a z h w+ w- QED=99 @2\n" | 138 | processTB =
"\ngenerate P P > t b / g a z h w+ w- QED=99 @1\nadd process P P > t~ b~ / g a z h w+ w- QED=99 @2\n" | 118 | false | true | 0 | 5 | 39 | 14 | 8 | 6 | null | null |
vTurbine/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtO ListOrigin = text "an overloaded list" | 56 | pprCtO ListOrigin = text "an overloaded list" | 56 | pprCtO ListOrigin = text "an overloaded list" | 56 | false | false | 0 | 5 | 17 | 13 | 5 | 8 | null | null |
gridaphobe/ghc | compiler/main/HscTypes.hs | bsd-3-clause | updNameCacheIO :: HscEnv
-> (NameCache -> (NameCache, c)) -- The updating function
-> IO c
updNameCacheIO hsc_env upd_fn
= atomicModifyIORef' (hsc_NC hsc_env) upd_fn | 198 | updNameCacheIO :: HscEnv
-> (NameCache -> (NameCache, c)) -- The updating function
-> IO c
updNameCacheIO hsc_env upd_fn
= atomicModifyIORef' (hsc_NC hsc_env) upd_fn | 198 | updNameCacheIO hsc_env upd_fn
= atomicModifyIORef' (hsc_NC hsc_env) upd_fn | 76 | false | true | 0 | 10 | 55 | 57 | 28 | 29 | null | null |
mbakke/ganeti | src/Ganeti/UDSServer.hs | bsd-2-clause | pipeClient :: ConnectConfig -> IO (Client, Client)
pipeClient conf =
let newClient r w = do
rf <- newIORef B.empty
rh <- fdToHandle r
wh <- fdToHandle w
return Client { rsocket = rh, wsocket = wh
, rbuf = rf, clientConfig = conf }
in do
(r1, w1) <- createPipe
(r2, w2) <- createPipe
(,) <$> newClient r1 w2 <*> newClient r2 w1
-- | Closes a server endpoint. | 428 | pipeClient :: ConnectConfig -> IO (Client, Client)
pipeClient conf =
let newClient r w = do
rf <- newIORef B.empty
rh <- fdToHandle r
wh <- fdToHandle w
return Client { rsocket = rh, wsocket = wh
, rbuf = rf, clientConfig = conf }
in do
(r1, w1) <- createPipe
(r2, w2) <- createPipe
(,) <$> newClient r1 w2 <*> newClient r2 w1
-- | Closes a server endpoint. | 428 | pipeClient conf =
let newClient r w = do
rf <- newIORef B.empty
rh <- fdToHandle r
wh <- fdToHandle w
return Client { rsocket = rh, wsocket = wh
, rbuf = rf, clientConfig = conf }
in do
(r1, w1) <- createPipe
(r2, w2) <- createPipe
(,) <$> newClient r1 w2 <*> newClient r2 w1
-- | Closes a server endpoint. | 377 | false | true | 0 | 13 | 140 | 163 | 80 | 83 | null | null |
mgrabmueller/harpy | Harpy/X86CodeGen.hs | bsd-3-clause | x86_stosd = x86_stosl | 21 | x86_stosd = x86_stosl | 21 | x86_stosd = x86_stosl | 21 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
mcmtroffaes/improb-redux | haskell/ImprobRedux.hs | mit | expectation :: Num a => [a] -> [a] -> a
expectation pmf rvar = sum $ zipWith (*) pmf rvar | 89 | expectation :: Num a => [a] -> [a] -> a
expectation pmf rvar = sum $ zipWith (*) pmf rvar | 89 | expectation pmf rvar = sum $ zipWith (*) pmf rvar | 49 | false | true | 0 | 8 | 19 | 54 | 27 | 27 | null | null |
miniBill/entangle | src/exe/Examples.hs | mit | mythirdcirc :: (Qubit, Qubit, Qubit) -> Circ (Qubit, Qubit, Qubit)
mythirdcirc (q1, q2, q3) = do
qnot_at q2 `controlled` q1
qnot_at q2 `controlled` q3
qnot_at q2 `controlled` q1
qnot_at q2 `controlled` q3
return (q1, q2, q3) | 244 | mythirdcirc :: (Qubit, Qubit, Qubit) -> Circ (Qubit, Qubit, Qubit)
mythirdcirc (q1, q2, q3) = do
qnot_at q2 `controlled` q1
qnot_at q2 `controlled` q3
qnot_at q2 `controlled` q1
qnot_at q2 `controlled` q3
return (q1, q2, q3) | 244 | mythirdcirc (q1, q2, q3) = do
qnot_at q2 `controlled` q1
qnot_at q2 `controlled` q3
qnot_at q2 `controlled` q1
qnot_at q2 `controlled` q3
return (q1, q2, q3) | 177 | false | true | 0 | 8 | 55 | 111 | 60 | 51 | null | null |
hvr/lens | src/Control/Lens/Traversal.hs | bsd-3-clause | -- | Try to map a function which uses the index over this 'IndexedTraversal', failing if the 'IndexedTraversal' has no targets.
--
-- @
-- 'ifailover' :: Alternative m => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> m t
-- @
ifailover :: Alternative m => Over (Indexed i) ((,) Any) s t a b -> (i -> a -> b) -> s -> m t
ifailover l f = failover l (Indexed f) | 364 | ifailover :: Alternative m => Over (Indexed i) ((,) Any) s t a b -> (i -> a -> b) -> s -> m t
ifailover l f = failover l (Indexed f) | 132 | ifailover l f = failover l (Indexed f) | 38 | true | true | 0 | 10 | 81 | 93 | 48 | 45 | null | null |
rahulmutt/ghcvm | libraries/eta-meta/Language/Eta/Meta/Lib.hs | bsd-3-clause | java = Java | 16 | java = Java | 16 | java = Java | 16 | false | false | 0 | 4 | 7 | 6 | 3 | 3 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/SADF.hs | bsd-3-clause | nextStateFSM5 :: (Int, Int, Int, Int, Int) -> (s -> [a] -> [b] -> [c] -> [d] -> [e] -> s)
-> Signal s -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal s
nextStateFSM5 _ _ NullS _ _ _ _ _ = NullS | 229 | nextStateFSM5 :: (Int, Int, Int, Int, Int) -> (s -> [a] -> [b] -> [c] -> [d] -> [e] -> s)
-> Signal s -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal s
nextStateFSM5 _ _ NullS _ _ _ _ _ = NullS | 229 | nextStateFSM5 _ _ NullS _ _ _ _ _ = NullS | 41 | false | true | 0 | 15 | 66 | 143 | 72 | 71 | null | null |
ExNexu/Idris-dev | src/Idris/Error.hs | bsd-3-clause | tclift :: TC a -> Idris a
tclift (OK v) = return v | 50 | tclift :: TC a -> Idris a
tclift (OK v) = return v | 50 | tclift (OK v) = return v | 24 | false | true | 0 | 9 | 12 | 38 | 16 | 22 | null | null |
m-alvarez/scher-run | PrettyPrint.hs | mit | fromRawLine :: [String] -> (Path, String)
fromRawLine [name, _, content] = (path, element)
where path = splitOn "%" $ quoted name
element = drop (length "object 0: data: ") content
quoted = takeWhile (/= '\'') <$> tail <$> dropWhile (/= '\'') | 263 | fromRawLine :: [String] -> (Path, String)
fromRawLine [name, _, content] = (path, element)
where path = splitOn "%" $ quoted name
element = drop (length "object 0: data: ") content
quoted = takeWhile (/= '\'') <$> tail <$> dropWhile (/= '\'') | 263 | fromRawLine [name, _, content] = (path, element)
where path = splitOn "%" $ quoted name
element = drop (length "object 0: data: ") content
quoted = takeWhile (/= '\'') <$> tail <$> dropWhile (/= '\'') | 221 | false | true | 4 | 8 | 61 | 115 | 57 | 58 | null | null |
learn-something-new/functional-programming | partial-eval/href.hs | gpl-2.0 | -- buildURI creates a proper URI including protocol, host, port, and page
-- in: protocol (string), host (string), port (integer), page (string)
-- out: valid URI
buildURI :: String -> String -> Integer -> String -> String
buildURI a b c d = a ++ "://" ++ b ++ ":" ++ show c ++ "/" ++ d | 286 | buildURI :: String -> String -> Integer -> String -> String
buildURI a b c d = a ++ "://" ++ b ++ ":" ++ show c ++ "/" ++ d | 123 | buildURI a b c d = a ++ "://" ++ b ++ ":" ++ show c ++ "/" ++ d | 63 | true | true | 0 | 10 | 56 | 66 | 34 | 32 | null | null |
ssaavedra/liquidhaskell | tests/todo/Axiomatize.hs | bsd-3-clause | axiomatize :: Q [Dec] -> Q [Dec]
axiomatize q = do d <- q
let vts = [(x, t) | FunD x _ <- d, SigD y t <- d, x == y ]
ds <- mapM (axiomatizeOne vts) d
return $ concat ds | 222 | axiomatize :: Q [Dec] -> Q [Dec]
axiomatize q = do d <- q
let vts = [(x, t) | FunD x _ <- d, SigD y t <- d, x == y ]
ds <- mapM (axiomatizeOne vts) d
return $ concat ds | 222 | axiomatize q = do d <- q
let vts = [(x, t) | FunD x _ <- d, SigD y t <- d, x == y ]
ds <- mapM (axiomatizeOne vts) d
return $ concat ds | 189 | false | true | 0 | 14 | 97 | 122 | 57 | 65 | null | null |
facebookincubator/duckling | Duckling/Time/SV/Rules.hs | bsd-3-clause | ruleNextNCycle :: Rule
ruleNextNCycle = Rule
{ name = "next n <cycle>"
, pattern =
[ regex "nästa"
, Predicate $ isIntegerBetween 1 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain v
_ -> Nothing
} | 350 | ruleNextNCycle :: Rule
ruleNextNCycle = Rule
{ name = "next n <cycle>"
, pattern =
[ regex "nästa"
, Predicate $ isIntegerBetween 1 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain v
_ -> Nothing
} | 350 | ruleNextNCycle = Rule
{ name = "next n <cycle>"
, pattern =
[ regex "nästa"
, Predicate $ isIntegerBetween 1 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain v
_ -> Nothing
} | 327 | false | true | 0 | 16 | 106 | 124 | 63 | 61 | null | null |
riaqn/zhina-dns | src/Server.hs | bsd-3-clause | nameM = "Server" | 16 | nameM = "Server" | 16 | nameM = "Server" | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
sdiehl/ghc | libraries/base/GHC/IO/Handle.hs | bsd-3-clause | hIsSeekable :: Handle -> IO Bool
hIsSeekable handle =
withHandle_ "hIsSeekable" handle $ \ handle_@Handle__{..} -> do
case haType of
ClosedHandle -> ioe_closedHandle
SemiClosedHandle -> ioe_semiclosedHandle
AppendHandle -> return False
_ -> IODevice.isSeekable haDevice
-- -----------------------------------------------------------------------------
-- Changing echo status
-- | Set the echoing status of a handle connected to a terminal. | 512 | hIsSeekable :: Handle -> IO Bool
hIsSeekable handle =
withHandle_ "hIsSeekable" handle $ \ handle_@Handle__{..} -> do
case haType of
ClosedHandle -> ioe_closedHandle
SemiClosedHandle -> ioe_semiclosedHandle
AppendHandle -> return False
_ -> IODevice.isSeekable haDevice
-- -----------------------------------------------------------------------------
-- Changing echo status
-- | Set the echoing status of a handle connected to a terminal. | 512 | hIsSeekable handle =
withHandle_ "hIsSeekable" handle $ \ handle_@Handle__{..} -> do
case haType of
ClosedHandle -> ioe_closedHandle
SemiClosedHandle -> ioe_semiclosedHandle
AppendHandle -> return False
_ -> IODevice.isSeekable haDevice
-- -----------------------------------------------------------------------------
-- Changing echo status
-- | Set the echoing status of a handle connected to a terminal. | 479 | false | true | 0 | 14 | 125 | 92 | 44 | 48 | null | null |
iron-codegen/iron | library/Iron/Analyze/Halting.hs | bsd-3-clause | -- | Does an expression halt?
halts :: (Recursive t (Expr d b)) => t -> Halts
halts = cata $ \case
DeclRefExpr _ -> Yes
BoundRefExpr _ -> Yes
CallExpr f xs -> f .&&. auf _All foldMap id xs
LambdaExpr _ _ -> Yes
EvalExpr a b -> a .&&. b
DeferExpr _ -> Yes
ForceExpr x -> Maybe .&&. x
-- | Do all of the expressions halt? | 347 | halts :: (Recursive t (Expr d b)) => t -> Halts
halts = cata $ \case
DeclRefExpr _ -> Yes
BoundRefExpr _ -> Yes
CallExpr f xs -> f .&&. auf _All foldMap id xs
LambdaExpr _ _ -> Yes
EvalExpr a b -> a .&&. b
DeferExpr _ -> Yes
ForceExpr x -> Maybe .&&. x
-- | Do all of the expressions halt? | 317 | halts = cata $ \case
DeclRefExpr _ -> Yes
BoundRefExpr _ -> Yes
CallExpr f xs -> f .&&. auf _All foldMap id xs
LambdaExpr _ _ -> Yes
EvalExpr a b -> a .&&. b
DeferExpr _ -> Yes
ForceExpr x -> Maybe .&&. x
-- | Do all of the expressions halt? | 269 | true | true | 0 | 10 | 98 | 139 | 65 | 74 | null | null |
defunSM/SpecialRel | SpecialRelativity.hs | apache-2.0 | xlorentz :: Float -> Float -> Float -> Float -- Does a lorentz transformation for the space.
xlorentz speed x t = (gamma speed) * (x - (speed * t)) | 156 | xlorentz :: Float -> Float -> Float -> Float
xlorentz speed x t = (gamma speed) * (x - (speed * t)) | 99 | xlorentz speed x t = (gamma speed) * (x - (speed * t)) | 54 | true | true | 0 | 9 | 38 | 55 | 29 | 26 | null | null |
TomMD/ghc | compiler/main/DynFlags.hs | bsd-3-clause | hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg fn = HasArg (upd . fn) | 103 | hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
hasArg fn = HasArg (upd . fn) | 103 | hasArg fn = HasArg (upd . fn) | 29 | false | true | 0 | 9 | 17 | 53 | 25 | 28 | null | null |
enolan/pdxfunc-cis194 | test/Main.hs | bsd-3-clause | testCCNumber :: Bool -> Integer -> TestTree
testCCNumber shouldBe ccNum = testCase (show ccNum) $ assertBool msg good
where
good = validateCC ccNum == shouldBe
msg = if shouldBe
then "validateCC should've returned True but returned False"
else "validateCC should've returned False but returned True" | 313 | testCCNumber :: Bool -> Integer -> TestTree
testCCNumber shouldBe ccNum = testCase (show ccNum) $ assertBool msg good
where
good = validateCC ccNum == shouldBe
msg = if shouldBe
then "validateCC should've returned True but returned False"
else "validateCC should've returned False but returned True" | 313 | testCCNumber shouldBe ccNum = testCase (show ccNum) $ assertBool msg good
where
good = validateCC ccNum == shouldBe
msg = if shouldBe
then "validateCC should've returned True but returned False"
else "validateCC should've returned False but returned True" | 269 | false | true | 2 | 8 | 58 | 82 | 36 | 46 | null | null |
kowey/GenI | src/NLP/GenI/Console.hs | gpl-2.0 | allWarnings :: GeniResults -> [Text]
allWarnings res = concat
$ grGlobalWarnings res
: [ grWarnings s | GSuccess s <- grResults res ] | 141 | allWarnings :: GeniResults -> [Text]
allWarnings res = concat
$ grGlobalWarnings res
: [ grWarnings s | GSuccess s <- grResults res ] | 141 | allWarnings res = concat
$ grGlobalWarnings res
: [ grWarnings s | GSuccess s <- grResults res ] | 104 | false | true | 4 | 9 | 30 | 55 | 25 | 30 | null | null |
ublubu/streamstats | src/Streaming.hs | mit | byColumnType DoubleCol _ x = Right x | 36 | byColumnType DoubleCol _ x = Right x | 36 | byColumnType DoubleCol _ x = Right x | 36 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
gxtaillon/spot | src/lib/Language/SPO/Parser/PrimaryParser.hs | gpl-3.0 | getCurrentScopeKey :: PParser T.Text
getCurrentScopeKey = getState >>= return . psCurrent | 89 | getCurrentScopeKey :: PParser T.Text
getCurrentScopeKey = getState >>= return . psCurrent | 89 | getCurrentScopeKey = getState >>= return . psCurrent | 52 | false | true | 3 | 7 | 10 | 33 | 14 | 19 | null | null |
tjakway/ghcjvm | compiler/cmm/CLabel.hs | bsd-3-clause | pprCLbl (PlainModuleInitLabel mod)
= text "__stginit_" <> ppr mod | 68 | pprCLbl (PlainModuleInitLabel mod)
= text "__stginit_" <> ppr mod | 68 | pprCLbl (PlainModuleInitLabel mod)
= text "__stginit_" <> ppr mod | 68 | false | false | 2 | 6 | 11 | 27 | 11 | 16 | null | null |
kmate/HaRe | old/testing/subIntroPattern/SubSubPatternIn2.hs | bsd-3-clause | g x = 42 | 8 | g x = 42 | 8 | g x = 42 | 8 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
DavidAlphaFox/darcs | harness/Darcs/Test/Patch/Properties/Generic.hs | gpl-2.0 | effectPreserving :: (Patchy p, MightBeEmptyHunk p, RepoModel model, ApplyState p ~ RepoState model) =>
(forall wX wY . (p :> p) wX wY -> Maybe ((p :> p) wX wY))
-> WithState model (p :> p) wA wB -> TestResult
effectPreserving _ (WithState _ (x :> _) _) | isEmptyHunk x = rejected | 324 | effectPreserving :: (Patchy p, MightBeEmptyHunk p, RepoModel model, ApplyState p ~ RepoState model) =>
(forall wX wY . (p :> p) wX wY -> Maybe ((p :> p) wX wY))
-> WithState model (p :> p) wA wB -> TestResult
effectPreserving _ (WithState _ (x :> _) _) | isEmptyHunk x = rejected | 324 | effectPreserving _ (WithState _ (x :> _) _) | isEmptyHunk x = rejected | 70 | false | true | 0 | 14 | 97 | 144 | 72 | 72 | null | null |
intolerable/year-beast | src/Main.hs | bsd-3-clause | main :: IO ()
main = do
[user, pass] <- fmap Text.pack <$> System.getArgs
go user pass | 90 | main :: IO ()
main = do
[user, pass] <- fmap Text.pack <$> System.getArgs
go user pass | 90 | main = do
[user, pass] <- fmap Text.pack <$> System.getArgs
go user pass | 76 | false | true | 0 | 10 | 20 | 48 | 23 | 25 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F32.hs | bsd-3-clause | -- glVertexStream4ivATI --------------------------------------------------------
glVertexStream4ivATI
:: MonadIO m
=> GLenum -- ^ @stream@ of type [VertexStreamATI](Graphics-GL-Groups.html#VertexStreamATI).
-> Ptr GLint -- ^ @coords@ pointing to @4@ elements of type @GLint@.
-> m ()
glVertexStream4ivATI v1 v2 = liftIO $ dyn143 ptr_glVertexStream4ivATI v1 v2 | 368 | glVertexStream4ivATI
:: MonadIO m
=> GLenum -- ^ @stream@ of type [VertexStreamATI](Graphics-GL-Groups.html#VertexStreamATI).
-> Ptr GLint -- ^ @coords@ pointing to @4@ elements of type @GLint@.
-> m ()
glVertexStream4ivATI v1 v2 = liftIO $ dyn143 ptr_glVertexStream4ivATI v1 v2 | 286 | glVertexStream4ivATI v1 v2 = liftIO $ dyn143 ptr_glVertexStream4ivATI v1 v2 | 75 | true | true | 0 | 10 | 49 | 57 | 27 | 30 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcForeign.hs | bsd-3-clause | foreignDeclCtxt :: ForeignDecl Name -> SDoc
foreignDeclCtxt fo
= hang (str "When checking declaration:")
2 (ppr fo) | 124 | foreignDeclCtxt :: ForeignDecl Name -> SDoc
foreignDeclCtxt fo
= hang (str "When checking declaration:")
2 (ppr fo) | 124 | foreignDeclCtxt fo
= hang (str "When checking declaration:")
2 (ppr fo) | 80 | false | true | 0 | 7 | 25 | 40 | 19 | 21 | null | null |
shouya/thinking-dumps | transformer/trans.hs | mit | eval4 (Id v) = do env <- ask
tell ["i'm being looking up!"]
case M.lookup v env of
Just v -> tick >> return v
Nothing -> throwError ("var " ++ v ++
" not found meow~") | 311 | eval4 (Id v) = do env <- ask
tell ["i'm being looking up!"]
case M.lookup v env of
Just v -> tick >> return v
Nothing -> throwError ("var " ++ v ++
" not found meow~") | 311 | eval4 (Id v) = do env <- ask
tell ["i'm being looking up!"]
case M.lookup v env of
Just v -> tick >> return v
Nothing -> throwError ("var " ++ v ++
" not found meow~") | 311 | false | false | 0 | 13 | 180 | 81 | 37 | 44 | null | null |
samscott89/tamarin-prover | lib/theory/src/Theory.hs | gpl-3.0 | prettyDiffTheory :: HighlightDocument d
=> (sig -> d) -> (c -> d) -> ((Side, r2) -> d) -> (p -> d) -> (p2 -> d)
-> DiffTheory sig c OpenProtoRule r2 p p2 -> d
prettyDiffTheory ppSig ppCache ppRule ppDiffPrf ppPrf thy = vsep $
[ kwTheoryHeader $ text $ L.get diffThyName thy
, lineComment_ "Function signature and definition of the equational theory E"
, ppSig $ L.get diffThySignature thy
, ppCache $ L.get diffThyCacheLeft thy
, ppCache $ L.get diffThyCacheRight thy
, ppCache $ L.get diffThyDiffCacheLeft thy
, ppCache $ L.get diffThyDiffCacheRight thy
] ++
parMap rdeepseq ppItem (L.get diffThyItems thy) ++
[ kwEnd ]
where
ppItem = foldDiffTheoryItem
prettyDiffRule ppRule (prettyDiffLemma ppDiffPrf) (prettyEitherLemma ppPrf) prettyEitherAxiom (uncurry prettyFormalComment)
-- | Pretty print the lemma name together with its attributes. | 930 | prettyDiffTheory :: HighlightDocument d
=> (sig -> d) -> (c -> d) -> ((Side, r2) -> d) -> (p -> d) -> (p2 -> d)
-> DiffTheory sig c OpenProtoRule r2 p p2 -> d
prettyDiffTheory ppSig ppCache ppRule ppDiffPrf ppPrf thy = vsep $
[ kwTheoryHeader $ text $ L.get diffThyName thy
, lineComment_ "Function signature and definition of the equational theory E"
, ppSig $ L.get diffThySignature thy
, ppCache $ L.get diffThyCacheLeft thy
, ppCache $ L.get diffThyCacheRight thy
, ppCache $ L.get diffThyDiffCacheLeft thy
, ppCache $ L.get diffThyDiffCacheRight thy
] ++
parMap rdeepseq ppItem (L.get diffThyItems thy) ++
[ kwEnd ]
where
ppItem = foldDiffTheoryItem
prettyDiffRule ppRule (prettyDiffLemma ppDiffPrf) (prettyEitherLemma ppPrf) prettyEitherAxiom (uncurry prettyFormalComment)
-- | Pretty print the lemma name together with its attributes. | 930 | prettyDiffTheory ppSig ppCache ppRule ppDiffPrf ppPrf thy = vsep $
[ kwTheoryHeader $ text $ L.get diffThyName thy
, lineComment_ "Function signature and definition of the equational theory E"
, ppSig $ L.get diffThySignature thy
, ppCache $ L.get diffThyCacheLeft thy
, ppCache $ L.get diffThyCacheRight thy
, ppCache $ L.get diffThyDiffCacheLeft thy
, ppCache $ L.get diffThyDiffCacheRight thy
] ++
parMap rdeepseq ppItem (L.get diffThyItems thy) ++
[ kwEnd ]
where
ppItem = foldDiffTheoryItem
prettyDiffRule ppRule (prettyDiffLemma ppDiffPrf) (prettyEitherLemma ppPrf) prettyEitherAxiom (uncurry prettyFormalComment)
-- | Pretty print the lemma name together with its attributes. | 737 | false | true | 0 | 12 | 218 | 275 | 140 | 135 | null | null |
wxwxwwxxx/ghc | compiler/nativeGen/SPARC/Regs.hs | bsd-3-clause | -- Get the register class of a certain real reg
classOfRealReg :: RealReg -> RegClass
classOfRealReg reg
= case reg of
RealRegSingle i
| i < 32 -> RcInteger
| otherwise -> RcFloat
RealRegPair{} -> RcDouble
-- | regSqueeze_class reg
-- Calculuate the maximum number of register colors that could be
-- denied to a node of this class due to having this reg
-- as a neighbour.
--
| 465 | classOfRealReg :: RealReg -> RegClass
classOfRealReg reg
= case reg of
RealRegSingle i
| i < 32 -> RcInteger
| otherwise -> RcFloat
RealRegPair{} -> RcDouble
-- | regSqueeze_class reg
-- Calculuate the maximum number of register colors that could be
-- denied to a node of this class due to having this reg
-- as a neighbour.
--
| 417 | classOfRealReg reg
= case reg of
RealRegSingle i
| i < 32 -> RcInteger
| otherwise -> RcFloat
RealRegPair{} -> RcDouble
-- | regSqueeze_class reg
-- Calculuate the maximum number of register colors that could be
-- denied to a node of this class due to having this reg
-- as a neighbour.
--
| 379 | true | true | 0 | 11 | 157 | 66 | 34 | 32 | null | null |
brendanhay/gogol | gogol-admin-directory/gen/Network/Google/Resource/Directory/Resources/Calendars/Get.hs | mpl-2.0 | -- | V1 error format.
rcgXgafv :: Lens' ResourcesCalendarsGet (Maybe Xgafv)
rcgXgafv = lens _rcgXgafv (\ s a -> s{_rcgXgafv = a}) | 129 | rcgXgafv :: Lens' ResourcesCalendarsGet (Maybe Xgafv)
rcgXgafv = lens _rcgXgafv (\ s a -> s{_rcgXgafv = a}) | 107 | rcgXgafv = lens _rcgXgafv (\ s a -> s{_rcgXgafv = a}) | 53 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
aartamonau/haskell-barrier | tests/Control/Concurrent/Barrier/Test.hs | lgpl-3.0 | ------------------------------------------------------------------------------
tests :: [Test]
tests = [ testCase "wait" test_wait,
testCase "waitCount" test_waitCount
] | 192 | tests :: [Test]
tests = [ testCase "wait" test_wait,
testCase "waitCount" test_waitCount
] | 113 | tests = [ testCase "wait" test_wait,
testCase "waitCount" test_waitCount
] | 97 | true | true | 0 | 6 | 36 | 31 | 17 | 14 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | combCount :: String -> ControlPattern
combCount name = pStateF "comb" name (maybe 0 (+1)) | 89 | combCount :: String -> ControlPattern
combCount name = pStateF "comb" name (maybe 0 (+1)) | 89 | combCount name = pStateF "comb" name (maybe 0 (+1)) | 51 | false | true | 0 | 8 | 13 | 45 | 20 | 25 | null | null |
romanb/amazonka | amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/DescribeLogStreams.hs | mpl-2.0 | -- | Specifies what to order the returned log streams by. Valid arguments are
-- 'LogStreamName' or 'LastEventTime'. If you don't specify a value, results are
-- ordered by LogStreamName. If 'LastEventTime' is chosen, the request cannot
-- also contain a logStreamNamePrefix.
dls1OrderBy :: Lens' DescribeLogStreams (Maybe OrderBy)
dls1OrderBy = lens _dls1OrderBy (\s a -> s { _dls1OrderBy = a }) | 396 | dls1OrderBy :: Lens' DescribeLogStreams (Maybe OrderBy)
dls1OrderBy = lens _dls1OrderBy (\s a -> s { _dls1OrderBy = a }) | 120 | dls1OrderBy = lens _dls1OrderBy (\s a -> s { _dls1OrderBy = a }) | 64 | true | true | 0 | 9 | 60 | 49 | 28 | 21 | null | null |
urbanslug/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey | 94 | timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey | 94 | timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey | 94 | false | false | 0 | 7 | 16 | 19 | 9 | 10 | null | null |
jcgruenhage/dendrite | vendor/src/github.com/apache/thrift/test/hs/DebugProtoTest_Main.hs | apache-2.0 | client :: (String, Network.PortID) -> IO ()
client addr = do
to <- hOpen addr
let p = BinaryProtocol to
let ps = (p,p)
v1 <- SClient.janky ps 42
ThriftTestUtils.clientLog $ show v1
SClient.voidMethod ps
v2 <- SClient.primitiveMethod ps
ThriftTestUtils.clientLog $ show v2
v3 <- SClient.structMethod ps
ThriftTestUtils.clientLog $ show v3
SClient.methodWithDefaultArgs ps 42
SClient.onewayMethod ps
v4 <- IClient.identity ps 42
ThriftTestUtils.clientLog $ show v4
return () | 541 | client :: (String, Network.PortID) -> IO ()
client addr = do
to <- hOpen addr
let p = BinaryProtocol to
let ps = (p,p)
v1 <- SClient.janky ps 42
ThriftTestUtils.clientLog $ show v1
SClient.voidMethod ps
v2 <- SClient.primitiveMethod ps
ThriftTestUtils.clientLog $ show v2
v3 <- SClient.structMethod ps
ThriftTestUtils.clientLog $ show v3
SClient.methodWithDefaultArgs ps 42
SClient.onewayMethod ps
v4 <- IClient.identity ps 42
ThriftTestUtils.clientLog $ show v4
return () | 541 | client addr = do
to <- hOpen addr
let p = BinaryProtocol to
let ps = (p,p)
v1 <- SClient.janky ps 42
ThriftTestUtils.clientLog $ show v1
SClient.voidMethod ps
v2 <- SClient.primitiveMethod ps
ThriftTestUtils.clientLog $ show v2
v3 <- SClient.structMethod ps
ThriftTestUtils.clientLog $ show v3
SClient.methodWithDefaultArgs ps 42
SClient.onewayMethod ps
v4 <- IClient.identity ps 42
ThriftTestUtils.clientLog $ show v4
return () | 497 | false | true | 0 | 10 | 135 | 202 | 88 | 114 | null | null |
chrra/iCalendar | Text/ICalendar/Parser/Properties.hs | bsd-3-clause | -- | Parse geographic position. 3.8.1.6
parseGeo :: Content -> ContentParser Geo
parseGeo (ContentLine _ "GEO" o bs) = do
let (lat', long') = B.break (==';') bs
lat = maybeRead . stripPlus $ B.unpack lat' :: Maybe Float
long = maybeRead . stripPlus . B.unpack $ B.tail long' :: Maybe Float
when (B.null long' || isNothing (lat >> long)) .
throwError $ "Invalid latitude/longitude: " ++ show bs
return $ Geo (fromJust lat) (fromJust long) (toO o)
where stripPlus ('+':xs) = xs
stripPlus xs = xs | 539 | parseGeo :: Content -> ContentParser Geo
parseGeo (ContentLine _ "GEO" o bs) = do
let (lat', long') = B.break (==';') bs
lat = maybeRead . stripPlus $ B.unpack lat' :: Maybe Float
long = maybeRead . stripPlus . B.unpack $ B.tail long' :: Maybe Float
when (B.null long' || isNothing (lat >> long)) .
throwError $ "Invalid latitude/longitude: " ++ show bs
return $ Geo (fromJust lat) (fromJust long) (toO o)
where stripPlus ('+':xs) = xs
stripPlus xs = xs | 499 | parseGeo (ContentLine _ "GEO" o bs) = do
let (lat', long') = B.break (==';') bs
lat = maybeRead . stripPlus $ B.unpack lat' :: Maybe Float
long = maybeRead . stripPlus . B.unpack $ B.tail long' :: Maybe Float
when (B.null long' || isNothing (lat >> long)) .
throwError $ "Invalid latitude/longitude: " ++ show bs
return $ Geo (fromJust lat) (fromJust long) (toO o)
where stripPlus ('+':xs) = xs
stripPlus xs = xs | 458 | true | true | 1 | 15 | 131 | 225 | 107 | 118 | null | null |
mgsloan/ghcjs-jquery | JavaScript/JQuery.hs | mit | prependElem :: IsElement e => e -> JQuery -> IO JQuery
prependElem e jq = jq_prepend (coerce . unElement $ toElement e) jq | 122 | prependElem :: IsElement e => e -> JQuery -> IO JQuery
prependElem e jq = jq_prepend (coerce . unElement $ toElement e) jq | 122 | prependElem e jq = jq_prepend (coerce . unElement $ toElement e) jq | 67 | false | true | 0 | 8 | 22 | 53 | 25 | 28 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/BankersQueue.hs | bsd-3-clause | revfoldl f e (x:xs) = f (revfoldl f e xs) x | 43 | revfoldl f e (x:xs) = f (revfoldl f e xs) x | 43 | revfoldl f e (x:xs) = f (revfoldl f e xs) x | 43 | false | false | 0 | 7 | 10 | 35 | 17 | 18 | null | null |
mbrock/HBEAM | src/Language/Erlang/BEAM/Opcodes.hs | gpl-3.0 | opcodeInfo 78 = ("call_ext_only", 2) | 36 | opcodeInfo 78 = ("call_ext_only", 2) | 36 | opcodeInfo 78 = ("call_ext_only", 2) | 36 | false | false | 0 | 5 | 4 | 15 | 8 | 7 | null | null |
dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | The number of instances with 'stopping' status.
icStopping :: Lens' InstancesCount (Maybe Int)
icStopping = lens _icStopping (\s a -> s { _icStopping = a }) | 161 | icStopping :: Lens' InstancesCount (Maybe Int)
icStopping = lens _icStopping (\s a -> s { _icStopping = a }) | 108 | icStopping = lens _icStopping (\s a -> s { _icStopping = a }) | 61 | true | true | 0 | 9 | 27 | 46 | 25 | 21 | null | null |
Lythimus/lptv | sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Writers/OpenDocument.hs | gpl-2.0 | handleSpaces :: String -> Doc
handleSpaces s
| ( ' ':_) <- s = genTag s
| ('\t':x) <- s = selfClosingTag "text:tab" [] <> rm x
| otherwise = rm s
where
genTag = span (==' ') >>> tag . length *** rm >>> uncurry (<>)
tag n = when (n /= 0) $ selfClosingTag "text:s" [("text:c", show n)]
rm ( ' ':xs) = char ' ' <> genTag xs
rm ('\t':xs) = selfClosingTag "text:tab" [] <> genTag xs
rm ( x:xs) = char x <> rm xs
rm [] = empty
-- | Convert Pandoc document to string in OpenDocument format. | 576 | handleSpaces :: String -> Doc
handleSpaces s
| ( ' ':_) <- s = genTag s
| ('\t':x) <- s = selfClosingTag "text:tab" [] <> rm x
| otherwise = rm s
where
genTag = span (==' ') >>> tag . length *** rm >>> uncurry (<>)
tag n = when (n /= 0) $ selfClosingTag "text:s" [("text:c", show n)]
rm ( ' ':xs) = char ' ' <> genTag xs
rm ('\t':xs) = selfClosingTag "text:tab" [] <> genTag xs
rm ( x:xs) = char x <> rm xs
rm [] = empty
-- | Convert Pandoc document to string in OpenDocument format. | 576 | handleSpaces s
| ( ' ':_) <- s = genTag s
| ('\t':x) <- s = selfClosingTag "text:tab" [] <> rm x
| otherwise = rm s
where
genTag = span (==' ') >>> tag . length *** rm >>> uncurry (<>)
tag n = when (n /= 0) $ selfClosingTag "text:s" [("text:c", show n)]
rm ( ' ':xs) = char ' ' <> genTag xs
rm ('\t':xs) = selfClosingTag "text:tab" [] <> genTag xs
rm ( x:xs) = char x <> rm xs
rm [] = empty
-- | Convert Pandoc document to string in OpenDocument format. | 546 | false | true | 6 | 14 | 195 | 245 | 123 | 122 | null | null |
deepfire/mood | tests/FlexTest.hs | agpl-3.0 | test_align_self2 ∷ TestTree
test_align_self2 =
let r = node 100 100
[ leaf 50 25 & geo.align'self .~ AlignEnd
, leaf 50 25 & geo.align'self .~ AlignEnd
, leaf 50 25 & geo.align'self .~ AlignEnd
] & layout (mkSize 100 100)
in testGroup "align_self2"
[ testCase "child 0" $ r^.child 0.area @?= Area (mkLU 50 0) (mkSize 50 25)
, testCase "child 1" $ r^.child 1.area @?= Area (mkLU 50 25) (mkSize 50 25)
, testCase "child 2" $ r^.child 2.area @?= Area (mkLU 50 50) (mkSize 50 25)
] | 560 | test_align_self2 ∷ TestTree
test_align_self2 =
let r = node 100 100
[ leaf 50 25 & geo.align'self .~ AlignEnd
, leaf 50 25 & geo.align'self .~ AlignEnd
, leaf 50 25 & geo.align'self .~ AlignEnd
] & layout (mkSize 100 100)
in testGroup "align_self2"
[ testCase "child 0" $ r^.child 0.area @?= Area (mkLU 50 0) (mkSize 50 25)
, testCase "child 1" $ r^.child 1.area @?= Area (mkLU 50 25) (mkSize 50 25)
, testCase "child 2" $ r^.child 2.area @?= Area (mkLU 50 50) (mkSize 50 25)
] | 560 | test_align_self2 =
let r = node 100 100
[ leaf 50 25 & geo.align'self .~ AlignEnd
, leaf 50 25 & geo.align'self .~ AlignEnd
, leaf 50 25 & geo.align'self .~ AlignEnd
] & layout (mkSize 100 100)
in testGroup "align_self2"
[ testCase "child 0" $ r^.child 0.area @?= Area (mkLU 50 0) (mkSize 50 25)
, testCase "child 1" $ r^.child 1.area @?= Area (mkLU 50 25) (mkSize 50 25)
, testCase "child 2" $ r^.child 2.area @?= Area (mkLU 50 50) (mkSize 50 25)
] | 532 | false | true | 0 | 14 | 172 | 235 | 113 | 122 | null | null |
conal/GtkTV | src/test.hs | bsd-3-clause | tv6 :: GTV (R -> Bool -> String)
tv6 = tv (title "currying" o6) (curry show) | 77 | tv6 :: GTV (R -> Bool -> String)
tv6 = tv (title "currying" o6) (curry show) | 77 | tv6 = tv (title "currying" o6) (curry show) | 44 | false | true | 1 | 8 | 16 | 47 | 22 | 25 | null | null |
ardumont/haskell-lab | src/Prop.hs | gpl-2.0 | vars (Not b) = vars b | 25 | vars (Not b) = vars b | 25 | vars (Not b) = vars b | 25 | false | false | 0 | 6 | 9 | 19 | 8 | 11 | null | null |
palf/free-driver | packages/drive-slack/lib/Drive/Slack/Handlers.hs | bsd-3-clause | slackToDescribeI (SendMessage t m a) = a <$ D.debug ("to " <> Text.pack (show t) <> " -> sending message \"" <> m <> "\"") | 125 | slackToDescribeI (SendMessage t m a) = a <$ D.debug ("to " <> Text.pack (show t) <> " -> sending message \"" <> m <> "\"") | 125 | slackToDescribeI (SendMessage t m a) = a <$ D.debug ("to " <> Text.pack (show t) <> " -> sending message \"" <> m <> "\"") | 125 | false | false | 0 | 14 | 27 | 58 | 28 | 30 | null | null |
seagreen/hjsonschema | src/JSONSchema/Draft4.hs | mit | -- | Checks if a schema and a set of referenced schemas are valid.
--
-- Return a function to validate data.
checkSchema
:: FE.URISchemaMap Schema
-> SchemaWithURI Schema
-> Either SchemaInvalid (Value -> [ValidatorFailure])
checkSchema sm sw =
case NE.nonEmpty failures of
Just fs -> Left (SchemaInvalid fs)
Nothing -> Right (Spec.specValidate sm sw)
where
failures :: [(Maybe Text, NonEmpty ValidatorFailure)]
failures =
let refFailures = first Just <$> referencesValidity sm
in case NE.nonEmpty (schemaValidity (_swSchema sw)) of
Nothing -> refFailures
Just errs -> (Nothing,errs) : refFailures | 699 | checkSchema
:: FE.URISchemaMap Schema
-> SchemaWithURI Schema
-> Either SchemaInvalid (Value -> [ValidatorFailure])
checkSchema sm sw =
case NE.nonEmpty failures of
Just fs -> Left (SchemaInvalid fs)
Nothing -> Right (Spec.specValidate sm sw)
where
failures :: [(Maybe Text, NonEmpty ValidatorFailure)]
failures =
let refFailures = first Just <$> referencesValidity sm
in case NE.nonEmpty (schemaValidity (_swSchema sw)) of
Nothing -> refFailures
Just errs -> (Nothing,errs) : refFailures | 590 | checkSchema sm sw =
case NE.nonEmpty failures of
Just fs -> Left (SchemaInvalid fs)
Nothing -> Right (Spec.specValidate sm sw)
where
failures :: [(Maybe Text, NonEmpty ValidatorFailure)]
failures =
let refFailures = first Just <$> referencesValidity sm
in case NE.nonEmpty (schemaValidity (_swSchema sw)) of
Nothing -> refFailures
Just errs -> (Nothing,errs) : refFailures | 462 | true | true | 2 | 12 | 189 | 202 | 95 | 107 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.