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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bjornbm/leapseconds-announced | tests/Test.hs | bsd-3-clause | -- A few trivial tests.
main :: IO ()
main = do
onceCheck $ lst (fromGregorian 1111 12 31) == Just 0 -- Before first leap second.
onceCheck $ lst (fromGregorian 2008 12 31) == Just 33
onceCheck $ lst (fromGregorian 2009 01 01) == Just 34
onceCheck $ lst (fromGregorian 2009 12 31) == Just 34
onceCheck $ lst (fromGregorian 2012 06 30) == Just 34
onceCheck $ lst (fromGregorian 2012 07 01) == Just 35
onceCheck $ lst (fromGregorian 2012 12 31) == Just 35
onceCheck $ lst (fromGregorian 2016 12 31) == Just 36 -- Prior to last leap second.
onceCheck $ lst (fromGregorian 2017 01 01) == Just 37 -- Last leap second.
onceCheck $ lst (fromGregorian 2017 12 31) == Just 37 -- Beyond last leap second. | 719 | main :: IO ()
main = do
onceCheck $ lst (fromGregorian 1111 12 31) == Just 0 -- Before first leap second.
onceCheck $ lst (fromGregorian 2008 12 31) == Just 33
onceCheck $ lst (fromGregorian 2009 01 01) == Just 34
onceCheck $ lst (fromGregorian 2009 12 31) == Just 34
onceCheck $ lst (fromGregorian 2012 06 30) == Just 34
onceCheck $ lst (fromGregorian 2012 07 01) == Just 35
onceCheck $ lst (fromGregorian 2012 12 31) == Just 35
onceCheck $ lst (fromGregorian 2016 12 31) == Just 36 -- Prior to last leap second.
onceCheck $ lst (fromGregorian 2017 01 01) == Just 37 -- Last leap second.
onceCheck $ lst (fromGregorian 2017 12 31) == Just 37 -- Beyond last leap second. | 695 | main = do
onceCheck $ lst (fromGregorian 1111 12 31) == Just 0 -- Before first leap second.
onceCheck $ lst (fromGregorian 2008 12 31) == Just 33
onceCheck $ lst (fromGregorian 2009 01 01) == Just 34
onceCheck $ lst (fromGregorian 2009 12 31) == Just 34
onceCheck $ lst (fromGregorian 2012 06 30) == Just 34
onceCheck $ lst (fromGregorian 2012 07 01) == Just 35
onceCheck $ lst (fromGregorian 2012 12 31) == Just 35
onceCheck $ lst (fromGregorian 2016 12 31) == Just 36 -- Prior to last leap second.
onceCheck $ lst (fromGregorian 2017 01 01) == Just 37 -- Last leap second.
onceCheck $ lst (fromGregorian 2017 12 31) == Just 37 -- Beyond last leap second. | 681 | true | true | 0 | 11 | 156 | 291 | 133 | 158 | null | null |
BeautifulDestinations/Simple-SVM | AI/SVM/Simple.hs | bsd-3-clause | trainClassifier
:: (SVMVector b, Ord a, Foldable f) =>
ClassifierType -- ^ The type of the classifier
-> Kernel -- ^ Kernel
-> f (a, b) -- ^ Training data
-> (String, SVMClassifier a)
trainClassifier ctype kernel dataset = unsafePerformIO $ do
let (to,from, doubleDataSet) = convertToDouble (F.toList dataset)
(m,svm) <- trainSVM (generalizeClassifier ctype) kernel [] doubleDataSet
return . (m,) $ SVMClassifier svm to from
-- | Train an SVM classifier of given type. | 511 | trainClassifier
:: (SVMVector b, Ord a, Foldable f) =>
ClassifierType -- ^ The type of the classifier
-> Kernel -- ^ Kernel
-> f (a, b) -- ^ Training data
-> (String, SVMClassifier a)
trainClassifier ctype kernel dataset = unsafePerformIO $ do
let (to,from, doubleDataSet) = convertToDouble (F.toList dataset)
(m,svm) <- trainSVM (generalizeClassifier ctype) kernel [] doubleDataSet
return . (m,) $ SVMClassifier svm to from
-- | Train an SVM classifier of given type. | 511 | trainClassifier ctype kernel dataset = unsafePerformIO $ do
let (to,from, doubleDataSet) = convertToDouble (F.toList dataset)
(m,svm) <- trainSVM (generalizeClassifier ctype) kernel [] doubleDataSet
return . (m,) $ SVMClassifier svm to from
-- | Train an SVM classifier of given type. | 297 | false | true | 0 | 15 | 116 | 165 | 84 | 81 | null | null |
d0kt0r0/Tidal | vis/Sound/Tidal/Cycle.hs | gpl-3.0 | applySurface :: Int -> Int -> Surface -> Surface -> Maybe Rect -> IO Bool
applySurface x y src dst clip = blitSurface src clip dst offset
where offset = Just Rect { rectX = x, rectY = y, rectW = 0, rectH = 0 } | 210 | applySurface :: Int -> Int -> Surface -> Surface -> Maybe Rect -> IO Bool
applySurface x y src dst clip = blitSurface src clip dst offset
where offset = Just Rect { rectX = x, rectY = y, rectW = 0, rectH = 0 } | 210 | applySurface x y src dst clip = blitSurface src clip dst offset
where offset = Just Rect { rectX = x, rectY = y, rectW = 0, rectH = 0 } | 136 | false | true | 0 | 10 | 46 | 94 | 49 | 45 | null | null |
dimara/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- | Name of the node group that gets created at cluster init or
-- upgrade
initialNodeGroupName :: String
initialNodeGroupName = "default" | 139 | initialNodeGroupName :: String
initialNodeGroupName = "default" | 63 | initialNodeGroupName = "default" | 32 | true | true | 0 | 6 | 21 | 20 | 9 | 11 | null | null |
candidtim/euler | src/Problem15.hs | bsd-3-clause | -- |Produces a grid bigger than given grid by a given number of nodes
increaseGrid :: Grid -> Int -> Grid
increaseGrid g 0 = g | 126 | increaseGrid :: Grid -> Int -> Grid
increaseGrid g 0 = g | 56 | increaseGrid g 0 = g | 20 | true | true | 0 | 8 | 25 | 31 | 14 | 17 | null | null |
forked-upstream-packages-for-ghcjs/ghc | ghc/GhciMonad.hs | bsd-3-clause | modifyGHCiState :: (GHCiState -> GHCiState) -> GHCi ()
modifyGHCiState f = GHCi $ \r -> liftIO $ readIORef r >>= writeIORef r . f | 129 | modifyGHCiState :: (GHCiState -> GHCiState) -> GHCi ()
modifyGHCiState f = GHCi $ \r -> liftIO $ readIORef r >>= writeIORef r . f | 129 | modifyGHCiState f = GHCi $ \r -> liftIO $ readIORef r >>= writeIORef r . f | 74 | false | true | 0 | 10 | 23 | 57 | 28 | 29 | null | null |
yoo-e/weixin-mp-sdk | WeiXin/PublicPlatform/AutoReplyRules.hs | mit | -- | 获取自动回复规则
wxppQueryOriginAutoReplyRules :: (WxppApiMonad env m)
=> AccessToken
-> m Object
wxppQueryOriginAutoReplyRules (AccessToken { accessTokenData = atk }) = do
(sess, url_conf) <- asks (getWreqSession &&& getWxppUrlConfig)
let url = wxppUrlConfSecureApiBase url_conf <> "/get_current_autoreply_info"
opts = defaults & param "access_token" .~ [ atk ]
liftIO (WS.getWith opts sess url)
>>= asWxppWsResponseNormal' | 514 | wxppQueryOriginAutoReplyRules :: (WxppApiMonad env m)
=> AccessToken
-> m Object
wxppQueryOriginAutoReplyRules (AccessToken { accessTokenData = atk }) = do
(sess, url_conf) <- asks (getWreqSession &&& getWxppUrlConfig)
let url = wxppUrlConfSecureApiBase url_conf <> "/get_current_autoreply_info"
opts = defaults & param "access_token" .~ [ atk ]
liftIO (WS.getWith opts sess url)
>>= asWxppWsResponseNormal' | 500 | wxppQueryOriginAutoReplyRules (AccessToken { accessTokenData = atk }) = do
(sess, url_conf) <- asks (getWreqSession &&& getWxppUrlConfig)
let url = wxppUrlConfSecureApiBase url_conf <> "/get_current_autoreply_info"
opts = defaults & param "access_token" .~ [ atk ]
liftIO (WS.getWith opts sess url)
>>= asWxppWsResponseNormal' | 359 | true | true | 0 | 12 | 145 | 125 | 63 | 62 | null | null |
geocurnoff/nikki | src/Base/Types.hs | lgpl-3.0 | -- | modifies all EditorPositions of the OEMState of EditorObjects
modifyOEMEditorPositions :: (EditorPosition -> EditorPosition)
-> EditorObject s -> EditorObject s
modifyOEMEditorPositions f o@EditorObject{editorOEMState_ = Nothing} = o | 242 | modifyOEMEditorPositions :: (EditorPosition -> EditorPosition)
-> EditorObject s -> EditorObject s
modifyOEMEditorPositions f o@EditorObject{editorOEMState_ = Nothing} = o | 175 | modifyOEMEditorPositions f o@EditorObject{editorOEMState_ = Nothing} = o | 72 | true | true | 4 | 8 | 31 | 55 | 27 | 28 | null | null |
ben-schulz/Idris-dev | src/Idris/Package.hs | bsd-3-clause | installIdx :: String -> String -> IO ()
installIdx dest p = do
let f = pkgIndex p
let destdir = dest </> p
putStrLn $ "Installing " ++ f ++ " to " ++ destdir
createDirectoryIfMissing True destdir
copyFile f (destdir </> takeFileName f)
return () | 257 | installIdx :: String -> String -> IO ()
installIdx dest p = do
let f = pkgIndex p
let destdir = dest </> p
putStrLn $ "Installing " ++ f ++ " to " ++ destdir
createDirectoryIfMissing True destdir
copyFile f (destdir </> takeFileName f)
return () | 257 | installIdx dest p = do
let f = pkgIndex p
let destdir = dest </> p
putStrLn $ "Installing " ++ f ++ " to " ++ destdir
createDirectoryIfMissing True destdir
copyFile f (destdir </> takeFileName f)
return () | 217 | false | true | 0 | 10 | 58 | 107 | 48 | 59 | null | null |
kim/amazonka | amazonka-elb/gen/Network/AWS/ELB/DisableAvailabilityZonesForLoadBalancer.hs | mpl-2.0 | -- | A list of updated Availability Zones for the load balancer.
dazflbrAvailabilityZones :: Lens' DisableAvailabilityZonesForLoadBalancerResponse [Text]
dazflbrAvailabilityZones =
lens _dazflbrAvailabilityZones
(\s a -> s { _dazflbrAvailabilityZones = a })
. _List | 289 | dazflbrAvailabilityZones :: Lens' DisableAvailabilityZonesForLoadBalancerResponse [Text]
dazflbrAvailabilityZones =
lens _dazflbrAvailabilityZones
(\s a -> s { _dazflbrAvailabilityZones = a })
. _List | 224 | dazflbrAvailabilityZones =
lens _dazflbrAvailabilityZones
(\s a -> s { _dazflbrAvailabilityZones = a })
. _List | 135 | true | true | 0 | 10 | 55 | 47 | 26 | 21 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-data/Data/Drasil/Concepts/Physics.hs | bsd-2-clause | fbd = dcc "FBD" (cn' "free body diagram")
("a graphical illustration used to visualize the applied forces, movements, and resulting " ++
"reactions on a body in a steady state condition") | 192 | fbd = dcc "FBD" (cn' "free body diagram")
("a graphical illustration used to visualize the applied forces, movements, and resulting " ++
"reactions on a body in a steady state condition") | 192 | fbd = dcc "FBD" (cn' "free body diagram")
("a graphical illustration used to visualize the applied forces, movements, and resulting " ++
"reactions on a body in a steady state condition") | 192 | false | false | 1 | 7 | 35 | 32 | 13 | 19 | null | null |
psibi/yesod | yesod-core/Yesod/Core/Class/Yesod.hs | mit | minToSec :: (Integral a, Num b) => a -> b
minToSec minutes = fromIntegral (minutes * 60) | 88 | minToSec :: (Integral a, Num b) => a -> b
minToSec minutes = fromIntegral (minutes * 60) | 88 | minToSec minutes = fromIntegral (minutes * 60) | 46 | false | true | 0 | 7 | 16 | 43 | 22 | 21 | null | null |
urbanslug/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | getDFunTyKey (TyConApp tc _) = getOccName tc | 44 | getDFunTyKey (TyConApp tc _) = getOccName tc | 44 | getDFunTyKey (TyConApp tc _) = getOccName tc | 44 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
bgaster/idris-java | src/IRTS/Java/JTypes.hs | bsd-3-clause | sourceTypes (LStrLen) = [stringType] | 36 | sourceTypes (LStrLen) = [stringType] | 36 | sourceTypes (LStrLen) = [stringType] | 36 | false | false | 0 | 6 | 3 | 15 | 8 | 7 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/Compiler.hs | bsd-3-clause | -- | Make package paths absolute
absolutePackageDBPaths :: PackageDBStack -> IO PackageDBStack
absolutePackageDBPaths = mapM absolutePackageDBPath | 148 | absolutePackageDBPaths :: PackageDBStack -> IO PackageDBStack
absolutePackageDBPaths = mapM absolutePackageDBPath | 113 | absolutePackageDBPaths = mapM absolutePackageDBPath | 51 | true | true | 0 | 6 | 17 | 22 | 11 | 11 | null | null |
drippdropp/haskell-huffman | src/Huffman/Core.hs | gpl-3.0 | -- This is for testing, will accept command line input in final version
secretMessage :: String
secretMessage = "this is a secret message we need to encode" | 156 | secretMessage :: String
secretMessage = "this is a secret message we need to encode" | 84 | secretMessage = "this is a secret message we need to encode" | 60 | true | true | 0 | 6 | 26 | 19 | 8 | 11 | null | null |
grwlf/vindinium-bot | src/Client.hs | mit | boardAdjascentTiles :: (Tile -> Bool) -> Pos -> Board -> HashSet (Pos)
boardAdjascentTiles flt Pos{..} Board{..} =
HashSet.unions $
flip concatMap [
(Pos (posX-1) posY),
(Pos (posX+1) posY),
(Pos posX (posY-1)),
(Pos posX (posY+1))] $ \p ->
fromMaybe [] $ do
tile <- HashMap.lookup p _bo_tiles
if flt tile then Just [HashSet.singleton p] else Nothing | 386 | boardAdjascentTiles :: (Tile -> Bool) -> Pos -> Board -> HashSet (Pos)
boardAdjascentTiles flt Pos{..} Board{..} =
HashSet.unions $
flip concatMap [
(Pos (posX-1) posY),
(Pos (posX+1) posY),
(Pos posX (posY-1)),
(Pos posX (posY+1))] $ \p ->
fromMaybe [] $ do
tile <- HashMap.lookup p _bo_tiles
if flt tile then Just [HashSet.singleton p] else Nothing | 386 | boardAdjascentTiles flt Pos{..} Board{..} =
HashSet.unions $
flip concatMap [
(Pos (posX-1) posY),
(Pos (posX+1) posY),
(Pos posX (posY-1)),
(Pos posX (posY+1))] $ \p ->
fromMaybe [] $ do
tile <- HashMap.lookup p _bo_tiles
if flt tile then Just [HashSet.singleton p] else Nothing | 315 | false | true | 0 | 12 | 90 | 196 | 100 | 96 | null | null |
well-typed/generics-sop | generics-sop/src/Generics/SOP/TH.hs | bsd-3-clause | deriveMetadataForDataDec ::
(Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec]
deriveMetadataForDataDec f variant _cxt name _bndrs instTys cons = do
let typ = appTysSubst f name instTys
deriveMetadataForDataType variant name typ cons | 303 | deriveMetadataForDataDec ::
(Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec]
deriveMetadataForDataDec f variant _cxt name _bndrs instTys cons = do
let typ = appTysSubst f name instTys
deriveMetadataForDataType variant name typ cons | 303 | deriveMetadataForDataDec f variant _cxt name _bndrs instTys cons = do
let typ = appTysSubst f name instTys
deriveMetadataForDataType variant name typ cons | 158 | false | true | 0 | 13 | 48 | 109 | 54 | 55 | null | null |
dsorokin/aivika-lattice | Simulation/Aivika/Lattice/Internal/Ref/Lazy.hs | bsd-3-clause | defineTopRef0 :: Ref a -> LIO a
defineTopRef0 r =
LIO $ \ps ->
do m <- readIORef (refMap r)
let !i = lioMapIndex ps
case M.lookup i m of
Just ra -> readIORef ra
Nothing ->
case parentLIOParams ps of
Nothing -> error "Cannot find parent: defineTopRef0"
Just ps' ->
do a <- invokeLIO ps' $ defineTopRef0 r
ra <- newIORef a
modifyIORef (refMap r) $ M.insert i ra
return a
-- | Ensure that the top reference value is defined. | 544 | defineTopRef0 :: Ref a -> LIO a
defineTopRef0 r =
LIO $ \ps ->
do m <- readIORef (refMap r)
let !i = lioMapIndex ps
case M.lookup i m of
Just ra -> readIORef ra
Nothing ->
case parentLIOParams ps of
Nothing -> error "Cannot find parent: defineTopRef0"
Just ps' ->
do a <- invokeLIO ps' $ defineTopRef0 r
ra <- newIORef a
modifyIORef (refMap r) $ M.insert i ra
return a
-- | Ensure that the top reference value is defined. | 544 | defineTopRef0 r =
LIO $ \ps ->
do m <- readIORef (refMap r)
let !i = lioMapIndex ps
case M.lookup i m of
Just ra -> readIORef ra
Nothing ->
case parentLIOParams ps of
Nothing -> error "Cannot find parent: defineTopRef0"
Just ps' ->
do a <- invokeLIO ps' $ defineTopRef0 r
ra <- newIORef a
modifyIORef (refMap r) $ M.insert i ra
return a
-- | Ensure that the top reference value is defined. | 512 | false | true | 0 | 20 | 204 | 177 | 77 | 100 | null | null |
michalkonecny/polypaver | src/Numeric/ER/Misc.hs | bsd-3-clause | divideUp c1 c2 = c1 / c2 | 24 | divideUp c1 c2 = c1 / c2 | 24 | divideUp c1 c2 = c1 / c2 | 24 | false | false | 1 | 5 | 6 | 19 | 7 | 12 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-database/Database/Drasil/ChunkDB.hs | bsd-2-clause | -- | Looks up a uid in the section table. If nothing is found, an error is thrown.
sectionLookup :: UID -> SectionMap -> Section
sectionLookup = uMapLookup "Section" "SectionMap" | 178 | sectionLookup :: UID -> SectionMap -> Section
sectionLookup = uMapLookup "Section" "SectionMap" | 95 | sectionLookup = uMapLookup "Section" "SectionMap" | 49 | true | true | 0 | 6 | 29 | 25 | 13 | 12 | null | null |
biegunka/biegunka | src/Control/Biegunka/Script.hs | mit | -- | Get annotated DSL and resulting annotations alongside
runScript
:: MAnnotations
-> Annotations
-> Script s a
-> (Term Annotate s a, MAnnotations)
runScript s e (Script i) = let
r = runStateT (runReaderT i e) s
ast = fmap fst r
(_, as) = iter nextTerm r
in
(ast, as)
where
nextTerm (TS _ _ _ x) = x
nextTerm (TA _ _ x) = x
nextTerm (TWait _ x) = x
| 407 | runScript
:: MAnnotations
-> Annotations
-> Script s a
-> (Term Annotate s a, MAnnotations)
runScript s e (Script i) = let
r = runStateT (runReaderT i e) s
ast = fmap fst r
(_, as) = iter nextTerm r
in
(ast, as)
where
nextTerm (TS _ _ _ x) = x
nextTerm (TA _ _ x) = x
nextTerm (TWait _ x) = x
| 348 | runScript s e (Script i) = let
r = runStateT (runReaderT i e) s
ast = fmap fst r
(_, as) = iter nextTerm r
in
(ast, as)
where
nextTerm (TS _ _ _ x) = x
nextTerm (TA _ _ x) = x
nextTerm (TWait _ x) = x
| 248 | true | true | 0 | 11 | 129 | 177 | 86 | 91 | null | null |
perryleo/sicp | ch1/sicpc1e09.hs | mit | -- Two procedures do increments or decrements
inc x = trace ("inc(" ++ show x ++ ")") (x + 1) | 93 | inc x = trace ("inc(" ++ show x ++ ")") (x + 1) | 47 | inc x = trace ("inc(" ++ show x ++ ")") (x + 1) | 47 | true | false | 1 | 9 | 19 | 40 | 18 | 22 | null | null |
juhp/network-uri | Network/URI.hs | bsd-3-clause | --
-- RFC3986, section 3.3
--
-- path = path-abempty ; begins with "/" or is empty
-- / path-abs ; begins with "/" but not "//"
-- / path-noscheme ; begins with a non-colon segment
-- / path-rootless ; begins with a segment
-- / path-empty ; zero characters
--
-- path-abempty = *( "/" segment )
-- path-abs = "/" [ segment-nz *( "/" segment ) ]
-- path-noscheme = segment-nzc *( "/" segment )
-- path-rootless = segment-nz *( "/" segment )
-- path-empty = 0<pchar>
--
-- segment = *pchar
-- segment-nz = 1*pchar
-- segment-nzc = 1*( unreserved / pct-encoded / sub-delims / "@" )
--
-- pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
{-
upath :: URIParser String
upath = pathAbEmpty
<|> pathAbs
<|> pathNoScheme
<|> pathRootLess
<|> pathEmpty
-}
pathAbEmpty :: URIParser String
pathAbEmpty =
do { ss <- many slashSegment
; return $ concat ss
} | 1,033 | pathAbEmpty :: URIParser String
pathAbEmpty =
do { ss <- many slashSegment
; return $ concat ss
} | 118 | pathAbEmpty =
do { ss <- many slashSegment
; return $ concat ss
} | 86 | true | true | 0 | 8 | 337 | 58 | 39 | 19 | null | null |
mwotton/proxomatic | src/Data/Blocker.hs | bsd-2-clause | newBlocker :: IO (IO a, IO (), a -> IO ())
newBlocker = do
ref <- newIORef (Left [])
return (blockIfNecessary ref, block ref, unblock ref)
where
blockIfNecessary ref = do
-- strictly speaking we don't need to have this outer layer.
-- however, we would be creating a new & mostly unused mvar
-- every time through the loop if we just used atomicModifyIORef'
-- so we check it first, and if it has nothing waiting (normal
-- case) we can proceed without further fuss.
ready <- readIORef ref
case ready of
Right x -> return x -- all good, we aren't waiting on anything.
Left _ -> do
-- stuff to do, create a new mvar & wait on it
blocker <- newEmptyMVar
-- this adds the mvar to the list iff we are still blocked.
todo <- atomicModifyIORef' ref (addToBlock blocker)
todo
addToBlock blocker (Right details) = (Right details, return details)
addToBlock blocker (Left blocked) = (Left (blocker:blocked), takeMVar blocker)
-- unblock ref = atomicModifyIORef' ref ((Left undefined,) .
-- fromMaybe [] ) >>= mapM_ (`putMVar` ())
unblock ref val =
join $ atomicModifyIORef' ref
(either ((Right val,) . mapM_ (`putMVar` val))
(const (Right val,return ())))
-- (\x -> (Right (_foo,mapM_ (`putMVar` val)) _bar)))
-- unblock ref = atomicModifyIORef' ref (\r -> (Just (fromMaybe [] r), ()))
block ref =
atomicModifyIORef' ref
(either (\x -> (Left x, ()))
(const (Left [], ())))
-- undefined -- atomicModifyIORef' ref ((,val) . Right . fromMaybe []) | 1,713 | newBlocker :: IO (IO a, IO (), a -> IO ())
newBlocker = do
ref <- newIORef (Left [])
return (blockIfNecessary ref, block ref, unblock ref)
where
blockIfNecessary ref = do
-- strictly speaking we don't need to have this outer layer.
-- however, we would be creating a new & mostly unused mvar
-- every time through the loop if we just used atomicModifyIORef'
-- so we check it first, and if it has nothing waiting (normal
-- case) we can proceed without further fuss.
ready <- readIORef ref
case ready of
Right x -> return x -- all good, we aren't waiting on anything.
Left _ -> do
-- stuff to do, create a new mvar & wait on it
blocker <- newEmptyMVar
-- this adds the mvar to the list iff we are still blocked.
todo <- atomicModifyIORef' ref (addToBlock blocker)
todo
addToBlock blocker (Right details) = (Right details, return details)
addToBlock blocker (Left blocked) = (Left (blocker:blocked), takeMVar blocker)
-- unblock ref = atomicModifyIORef' ref ((Left undefined,) .
-- fromMaybe [] ) >>= mapM_ (`putMVar` ())
unblock ref val =
join $ atomicModifyIORef' ref
(either ((Right val,) . mapM_ (`putMVar` val))
(const (Right val,return ())))
-- (\x -> (Right (_foo,mapM_ (`putMVar` val)) _bar)))
-- unblock ref = atomicModifyIORef' ref (\r -> (Just (fromMaybe [] r), ()))
block ref =
atomicModifyIORef' ref
(either (\x -> (Left x, ()))
(const (Left [], ())))
-- undefined -- atomicModifyIORef' ref ((,val) . Right . fromMaybe []) | 1,713 | newBlocker = do
ref <- newIORef (Left [])
return (blockIfNecessary ref, block ref, unblock ref)
where
blockIfNecessary ref = do
-- strictly speaking we don't need to have this outer layer.
-- however, we would be creating a new & mostly unused mvar
-- every time through the loop if we just used atomicModifyIORef'
-- so we check it first, and if it has nothing waiting (normal
-- case) we can proceed without further fuss.
ready <- readIORef ref
case ready of
Right x -> return x -- all good, we aren't waiting on anything.
Left _ -> do
-- stuff to do, create a new mvar & wait on it
blocker <- newEmptyMVar
-- this adds the mvar to the list iff we are still blocked.
todo <- atomicModifyIORef' ref (addToBlock blocker)
todo
addToBlock blocker (Right details) = (Right details, return details)
addToBlock blocker (Left blocked) = (Left (blocker:blocked), takeMVar blocker)
-- unblock ref = atomicModifyIORef' ref ((Left undefined,) .
-- fromMaybe [] ) >>= mapM_ (`putMVar` ())
unblock ref val =
join $ atomicModifyIORef' ref
(either ((Right val,) . mapM_ (`putMVar` val))
(const (Right val,return ())))
-- (\x -> (Right (_foo,mapM_ (`putMVar` val)) _bar)))
-- unblock ref = atomicModifyIORef' ref (\r -> (Just (fromMaybe [] r), ()))
block ref =
atomicModifyIORef' ref
(either (\x -> (Left x, ()))
(const (Left [], ())))
-- undefined -- atomicModifyIORef' ref ((,val) . Right . fromMaybe []) | 1,670 | false | true | 3 | 15 | 524 | 372 | 185 | 187 | null | null |
sbditto85/parsedsltest | test/Generators.hs | apache-2.0 | errorHandlerToString (ErrorHandlerEmail strConcat) = "email " ++ stringConcatToString strConcat | 95 | errorHandlerToString (ErrorHandlerEmail strConcat) = "email " ++ stringConcatToString strConcat | 95 | errorHandlerToString (ErrorHandlerEmail strConcat) = "email " ++ stringConcatToString strConcat | 95 | false | false | 0 | 7 | 8 | 22 | 10 | 12 | null | null |
binesiyu/ifl | examples/ch16/HttpRequestParser.hs | mit | notEOL :: CharParser st Char
notEOL = noneOf "\r\n" | 51 | notEOL :: CharParser st Char
notEOL = noneOf "\r\n" | 51 | notEOL = noneOf "\r\n" | 22 | false | true | 0 | 5 | 8 | 19 | 9 | 10 | null | null |
jcristovao/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | oidToPersistValue :: DB.ObjectId -> PersistValue
oidToPersistValue = PersistObjectId . Serialize.encode | 103 | oidToPersistValue :: DB.ObjectId -> PersistValue
oidToPersistValue = PersistObjectId . Serialize.encode | 103 | oidToPersistValue = PersistObjectId . Serialize.encode | 54 | false | true | 0 | 7 | 9 | 30 | 13 | 17 | null | null |
byorgey/Idris-dev | src/Core/ProofState.hs | bsd-3-clause | addLog :: Monad m => String -> StateT TState m ()
addLog str = action (\ps -> ps { plog = plog ps ++ str ++ "\n" }) | 115 | addLog :: Monad m => String -> StateT TState m ()
addLog str = action (\ps -> ps { plog = plog ps ++ str ++ "\n" }) | 115 | addLog str = action (\ps -> ps { plog = plog ps ++ str ++ "\n" }) | 65 | false | true | 0 | 12 | 27 | 68 | 33 | 35 | null | null |
pgj/bead | src/Bead/View/DataBridge.hs | bsd-3-clause | delUserFromCoursePrm :: Parameter Username
delUserFromCoursePrm = customUsernamePrm (fieldName delUserFromCourseField) | 118 | delUserFromCoursePrm :: Parameter Username
delUserFromCoursePrm = customUsernamePrm (fieldName delUserFromCourseField) | 118 | delUserFromCoursePrm = customUsernamePrm (fieldName delUserFromCourseField) | 75 | false | true | 1 | 7 | 8 | 26 | 11 | 15 | null | null |
brendanhay/gogol | gogol-youtube-reporting/gen/Network/Google/YouTubeReporting/Types/Product.hs | mpl-2.0 | -- | gdata
gdctiBestGuess :: Lens' GDataContentTypeInfo (Maybe Text)
gdctiBestGuess
= lens _gdctiBestGuess
(\ s a -> s{_gdctiBestGuess = a}) | 148 | gdctiBestGuess :: Lens' GDataContentTypeInfo (Maybe Text)
gdctiBestGuess
= lens _gdctiBestGuess
(\ s a -> s{_gdctiBestGuess = a}) | 137 | gdctiBestGuess
= lens _gdctiBestGuess
(\ s a -> s{_gdctiBestGuess = a}) | 79 | true | true | 0 | 8 | 27 | 49 | 25 | 24 | null | null |
markus-git/PBKDF2 | src/PBKDF2.hs | bsd-3-clause | res = 0xde7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9 :: Integer | 59 | res = 0xde7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9 :: Integer | 59 | res = 0xde7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9 :: Integer | 59 | false | false | 0 | 4 | 4 | 12 | 6 | 6 | null | null |
MichielDerhaeg/stack | src/Stack/Solver.hs | bsd-3-clause | getResolverConstraints
:: (HasConfig env, HasGHCVariant env)
=> EnvOverride -- ^ for running Git/Hg clone commands
-> Maybe (CompilerVersion 'CVActual) -- ^ actually installed compiler
-> Path Abs File
-> SnapshotDef
-> RIO env
(CompilerVersion 'CVActual,
Map PackageName (Version, Map FlagName Bool))
getResolverConstraints menv mcompilerVersion stackYaml sd = do
ls <- loadSnapshot menv mcompilerVersion (parent stackYaml) sd
return (lsCompilerVersion ls, lsConstraints ls)
where
lpiConstraints lpi = (lpiVersion lpi, lpiFlags lpi)
lsConstraints ls = Map.union
(Map.map lpiConstraints (lsPackages ls))
(Map.map lpiConstraints (lsGlobals ls))
-- | Finds all files with a .cabal extension under a given directory. If
-- a `hpack` `package.yaml` file exists, this will be used to generate a cabal
-- file.
-- Subdirectories can be included depending on the @recurse@ parameter. | 950 | getResolverConstraints
:: (HasConfig env, HasGHCVariant env)
=> EnvOverride -- ^ for running Git/Hg clone commands
-> Maybe (CompilerVersion 'CVActual) -- ^ actually installed compiler
-> Path Abs File
-> SnapshotDef
-> RIO env
(CompilerVersion 'CVActual,
Map PackageName (Version, Map FlagName Bool))
getResolverConstraints menv mcompilerVersion stackYaml sd = do
ls <- loadSnapshot menv mcompilerVersion (parent stackYaml) sd
return (lsCompilerVersion ls, lsConstraints ls)
where
lpiConstraints lpi = (lpiVersion lpi, lpiFlags lpi)
lsConstraints ls = Map.union
(Map.map lpiConstraints (lsPackages ls))
(Map.map lpiConstraints (lsGlobals ls))
-- | Finds all files with a .cabal extension under a given directory. If
-- a `hpack` `package.yaml` file exists, this will be used to generate a cabal
-- file.
-- Subdirectories can be included depending on the @recurse@ parameter. | 950 | getResolverConstraints menv mcompilerVersion stackYaml sd = do
ls <- loadSnapshot menv mcompilerVersion (parent stackYaml) sd
return (lsCompilerVersion ls, lsConstraints ls)
where
lpiConstraints lpi = (lpiVersion lpi, lpiFlags lpi)
lsConstraints ls = Map.union
(Map.map lpiConstraints (lsPackages ls))
(Map.map lpiConstraints (lsGlobals ls))
-- | Finds all files with a .cabal extension under a given directory. If
-- a `hpack` `package.yaml` file exists, this will be used to generate a cabal
-- file.
-- Subdirectories can be included depending on the @recurse@ parameter. | 605 | false | true | 0 | 15 | 194 | 221 | 108 | 113 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Types/RefType.hs | bsd-3-clause | subsTyVars_nomeet = subsTyVars False | 41 | subsTyVars_nomeet = subsTyVars False | 41 | subsTyVars_nomeet = subsTyVars False | 41 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
ezyang/ghc | compiler/coreSyn/CoreArity.hs | bsd-3-clause | etaInfoApp subst e eis
= go (subst_expr subst e) eis
where
go e [] = e
go e (EtaVar v : eis) = go (App e (varToCoreExpr v)) eis
go e (EtaCo co : eis) = go (Cast e co) eis
-------------- | 226 | etaInfoApp subst e eis
= go (subst_expr subst e) eis
where
go e [] = e
go e (EtaVar v : eis) = go (App e (varToCoreExpr v)) eis
go e (EtaCo co : eis) = go (Cast e co) eis
-------------- | 226 | etaInfoApp subst e eis
= go (subst_expr subst e) eis
where
go e [] = e
go e (EtaVar v : eis) = go (App e (varToCoreExpr v)) eis
go e (EtaCo co : eis) = go (Cast e co) eis
-------------- | 226 | false | false | 0 | 9 | 82 | 118 | 55 | 63 | null | null |
ashishnegi/hsalgos | src/DivideAndConquer.hs | bsd-3-clause | kthSmallest :: (Ord a) => Int -> [a] -> Maybe a
kthSmallest k list =
if k < 0
then Nothing
else
case list of
[] -> Nothing
x:xs ->
let pivot = x -- randomness would have helped
(smaller, same, larger) = listInParts x list
lenSmaller = length smaller
lenSame = length same
in if lenSmaller > k
then kthSmallest k smaller
else
if lenSmaller + lenSame > k
then Just x
else kthSmallest (k - lenSmaller - lenSame) larger | 550 | kthSmallest :: (Ord a) => Int -> [a] -> Maybe a
kthSmallest k list =
if k < 0
then Nothing
else
case list of
[] -> Nothing
x:xs ->
let pivot = x -- randomness would have helped
(smaller, same, larger) = listInParts x list
lenSmaller = length smaller
lenSame = length same
in if lenSmaller > k
then kthSmallest k smaller
else
if lenSmaller + lenSame > k
then Just x
else kthSmallest (k - lenSmaller - lenSame) larger | 550 | kthSmallest k list =
if k < 0
then Nothing
else
case list of
[] -> Nothing
x:xs ->
let pivot = x -- randomness would have helped
(smaller, same, larger) = listInParts x list
lenSmaller = length smaller
lenSame = length same
in if lenSmaller > k
then kthSmallest k smaller
else
if lenSmaller + lenSame > k
then Just x
else kthSmallest (k - lenSmaller - lenSame) larger | 502 | false | true | 0 | 16 | 215 | 173 | 90 | 83 | null | null |
annenkov/contracts | Coq/Extraction/contracts-haskell/src/Examples/PayoffToHaskell.hs | mit | fromTexpr e = case e of
Tnum n -> show n
Tvar s -> inParens ("tenv Map.! " ++ show s) | 117 | fromTexpr e = case e of
Tnum n -> show n
Tvar s -> inParens ("tenv Map.! " ++ show s) | 117 | fromTexpr e = case e of
Tnum n -> show n
Tvar s -> inParens ("tenv Map.! " ++ show s) | 117 | false | false | 0 | 11 | 52 | 47 | 21 | 26 | null | null |
io7m/r2 | com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/LogDepth.hs | isc | depth_coefficient :: Float -> Float
depth_coefficient far = 2.0 / log2 (far + 1.0) | 82 | depth_coefficient :: Float -> Float
depth_coefficient far = 2.0 / log2 (far + 1.0) | 82 | depth_coefficient far = 2.0 / log2 (far + 1.0) | 46 | false | true | 0 | 8 | 13 | 32 | 16 | 16 | null | null |
marcellussiegburg/icfp-2015 | Translate.hs | mit | transform :: [Command] -> Text
transform [] = "" | 48 | transform :: [Command] -> Text
transform [] = "" | 48 | transform [] = "" | 17 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
kojiromike/Idris-dev | Setup.hs | bsd-3-clause | idrisCmd local = Px.joinPath $ splitDirectories $ ".." <//> ".." <//> buildDir local <//> "idris" <//> "idris" | 110 | idrisCmd local = Px.joinPath $ splitDirectories $ ".." <//> ".." <//> buildDir local <//> "idris" <//> "idris" | 110 | idrisCmd local = Px.joinPath $ splitDirectories $ ".." <//> ".." <//> buildDir local <//> "idris" <//> "idris" | 110 | false | false | 0 | 11 | 16 | 38 | 18 | 20 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Hooks/DynamicLog.hs | bsd-2-clause | -- | Pad a string with a leading and trailing space.
pad :: String -> String
pad = wrap " " " " | 95 | pad :: String -> String
pad = wrap " " " " | 42 | pad = wrap " " " " | 18 | true | true | 0 | 7 | 22 | 29 | 12 | 17 | null | null |
easoncxz/hack-assembler | src/Parser.hs | gpl-3.0 | parseExpr "-1" = Just ( ComputeNegOne , UseA) | 45 | parseExpr "-1" = Just ( ComputeNegOne , UseA) | 45 | parseExpr "-1" = Just ( ComputeNegOne , UseA) | 45 | false | false | 0 | 6 | 7 | 18 | 9 | 9 | null | null |
ekmett/multipass | Data/Pass/Robust.hs | bsd-3-clause | q3 = quantile 0.75 | 18 | q3 = quantile 0.75 | 18 | q3 = quantile 0.75 | 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bernstein/ircfs | Ircfs/Misc.hs | bsd-3-clause | stamp' :: T.TimeZone -> CTime -> String
stamp' z = T.formatTime defaultTimeLocale "%H:%M" . T.utcToLocalTime z . toUTCTime | 122 | stamp' :: T.TimeZone -> CTime -> String
stamp' z = T.formatTime defaultTimeLocale "%H:%M" . T.utcToLocalTime z . toUTCTime | 122 | stamp' z = T.formatTime defaultTimeLocale "%H:%M" . T.utcToLocalTime z . toUTCTime | 82 | false | true | 0 | 8 | 17 | 50 | 22 | 28 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Projects/Sinks/Update.hs | mpl-2.0 | -- | Optional. See sinks.create for a description of this field. When
-- updating a sink, the effect of this field on the value of
-- writer_identity in the updated sink depends on both the old and new
-- values of this field: If the old and new values of this field are both
-- false or both true, then there is no change to the sink\'s
-- writer_identity. If the old value is false and the new value is true,
-- then writer_identity is changed to a unique service account. It is an
-- error if the old value is true and the new value is set to false or
-- defaulted to false.
psuUniqueWriterIdentity :: Lens' ProjectsSinksUpdate (Maybe Bool)
psuUniqueWriterIdentity
= lens _psuUniqueWriterIdentity
(\ s a -> s{_psuUniqueWriterIdentity = a}) | 750 | psuUniqueWriterIdentity :: Lens' ProjectsSinksUpdate (Maybe Bool)
psuUniqueWriterIdentity
= lens _psuUniqueWriterIdentity
(\ s a -> s{_psuUniqueWriterIdentity = a}) | 172 | psuUniqueWriterIdentity
= lens _psuUniqueWriterIdentity
(\ s a -> s{_psuUniqueWriterIdentity = a}) | 106 | true | true | 0 | 9 | 139 | 56 | 33 | 23 | null | null |
csabahruska/gpipe-quake3 | ShaderParser.hs | bsd-3-clause | --
-- Q3MAP Specific Shader Keywords
--
cloudparams = pass <$> kw "cloudparms" | 78 | cloudparams = pass <$> kw "cloudparms" | 38 | cloudparams = pass <$> kw "cloudparms" | 38 | true | false | 3 | 5 | 12 | 21 | 9 | 12 | null | null |
fmthoma/ghc | compiler/types/Type.hs | bsd-3-clause | isIPPred_maybe :: Type -> Maybe (FastString, Type)
isIPPred_maybe ty =
do (tc,[t1,t2]) <- splitTyConApp_maybe ty
guard (isIPTyCon tc)
x <- isStrLitTy t1
return (x,t2)
{-
Make PredTypes
--------------------- Equality types ---------------------------------
-}
-- | Creates a type equality predicate | 317 | isIPPred_maybe :: Type -> Maybe (FastString, Type)
isIPPred_maybe ty =
do (tc,[t1,t2]) <- splitTyConApp_maybe ty
guard (isIPTyCon tc)
x <- isStrLitTy t1
return (x,t2)
{-
Make PredTypes
--------------------- Equality types ---------------------------------
-}
-- | Creates a type equality predicate | 317 | isIPPred_maybe ty =
do (tc,[t1,t2]) <- splitTyConApp_maybe ty
guard (isIPTyCon tc)
x <- isStrLitTy t1
return (x,t2)
{-
Make PredTypes
--------------------- Equality types ---------------------------------
-}
-- | Creates a type equality predicate | 266 | false | true | 0 | 9 | 58 | 85 | 43 | 42 | null | null |
raymoo/psc-lua-redux | src/Language/PureScript/CodeGen/Lua.hs | mit | bindToLua mn (Rec vals) = (emptyDecs:) <$> traverse makeAss vals
where names = map fst vals
emptyDecs = L.LocalAssign (map identToLua names) Nothing
makeAss (ident, val) = do
lua <- valueToLua mn val
return $ L.Assign [L.VarName $ identToLua ident] [lua]
-- | Generate code in the Lua AST for a value or expression | 356 | bindToLua mn (Rec vals) = (emptyDecs:) <$> traverse makeAss vals
where names = map fst vals
emptyDecs = L.LocalAssign (map identToLua names) Nothing
makeAss (ident, val) = do
lua <- valueToLua mn val
return $ L.Assign [L.VarName $ identToLua ident] [lua]
-- | Generate code in the Lua AST for a value or expression | 356 | bindToLua mn (Rec vals) = (emptyDecs:) <$> traverse makeAss vals
where names = map fst vals
emptyDecs = L.LocalAssign (map identToLua names) Nothing
makeAss (ident, val) = do
lua <- valueToLua mn val
return $ L.Assign [L.VarName $ identToLua ident] [lua]
-- | Generate code in the Lua AST for a value or expression | 356 | false | false | 1 | 12 | 95 | 126 | 59 | 67 | null | null |
abhin4v/combinatorrent | src/Process/PeerMgr.hs | bsd-2-clause | incomingPeers :: PeerMgrMsg -> Process CF ST ()
incomingPeers msg =
case msg of
PeersFromTracker ih ps -> do
debugP "Adding peers to queue"
modify (\s -> s { peersInQueue = (map (ih,) ps) ++ peersInQueue s })
NewIncoming conn@(s, _) -> do
sz <- liftM M.size $ gets peers
if sz < numPeers
then do debugP "New incoming peer, handling"
_ <- addIncoming conn
return ()
else do debugP "Already too many peers, closing!"
liftIO $ Sock.sClose s
NewTorrent ih tl -> do
modify (\s -> s { cmMap = M.insert ih tl (cmMap s)})
StopTorrent _ih -> do
errorP "Not implemented stopping yet" | 775 | incomingPeers :: PeerMgrMsg -> Process CF ST ()
incomingPeers msg =
case msg of
PeersFromTracker ih ps -> do
debugP "Adding peers to queue"
modify (\s -> s { peersInQueue = (map (ih,) ps) ++ peersInQueue s })
NewIncoming conn@(s, _) -> do
sz <- liftM M.size $ gets peers
if sz < numPeers
then do debugP "New incoming peer, handling"
_ <- addIncoming conn
return ()
else do debugP "Already too many peers, closing!"
liftIO $ Sock.sClose s
NewTorrent ih tl -> do
modify (\s -> s { cmMap = M.insert ih tl (cmMap s)})
StopTorrent _ih -> do
errorP "Not implemented stopping yet" | 775 | incomingPeers msg =
case msg of
PeersFromTracker ih ps -> do
debugP "Adding peers to queue"
modify (\s -> s { peersInQueue = (map (ih,) ps) ++ peersInQueue s })
NewIncoming conn@(s, _) -> do
sz <- liftM M.size $ gets peers
if sz < numPeers
then do debugP "New incoming peer, handling"
_ <- addIncoming conn
return ()
else do debugP "Already too many peers, closing!"
liftIO $ Sock.sClose s
NewTorrent ih tl -> do
modify (\s -> s { cmMap = M.insert ih tl (cmMap s)})
StopTorrent _ih -> do
errorP "Not implemented stopping yet" | 727 | false | true | 0 | 18 | 306 | 251 | 117 | 134 | null | null |
sdiehl/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name
-- WATCH OUT! External Names should be in the Name Cache
-- (see Note [The Name Cache] in GHC.Iface.Env), so don't just call mkExternalName
-- with some fresh unique without populating the Name Cache
mkExternalName uniq mod occ loc
= Name { n_uniq = uniq, n_sort = External mod,
n_occ = occ, n_loc = loc } | 383 | mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name
mkExternalName uniq mod occ loc
= Name { n_uniq = uniq, n_sort = External mod,
n_occ = occ, n_loc = loc } | 183 | mkExternalName uniq mod occ loc
= Name { n_uniq = uniq, n_sort = External mod,
n_occ = occ, n_loc = loc } | 118 | true | true | 0 | 10 | 79 | 77 | 41 | 36 | null | null |
uwap/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | toNsName _ = [] | 23 | toNsName _ = [] | 23 | toNsName _ = [] | 23 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
nevrenato/Hets_Fork | CASL/OMDocExport.hs | gpl-2.0 | -- ------------------------ TERMS --------------------------
appOrConst :: AsSymbol a => Env -> a -> [OMElement] -> OMElement
appOrConst e o [] = oms e o | 154 | appOrConst :: AsSymbol a => Env -> a -> [OMElement] -> OMElement
appOrConst e o [] = oms e o | 92 | appOrConst e o [] = oms e o | 27 | true | true | 0 | 9 | 24 | 54 | 25 | 29 | null | null |
david-christiansen/final-pretty-printer | Text/PrettyPrint/Final.hs | mit | getCurLine :: (Functor m, MonadState (PState w fmt) m) => m (Line w fmt)
getCurLine = curLine <$> get | 101 | getCurLine :: (Functor m, MonadState (PState w fmt) m) => m (Line w fmt)
getCurLine = curLine <$> get | 101 | getCurLine = curLine <$> get | 28 | false | true | 2 | 9 | 18 | 58 | 27 | 31 | null | null |
creichert/wai | warp/Network/Wai/Handler/Warp/FileInfoCache.hs | mit | positive :: FileInfoCache -> Hash -> FilePath -> IO FileInfo
positive Reaper{..} h path = do
info <- getInfo path
reaperAdd (h, path, Positive info)
return info | 172 | positive :: FileInfoCache -> Hash -> FilePath -> IO FileInfo
positive Reaper{..} h path = do
info <- getInfo path
reaperAdd (h, path, Positive info)
return info | 172 | positive Reaper{..} h path = do
info <- getInfo path
reaperAdd (h, path, Positive info)
return info | 111 | false | true | 0 | 9 | 38 | 73 | 34 | 39 | null | null |
buckie/scheme48 | src/Scheme48/Error.hs | mit | extractValue (Left s) = error $ "This should never happen: " ++ show s | 70 | extractValue (Left s) = error $ "This should never happen: " ++ show s | 70 | extractValue (Left s) = error $ "This should never happen: " ++ show s | 70 | false | false | 0 | 7 | 13 | 26 | 12 | 14 | null | null |
ChrisPenner/rasa | rasa-ext-vim/src/Rasa/Ext/Vim.hs | gpl-3.0 | normal [Keypress 'r' []] = addHist $ Keypress 'r' [] | 52 | normal [Keypress 'r' []] = addHist $ Keypress 'r' [] | 52 | normal [Keypress 'r' []] = addHist $ Keypress 'r' [] | 52 | false | false | 0 | 8 | 9 | 30 | 14 | 16 | null | null |
chreekat/yesod | yesod-core/test/YesodCoreTest/JsLoader.hs | bsd-2-clause | runner :: (YesodDispatch master master, Yesod master) => master -> Session () -> IO ()
runner app f = toWaiApp app >>= runSession f | 131 | runner :: (YesodDispatch master master, Yesod master) => master -> Session () -> IO ()
runner app f = toWaiApp app >>= runSession f | 131 | runner app f = toWaiApp app >>= runSession f | 44 | false | true | 0 | 9 | 23 | 61 | 29 | 32 | null | null |
gitfoxi/vcd-haskell | app/hus-jtag-comments.hs | agpl-3.0 | -- LSB First
-- For my first crack, just map X to 0
decodeXNum :: [Maybe Bool] -> String
decodeXNum = (\a -> a "") . showHex . foldl' shiftAdd 0 . map xzero . reverse
where
xzero Nothing = False
xzero (Just a) = a | 223 | decodeXNum :: [Maybe Bool] -> String
decodeXNum = (\a -> a "") . showHex . foldl' shiftAdd 0 . map xzero . reverse
where
xzero Nothing = False
xzero (Just a) = a | 171 | decodeXNum = (\a -> a "") . showHex . foldl' shiftAdd 0 . map xzero . reverse
where
xzero Nothing = False
xzero (Just a) = a | 134 | true | true | 0 | 11 | 55 | 83 | 42 | 41 | null | null |
orezpraw/gitit2 | Network/Gitit2.hs | gpl-2.0 | stripElementForToc False _ _ = [] | 34 | stripElementForToc False _ _ = [] | 34 | stripElementForToc False _ _ = [] | 34 | false | false | 0 | 5 | 6 | 17 | 7 | 10 | null | null |
prt2121/haskell-practice | hb-chap04/src/Main.hs | apache-2.0 | myAbs :: Integer -> Integer
myAbs n = if n > 0 then n else (-1) * n | 67 | myAbs :: Integer -> Integer
myAbs n = if n > 0 then n else (-1) * n | 67 | myAbs n = if n > 0 then n else (-1) * n | 39 | false | true | 0 | 8 | 17 | 45 | 22 | 23 | null | null |
mgsloan/language-typescript | src/Language/TypeScript/Parser.hs | mit | identifier = lexeme $ try $ do
name <- ident
if name `elem` reservedNames
then unexpected $ "reserved word " ++ show name
else return name | 150 | identifier = lexeme $ try $ do
name <- ident
if name `elem` reservedNames
then unexpected $ "reserved word " ++ show name
else return name | 150 | identifier = lexeme $ try $ do
name <- ident
if name `elem` reservedNames
then unexpected $ "reserved word " ++ show name
else return name | 150 | false | false | 3 | 11 | 37 | 57 | 26 | 31 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | integerDataConKey = mkPreludeDataConUnique 18 | 67 | integerDataConKey = mkPreludeDataConUnique 18 | 67 | integerDataConKey = mkPreludeDataConUnique 18 | 67 | false | false | 0 | 5 | 25 | 9 | 4 | 5 | null | null |
fmapfmapfmap/amazonka | amazonka-efs/gen/Network/AWS/ElasticFileSystem/DescribeMountTargets.hs | mpl-2.0 | -- | Returns the file system\'s mount targets as an array of
-- @MountTargetDescription@ objects.
dmtrMountTargets :: Lens' DescribeMountTargetsResponse [MountTargetDescription]
dmtrMountTargets = lens _dmtrMountTargets (\ s a -> s{_dmtrMountTargets = a}) . _Default | 266 | dmtrMountTargets :: Lens' DescribeMountTargetsResponse [MountTargetDescription]
dmtrMountTargets = lens _dmtrMountTargets (\ s a -> s{_dmtrMountTargets = a}) . _Default | 168 | dmtrMountTargets = lens _dmtrMountTargets (\ s a -> s{_dmtrMountTargets = a}) . _Default | 88 | true | true | 0 | 10 | 32 | 48 | 27 | 21 | null | null |
mzero/PlainChanges2 | src/PartIII.hs | bsd-3-clause | p3SetC :: Music Pitch
p3SetC = chord
[ onBells $ holdLast $ timesM 7 final
, coilAndPad FF $ chord $ zipWith cCycle [5,3,1] [0,12,24]
-- N.B.: The high (Bf,6) of the very last cycle is too high for the
-- coil - it just gets dropped... oh well!
]
where
final = line $ map (note qn) [(Bf, 4), (F, 4), (D, 4), (C, 4), (Bf, 3)]
cCycle n t =
delayM ((7-fromIntegral n)*dur final) $ timesM n $ transpose t final | 452 | p3SetC :: Music Pitch
p3SetC = chord
[ onBells $ holdLast $ timesM 7 final
, coilAndPad FF $ chord $ zipWith cCycle [5,3,1] [0,12,24]
-- N.B.: The high (Bf,6) of the very last cycle is too high for the
-- coil - it just gets dropped... oh well!
]
where
final = line $ map (note qn) [(Bf, 4), (F, 4), (D, 4), (C, 4), (Bf, 3)]
cCycle n t =
delayM ((7-fromIntegral n)*dur final) $ timesM n $ transpose t final | 452 | p3SetC = chord
[ onBells $ holdLast $ timesM 7 final
, coilAndPad FF $ chord $ zipWith cCycle [5,3,1] [0,12,24]
-- N.B.: The high (Bf,6) of the very last cycle is too high for the
-- coil - it just gets dropped... oh well!
]
where
final = line $ map (note qn) [(Bf, 4), (F, 4), (D, 4), (C, 4), (Bf, 3)]
cCycle n t =
delayM ((7-fromIntegral n)*dur final) $ timesM n $ transpose t final | 430 | false | true | 1 | 12 | 128 | 194 | 104 | 90 | null | null |
charles-cooper/postgresql-orm | Database/PostgreSQL/Migrate.hs | gpl-3.0 | -- | The default relative path containing migrations: @\"db\/migrations\"@
defaultMigrationsDir :: FilePath
defaultMigrationsDir = "db" </> "migrations" | 152 | defaultMigrationsDir :: FilePath
defaultMigrationsDir = "db" </> "migrations" | 77 | defaultMigrationsDir = "db" </> "migrations" | 44 | true | true | 0 | 5 | 16 | 16 | 9 | 7 | null | null |
MaxGabriel/yesod | yesod-core/Yesod/Core/Content.hs | mit | typeFlv :: ContentType
typeFlv = "video/x-flv" | 46 | typeFlv :: ContentType
typeFlv = "video/x-flv" | 46 | typeFlv = "video/x-flv" | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
tedhag/teuler | haskell/rest-euler/src/UCeuler1.hs | gpl-3.0 | multiples_of_3_and_5 = [x | x <-[1..999], (x `mod` 3==0) || (x `mod` 5==0)] | 75 | multiples_of_3_and_5 = [x | x <-[1..999], (x `mod` 3==0) || (x `mod` 5==0)] | 75 | multiples_of_3_and_5 = [x | x <-[1..999], (x `mod` 3==0) || (x `mod` 5==0)] | 75 | false | false | 0 | 10 | 12 | 56 | 32 | 24 | null | null |
forste/haReFork | tools/interp/AST.hs | bsd-3-clause | showE (Let dcls d) = "let " ++
foldr (++) "" (map showD dcls)
++
" in " ++ showE d | 162 | showE (Let dcls d) = "let " ++
foldr (++) "" (map showD dcls)
++
" in " ++ showE d | 162 | showE (Let dcls d) = "let " ++
foldr (++) "" (map showD dcls)
++
" in " ++ showE d | 162 | false | false | 0 | 10 | 100 | 50 | 24 | 26 | null | null |
JPMoresmau/haddock | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | bsd-2-clause | ppHsContext [p] unicode qual = ppCtxType unicode qual p | 55 | ppHsContext [p] unicode qual = ppCtxType unicode qual p | 55 | ppHsContext [p] unicode qual = ppCtxType unicode qual p | 55 | false | false | 0 | 6 | 8 | 23 | 11 | 12 | null | null |
xcthulhu/lambda-geda | Geda/Core.hs | gpl-3.0 | attributes (Dirname _) = [] | 27 | attributes (Dirname _) = [] | 27 | attributes (Dirname _) = [] | 27 | false | false | 0 | 7 | 4 | 17 | 8 | 9 | null | null |
yiannist/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | luxiReqChangeJobPriority :: String
luxiReqChangeJobPriority = "ChangeJobPriority" | 81 | luxiReqChangeJobPriority :: String
luxiReqChangeJobPriority = "ChangeJobPriority" | 81 | luxiReqChangeJobPriority = "ChangeJobPriority" | 46 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs | mpl-2.0 | -- | V1 error format.
pjmlXgafv :: Lens' ProjectsJobsMessagesList (Maybe Xgafv)
pjmlXgafv
= lens _pjmlXgafv (\ s a -> s{_pjmlXgafv = a}) | 138 | pjmlXgafv :: Lens' ProjectsJobsMessagesList (Maybe Xgafv)
pjmlXgafv
= lens _pjmlXgafv (\ s a -> s{_pjmlXgafv = a}) | 116 | pjmlXgafv
= lens _pjmlXgafv (\ s a -> s{_pjmlXgafv = a}) | 58 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
nazrhom/vcs-clojure | src/Language/Clojure/Lang.hs | bsd-3-clause | viewExpr (Comment c _) = Tag C3CommentProof (UString c .@. An) | 62 | viewExpr (Comment c _) = Tag C3CommentProof (UString c .@. An) | 62 | viewExpr (Comment c _) = Tag C3CommentProof (UString c .@. An) | 62 | false | false | 0 | 8 | 10 | 32 | 15 | 17 | null | null |
Philonous/pontarius-service | source/Signals.hs | agpl-3.0 | pontariusSignal :: SingI a =>
Text
-> ArgumentDescription (ArgParity a)
-> SignalDescription a
pontariusSignal name args =
SignalDescription { signalDMember = name
, signalDInterface = pontariusInterface
, signalDPath = pontariusObjectPath
, signalDArguments = args
} | 430 | pontariusSignal :: SingI a =>
Text
-> ArgumentDescription (ArgParity a)
-> SignalDescription a
pontariusSignal name args =
SignalDescription { signalDMember = name
, signalDInterface = pontariusInterface
, signalDPath = pontariusObjectPath
, signalDArguments = args
} | 430 | pontariusSignal name args =
SignalDescription { signalDMember = name
, signalDInterface = pontariusInterface
, signalDPath = pontariusObjectPath
, signalDArguments = args
} | 284 | false | true | 0 | 11 | 197 | 77 | 39 | 38 | null | null |
xu-hao/QueryArrow | QueryArrow-db-cypher/src/QueryArrow/Cypher/Cypher.hs | bsd-3-clause | translateFormulaToCypher (FChoice disj1 disj2) =
error "translateFormulaToCypher: unsupported" | 100 | translateFormulaToCypher (FChoice disj1 disj2) =
error "translateFormulaToCypher: unsupported" | 100 | translateFormulaToCypher (FChoice disj1 disj2) =
error "translateFormulaToCypher: unsupported" | 100 | false | false | 0 | 7 | 13 | 20 | 9 | 11 | null | null |
kaoskorobase/mescaline | resources/hugs/packages/base/Data/Set.hs | gpl-3.0 | splitMember :: Ord a => a -> Set a -> (Set a,Bool,Set a)
splitMember x t = let (l,m,r) = splitLookup x t in
(l,maybe False (const True) m,r) | 145 | splitMember :: Ord a => a -> Set a -> (Set a,Bool,Set a)
splitMember x t = let (l,m,r) = splitLookup x t in
(l,maybe False (const True) m,r) | 145 | splitMember x t = let (l,m,r) = splitLookup x t in
(l,maybe False (const True) m,r) | 88 | false | true | 0 | 10 | 33 | 97 | 49 | 48 | null | null |
ekmett/indexed | src/Indexed/Map.hs | bsd-3-clause | null Bin{} = False | 18 | null Bin{} = False | 18 | null Bin{} = False | 18 | false | false | 0 | 5 | 3 | 14 | 6 | 8 | null | null |
Cognimeta/perdure-file | src/Database/Perdure/LocalStoreFile.hs | apache-2.0 | storeFileReadWords :: (LgMultiple w Word8, Endian w, RawStoreFile f) =>
f -> Len Word8 Word64 -> Endianness -> Len w Word32 -> Async (Maybe (PrimArray Pinned w)) ()
storeFileReadWords f addr e l k = do
buf <- stToIO $ mkArray $ refineLen $ apply super <$> l
($ k) $ mapAsync (bool (return Nothing) $ Just <$> processBuf buf) $ storeFileReadRaw f addr (fullArrayRange buf) where
processBuf buf = stToIO (toWords <$> unsafeFreezeSTPrimArray buf) -- TODO optimize by swapping bytes in-place then freezing
toWords = bool (mapImmArray unswapBytes . unsafePrimArrayCast) unsafePrimArrayCast (e == platformWordEndianness)
---------------------------------------------------------------------------
-- | A file or raw device where we can persist bytes. | 791 | storeFileReadWords :: (LgMultiple w Word8, Endian w, RawStoreFile f) =>
f -> Len Word8 Word64 -> Endianness -> Len w Word32 -> Async (Maybe (PrimArray Pinned w)) ()
storeFileReadWords f addr e l k = do
buf <- stToIO $ mkArray $ refineLen $ apply super <$> l
($ k) $ mapAsync (bool (return Nothing) $ Just <$> processBuf buf) $ storeFileReadRaw f addr (fullArrayRange buf) where
processBuf buf = stToIO (toWords <$> unsafeFreezeSTPrimArray buf) -- TODO optimize by swapping bytes in-place then freezing
toWords = bool (mapImmArray unswapBytes . unsafePrimArrayCast) unsafePrimArrayCast (e == platformWordEndianness)
---------------------------------------------------------------------------
-- | A file or raw device where we can persist bytes. | 791 | storeFileReadWords f addr e l k = do
buf <- stToIO $ mkArray $ refineLen $ apply super <$> l
($ k) $ mapAsync (bool (return Nothing) $ Just <$> processBuf buf) $ storeFileReadRaw f addr (fullArrayRange buf) where
processBuf buf = stToIO (toWords <$> unsafeFreezeSTPrimArray buf) -- TODO optimize by swapping bytes in-place then freezing
toWords = bool (mapImmArray unswapBytes . unsafePrimArrayCast) unsafePrimArrayCast (e == platformWordEndianness)
---------------------------------------------------------------------------
-- | A file or raw device where we can persist bytes. | 603 | false | true | 0 | 15 | 154 | 227 | 112 | 115 | null | null |
palf/haskellSDL2Examples | common/lib/Common.hs | gpl-2.0 | conditionallyRun _ False = pure False | 37 | conditionallyRun _ False = pure False | 37 | conditionallyRun _ False = pure False | 37 | false | false | 1 | 5 | 5 | 15 | 6 | 9 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/array/Data/Array/Base.hs | bsd-3-clause | thaw arr = case bounds arr of
(l,u) -> do
marr <- newArray_ (l,u)
let n = safeRangeSize (l,u)
sequence_ [ unsafeWrite marr i (unsafeAt arr i)
| i <- [0 .. n - 1]]
return marr | 206 | thaw arr = case bounds arr of
(l,u) -> do
marr <- newArray_ (l,u)
let n = safeRangeSize (l,u)
sequence_ [ unsafeWrite marr i (unsafeAt arr i)
| i <- [0 .. n - 1]]
return marr | 206 | thaw arr = case bounds arr of
(l,u) -> do
marr <- newArray_ (l,u)
let n = safeRangeSize (l,u)
sequence_ [ unsafeWrite marr i (unsafeAt arr i)
| i <- [0 .. n - 1]]
return marr | 206 | false | false | 1 | 13 | 68 | 111 | 54 | 57 | null | null |
coccinelle/hBugs | src/Psql.hs | gpl-2.0 | psqlDebug = PsqlM . lift . debug | 34 | psqlDebug = PsqlM . lift . debug | 34 | psqlDebug = PsqlM . lift . debug | 34 | false | false | 0 | 6 | 8 | 14 | 7 | 7 | null | null |
stgm/prac-testing | week6/Week6.hs | mit | m12 = 2^127-1 | 13 | m12 = 2^127-1 | 13 | m12 = 2^127-1 | 13 | false | false | 0 | 6 | 2 | 14 | 7 | 7 | null | null |
hterkelsen/mal | haskell/step6_file.hs | mpl-2.0 | eval_ast ast@(MalList lst m) env = do
new_lst <- mapM (\x -> (eval x env)) lst
return $ MalList new_lst m | 113 | eval_ast ast@(MalList lst m) env = do
new_lst <- mapM (\x -> (eval x env)) lst
return $ MalList new_lst m | 113 | eval_ast ast@(MalList lst m) env = do
new_lst <- mapM (\x -> (eval x env)) lst
return $ MalList new_lst m | 113 | false | false | 0 | 12 | 28 | 62 | 30 | 32 | null | null |
meimisaki/Rin | src/Core/AnnotAST.hs | mit | getAnnot :: Annot a b -> a
getAnnot = fst . runAnnot | 52 | getAnnot :: Annot a b -> a
getAnnot = fst . runAnnot | 52 | getAnnot = fst . runAnnot | 25 | false | true | 1 | 7 | 11 | 32 | 13 | 19 | null | null |
ekmett/multipass | Data/Pass/Fun.hs | bsd-3-clause | funTyCon = mkTyCon3 "pass" "Data.Pass.Fun" "Fun" | 48 | funTyCon = mkTyCon3 "pass" "Data.Pass.Fun" "Fun" | 48 | funTyCon = mkTyCon3 "pass" "Data.Pass.Fun" "Fun" | 48 | false | false | 1 | 5 | 5 | 17 | 6 | 11 | null | null |
spetz911/progames | nehe-tuts-0.2.3/lesson10.hs | mit | mkGlobal :: IO Global
mkGlobal = do xr <- newIORef 0 -- please someone find a nicer way...
yr <- newIORef 0
xs <- newIORef 0
ys <- newIORef 0
wb <- newIORef 0
wba <- newIORef 0
lud <- newIORef 0
xp <- newIORef 0
zp <- newIORef 0
cx <- newIORef 0
cy <- newIORef 0
cz <- newIORef 0
tr <- newIORef 0
h <- newIORef 0
zd <- newIORef 0
fs <- newIORef 0
b <- newIORef True
l <- newIORef True
return Global { xrot = xr, yrot = yr, xspeed = xs, yspeed = ys,
walkbias = wb, walkbiasangle = wba, lookupdown =
lud, xpos = xp, zpos = zp, camx = cx, camy = cy,
camz = cz, therotate = tr, heading = h,
zdepth = zd, filterSelector = fs, blend = b,
lighting = l } | 1,051 | mkGlobal :: IO Global
mkGlobal = do xr <- newIORef 0 -- please someone find a nicer way...
yr <- newIORef 0
xs <- newIORef 0
ys <- newIORef 0
wb <- newIORef 0
wba <- newIORef 0
lud <- newIORef 0
xp <- newIORef 0
zp <- newIORef 0
cx <- newIORef 0
cy <- newIORef 0
cz <- newIORef 0
tr <- newIORef 0
h <- newIORef 0
zd <- newIORef 0
fs <- newIORef 0
b <- newIORef True
l <- newIORef True
return Global { xrot = xr, yrot = yr, xspeed = xs, yspeed = ys,
walkbias = wb, walkbiasangle = wba, lookupdown =
lud, xpos = xp, zpos = zp, camx = cx, camy = cy,
camz = cz, therotate = tr, heading = h,
zdepth = zd, filterSelector = fs, blend = b,
lighting = l } | 1,051 | mkGlobal = do xr <- newIORef 0 -- please someone find a nicer way...
yr <- newIORef 0
xs <- newIORef 0
ys <- newIORef 0
wb <- newIORef 0
wba <- newIORef 0
lud <- newIORef 0
xp <- newIORef 0
zp <- newIORef 0
cx <- newIORef 0
cy <- newIORef 0
cz <- newIORef 0
tr <- newIORef 0
h <- newIORef 0
zd <- newIORef 0
fs <- newIORef 0
b <- newIORef True
l <- newIORef True
return Global { xrot = xr, yrot = yr, xspeed = xs, yspeed = ys,
walkbias = wb, walkbiasangle = wba, lookupdown =
lud, xpos = xp, zpos = zp, camx = cx, camy = cy,
camz = cz, therotate = tr, heading = h,
zdepth = zd, filterSelector = fs, blend = b,
lighting = l } | 1,029 | false | true | 0 | 9 | 548 | 311 | 155 | 156 | null | null |
sakari/haskell-gherkin | Language/Gherkin/Pretty.hs | bsd-3-clause | prettyScenario :: Scenario -> Doc
prettyScenario Scenario { scenario_tags
, scenario_name
, scenario_steps
} =
hsep (map (text . ("@" ++)) scenario_tags) $+$
text "Scenario:" <+> text scenario_name $+$
(nest 4 $
vcat $ map prettyStep scenario_steps) | 330 | prettyScenario :: Scenario -> Doc
prettyScenario Scenario { scenario_tags
, scenario_name
, scenario_steps
} =
hsep (map (text . ("@" ++)) scenario_tags) $+$
text "Scenario:" <+> text scenario_name $+$
(nest 4 $
vcat $ map prettyStep scenario_steps) | 330 | prettyScenario Scenario { scenario_tags
, scenario_name
, scenario_steps
} =
hsep (map (text . ("@" ++)) scenario_tags) $+$
text "Scenario:" <+> text scenario_name $+$
(nest 4 $
vcat $ map prettyStep scenario_steps) | 296 | false | true | 0 | 13 | 117 | 89 | 45 | 44 | null | null |
christiaanb/clash-compiler | clash-vhdl/src/CLaSH/Backend/VHDL.hs | bsd-2-clause | vectorChain :: Expr -> Maybe [Expr]
vectorChain (DataCon (Vector 0 _) _ _) = Just [] | 91 | vectorChain :: Expr -> Maybe [Expr]
vectorChain (DataCon (Vector 0 _) _ _) = Just [] | 91 | vectorChain (DataCon (Vector 0 _) _ _) = Just [] | 55 | false | true | 0 | 9 | 22 | 47 | 23 | 24 | null | null |
alexander-at-github/eta | compiler/ETA/Interactive/ByteCodeInstr.hs | bsd-3-clause | bciStackUse (UNPACK sz) = fromIntegral sz | 51 | bciStackUse (UNPACK sz) = fromIntegral sz | 51 | bciStackUse (UNPACK sz) = fromIntegral sz | 51 | false | false | 0 | 6 | 15 | 19 | 8 | 11 | null | null |
abbergie/allison | src/Parser.hs | gpl-3.0 | pVarA :: Parser Annot
pVarA =
do char '\''
x <- identifier
return $ VarA x | 104 | pVarA :: Parser Annot
pVarA =
do char '\''
x <- identifier
return $ VarA x | 104 | pVarA =
do char '\''
x <- identifier
return $ VarA x | 82 | false | true | 0 | 8 | 45 | 37 | 16 | 21 | null | null |
mettekou/ghc | compiler/prelude/THNames.hs | bsd-3-clause | unTypeIdKey = mkPreludeMiscIdUnique 211 | 48 | unTypeIdKey = mkPreludeMiscIdUnique 211 | 48 | unTypeIdKey = mkPreludeMiscIdUnique 211 | 48 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
vincenthz/hs-foundation | basement/Basement/Compat/ExtList.hs | bsd-3-clause | null (_:_) = False | 18 | null (_:_) = False | 18 | null (_:_) = False | 18 | false | false | 0 | 6 | 3 | 17 | 8 | 9 | null | null |
ezyang/ghc | testsuite/tests/gadt/josef.hs | bsd-3-clause | interp :: CartesianClosed terminal exp prod arr =>
Lambda terminal exp prod s t -> arr s t
interp (Unit) = terminal | 131 | interp :: CartesianClosed terminal exp prod arr =>
Lambda terminal exp prod s t -> arr s t
interp (Unit) = terminal | 131 | interp (Unit) = terminal | 30 | false | true | 0 | 7 | 37 | 50 | 24 | 26 | null | null |
diminishedprime/.org | programmey_stuff/write_yourself_a_scheme/ch_08/wyas/app/Eval.hs | mit | cons :: [LispVal] -> ThrowsError LispVal
cons [x1, List []] = return $ List [x1] | 91 | cons :: [LispVal] -> ThrowsError LispVal
cons [x1, List []] = return $ List [x1] | 91 | cons [x1, List []] = return $ List [x1] | 50 | false | true | 2 | 10 | 25 | 50 | 24 | 26 | null | null |
ezyang/ghc | compiler/prelude/THNames.hs | bsd-3-clause | caseEName = libFun (fsLit "caseE") caseEIdKey | 57 | caseEName = libFun (fsLit "caseE") caseEIdKey | 57 | caseEName = libFun (fsLit "caseE") caseEIdKey | 57 | false | false | 0 | 7 | 17 | 17 | 8 | 9 | null | null |
lukasepple/emoji | src/Text/Emoji/DataFiles/EmojiTest.hs | lgpl-3.0 | groupLevelText EmojiTestSubgroup = "subgroup" | 45 | groupLevelText EmojiTestSubgroup = "subgroup" | 45 | groupLevelText EmojiTestSubgroup = "subgroup" | 45 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
sdiehl/ghc | compiler/utils/Bag.hs | bsd-3-clause | mapBagM f (TwoBags b1 b2) = do r1 <- mapBagM f b1
r2 <- mapBagM f b2
return (TwoBags r1 r2) | 153 | mapBagM f (TwoBags b1 b2) = do r1 <- mapBagM f b1
r2 <- mapBagM f b2
return (TwoBags r1 r2) | 153 | mapBagM f (TwoBags b1 b2) = do r1 <- mapBagM f b1
r2 <- mapBagM f b2
return (TwoBags r1 r2) | 153 | false | false | 0 | 9 | 82 | 59 | 25 | 34 | null | null |
sleexyz/haskell-fun | Oscillator.hs | bsd-3-clause | squareWavetable :: Int -> [Double]
squareWavetable tableSize = replicate half 0.5 ++ replicate (tableSize - half) (-0.5)
where
half = tableSize `div` 2 | 157 | squareWavetable :: Int -> [Double]
squareWavetable tableSize = replicate half 0.5 ++ replicate (tableSize - half) (-0.5)
where
half = tableSize `div` 2 | 157 | squareWavetable tableSize = replicate half 0.5 ++ replicate (tableSize - half) (-0.5)
where
half = tableSize `div` 2 | 122 | false | true | 1 | 8 | 28 | 72 | 34 | 38 | null | null |
dbp/karamaan-opaleye | Karamaan/Opaleye/Aggregate.hs | bsd-3-clause | -- This is messy and there should be a lot more structure to it, but I can't see
-- how, currently. Once there's another function like this
-- and binrel it will perhaps be easy to see where the real duplication is.
aggregate' :: Aggregator a b -> (a, PrimQuery, Tag) -> (b, PrimQuery, Tag)
aggregate' agg (out, primQ', j) =
let tag' :: String -> String
tag' = tagWith j
(Aggregator aggrs writer' mapper) = agg
old_names :: [String]
old_names = runWriter writer' out
new_names :: [String]
new_names = map tag' old_names
zipped :: [(String, Maybe AggrOp, String)]
zipped = zip3 new_names (runWriter aggrs out) old_names
jobber :: PrimQuery
jobber = Project (map assoc zipped) primQ'
in (runPackMap mapper tag' out, jobber, next j) | 818 | aggregate' :: Aggregator a b -> (a, PrimQuery, Tag) -> (b, PrimQuery, Tag)
aggregate' agg (out, primQ', j) =
let tag' :: String -> String
tag' = tagWith j
(Aggregator aggrs writer' mapper) = agg
old_names :: [String]
old_names = runWriter writer' out
new_names :: [String]
new_names = map tag' old_names
zipped :: [(String, Maybe AggrOp, String)]
zipped = zip3 new_names (runWriter aggrs out) old_names
jobber :: PrimQuery
jobber = Project (map assoc zipped) primQ'
in (runPackMap mapper tag' out, jobber, next j) | 601 | aggregate' agg (out, primQ', j) =
let tag' :: String -> String
tag' = tagWith j
(Aggregator aggrs writer' mapper) = agg
old_names :: [String]
old_names = runWriter writer' out
new_names :: [String]
new_names = map tag' old_names
zipped :: [(String, Maybe AggrOp, String)]
zipped = zip3 new_names (runWriter aggrs out) old_names
jobber :: PrimQuery
jobber = Project (map assoc zipped) primQ'
in (runPackMap mapper tag' out, jobber, next j) | 526 | true | true | 0 | 11 | 213 | 216 | 118 | 98 | null | null |
ichistmeinname/holumbus | src/Holumbus/Query/Ranking.hs | mit | -- | Rank words by context-weighted count. The weights will be normalized to a maximum of 1.0.
-- Contexts with no weight (or a weight of zero) will be ignored.
wordRankWeightedByCount :: [(Context, Score)] -> Word -> WordInfo -> WordContextHits -> Score
wordRankWeightedByCount ws _ _ h
= M.foldrWithKey (calcWeightedScore ws) 0.0 h | 358 | wordRankWeightedByCount :: [(Context, Score)] -> Word -> WordInfo -> WordContextHits -> Score
wordRankWeightedByCount ws _ _ h
= M.foldrWithKey (calcWeightedScore ws) 0.0 h | 196 | wordRankWeightedByCount ws _ _ h
= M.foldrWithKey (calcWeightedScore ws) 0.0 h | 102 | true | true | 0 | 8 | 77 | 62 | 33 | 29 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.