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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GaloisInc/halvm-ghc | compiler/main/HscTypes.hs | bsd-3-clause | trustInfoToNum :: IfaceTrustInfo -> Word8
trustInfoToNum it
= case getSafeMode it of
Sf_None -> 0
Sf_Unsafe -> 1
Sf_Trustworthy -> 2
Sf_Safe -> 3 | 218 | trustInfoToNum :: IfaceTrustInfo -> Word8
trustInfoToNum it
= case getSafeMode it of
Sf_None -> 0
Sf_Unsafe -> 1
Sf_Trustworthy -> 2
Sf_Safe -> 3 | 218 | trustInfoToNum it
= case getSafeMode it of
Sf_None -> 0
Sf_Unsafe -> 1
Sf_Trustworthy -> 2
Sf_Safe -> 3 | 176 | false | true | 0 | 8 | 96 | 55 | 25 | 30 | null | null |
GaloisInc/verification-game | web-prover/exes/ComputeTasksLists.hs | bsd-3-clause | getTaskStats :: TaskGroupData -> TaskName -> TM LevelStats
getTaskStats tgd tiName =
do mbLevel <- io2 (\site a b -> X.try (loadTaskFrom site a b)) tgd tiName
case mbLevel of
Left X.SomeException {} ->
do fail ("Failed to load task: " ++ show tiName)
Right lvl -> return (levelStats lvl)
... | 410 | getTaskStats :: TaskGroupData -> TaskName -> TM LevelStats
getTaskStats tgd tiName =
do mbLevel <- io2 (\site a b -> X.try (loadTaskFrom site a b)) tgd tiName
case mbLevel of
Left X.SomeException {} ->
do fail ("Failed to load task: " ++ show tiName)
Right lvl -> return (levelStats lvl)
... | 410 | getTaskStats tgd tiName =
do mbLevel <- io2 (\site a b -> X.try (loadTaskFrom site a b)) tgd tiName
case mbLevel of
Left X.SomeException {} ->
do fail ("Failed to load task: " ++ show tiName)
Right lvl -> return (levelStats lvl)
-- | Get information about an individual task.
-- Returns... | 351 | false | true | 0 | 15 | 99 | 126 | 60 | 66 | null | null |
spechub/Hets | OWL2/XMLConversion.hs | gpl-2.0 | -- | makes a new element with the IRI as the text content
mwSimpleIRI :: IRI -> Element
mwSimpleIRI s = setName (if hasFullIRI s then iriK
else abbreviatedIRI) $ mwText $ showIRI
$ setReservedPrefix s | 252 | mwSimpleIRI :: IRI -> Element
mwSimpleIRI s = setName (if hasFullIRI s then iriK
else abbreviatedIRI) $ mwText $ showIRI
$ setReservedPrefix s | 194 | mwSimpleIRI s = setName (if hasFullIRI s then iriK
else abbreviatedIRI) $ mwText $ showIRI
$ setReservedPrefix s | 164 | true | true | 0 | 11 | 87 | 51 | 26 | 25 | null | null |
keera-studios/hsQt | Qtc/Gui/QStyleOptionHeader.hs | bsd-2-clause | setIconAlignment :: QStyleOptionHeader a -> ((Alignment)) -> IO ()
setIconAlignment x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionHeader_setIconAlignment cobj_x0 (toCLong $ qFlags_toInt x1) | 206 | setIconAlignment :: QStyleOptionHeader a -> ((Alignment)) -> IO ()
setIconAlignment x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionHeader_setIconAlignment cobj_x0 (toCLong $ qFlags_toInt x1) | 206 | setIconAlignment x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionHeader_setIconAlignment cobj_x0 (toCLong $ qFlags_toInt x1) | 139 | false | true | 0 | 10 | 29 | 68 | 34 | 34 | null | null |
ChristopheF/OpenCLTestFramework | Client/TestTools.hs | bsd-3-clause | -- | Comparison of two floating point numbers.
-- The relative error Dx/x can be set first the first argument.
-- When b is 0, we revert to the absolute error.
-- This code NEEDS REWORK to define the right way to compare floating point numbers
approx :: Double -> (Float,Float) -> Bool
approx e (a,b) = let da = realToF... | 455 | approx :: Double -> (Float,Float) -> Bool
approx e (a,b) = let da = realToFrac a :: Double
db = realToFrac b :: Double
m = max (abs da) (abs db) :: Double
in
a == b | 210 | approx e (a,b) = let da = realToFrac a :: Double
db = realToFrac b :: Double
m = max (abs da) (abs db) :: Double
in
a == b | 168 | true | true | 0 | 11 | 129 | 97 | 53 | 44 | null | null |
urbanslug/ghc | compiler/ghci/ByteCodeLink.hs | bsd-3-clause | lookupIE :: DynFlags -> ItblEnv -> Name -> IO (Ptr a)
lookupIE dflags ie con_nm
= case lookupNameEnv ie con_nm of
Just (_, a) -> return (castPtr (itblCode dflags a))
Nothing
-> do -- try looking up in the object files.
let sym_to_find1 = nameToCLabel con_nm "con_info"
... | 931 | lookupIE :: DynFlags -> ItblEnv -> Name -> IO (Ptr a)
lookupIE dflags ie con_nm
= case lookupNameEnv ie con_nm of
Just (_, a) -> return (castPtr (itblCode dflags a))
Nothing
-> do -- try looking up in the object files.
let sym_to_find1 = nameToCLabel con_nm "con_info"
... | 931 | lookupIE dflags ie con_nm
= case lookupNameEnv ie con_nm of
Just (_, a) -> return (castPtr (itblCode dflags a))
Nothing
-> do -- try looking up in the object files.
let sym_to_find1 = nameToCLabel con_nm "con_info"
m <- lookupSymbol sym_to_find1
... | 877 | false | true | 0 | 23 | 440 | 208 | 95 | 113 | null | null |
damianfral/clay | src/Clay/Color.hs | bsd-3-clause | peru = rgb 205 133 63 | 38 | peru = rgb 205 133 63 | 38 | peru = rgb 205 133 63 | 38 | false | false | 0 | 5 | 22 | 13 | 6 | 7 | null | null |
sanjoy/echoes | src/Codegen/Codegen.hs | gpl-3.0 | lirToMachineCode :: EchoesOptions -> (ClsrId -> Int) -> LFunction SSAVar ->
M [String]
lirToMachineCode opts argCounts (LFunction _ _ entry graph) = do
graphWithoutPhis <- eliminatePhi graph
(GMany NothingO lMap NothingO, stackSize) <- nullRegAlloc graphWithoutPhis
let blockList = postorder_df... | 1,095 | lirToMachineCode :: EchoesOptions -> (ClsrId -> Int) -> LFunction SSAVar ->
M [String]
lirToMachineCode opts argCounts (LFunction _ _ entry graph) = do
graphWithoutPhis <- eliminatePhi graph
(GMany NothingO lMap NothingO, stackSize) <- nullRegAlloc graphWithoutPhis
let blockList = postorder_df... | 1,095 | lirToMachineCode opts argCounts (LFunction _ _ entry graph) = do
graphWithoutPhis <- eliminatePhi graph
(GMany NothingO lMap NothingO, stackSize) <- nullRegAlloc graphWithoutPhis
let blockList = postorder_dfs_from lMap entry
allCode <- mapM showBlock blockList
let flatCode = concat allCode
return $ prologue... | 988 | false | true | 5 | 10 | 265 | 383 | 171 | 212 | null | null |
gencer/bond | compiler/src/Language/Bond/Codegen/CustomMapping.hs | mit | parseNamespaceMapping :: String -> Either (ParseError Char Void) NamespaceMapping
parseNamespaceMapping s = parse namespaceMapping "" s
where
namespaceMapping = NamespaceMapping <$> qualifiedName <* equal <*> qualifiedName | 228 | parseNamespaceMapping :: String -> Either (ParseError Char Void) NamespaceMapping
parseNamespaceMapping s = parse namespaceMapping "" s
where
namespaceMapping = NamespaceMapping <$> qualifiedName <* equal <*> qualifiedName | 228 | parseNamespaceMapping s = parse namespaceMapping "" s
where
namespaceMapping = NamespaceMapping <$> qualifiedName <* equal <*> qualifiedName | 146 | false | true | 0 | 8 | 31 | 58 | 28 | 30 | null | null |
mhwombat/creatur-realtra.OLD | src/ALife/Realtra/UnHaar.hs | bsd-3-clause | main :: IO ()
main = do
(infile:outfile:_) <- getArgs
(Right pss) <- fmap decode $ BS.readFile infile
:: IO (Either String [[Double]])
let pss2 = unHaar2D pss
let pss3 = map (map round) pss2
let h = length pss3
let w = length (head pss3)
let img = mkImage w h $ concat pss3
writeImage ou... | 329 | main :: IO ()
main = do
(infile:outfile:_) <- getArgs
(Right pss) <- fmap decode $ BS.readFile infile
:: IO (Either String [[Double]])
let pss2 = unHaar2D pss
let pss3 = map (map round) pss2
let h = length pss3
let w = length (head pss3)
let img = mkImage w h $ concat pss3
writeImage ou... | 329 | main = do
(infile:outfile:_) <- getArgs
(Right pss) <- fmap decode $ BS.readFile infile
:: IO (Either String [[Double]])
let pss2 = unHaar2D pss
let pss3 = map (map round) pss2
let h = length pss3
let w = length (head pss3)
let img = mkImage w h $ concat pss3
writeImage outfile img | 315 | false | true | 0 | 13 | 90 | 176 | 79 | 97 | null | null |
spinda/glyph-editor | app/Model.hs | gpl-3.0 | mapAt :: (a -> a) -> Int -> [a] -> [a]
mapAt f n xs = before ++ (f it : after)
where
(before, it : after) = splitAt n xs | 126 | mapAt :: (a -> a) -> Int -> [a] -> [a]
mapAt f n xs = before ++ (f it : after)
where
(before, it : after) = splitAt n xs | 126 | mapAt f n xs = before ++ (f it : after)
where
(before, it : after) = splitAt n xs | 87 | false | true | 0 | 8 | 36 | 80 | 42 | 38 | null | null |
tfausak/strive | source/library/Strive/Actions/Activities.hs | mit | updateActivity
:: Client
-> ActivityId
-> UpdateActivityOptions
-> IO (Result ActivityDetailed)
updateActivity client activityId options = put client resource query
where
resource = "api/v3/activities/" <> show activityId
query = toQuery options
-- | <http://strava.github.io/api/v3/activities/#delete> | 316 | updateActivity
:: Client
-> ActivityId
-> UpdateActivityOptions
-> IO (Result ActivityDetailed)
updateActivity client activityId options = put client resource query
where
resource = "api/v3/activities/" <> show activityId
query = toQuery options
-- | <http://strava.github.io/api/v3/activities/#delete> | 316 | updateActivity client activityId options = put client resource query
where
resource = "api/v3/activities/" <> show activityId
query = toQuery options
-- | <http://strava.github.io/api/v3/activities/#delete> | 212 | false | true | 2 | 11 | 47 | 81 | 35 | 46 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprPECategory NoTypeInTypeDC = text "Data constructor" | 54 | pprPECategory NoTypeInTypeDC = text "Data constructor" | 54 | pprPECategory NoTypeInTypeDC = text "Data constructor" | 54 | false | false | 1 | 5 | 5 | 16 | 5 | 11 | null | null |
masaedw/Yiki | Samples/PandocSample.hs | bsd-2-clause | main = getContents >>= putStrLn . markdownToHtml | 48 | main = getContents >>= putStrLn . markdownToHtml | 48 | main = getContents >>= putStrLn . markdownToHtml | 48 | false | false | 0 | 6 | 6 | 14 | 7 | 7 | null | null |
PierreR/streaming | benchmarks/old/Stream/Prelude/Folding.hs | bsd-3-clause | buildList :: Folding (Of a) Identity () -> [a]
buildList = \(Folding phi) -> buildList_ phi | 91 | buildList :: Folding (Of a) Identity () -> [a]
buildList = \(Folding phi) -> buildList_ phi | 91 | buildList = \(Folding phi) -> buildList_ phi | 44 | false | true | 0 | 8 | 15 | 47 | 24 | 23 | null | null |
nushio3/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | numClassKey = mkPreludeClassUnique 11 | 49 | numClassKey = mkPreludeClassUnique 11 | 49 | numClassKey = mkPreludeClassUnique 11 | 49 | false | false | 0 | 5 | 15 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionInstanceGroups/List.hs | mpl-2.0 | -- | Specifies a page token to use. Set \`pageToken\` to the
-- \`nextPageToken\` returned by a previous list request to get the next
-- page of results.
riglPageToken :: Lens' RegionInstanceGroupsList (Maybe Text)
riglPageToken
= lens _riglPageToken
(\ s a -> s{_riglPageToken = a}) | 291 | riglPageToken :: Lens' RegionInstanceGroupsList (Maybe Text)
riglPageToken
= lens _riglPageToken
(\ s a -> s{_riglPageToken = a}) | 137 | riglPageToken
= lens _riglPageToken
(\ s a -> s{_riglPageToken = a}) | 76 | true | true | 0 | 9 | 52 | 50 | 27 | 23 | null | null |
nushio3/ghc | compiler/types/Coercion.hs | bsd-3-clause | ty_co_subst :: LiftingContext -> Role -> Type -> Coercion
ty_co_subst lc role ty
= go role ty
where
go :: Role -> Type -> Coercion
go Phantom ty = lift_phantom ty
go r (TyVarTy tv) = expectJust "ty_co_subst bad roles" $
liftCoSubstTyVar lc r tv
go r (AppTy ... | 1,937 | ty_co_subst :: LiftingContext -> Role -> Type -> Coercion
ty_co_subst lc role ty
= go role ty
where
go :: Role -> Type -> Coercion
go Phantom ty = lift_phantom ty
go r (TyVarTy tv) = expectJust "ty_co_subst bad roles" $
liftCoSubstTyVar lc r tv
go r (AppTy ... | 1,937 | ty_co_subst lc role ty
= go role ty
where
go :: Role -> Type -> Coercion
go Phantom ty = lift_phantom ty
go r (TyVarTy tv) = expectJust "ty_co_subst bad roles" $
liftCoSubstTyVar lc r tv
go r (AppTy ty1 ty2) = mkAppCo (go r ty1) (go Nominal ty2)
go r ... | 1,879 | false | true | 0 | 9 | 670 | 494 | 243 | 251 | null | null |
harrisi/on-being-better | list-expansion/Haskell/course/src/Course/Parser.hs | cc0-1.0 | -- | Return a parser that tries the first parser for a successful value.
--
-- * If the first parser succeeds then use this parser.
--
-- * If the first parser fails, try the second parser.
--
-- >>> parse (character ||| valueParser 'v') ""
-- Result >< 'v'
--
-- >>> parse (failed ||| valueParser 'v') ""
-- Result ... | 562 | (|||) ::
Parser a
-> Parser a
-> Parser a
(|||) =
error "todo: Course.Parser#(|||)" | 91 | (|||) =
error "todo: Course.Parser#(|||)" | 43 | true | true | 0 | 8 | 116 | 57 | 36 | 21 | null | null |
spechub/Hets | MMT/XMLtoPT.hs | gpl-2.0 | getAttByNameR :: String -> Element -> Result String
getAttByNameR x e = let
maybeVal = findAttr QName
{qName = x, qURI = Nothing, qPrefix = Nothing}
e
in
case maybeVal of
Just str -> Result [] (Just str)
Nothing -> Result [] Nothing
{- TODO: a sho... | 601 | getAttByNameR :: String -> Element -> Result String
getAttByNameR x e = let
maybeVal = findAttr QName
{qName = x, qURI = Nothing, qPrefix = Nothing}
e
in
case maybeVal of
Just str -> Result [] (Just str)
Nothing -> Result [] Nothing
{- TODO: a sho... | 601 | getAttByNameR x e = let
maybeVal = findAttr QName
{qName = x, qURI = Nothing, qPrefix = Nothing}
e
in
case maybeVal of
Just str -> Result [] (Just str)
Nothing -> Result [] Nothing
{- TODO: a shorthand func that deals specifically with application... | 549 | false | true | 0 | 12 | 163 | 108 | 54 | 54 | null | null |
DominikDitoIvosevic/Uni | IRG/src/Irg/Lab4/Shading/Shading.hs | mit | intensityDiff :: V4 Float -> V4 Float -> Float
intensityDiff l n = backSurfaceLighting * ka + lightSourceIntensity * kd * (l `dot` n) | 133 | intensityDiff :: V4 Float -> V4 Float -> Float
intensityDiff l n = backSurfaceLighting * ka + lightSourceIntensity * kd * (l `dot` n) | 133 | intensityDiff l n = backSurfaceLighting * ka + lightSourceIntensity * kd * (l `dot` n) | 86 | false | true | 0 | 8 | 23 | 60 | 29 | 31 | null | null |
snoyberg/ghc | compiler/utils/Pretty.hs | bsd-3-clause | reduceAB :: Doc -> Doc
reduceAB (Above Empty _ q) = q | 54 | reduceAB :: Doc -> Doc
reduceAB (Above Empty _ q) = q | 54 | reduceAB (Above Empty _ q) = q | 31 | false | true | 0 | 7 | 12 | 28 | 14 | 14 | null | null |
winterland1989/stdio | System/IO/Exception.hs | bsd-3-clause | initResource create release = Resource $ do
r <- create
return $ (r, release r)
-- | Create 'Resource' from create and release action.
--
-- This function is useful when you want to add some initialization and clean up action
-- inside 'Resource' monad.
-- | 265 | initResource create release = Resource $ do
r <- create
return $ (r, release r)
-- | Create 'Resource' from create and release action.
--
-- This function is useful when you want to add some initialization and clean up action
-- inside 'Resource' monad.
-- | 265 | initResource create release = Resource $ do
r <- create
return $ (r, release r)
-- | Create 'Resource' from create and release action.
--
-- This function is useful when you want to add some initialization and clean up action
-- inside 'Resource' monad.
-- | 265 | false | false | 1 | 11 | 54 | 48 | 23 | 25 | null | null |
denisenkom/hspkcs11 | src/Bindings/Pkcs11/Attribs.hs | mit | _attrType (Token _) = TokenType | 31 | _attrType (Token _) = TokenType | 31 | _attrType (Token _) = TokenType | 31 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
tom-lpsd/tokyocabinet-haskell | Database/TokyoCabinet/Map.hs | bsd-3-clause | cutfront :: Map k v -> Int -> IO ()
cutfront m num = withForeignPtr (unMap m) $ flip c_tcmapcutfront (fromIntegral num) | 119 | cutfront :: Map k v -> Int -> IO ()
cutfront m num = withForeignPtr (unMap m) $ flip c_tcmapcutfront (fromIntegral num) | 119 | cutfront m num = withForeignPtr (unMap m) $ flip c_tcmapcutfront (fromIntegral num) | 83 | false | true | 0 | 8 | 21 | 62 | 28 | 34 | null | null |
Xingtao/RLHask | src/Chapter4DP.hs | bsd-3-clause | -- generate all states for multiple locations
generateStates :: [Int] -> [[Int]]
generateStates [] = [[]] | 105 | generateStates :: [Int] -> [[Int]]
generateStates [] = [[]] | 59 | generateStates [] = [[]] | 24 | true | true | 0 | 7 | 15 | 35 | 20 | 15 | null | null |
andrewthad/yesod-static-commons | src/Yesod/Static/Bootstrap.hs | bsd-3-clause | js_3_6 :: Route EmbeddedStatic
js_3_6 = bootstrap_3_3_6_js_bootstrap_js | 71 | js_3_6 :: Route EmbeddedStatic
js_3_6 = bootstrap_3_3_6_js_bootstrap_js | 71 | js_3_6 = bootstrap_3_3_6_js_bootstrap_js | 40 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
nevrenato/Hets_Fork | CASL/Freeness.hs | gpl-2.0 | homomorphy_term t = t | 21 | homomorphy_term t = t | 21 | homomorphy_term t = t | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
termite2/debug | Debug/DbgGUI.hs | bsd-3-clause | -- GUI manager
debugGUI :: (Rel c v a s, Vals b, Vals d) => [(RModel c a b d -> IO (View a b d), Bool)] -> Model c a b d -> IO ()
debugGUI extraFactories model = do
let ?m = mCtx model
let factories = viewFactories ++ extraFactories
rmodel <- newIORef $ mUpdateTRel model
-- Initialize GTK+ engine
_... | 2,923 | debugGUI :: (Rel c v a s, Vals b, Vals d) => [(RModel c a b d -> IO (View a b d), Bool)] -> Model c a b d -> IO ()
debugGUI extraFactories model = do
let ?m = mCtx model
let factories = viewFactories ++ extraFactories
rmodel <- newIORef $ mUpdateTRel model
-- Initialize GTK+ engine
_ <- G.initGUI
... | 2,908 | debugGUI extraFactories model = do
let ?m = mCtx model
let factories = viewFactories ++ extraFactories
rmodel <- newIORef $ mUpdateTRel model
-- Initialize GTK+ engine
_ <- G.initGUI
-- main window
wmain <- G.windowNew
G.windowSetDefaultSize wmain dbgDefaultWidth dbgDefaultHeight
... | 2,793 | true | true | 0 | 20 | 1,144 | 814 | 380 | 434 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | htKvmSpiceVideoStreamDetectionOff :: String
htKvmSpiceVideoStreamDetectionOff = "off" | 85 | htKvmSpiceVideoStreamDetectionOff :: String
htKvmSpiceVideoStreamDetectionOff = "off" | 85 | htKvmSpiceVideoStreamDetectionOff = "off" | 41 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
Mahdi89/eTeak | src/Print.hs | bsd-3-clause | binOpSymbol BinGE = ">=" | 24 | binOpSymbol BinGE = ">=" | 24 | binOpSymbol BinGE = ">=" | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | -- | Amount in the currency listed below. (In LITE projection.)
vsirpAmount :: Lens' VolumeSaleInfoRetailPrice (Maybe Double)
vsirpAmount
= lens _vsirpAmount (\ s a -> s{_vsirpAmount = a}) .
mapping _Coerce | 214 | vsirpAmount :: Lens' VolumeSaleInfoRetailPrice (Maybe Double)
vsirpAmount
= lens _vsirpAmount (\ s a -> s{_vsirpAmount = a}) .
mapping _Coerce | 150 | vsirpAmount
= lens _vsirpAmount (\ s a -> s{_vsirpAmount = a}) .
mapping _Coerce | 88 | true | true | 0 | 10 | 38 | 55 | 28 | 27 | null | null |
flowbox-public/imagemagick | Graphics/ImageMagick/MagickWand/PixelWand.hs | apache-2.0 | setColor :: (MonadResource m) => PPixelWand -> ByteString -> m ()
setColor p s = withException_ p $ useAsCString s (F.pixelSetColor p) | 134 | setColor :: (MonadResource m) => PPixelWand -> ByteString -> m ()
setColor p s = withException_ p $ useAsCString s (F.pixelSetColor p) | 134 | setColor p s = withException_ p $ useAsCString s (F.pixelSetColor p) | 68 | false | true | 0 | 10 | 21 | 62 | 29 | 33 | null | null |
giorgidze/HCodecs | src/Codec/Midi.hs | bsd-3-clause | parseMessages :: Maybe Message -> Parser (Track Ticks)
parseMessages mPreMsg = do
dt <- getVarLenBe >>= return . fromIntegral
msg <- parseMessage mPreMsg
if (isTrackEnd msg)
then return [(dt,msg)]
else do
let mMsg = if isChannelMessage msg then (Just msg) else mPreMsg
msgs <- parseMessages mMs... | 353 | parseMessages :: Maybe Message -> Parser (Track Ticks)
parseMessages mPreMsg = do
dt <- getVarLenBe >>= return . fromIntegral
msg <- parseMessage mPreMsg
if (isTrackEnd msg)
then return [(dt,msg)]
else do
let mMsg = if isChannelMessage msg then (Just msg) else mPreMsg
msgs <- parseMessages mMs... | 353 | parseMessages mPreMsg = do
dt <- getVarLenBe >>= return . fromIntegral
msg <- parseMessage mPreMsg
if (isTrackEnd msg)
then return [(dt,msg)]
else do
let mMsg = if isChannelMessage msg then (Just msg) else mPreMsg
msgs <- parseMessages mMsg
return $! (dt,msg) : msgs | 298 | false | true | 0 | 15 | 82 | 137 | 67 | 70 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/CodeGen/Flatten.hs | bsd-3-clause | real2prob x =
do x' <- localVar' SProb "r2p"
ifCG (x .<. (intE 0))
(do putExprStat $ printfE [ stringE "error: cannot coerce negative real to prob\n" ]
putExprStat $ mkCallE "abort" [] )
(putExprStat $ x' .=. (logE x))
return x' | 274 | real2prob x =
do x' <- localVar' SProb "r2p"
ifCG (x .<. (intE 0))
(do putExprStat $ printfE [ stringE "error: cannot coerce negative real to prob\n" ]
putExprStat $ mkCallE "abort" [] )
(putExprStat $ x' .=. (logE x))
return x' | 274 | real2prob x =
do x' <- localVar' SProb "r2p"
ifCG (x .<. (intE 0))
(do putExprStat $ printfE [ stringE "error: cannot coerce negative real to prob\n" ]
putExprStat $ mkCallE "abort" [] )
(putExprStat $ x' .=. (logE x))
return x' | 274 | false | false | 0 | 14 | 87 | 100 | 46 | 54 | null | null |
jkarni/aeson | Data/Aeson/Encode/Builder.hs | bsd-3-clause | -- | Encode a JSON number.
number :: Scientific -> Builder
number s
| e < 0 = scientificBuilder s
| otherwise = B.integerDec (coefficient s * 10 ^ e)
where
e = base10Exponent s | 194 | number :: Scientific -> Builder
number s
| e < 0 = scientificBuilder s
| otherwise = B.integerDec (coefficient s * 10 ^ e)
where
e = base10Exponent s | 167 | number s
| e < 0 = scientificBuilder s
| otherwise = B.integerDec (coefficient s * 10 ^ e)
where
e = base10Exponent s | 135 | true | true | 1 | 8 | 52 | 82 | 35 | 47 | null | null |
alphaHeavy/cabal | cabal-install/Distribution/Client/Dependency/Modular/Message.hs | bsd-3-clause | showFR _ GlobalConstraintInstalled = " (global constraint requires installed instance)" | 92 | showFR _ GlobalConstraintInstalled = " (global constraint requires installed instance)" | 92 | showFR _ GlobalConstraintInstalled = " (global constraint requires installed instance)" | 92 | false | false | 0 | 5 | 14 | 11 | 5 | 6 | null | null |
jgm/pandoc2 | Text/Pandoc2/Writer/HTML.hs | gpl-2.0 | inlineToHtml (Strikeout ils) = H.del <$> inlinesToHtml ils | 58 | inlineToHtml (Strikeout ils) = H.del <$> inlinesToHtml ils | 58 | inlineToHtml (Strikeout ils) = H.del <$> inlinesToHtml ils | 58 | false | false | 0 | 7 | 7 | 24 | 11 | 13 | null | null |
DavidEichmann/GameGeometry | app/Main.hs | bsd-3-clause | main :: IO ()
main = return () | 30 | main :: IO ()
main = return () | 30 | main = return () | 16 | false | true | 0 | 7 | 7 | 27 | 11 | 16 | null | null |
Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/Parser/Token.hs | bsd-3-clause | -- | Parse a forall (@forall@ or @∀@)
_forall :: Parser CharacterSet
_forall =
(Unicode <$ char '∀' <?> "\"∀\"")
<|> (ASCII <$ text "forall" <?> "forall") | 166 | _forall :: Parser CharacterSet
_forall =
(Unicode <$ char '∀' <?> "\"∀\"")
<|> (ASCII <$ text "forall" <?> "forall") | 128 | _forall =
(Unicode <$ char '∀' <?> "\"∀\"")
<|> (ASCII <$ text "forall" <?> "forall") | 97 | true | true | 3 | 9 | 38 | 56 | 27 | 29 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Options/All.hs | gpl-2.0 | -- | TODO: see issue2395
onlyToFiles :: PrimDarcsOption Bool
onlyToFiles = withDefault False
[ RawNoArg [] ["only-to-files"] F.OnlyChangesToFiles True
"show only changes to specified files"
, RawNoArg [] ["no-only-to-files"] F.ChangesToAllFiles False
"show changes to all files" ] | 292 | onlyToFiles :: PrimDarcsOption Bool
onlyToFiles = withDefault False
[ RawNoArg [] ["only-to-files"] F.OnlyChangesToFiles True
"show only changes to specified files"
, RawNoArg [] ["no-only-to-files"] F.ChangesToAllFiles False
"show changes to all files" ] | 267 | onlyToFiles = withDefault False
[ RawNoArg [] ["only-to-files"] F.OnlyChangesToFiles True
"show only changes to specified files"
, RawNoArg [] ["no-only-to-files"] F.ChangesToAllFiles False
"show changes to all files" ] | 231 | true | true | 0 | 7 | 48 | 63 | 32 | 31 | null | null |
Vetii/SCFDMA | src/Model.hs | mit | utility :: Bandwidth -> NPSD -> GainF -> (Block -> PowerF) -> UtilityF
utility (Bandwidth b) (NPSD npsd) gainF powF = UtilityF (\u block@(Block channels) ->
let power = getPower (powF block) u
gain = getGain gainF u
pRatio = fromDecibel npsd
f' c = b * (logBase 2 (1 + ((power c) * ... | 380 | utility :: Bandwidth -> NPSD -> GainF -> (Block -> PowerF) -> UtilityF
utility (Bandwidth b) (NPSD npsd) gainF powF = UtilityF (\u block@(Block channels) ->
let power = getPower (powF block) u
gain = getGain gainF u
pRatio = fromDecibel npsd
f' c = b * (logBase 2 (1 + ((power c) * ... | 380 | utility (Bandwidth b) (NPSD npsd) gainF powF = UtilityF (\u block@(Block channels) ->
let power = getPower (powF block) u
gain = getGain gainF u
pRatio = fromDecibel npsd
f' c = b * (logBase 2 (1 + ((power c) * (gain c)) / (pRatio * b)))
in sum (Set.map f' channels)) | 309 | false | true | 0 | 21 | 106 | 192 | 96 | 96 | null | null |
tty/joy-of-coding | solutions/Mp3.hs | bsd-3-clause | testDb2 = addRecord (mp3ToProplist mp32) testDb | 47 | testDb2 = addRecord (mp3ToProplist mp32) testDb | 47 | testDb2 = addRecord (mp3ToProplist mp32) testDb | 47 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
romanb/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | The array's mount point.
raMountPoint :: Lens' RaidArray (Maybe Text)
raMountPoint = lens _raMountPoint (\s a -> s { _raMountPoint = a }) | 142 | raMountPoint :: Lens' RaidArray (Maybe Text)
raMountPoint = lens _raMountPoint (\s a -> s { _raMountPoint = a }) | 112 | raMountPoint = lens _raMountPoint (\s a -> s { _raMountPoint = a }) | 67 | true | true | 0 | 9 | 24 | 46 | 25 | 21 | null | null |
thalerjonathan/phd | public/towards/SugarScape/experimental/chapter2_environment/src/SugarScape/Discrete.hs | gpl-3.0 | updateCellsWithCoordsM :: MonadState (Discrete2d c) m
=> (Discrete2dCell c -> c)
-> m ()
updateCellsWithCoordsM f = state (\e -> ((), updateCellsWithCoords f e)) | 208 | updateCellsWithCoordsM :: MonadState (Discrete2d c) m
=> (Discrete2dCell c -> c)
-> m ()
updateCellsWithCoordsM f = state (\e -> ((), updateCellsWithCoords f e)) | 208 | updateCellsWithCoordsM f = state (\e -> ((), updateCellsWithCoords f e)) | 72 | false | true | 0 | 10 | 70 | 76 | 37 | 39 | null | null |
seni/copilot-libraries | src/Copilot/Library/Utils.hs | bsd-3-clause | nscanr :: ( Typed a )
=> Int -> ( Stream a -> Stream b -> Stream b )
-> Stream b -> Stream a -> [ Stream b ]
nscanr n f e s = scanr f e $ take n s | 166 | nscanr :: ( Typed a )
=> Int -> ( Stream a -> Stream b -> Stream b )
-> Stream b -> Stream a -> [ Stream b ]
nscanr n f e s = scanr f e $ take n s | 166 | nscanr n f e s = scanr f e $ take n s | 37 | false | true | 2 | 13 | 62 | 100 | 44 | 56 | null | null |
plumlife/cabal | Cabal/tests/PackageTests/TestSuiteExeV10/Check.hs | bsd-3-clause | shouldExist :: FilePath -> Assertion
shouldExist path = doesFileExist path >>= assertBool (path ++ " should exist") | 115 | shouldExist :: FilePath -> Assertion
shouldExist path = doesFileExist path >>= assertBool (path ++ " should exist") | 115 | shouldExist path = doesFileExist path >>= assertBool (path ++ " should exist") | 78 | false | true | 0 | 8 | 16 | 35 | 17 | 18 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/src/C2HS/Gen/Bind.hs | mit | applyUnary _ CNegOp (IntResult x) =
let r = toInteger . fromEnum $ (x == 0)
in return (IntResult r) | 112 | applyUnary _ CNegOp (IntResult x) =
let r = toInteger . fromEnum $ (x == 0)
in return (IntResult r) | 112 | applyUnary _ CNegOp (IntResult x) =
let r = toInteger . fromEnum $ (x == 0)
in return (IntResult r) | 112 | false | false | 0 | 11 | 32 | 54 | 26 | 28 | null | null |
rfranek/duckling | Duckling/Time/SV/Rules.hs | bsd-3-clause | ruleBetweenTimeofdayAndTimeofdayInterval :: Rule
ruleBetweenTimeofdayAndTimeofdayInterval = Rule
{ name = "between <time-of-day> and <time-of-day> (interval)"
, pattern =
[ regex "mellan"
, Predicate isATimeOfDay
, regex "och"
, Predicate isATimeOfDay
]
, prod = \tokens -> case tokens of
... | 437 | ruleBetweenTimeofdayAndTimeofdayInterval :: Rule
ruleBetweenTimeofdayAndTimeofdayInterval = Rule
{ name = "between <time-of-day> and <time-of-day> (interval)"
, pattern =
[ regex "mellan"
, Predicate isATimeOfDay
, regex "och"
, Predicate isATimeOfDay
]
, prod = \tokens -> case tokens of
... | 437 | ruleBetweenTimeofdayAndTimeofdayInterval = Rule
{ name = "between <time-of-day> and <time-of-day> (interval)"
, pattern =
[ regex "mellan"
, Predicate isATimeOfDay
, regex "och"
, Predicate isATimeOfDay
]
, prod = \tokens -> case tokens of
(_:Token Time td1:_:Token Time td2:_) ->
... | 388 | false | true | 0 | 17 | 102 | 125 | 64 | 61 | null | null |
mikusp/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen.hs | bsd-3-clause | codegenPrimConst (PrimMaxBound ty) = codegenMaxBound ty | 55 | codegenPrimConst (PrimMaxBound ty) = codegenMaxBound ty | 55 | codegenPrimConst (PrimMaxBound ty) = codegenMaxBound ty | 55 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
nushio3/ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | exeFileName :: Bool -> DynFlags -> FilePath
exeFileName staticLink dflags
| Just s <- outputFile dflags =
case platformOS (targetPlatform dflags) of
OSMinGW32 -> s <?.> "exe"
_ -> if staticLink
then s <?.> "a"
else s
| otherwise =
... | 573 | exeFileName :: Bool -> DynFlags -> FilePath
exeFileName staticLink dflags
| Just s <- outputFile dflags =
case platformOS (targetPlatform dflags) of
OSMinGW32 -> s <?.> "exe"
_ -> if staticLink
then s <?.> "a"
else s
| otherwise =
... | 573 | exeFileName staticLink dflags
| Just s <- outputFile dflags =
case platformOS (targetPlatform dflags) of
OSMinGW32 -> s <?.> "exe"
_ -> if staticLink
then s <?.> "a"
else s
| otherwise =
if platformOS (targetPlatform dflags) =... | 529 | false | true | 5 | 10 | 230 | 159 | 77 | 82 | null | null |
byorgey/Idris-dev | src/RTS/BCParser.hs | bsd-3-clause | integer = PTok.integer lexer | 30 | integer = PTok.integer lexer | 30 | integer = PTok.integer lexer | 30 | false | false | 1 | 6 | 5 | 14 | 5 | 9 | null | null |
mainland/dph | dph-prim-par/Data/Array/Parallel/Unlifted.hs | bsd-3-clause | indices_s segd
= let arr = UPSegd.indicesP segd
in tracePrim (TraceIndices_s (Seq.length arr)) arr | 109 | indices_s segd
= let arr = UPSegd.indicesP segd
in tracePrim (TraceIndices_s (Seq.length arr)) arr | 109 | indices_s segd
= let arr = UPSegd.indicesP segd
in tracePrim (TraceIndices_s (Seq.length arr)) arr | 109 | false | false | 0 | 12 | 24 | 44 | 20 | 24 | null | null |
merijn/parsers | src/Text/Parser/Char.hs | bsd-3-clause | -- | @oneOf cs@ succeeds if the current character is in the supplied
-- list of characters @cs@. Returns the parsed character. See also
-- 'satisfy'.
--
-- > vowel = oneOf "aeiou"
oneOf :: CharParsing m => [Char] -> m Char
oneOf xs = oneOfSet (CharSet.fromList xs) | 267 | oneOf :: CharParsing m => [Char] -> m Char
oneOf xs = oneOfSet (CharSet.fromList xs) | 84 | oneOf xs = oneOfSet (CharSet.fromList xs) | 41 | true | true | 0 | 8 | 50 | 47 | 25 | 22 | null | null |
dmjio/aeson | src/Data/Aeson/TH.hs | bsd-3-clause | wrongPairCountFail :: String -> String -> Parser fail
wrongPairCountFail t n =
fail $ printf "When parsing %s expected an Object with a single tag/contents pair but got %s pairs."
t n | 205 | wrongPairCountFail :: String -> String -> Parser fail
wrongPairCountFail t n =
fail $ printf "When parsing %s expected an Object with a single tag/contents pair but got %s pairs."
t n | 205 | wrongPairCountFail t n =
fail $ printf "When parsing %s expected an Object with a single tag/contents pair but got %s pairs."
t n | 151 | false | true | 0 | 7 | 53 | 38 | 18 | 20 | null | null |
cchens/courseography | hs/Database/JsonParser.hs | gpl-3.0 | -- | Inserts a tutorial into the Tutorials table associated with a given
-- session and course code.
insertTut :: MonadIO m => T.Text -> T.Text-> Tutorial -> ReaderT SqlBackend m ()
insertTut session code tutorial =
insert_ $ Tutorials code
(tutorialSection tutorial)
... | 422 | insertTut :: MonadIO m => T.Text -> T.Text-> Tutorial -> ReaderT SqlBackend m ()
insertTut session code tutorial =
insert_ $ Tutorials code
(tutorialSection tutorial)
session
(map Time (times tutorial))
(timeStr tutorial... | 321 | insertTut session code tutorial =
insert_ $ Tutorials code
(tutorialSection tutorial)
session
(map Time (times tutorial))
(timeStr tutorial) | 240 | true | true | 0 | 10 | 149 | 93 | 46 | 47 | null | null |
nevrenato/Hets_Fork | CMDL/ProveCommands.hs | gpl-2.0 | cTranslate :: String -> CmdlState -> IO CmdlState
cTranslate input state =
case i_state $ intState state of
-- nothing selected !
Nothing -> return $ genErrorMsg "Nothing selected" state
Just pS ->
-- parse the comorphism name
case lookupComorphism_in_LG $ trim input of
Result _ Nothing -> return $ gen... | 1,113 | cTranslate :: String -> CmdlState -> IO CmdlState
cTranslate input state =
case i_state $ intState state of
-- nothing selected !
Nothing -> return $ genErrorMsg "Nothing selected" state
Just pS ->
-- parse the comorphism name
case lookupComorphism_in_LG $ trim input of
Result _ Nothing -> return $ gen... | 1,113 | cTranslate input state =
case i_state $ intState state of
-- nothing selected !
Nothing -> return $ genErrorMsg "Nothing selected" state
Just pS ->
-- parse the comorphism name
case lookupComorphism_in_LG $ trim input of
Result _ Nothing -> return $ genErrorMsg "Wrong comorphism name" state
Result ... | 1,063 | false | true | 0 | 26 | 412 | 263 | 125 | 138 | null | null |
cje/system-log-transform | src/Parser.hs | cc0-1.0 | datetime :: Parser Datetime
datetime = do d <- date
AP.skipSpace
t <- time
return $ Datetime (d::Date) (t::Time)
-- Date -- | 173 | datetime :: Parser Datetime
datetime = do d <- date
AP.skipSpace
t <- time
return $ Datetime (d::Date) (t::Time)
-- Date -- | 171 | datetime = do d <- date
AP.skipSpace
t <- time
return $ Datetime (d::Date) (t::Time)
-- Date -- | 143 | false | true | 1 | 10 | 71 | 62 | 29 | 33 | null | null |
sardonicpresence/glucose | src/Glucose/Parser.hs | mit | parse :: (MonadThrow (ParseError Location (FromSource Token)) m) => Location -> [FromSource Token] -> m Module
parse eofLocation = runParser parser (maybeEOF eofLocation startLocation) where
parser = Module <$> many ((definition <|> typeDefinition) <* endOfDefinition) <* eof | 279 | parse :: (MonadThrow (ParseError Location (FromSource Token)) m) => Location -> [FromSource Token] -> m Module
parse eofLocation = runParser parser (maybeEOF eofLocation startLocation) where
parser = Module <$> many ((definition <|> typeDefinition) <* endOfDefinition) <* eof | 278 | parse eofLocation = runParser parser (maybeEOF eofLocation startLocation) where
parser = Module <$> many ((definition <|> typeDefinition) <* endOfDefinition) <* eof | 167 | false | true | 0 | 13 | 40 | 101 | 51 | 50 | null | null |
davidfontenot/haskell-hashtag-viewer | src/TwitterPoller.hs | mit | dbFile :: String
dbFile = "tweets.db" | 37 | dbFile :: String
dbFile = "tweets.db" | 37 | dbFile = "tweets.db" | 20 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
rvion/ride | jetpack/src/Data/Map/Strict/AsMap.hs | bsd-3-clause | -- map_assocs :: forall k a. Map k a -> [(k, a)]
map_assocs = I.assocs | 70 | map_assocs = I.assocs | 21 | map_assocs = I.assocs | 21 | true | false | 1 | 6 | 14 | 13 | 5 | 8 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Runtime/IOSource.hs | mit | doc2SpecialFormEmbedInlineId = constructorNamed doc2SpecialFormRef "Doc2.SpecialForm.EmbedInline" | 97 | doc2SpecialFormEmbedInlineId = constructorNamed doc2SpecialFormRef "Doc2.SpecialForm.EmbedInline" | 97 | doc2SpecialFormEmbedInlineId = constructorNamed doc2SpecialFormRef "Doc2.SpecialForm.EmbedInline" | 97 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
jonathan-laurent/copilot-kind | src/Copilot/Kind/Light/Prover.hs | bsd-3-clause | selectProps :: [PropId] -> Map PropId Constraint -> [Constraint]
selectProps propIds properties =
[c | (id, c) <- Map.toList properties, id `elem` propIds] | 158 | selectProps :: [PropId] -> Map PropId Constraint -> [Constraint]
selectProps propIds properties =
[c | (id, c) <- Map.toList properties, id `elem` propIds] | 158 | selectProps propIds properties =
[c | (id, c) <- Map.toList properties, id `elem` propIds] | 93 | false | true | 0 | 9 | 25 | 67 | 36 | 31 | null | null |
giogadi/hs-motion-planning | lib-src/Planners/RRT.hs | mit | nodeState (Node s _) = s | 24 | nodeState (Node s _) = s | 24 | nodeState (Node s _) = s | 24 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
dagit/helisp | src/X86_32Regs.hs | bsd-3-clause | ebp :: Reg32
ebp = Ebp | 22 | ebp :: Reg32
ebp = Ebp | 22 | ebp = Ebp | 9 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
urbanslug/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isListCompExpr (ParStmtCtxt c) = isListCompExpr c | 51 | isListCompExpr (ParStmtCtxt c) = isListCompExpr c | 51 | isListCompExpr (ParStmtCtxt c) = isListCompExpr c | 51 | false | false | 0 | 7 | 7 | 18 | 8 | 10 | null | null |
thomie/vector | tests/Tests/Vector.hs | bsd-3-clause | testMonadFunctions :: forall a v. (COMMON_CONTEXT(a, v), Monad v) => v a -> [Test]
testMonadFunctions _ = $(testProperties
[ 'prop_return, 'prop_bind ])
where
prop_return :: P (a -> v a) = return `eq` return
prop_bind :: P (v a -> (a -> v a) -> v a) = (>>=) `eq` (>>=) | 282 | testMonadFunctions :: forall a v. (COMMON_CONTEXT(a, v), Monad v) => v a -> [Test]
testMonadFunctions _ = $(testProperties
[ 'prop_return, 'prop_bind ])
where
prop_return :: P (a -> v a) = return `eq` return
prop_bind :: P (v a -> (a -> v a) -> v a) = (>>=) `eq` (>>=) | 282 | testMonadFunctions _ = $(testProperties
[ 'prop_return, 'prop_bind ])
where
prop_return :: P (a -> v a) = return `eq` return
prop_bind :: P (v a -> (a -> v a) -> v a) = (>>=) `eq` (>>=) | 199 | false | true | 6 | 11 | 64 | 146 | 80 | 66 | null | null |
maximilianhuber/univOpWrap | src/System/UnivOpWrap/Logic/HeuristikA.hs | bsd-3-clause | matchStringM :: String -> MData -> MData
matchStringM [] = id | 65 | matchStringM :: String -> MData -> MData
matchStringM [] = id | 65 | matchStringM [] = id | 24 | false | true | 0 | 6 | 14 | 24 | 12 | 12 | null | null |
Philonous/pontarius-xmpp | source/Network/Xmpp/Stanza.hs | bsd-3-clause | -- | Request subscription with an entity.
presenceSubscribe :: Jid -> Presence
presenceSubscribe to' = presence { presenceTo = Just to'
, presenceType = Subscribe
} | 230 | presenceSubscribe :: Jid -> Presence
presenceSubscribe to' = presence { presenceTo = Just to'
, presenceType = Subscribe
} | 188 | presenceSubscribe to' = presence { presenceTo = Just to'
, presenceType = Subscribe
} | 151 | true | true | 0 | 7 | 91 | 36 | 20 | 16 | null | null |
johanneshilden/principle | Trombone/Dispatch/Db.hs | bsd-3-clause | persistValToJsonVal (PersistDouble d) = Number $ fromFloatDigits d | 70 | persistValToJsonVal (PersistDouble d) = Number $ fromFloatDigits d | 70 | persistValToJsonVal (PersistDouble d) = Number $ fromFloatDigits d | 70 | false | false | 0 | 6 | 11 | 23 | 10 | 13 | null | null |
NorfairKing/the-notes | src/MachineLearning/SupervisedLearning/Main.hs | gpl-2.0 | lossFunctionExamples :: Note
lossFunctionExamples = do
let (x, y) = ("x", "y")
ex $ do
s [the, quadraticLoss', function]
ma $ func2 lf_ reals reals realsp x y $ (pars $ (y - x)) ^: 2
ex $ do
s [the, defineTerm "0-1 loss", function, "is", m 1, "whenever the arguments differ and", m 0,... | 595 | lossFunctionExamples :: Note
lossFunctionExamples = do
let (x, y) = ("x", "y")
ex $ do
s [the, quadraticLoss', function]
ma $ func2 lf_ reals reals realsp x y $ (pars $ (y - x)) ^: 2
ex $ do
s [the, defineTerm "0-1 loss", function, "is", m 1, "whenever the arguments differ and", m 0,... | 595 | lossFunctionExamples = do
let (x, y) = ("x", "y")
ex $ do
s [the, quadraticLoss', function]
ma $ func2 lf_ reals reals realsp x y $ (pars $ (y - x)) ^: 2
ex $ do
s [the, defineTerm "0-1 loss", function, "is", m 1, "whenever the arguments differ and", m 0, " otherwise"]
ma $ f... | 566 | false | true | 0 | 16 | 182 | 284 | 143 | 141 | null | null |
tonymorris/story-board | src/Graphics/Storyboard/Tile.hs | bsd-3-clause | tileWidth :: Tile a -> Double
tileWidth (Tile (w,_) _) = w | 58 | tileWidth :: Tile a -> Double
tileWidth (Tile (w,_) _) = w | 58 | tileWidth (Tile (w,_) _) = w | 28 | false | true | 0 | 8 | 11 | 35 | 18 | 17 | null | null |
narrative/stack | src/Stack/Types/Config.hs | bsd-3-clause | -- | Relative directory for the platform identifier
platformOnlyRelDir
:: (MonadReader env m, HasPlatform env, MonadThrow m)
=> m (Path Rel Dir)
platformOnlyRelDir = do
platform <- asks getPlatform
platformVariant <- asks getPlatformVariant
parseRelDir (Distribution.Text.display platform ++ platform... | 387 | platformOnlyRelDir
:: (MonadReader env m, HasPlatform env, MonadThrow m)
=> m (Path Rel Dir)
platformOnlyRelDir = do
platform <- asks getPlatform
platformVariant <- asks getPlatformVariant
parseRelDir (Distribution.Text.display platform ++ platformVariantSuffix platformVariant)
-- | Directory conta... | 335 | platformOnlyRelDir = do
platform <- asks getPlatform
platformVariant <- asks getPlatformVariant
parseRelDir (Distribution.Text.display platform ++ platformVariantSuffix platformVariant)
-- | Directory containing snapshots | 234 | true | true | 0 | 12 | 64 | 93 | 44 | 49 | null | null |
rafaelbfs/enumgen | src/EnumGen/EnumParser.hs | apache-2.0 | maybeid:: Parser EnumIdType
maybeid = fromMaybe Auto <$> optionMaybe ((string "Manual" *> return Manual) <|> (string "Auto" *> return Auto) <|> (string "Seq" *> parseSeq)) | 171 | maybeid:: Parser EnumIdType
maybeid = fromMaybe Auto <$> optionMaybe ((string "Manual" *> return Manual) <|> (string "Auto" *> return Auto) <|> (string "Seq" *> parseSeq)) | 171 | maybeid = fromMaybe Auto <$> optionMaybe ((string "Manual" *> return Manual) <|> (string "Auto" *> return Auto) <|> (string "Seq" *> parseSeq)) | 143 | false | true | 2 | 11 | 24 | 78 | 35 | 43 | null | null |
kim/amazonka | amazonka-autoscaling/gen/Network/AWS/AutoScaling/PutScheduledUpdateGroupAction.hs | mpl-2.0 | -- | The time for this action to start, as in '--start-time 2010-06-01T00:00:00Z'.
--
-- If you try to schedule your action in the past, Auto Scaling returns an
-- error message.
--
-- When 'StartTime' and 'EndTime' are specified with 'Recurrence', they form the
-- boundaries of when the recurring action will start and... | 486 | psugaStartTime :: Lens' PutScheduledUpdateGroupAction (Maybe UTCTime)
psugaStartTime = lens _psugaStartTime (\s a -> s { _psugaStartTime = a }) . mapping _Time | 159 | psugaStartTime = lens _psugaStartTime (\s a -> s { _psugaStartTime = a }) . mapping _Time | 89 | true | true | 0 | 10 | 77 | 59 | 34 | 25 | null | null |
da-x/ghc | libraries/base/GHC/Enum.hs | bsd-3-clause | boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
boundedEnumFrom n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)] | 130 | boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
boundedEnumFrom n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)] | 130 | boundedEnumFrom n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)] | 79 | false | true | 0 | 9 | 21 | 62 | 33 | 29 | null | null |
rueshyna/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/VariantSets/Patch.hs | mpl-2.0 | -- | V1 error format.
vspXgafv :: Lens' VariantSetsPatch (Maybe Xgafv)
vspXgafv = lens _vspXgafv (\ s a -> s{_vspXgafv = a}) | 124 | vspXgafv :: Lens' VariantSetsPatch (Maybe Xgafv)
vspXgafv = lens _vspXgafv (\ s a -> s{_vspXgafv = a}) | 102 | vspXgafv = lens _vspXgafv (\ s a -> s{_vspXgafv = a}) | 53 | true | true | 2 | 9 | 21 | 55 | 25 | 30 | null | null |
dysinger/amazonka | amazonka-ssm/gen/Network/AWS/SSM/DescribeAssociation.hs | mpl-2.0 | -- | The ID of the instance.
daInstanceId :: Lens' DescribeAssociation Text
daInstanceId = lens _daInstanceId (\s a -> s { _daInstanceId = a }) | 143 | daInstanceId :: Lens' DescribeAssociation Text
daInstanceId = lens _daInstanceId (\s a -> s { _daInstanceId = a }) | 114 | daInstanceId = lens _daInstanceId (\s a -> s { _daInstanceId = a }) | 67 | true | true | 0 | 9 | 24 | 40 | 22 | 18 | null | null |
brooksbp/P4 | src/compiler/CodeGen.hs | apache-2.0 | cInstances (ArrayInstanceDecl hdrTy name cnt) = [
[csdecl|struct $id:hdrTy $id:name[$int:(c2i cnt)];|]
, [csdecl|int $id:(name ++ "_valid")[$int:(c2i cnt)];|]
, [csdecl|int $id:(name ++ "_idx");|]
] | 208 | cInstances (ArrayInstanceDecl hdrTy name cnt) = [
[csdecl|struct $id:hdrTy $id:name[$int:(c2i cnt)];|]
, [csdecl|int $id:(name ++ "_valid")[$int:(c2i cnt)];|]
, [csdecl|int $id:(name ++ "_idx");|]
] | 208 | cInstances (ArrayInstanceDecl hdrTy name cnt) = [
[csdecl|struct $id:hdrTy $id:name[$int:(c2i cnt)];|]
, [csdecl|int $id:(name ++ "_valid")[$int:(c2i cnt)];|]
, [csdecl|int $id:(name ++ "_idx");|]
] | 208 | false | false | 0 | 7 | 32 | 40 | 27 | 13 | null | null |
scolobb/fgl | Data/Graph/Inductive/Query/MST.hs | bsd-3-clause | prim h g =
case match v g of
(Just c,g') -> p:prim (H.mergeAll (h':newEdges p c)) g'
(Nothing,g') -> prim h' g'
where (_,p@(LP ((v,_):_)),h') = H.splitMin h | 183 | prim h g =
case match v g of
(Just c,g') -> p:prim (H.mergeAll (h':newEdges p c)) g'
(Nothing,g') -> prim h' g'
where (_,p@(LP ((v,_):_)),h') = H.splitMin h | 183 | prim h g =
case match v g of
(Just c,g') -> p:prim (H.mergeAll (h':newEdges p c)) g'
(Nothing,g') -> prim h' g'
where (_,p@(LP ((v,_):_)),h') = H.splitMin h | 183 | false | false | 0 | 14 | 55 | 125 | 65 | 60 | null | null |
rzil/honours | LeavittPathAlgebras/WeightedLPA.hs | mit | showMapping graph = putStrLn $ unlines (zipWith (\a b -> a ++ " --> " ++ b) (map show non_nods) (map show non_nods_reduced))
where
twos = map (pathToNormalForm graph) $ S.toList $ paths (doubleGraph (directedGraphAssociatedToWeightedGraph graph)) 2
non_nods = filter (not . isNodPath graph) twos
non_nods_reduced ... | 396 | showMapping graph = putStrLn $ unlines (zipWith (\a b -> a ++ " --> " ++ b) (map show non_nods) (map show non_nods_reduced))
where
twos = map (pathToNormalForm graph) $ S.toList $ paths (doubleGraph (directedGraphAssociatedToWeightedGraph graph)) 2
non_nods = filter (not . isNodPath graph) twos
non_nods_reduced ... | 396 | showMapping graph = putStrLn $ unlines (zipWith (\a b -> a ++ " --> " ++ b) (map show non_nods) (map show non_nods_reduced))
where
twos = map (pathToNormalForm graph) $ S.toList $ paths (doubleGraph (directedGraphAssociatedToWeightedGraph graph)) 2
non_nods = filter (not . isNodPath graph) twos
non_nods_reduced ... | 396 | false | false | 10 | 10 | 64 | 162 | 72 | 90 | null | null |
siddhanathan/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcTyFamInsts (FunTy ty1 ty2) = tcTyFamInsts ty1 ++ tcTyFamInsts ty2 | 70 | tcTyFamInsts (FunTy ty1 ty2) = tcTyFamInsts ty1 ++ tcTyFamInsts ty2 | 70 | tcTyFamInsts (FunTy ty1 ty2) = tcTyFamInsts ty1 ++ tcTyFamInsts ty2 | 70 | false | false | 0 | 7 | 12 | 27 | 12 | 15 | null | null |
siddhanathan/yi | yi-frontend-vty/src/Yi/Frontend/Vty/Conversions.hs | gpl-2.0 | fromVtyEvent _ = error "fromVtyEvent: unsupported event encountered." | 69 | fromVtyEvent _ = error "fromVtyEvent: unsupported event encountered." | 69 | fromVtyEvent _ = error "fromVtyEvent: unsupported event encountered." | 69 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Codebase/Branch.hs | mit | deepEdits' :: Branch0 m -> Map Name (EditHash, m Patch)
deepEdits' b = go id b where
-- can change this to an actual prefix once Name is a [NameSegment]
go :: (Name -> Name) -> Branch0 m -> Map Name (EditHash, m Patch)
go addPrefix Branch0{..} =
Map.mapKeysMonotonic (addPrefix . Name.fromSegment) _edits
... | 507 | deepEdits' :: Branch0 m -> Map Name (EditHash, m Patch)
deepEdits' b = go id b where
-- can change this to an actual prefix once Name is a [NameSegment]
go :: (Name -> Name) -> Branch0 m -> Map Name (EditHash, m Patch)
go addPrefix Branch0{..} =
Map.mapKeysMonotonic (addPrefix . Name.fromSegment) _edits
... | 507 | deepEdits' b = go id b where
-- can change this to an actual prefix once Name is a [NameSegment]
go :: (Name -> Name) -> Branch0 m -> Map Name (EditHash, m Patch)
go addPrefix Branch0{..} =
Map.mapKeysMonotonic (addPrefix . Name.fromSegment) _edits
<> foldMap f (Map.toList _children)
where
f :: ... | 451 | false | true | 0 | 13 | 110 | 207 | 105 | 102 | null | null |
uduki/hsQt | Qtc/Enums/Network/QFtp.hs | bsd-2-clause | eMkdir :: Command
eMkdir
= ieCommand $ 11 | 43 | eMkdir :: Command
eMkdir
= ieCommand $ 11 | 43 | eMkdir
= ieCommand $ 11 | 25 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
thoughtpolice/vacuum | src/GHC/Vacuum.hs | lgpl-3.0 | getHVal :: HNodeId -> H HValue
getHVal i = do
-- the following pattern match is important: it evaluates the lookup
-- without evaluating x itself
Box x <- (IM.! i) `fmap` gets hvals
return x | 206 | getHVal :: HNodeId -> H HValue
getHVal i = do
-- the following pattern match is important: it evaluates the lookup
-- without evaluating x itself
Box x <- (IM.! i) `fmap` gets hvals
return x | 206 | getHVal i = do
-- the following pattern match is important: it evaluates the lookup
-- without evaluating x itself
Box x <- (IM.! i) `fmap` gets hvals
return x | 175 | false | true | 0 | 9 | 51 | 54 | 27 | 27 | null | null |
Dlackware/dlackware | test/Slackware/InfoSpec.hs | gpl-3.0 | infoDownload1 :: ByteString
infoDownload1 = "PKGNAM=\"pkgnam\"\n\
\VERSION=\"1.2.3\"\n\
\HOMEPAGE=\"homepage\"\n\
\DOWNLOAD=\"https://dlackware.com/download.tar.gz\"\n\
\MD5SUM=\"0102030405060708090a0b0c0d0e0f10\"\n" | 232 | infoDownload1 :: ByteString
infoDownload1 = "PKGNAM=\"pkgnam\"\n\
\VERSION=\"1.2.3\"\n\
\HOMEPAGE=\"homepage\"\n\
\DOWNLOAD=\"https://dlackware.com/download.tar.gz\"\n\
\MD5SUM=\"0102030405060708090a0b0c0d0e0f10\"\n" | 232 | infoDownload1 = "PKGNAM=\"pkgnam\"\n\
\VERSION=\"1.2.3\"\n\
\HOMEPAGE=\"homepage\"\n\
\DOWNLOAD=\"https://dlackware.com/download.tar.gz\"\n\
\MD5SUM=\"0102030405060708090a0b0c0d0e0f10\"\n" | 204 | false | true | 0 | 4 | 25 | 11 | 6 | 5 | null | null |
everyevery/programming_study | algospot/palindromize/palindromize.hs | mit | simple :: String -> Int
simple [] = 0 | 37 | simple :: String -> Int
simple [] = 0 | 37 | simple [] = 0 | 13 | false | true | 0 | 6 | 8 | 20 | 10 | 10 | null | null |
shicks/shsh | System/Console/ShSh/Shell.hs | bsd-3-clause | withErrorsPrefixed :: String -> ShellT e a -> ShellT e a
withErrorsPrefixed s = withErrors $ prefixError s | 106 | withErrorsPrefixed :: String -> ShellT e a -> ShellT e a
withErrorsPrefixed s = withErrors $ prefixError s | 106 | withErrorsPrefixed s = withErrors $ prefixError s | 49 | false | true | 2 | 8 | 17 | 44 | 19 | 25 | null | null |
massysett/rewrite | rewrite.hs | bsd-3-clause | runProgram
:: Maybe Backup
-> InputFile
-- ^ Name of input file
-> ProgName
-> [ProgramOpt]
-> IO ()
runProgram mayBak inFile pn opts = do
input <- BS.readFile inFile
(code, out) <- readProcess pn opts input
_ <- case code of
Exit.ExitSuccess -> return ()
Exit.ExitFailure bad ->
errE... | 2,204 | runProgram
:: Maybe Backup
-> InputFile
-- ^ Name of input file
-> ProgName
-> [ProgramOpt]
-> IO ()
runProgram mayBak inFile pn opts = do
input <- BS.readFile inFile
(code, out) <- readProcess pn opts input
_ <- case code of
Exit.ExitSuccess -> return ()
Exit.ExitFailure bad ->
errE... | 2,204 | runProgram mayBak inFile pn opts = do
input <- BS.readFile inFile
(code, out) <- readProcess pn opts input
_ <- case code of
Exit.ExitSuccess -> return ()
Exit.ExitFailure bad ->
errExit $ "program " ++ pn ++ " exited with code "
++ show bad
_ <- case mayBak of
Nothing -> retur... | 2,087 | false | true | 0 | 15 | 449 | 226 | 126 | 100 | null | null |
bionikspoon/playing-with-haskell---learnyouahaskell | functions.hs | mit | nouns :: [String]
nouns = ["hobo","frog","pope"] | 48 | nouns :: [String]
nouns = ["hobo","frog","pope"] | 48 | nouns = ["hobo","frog","pope"] | 30 | false | true | 0 | 7 | 5 | 30 | 15 | 15 | null | null |
qpliu/esolang | DGOL/hs/compiler/CodeGen/Runtime.hs | gpl-3.0 | addEdgeImpl :: ModuleBuilder Operand
addEdgeImpl = function addEdgeName [(pNodeType,NoParameterName),(pNodeType,NoParameterName)] void $ \ [node,edge] -> mdo
alreadyHasEdge <- call hasEdge [node,edge]
condBr alreadyHasEdge done initLoop
initLoop <- block
edgeArraySizePtr <- gep node [intConst 32 0,intC... | 2,935 | addEdgeImpl :: ModuleBuilder Operand
addEdgeImpl = function addEdgeName [(pNodeType,NoParameterName),(pNodeType,NoParameterName)] void $ \ [node,edge] -> mdo
alreadyHasEdge <- call hasEdge [node,edge]
condBr alreadyHasEdge done initLoop
initLoop <- block
edgeArraySizePtr <- gep node [intConst 32 0,intC... | 2,935 | addEdgeImpl = function addEdgeName [(pNodeType,NoParameterName),(pNodeType,NoParameterName)] void $ \ [node,edge] -> mdo
alreadyHasEdge <- call hasEdge [node,edge]
condBr alreadyHasEdge done initLoop
initLoop <- block
edgeArraySizePtr <- gep node [intConst 32 0,intConst 32 2]
-- workaround for
... | 2,898 | false | true | 0 | 13 | 563 | 763 | 363 | 400 | null | null |
guilt/webify | src/TTF.hs | mit | cmapStart CmapFormat6{c6FirstCode = firstCode} = fromIntegral firstCode | 71 | cmapStart CmapFormat6{c6FirstCode = firstCode} = fromIntegral firstCode | 71 | cmapStart CmapFormat6{c6FirstCode = firstCode} = fromIntegral firstCode | 71 | false | false | 0 | 8 | 6 | 21 | 10 | 11 | null | null |
christiaanb/cabal | Cabal/Distribution/Simple/PackageIndex.hs | bsd-3-clause | merge :: PackageInstalled a => PackageIndex a -> PackageIndex a -> PackageIndex a
merge (PackageIndex pids1 pnames1) (PackageIndex pids2 pnames2) =
mkPackageIndex (Map.unionWith (\_ y -> y) pids1 pids2)
(Map.unionWith (Map.unionWith mergeBuckets) pnames1 pnames2)
where
-- Packages in the second... | 665 | merge :: PackageInstalled a => PackageIndex a -> PackageIndex a -> PackageIndex a
merge (PackageIndex pids1 pnames1) (PackageIndex pids2 pnames2) =
mkPackageIndex (Map.unionWith (\_ y -> y) pids1 pids2)
(Map.unionWith (Map.unionWith mergeBuckets) pnames1 pnames2)
where
-- Packages in the second... | 665 | merge (PackageIndex pids1 pnames1) (PackageIndex pids2 pnames2) =
mkPackageIndex (Map.unionWith (\_ y -> y) pids1 pids2)
(Map.unionWith (Map.unionWith mergeBuckets) pnames1 pnames2)
where
-- Packages in the second list mask those in the first, however preferred
-- packages go first in the l... | 583 | false | true | 1 | 11 | 136 | 157 | 79 | 78 | null | null |
brendanhay/gogol | gogol-fusiontables/gen/Network/Google/FusionTables/Types/Product.hs | mpl-2.0 | -- | Column-value, gradient, or bucket styler that is used to determine the
-- interior color and opacity of the polygon.
psFillColorStyler :: Lens' PolygonStyle (Maybe StyleFunction)
psFillColorStyler
= lens _psFillColorStyler
(\ s a -> s{_psFillColorStyler = a}) | 272 | psFillColorStyler :: Lens' PolygonStyle (Maybe StyleFunction)
psFillColorStyler
= lens _psFillColorStyler
(\ s a -> s{_psFillColorStyler = a}) | 150 | psFillColorStyler
= lens _psFillColorStyler
(\ s a -> s{_psFillColorStyler = a}) | 88 | true | true | 1 | 9 | 45 | 52 | 26 | 26 | null | null |
clockworkdevstudio/Idlewild-Lang | CompilerData.hs | bsd-2-clause | debug_abbrev_ = "h debug_abbrev" | 32 | debug_abbrev_ = "h debug_abbrev" | 32 | debug_abbrev_ = "h debug_abbrev" | 32 | false | false | 1 | 5 | 3 | 10 | 3 | 7 | null | null |
lifengsun/haskell-exercise | scheme/05/listparser.hs | gpl-3.0 | eval (List [Atom "if", pred, conseq, alt]) = do
b <- eval pred
case b of
Bool False -> eval alt
otherwise -> eval conseq | 132 | eval (List [Atom "if", pred, conseq, alt]) = do
b <- eval pred
case b of
Bool False -> eval alt
otherwise -> eval conseq | 132 | eval (List [Atom "if", pred, conseq, alt]) = do
b <- eval pred
case b of
Bool False -> eval alt
otherwise -> eval conseq | 132 | false | false | 0 | 10 | 36 | 68 | 32 | 36 | null | null |
TomMD/cryptol | sbv/Data/SBV/BitVectors/Model.hs | bsd-3-clause | -- | Generate a finite constant bitvector
genLiteral :: Integral a => Kind -> a -> SBV b
genLiteral k = SBV k . Left . mkConstCW k | 130 | genLiteral :: Integral a => Kind -> a -> SBV b
genLiteral k = SBV k . Left . mkConstCW k | 88 | genLiteral k = SBV k . Left . mkConstCW k | 41 | true | true | 1 | 9 | 27 | 52 | 23 | 29 | null | null |
masatoko/protonic | src/Protonic/Core.hs | bsd-3-clause | -- Start scene
runScene :: Scene g a -> ProtoT ()
runScene scn0 = do
goScene scn0
gets execScene >>= \case
Nothing -> return ()
Just exec -> do
modify' $ \pst -> pst {execScene = Nothing}
exec | 217 | runScene :: Scene g a -> ProtoT ()
runScene scn0 = do
goScene scn0
gets execScene >>= \case
Nothing -> return ()
Just exec -> do
modify' $ \pst -> pst {execScene = Nothing}
exec | 202 | runScene scn0 = do
goScene scn0
gets execScene >>= \case
Nothing -> return ()
Just exec -> do
modify' $ \pst -> pst {execScene = Nothing}
exec | 167 | true | true | 0 | 16 | 62 | 95 | 43 | 52 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/TysPrim.hs | bsd-3-clause | addrPrimTy :: Type
addrPrimTy = mkTyConTy addrPrimTyCon | 60 | addrPrimTy :: Type
addrPrimTy = mkTyConTy addrPrimTyCon | 60 | addrPrimTy = mkTyConTy addrPrimTyCon | 41 | false | true | 0 | 5 | 11 | 14 | 7 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.