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
locaweb/leela
src/warpdrive/src/Leela/Data/Funclib.hs
apache-2.0
ewma :: Num a => a -> Func (Maybe a) (V.Vector a) a ewma alpha = func Nothing next where next Nothing as = next (Just $ V.head as) (V.tail as) next (Just m0) as = let m1 = V.foldl' (\m a -> m + alpha * (a - m)) m0 as in (func (Just m1) next, m1)
290
ewma :: Num a => a -> Func (Maybe a) (V.Vector a) a ewma alpha = func Nothing next where next Nothing as = next (Just $ V.head as) (V.tail as) next (Just m0) as = let m1 = V.foldl' (\m a -> m + alpha * (a - m)) m0 as in (func (Just m1) next, m1)
290
ewma alpha = func Nothing next where next Nothing as = next (Just $ V.head as) (V.tail as) next (Just m0) as = let m1 = V.foldl' (\m a -> m + alpha * (a - m)) m0 as in (func (Just m1) next, m1)
238
false
true
0
14
102
175
83
92
null
null
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/unloadAll/null/Dep.hs
bsd-3-clause
resource = null
15
resource = null
15
resource = null
15
false
false
1
5
2
10
3
7
null
null
CloudI/CloudI
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString.hs
mit
-- | /O(n)/ The 'isSuffixOf' function takes two ByteStrings and returns 'True' -- iff the first is a suffix of the second. -- -- The following holds: -- -- > isSuffixOf x y == reverse x `isPrefixOf` reverse y -- -- However, the real implemenation uses memcmp to compare the end of the -- string only, with no reverse required.. isSuffixOf :: ByteString -> ByteString -> Bool isSuffixOf (PS x1 s1 l1) (PS x2 s2 l2) | l1 == 0 = True | l2 < l1 = False | otherwise = accursedUnutterablePerformIO $ withForeignPtr x1 $ \p1 -> withForeignPtr x2 $ \p2 -> do i <- memcmp (p1 `plusPtr` s1) (p2 `plusPtr` s2 `plusPtr` (l2 - l1)) (fromIntegral l1) return $! i == 0 -- | /O(n)/ The 'stripSuffix' function takes two ByteStrings and returns 'Just' -- the remainder of the second iff the first is its suffix, and otherwise -- 'Nothing'.
870
isSuffixOf :: ByteString -> ByteString -> Bool isSuffixOf (PS x1 s1 l1) (PS x2 s2 l2) | l1 == 0 = True | l2 < l1 = False | otherwise = accursedUnutterablePerformIO $ withForeignPtr x1 $ \p1 -> withForeignPtr x2 $ \p2 -> do i <- memcmp (p1 `plusPtr` s1) (p2 `plusPtr` s2 `plusPtr` (l2 - l1)) (fromIntegral l1) return $! i == 0 -- | /O(n)/ The 'stripSuffix' function takes two ByteStrings and returns 'Just' -- the remainder of the second iff the first is its suffix, and otherwise -- 'Nothing'.
542
isSuffixOf (PS x1 s1 l1) (PS x2 s2 l2) | l1 == 0 = True | l2 < l1 = False | otherwise = accursedUnutterablePerformIO $ withForeignPtr x1 $ \p1 -> withForeignPtr x2 $ \p2 -> do i <- memcmp (p1 `plusPtr` s1) (p2 `plusPtr` s2 `plusPtr` (l2 - l1)) (fromIntegral l1) return $! i == 0 -- | /O(n)/ The 'stripSuffix' function takes two ByteStrings and returns 'Just' -- the remainder of the second iff the first is its suffix, and otherwise -- 'Nothing'.
495
true
true
2
13
200
189
99
90
null
null
fmapfmapfmap/amazonka
amazonka-dynamodb-streams/gen/Network/AWS/DynamoDBStreams/Types/Product.hs
mpl-2.0
-- | The shard ID of the item where the operation stopped, inclusive of the -- previous result set. Use this value to start a new operation, excluding -- this value in the new request. -- -- If 'LastEvaluatedShardId' is empty, then the \"last page\" of results -- has been processed and there is currently no more data to be retrieved. -- -- If 'LastEvaluatedShardId' is not empty, it does not necessarily mean -- that there is more data in the result set. The only way to know when you -- have reached the end of the result set is when 'LastEvaluatedShardId' is -- empty. sdLastEvaluatedShardId :: Lens' StreamDescription (Maybe Text) sdLastEvaluatedShardId = lens _sdLastEvaluatedShardId (\ s a -> s{_sdLastEvaluatedShardId = a})
731
sdLastEvaluatedShardId :: Lens' StreamDescription (Maybe Text) sdLastEvaluatedShardId = lens _sdLastEvaluatedShardId (\ s a -> s{_sdLastEvaluatedShardId = a})
158
sdLastEvaluatedShardId = lens _sdLastEvaluatedShardId (\ s a -> s{_sdLastEvaluatedShardId = a})
95
true
true
0
9
121
56
35
21
null
null
matterhorn-chat/matterhorn
src/Matterhorn/Events/Mouse.hs
bsd-3-clause
-- The top-level mouse click handler. This dispatches to specific -- handlers for some modes, or the global mouse handler when the mode is -- not important (or when it is important that we ignore the mode). mouseHandlerByMode :: Mode -> BrickEvent Name MHEvent -> MH () mouseHandlerByMode mode = case mode of ChannelSelect -> channelSelectMouseHandler EditNotifyPrefs -> handleEditNotifyPrefsEvent ReactionEmojiListOverlay -> reactionEmojiListMouseHandler UrlSelect -> urlListMouseHandler _ -> globalMouseHandler -- Handle global mouse click events (when mode is not important). -- -- Note that the handler for each case may need to check the application -- mode before handling the click. This is because some mouse events -- only make sense when the UI is displaying certain contents. While -- it's true that we probably wouldn't even get the click events in the -- first place (because the UI element would only cause a click event -- to be reported if it was actually rendered), there are cases when we -- can get clicks on UI elements that *are* clickable even though those -- clicks don't make sense for the application mode. A concrete example -- of this is when we display the current channel's contents in one -- layer, in monochrome, and then display a modal dialog box on top of -- that. We probably *should* ignore clicks on the lower layer because -- that's not the mode the application is in, but getting that right -- could be hard because we'd have to figure out all possible modes -- where those lower-layer clicks would be nonsensical. We don't bother -- doing that in the harder cases; instead we just handle the clicks -- and do what we would ordinarily do, assuming that there's no real -- harm done. The worst that could happen is that a user could click -- accidentally on a grayed-out URL (in a message, say) next to a modal -- dialog box and then see the URL get opened. That would be weird, but -- it isn't the end of the world.
2,057
mouseHandlerByMode :: Mode -> BrickEvent Name MHEvent -> MH () mouseHandlerByMode mode = case mode of ChannelSelect -> channelSelectMouseHandler EditNotifyPrefs -> handleEditNotifyPrefsEvent ReactionEmojiListOverlay -> reactionEmojiListMouseHandler UrlSelect -> urlListMouseHandler _ -> globalMouseHandler -- Handle global mouse click events (when mode is not important). -- -- Note that the handler for each case may need to check the application -- mode before handling the click. This is because some mouse events -- only make sense when the UI is displaying certain contents. While -- it's true that we probably wouldn't even get the click events in the -- first place (because the UI element would only cause a click event -- to be reported if it was actually rendered), there are cases when we -- can get clicks on UI elements that *are* clickable even though those -- clicks don't make sense for the application mode. A concrete example -- of this is when we display the current channel's contents in one -- layer, in monochrome, and then display a modal dialog box on top of -- that. We probably *should* ignore clicks on the lower layer because -- that's not the mode the application is in, but getting that right -- could be hard because we'd have to figure out all possible modes -- where those lower-layer clicks would be nonsensical. We don't bother -- doing that in the harder cases; instead we just handle the clicks -- and do what we would ordinarily do, assuming that there's no real -- harm done. The worst that could happen is that a user could click -- accidentally on a grayed-out URL (in a message, say) next to a modal -- dialog box and then see the URL get opened. That would be weird, but -- it isn't the end of the world.
1,850
mouseHandlerByMode mode = case mode of ChannelSelect -> channelSelectMouseHandler EditNotifyPrefs -> handleEditNotifyPrefsEvent ReactionEmojiListOverlay -> reactionEmojiListMouseHandler UrlSelect -> urlListMouseHandler _ -> globalMouseHandler -- Handle global mouse click events (when mode is not important). -- -- Note that the handler for each case may need to check the application -- mode before handling the click. This is because some mouse events -- only make sense when the UI is displaying certain contents. While -- it's true that we probably wouldn't even get the click events in the -- first place (because the UI element would only cause a click event -- to be reported if it was actually rendered), there are cases when we -- can get clicks on UI elements that *are* clickable even though those -- clicks don't make sense for the application mode. A concrete example -- of this is when we display the current channel's contents in one -- layer, in monochrome, and then display a modal dialog box on top of -- that. We probably *should* ignore clicks on the lower layer because -- that's not the mode the application is in, but getting that right -- could be hard because we'd have to figure out all possible modes -- where those lower-layer clicks would be nonsensical. We don't bother -- doing that in the harder cases; instead we just handle the clicks -- and do what we would ordinarily do, assuming that there's no real -- harm done. The worst that could happen is that a user could click -- accidentally on a grayed-out URL (in a message, say) next to a modal -- dialog box and then see the URL get opened. That would be weird, but -- it isn't the end of the world.
1,787
true
true
0
8
439
91
57
34
null
null
DavidAlphaFox/darcs
harness/Darcs/Test/Misc.hs
gpl-2.0
knownShifts :: [([Int],[Int],String,String,[Int],[Int])] knownShifts = [([0,0,0],[0,1,0,1,0],"aaa","aaaaa", [0,0,0],[0,0,0,1,1]), ([0,1,0],[0,1,1,0],"cd ","c a ", [0,1,0],[0,1,1,0]), ([1,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,1,1,1,1,1,0,0,0], "fg{} if{}","dg{} ih{} if{}", [1,0,0,0,0,0,0,0,0],[1,0,0,0,0,1,1,1,1,1,0,0,0,0]), -- prefer empty line at end ([0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,1,1,0,0,0], "fg{} if{}","fg{} ih{} if{}", [0,0,0,0,0,0,0,0,0],[0,0,0,0,0,1,1,1,1,1,0,0,0,0]), -- prefer empty line at end ([],[1,1],"","aa",[],[1,1]), ([1,1],[],"aa","",[1,1],[])]
597
knownShifts :: [([Int],[Int],String,String,[Int],[Int])] knownShifts = [([0,0,0],[0,1,0,1,0],"aaa","aaaaa", [0,0,0],[0,0,0,1,1]), ([0,1,0],[0,1,1,0],"cd ","c a ", [0,1,0],[0,1,1,0]), ([1,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,1,1,1,1,1,0,0,0], "fg{} if{}","dg{} ih{} if{}", [1,0,0,0,0,0,0,0,0],[1,0,0,0,0,1,1,1,1,1,0,0,0,0]), -- prefer empty line at end ([0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,1,1,0,0,0], "fg{} if{}","fg{} ih{} if{}", [0,0,0,0,0,0,0,0,0],[0,0,0,0,0,1,1,1,1,1,0,0,0,0]), -- prefer empty line at end ([],[1,1],"","aa",[],[1,1]), ([1,1],[],"aa","",[1,1],[])]
597
knownShifts = [([0,0,0],[0,1,0,1,0],"aaa","aaaaa", [0,0,0],[0,0,0,1,1]), ([0,1,0],[0,1,1,0],"cd ","c a ", [0,1,0],[0,1,1,0]), ([1,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,1,1,1,1,1,0,0,0], "fg{} if{}","dg{} ih{} if{}", [1,0,0,0,0,0,0,0,0],[1,0,0,0,0,1,1,1,1,1,0,0,0,0]), -- prefer empty line at end ([0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,1,1,0,0,0], "fg{} if{}","fg{} ih{} if{}", [0,0,0,0,0,0,0,0,0],[0,0,0,0,0,1,1,1,1,1,0,0,0,0]), -- prefer empty line at end ([],[1,1],"","aa",[],[1,1]), ([1,1],[],"aa","",[1,1],[])]
540
false
true
0
7
70
570
378
192
null
null
frontrowed/stratosphere
library-gen/Stratosphere/Resources/EC2Instance.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-launchtemplate eciLaunchTemplate :: Lens' EC2Instance (Maybe EC2InstanceLaunchTemplateSpecification) eciLaunchTemplate = lens _eC2InstanceLaunchTemplate (\s a -> s { _eC2InstanceLaunchTemplate = a })
316
eciLaunchTemplate :: Lens' EC2Instance (Maybe EC2InstanceLaunchTemplateSpecification) eciLaunchTemplate = lens _eC2InstanceLaunchTemplate (\s a -> s { _eC2InstanceLaunchTemplate = a })
184
eciLaunchTemplate = lens _eC2InstanceLaunchTemplate (\s a -> s { _eC2InstanceLaunchTemplate = a })
98
true
true
1
9
21
51
25
26
null
null
truls/almique
src/Language/PySMEIL/Typing.hs
gpl-3.0
sign (UIntType _) = IsUnsigned
31
sign (UIntType _) = IsUnsigned
31
sign (UIntType _) = IsUnsigned
31
false
false
0
7
5
15
7
8
null
null
acowley/ghc
compiler/basicTypes/Id.hs
bsd-3-clause
-- TyVars count as not dead {- ************************************************************************ * * Evidence variables * * ************************************************************************ -} isEvVar :: Var -> Bool isEvVar var = isPredTy (varType var)
420
isEvVar :: Var -> Bool isEvVar var = isPredTy (varType var)
59
isEvVar var = isPredTy (varType var)
36
true
true
0
7
180
29
15
14
null
null
nevrenato/HetsAlloy
Common/Lib/Maybe.hs
gpl-2.0
liftToMaybeT :: Monad m => m a -> MaybeT m a liftToMaybeT = MaybeT . liftM Just
79
liftToMaybeT :: Monad m => m a -> MaybeT m a liftToMaybeT = MaybeT . liftM Just
79
liftToMaybeT = MaybeT . liftM Just
34
false
true
1
8
16
43
18
25
null
null
savannidgerinel/health
tests/ApiSpec.hs
bsd-3-clause
reloadSpec :: Spec reloadSpec = describe "verify that reloading works as it should" $ do it "should reload an empty database if the database has been removed" $ wrapDB testDir testConfig $ \ctx -> do do res <- runClient (authToken, ctx) $ do _ <- putWeight Nothing "2017-07-21T00:00:00-0400" 21.0 _ <- putWeight Nothing "2017-07-22T00:00:00-0400" 22.0 _ <- putWeight Nothing "2017-07-23T00:00:00-0400" 23.0 getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err removeSeries testDir do res <- runClient (authToken, ctx) $ do reloadSeries getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 0 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err it "should reload the existing database" $ wrapDB testDir testConfig $ \ctx -> do do res <- runClient (authToken, ctx) $ do _ <- putWeight Nothing "2017-07-21T00:00:00-0400" 21.0 _ <- putWeight Nothing "2017-07-22T00:00:00-0400" 22.0 _ <- putWeight Nothing "2017-07-23T00:00:00-0400" 23.0 getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err do res <- runClient (authToken, ctx) $ do reloadSeries getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err
2,562
reloadSpec :: Spec reloadSpec = describe "verify that reloading works as it should" $ do it "should reload an empty database if the database has been removed" $ wrapDB testDir testConfig $ \ctx -> do do res <- runClient (authToken, ctx) $ do _ <- putWeight Nothing "2017-07-21T00:00:00-0400" 21.0 _ <- putWeight Nothing "2017-07-22T00:00:00-0400" 22.0 _ <- putWeight Nothing "2017-07-23T00:00:00-0400" 23.0 getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err removeSeries testDir do res <- runClient (authToken, ctx) $ do reloadSeries getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 0 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err it "should reload the existing database" $ wrapDB testDir testConfig $ \ctx -> do do res <- runClient (authToken, ctx) $ do _ <- putWeight Nothing "2017-07-21T00:00:00-0400" 21.0 _ <- putWeight Nothing "2017-07-22T00:00:00-0400" 22.0 _ <- putWeight Nothing "2017-07-23T00:00:00-0400" 23.0 getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err do res <- runClient (authToken, ctx) $ do reloadSeries getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err
2,562
reloadSpec = describe "verify that reloading works as it should" $ do it "should reload an empty database if the database has been removed" $ wrapDB testDir testConfig $ \ctx -> do do res <- runClient (authToken, ctx) $ do _ <- putWeight Nothing "2017-07-21T00:00:00-0400" 21.0 _ <- putWeight Nothing "2017-07-22T00:00:00-0400" 22.0 _ <- putWeight Nothing "2017-07-23T00:00:00-0400" 23.0 getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err removeSeries testDir do res <- runClient (authToken, ctx) $ do reloadSeries getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 0 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err it "should reload the existing database" $ wrapDB testDir testConfig $ \ctx -> do do res <- runClient (authToken, ctx) $ do _ <- putWeight Nothing "2017-07-21T00:00:00-0400" 21.0 _ <- putWeight Nothing "2017-07-22T00:00:00-0400" 22.0 _ <- putWeight Nothing "2017-07-23T00:00:00-0400" 23.0 getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err do res <- runClient (authToken, ctx) $ do reloadSeries getHistory (Just ("2017-07-20T00:00:00-0400", "2017-07-24T00:00:00-0400")) case res of Right (History weights timeDistance setRep) -> do length weights `shouldBe` 3 length timeDistance `shouldBe` 0 length setRep `shouldBe` 0 Left err -> expectationFailure $ show err
2,543
false
true
0
21
920
638
299
339
null
null
clinty/Juicy.Pixels
src/Codec/Picture/Jpg/Types.hs
bsd-3-clause
putFrame (JpgHuffmanTable tables) = put JpgHuffmanTableMarker >> put (TableList $ map fst tables)
101
putFrame (JpgHuffmanTable tables) = put JpgHuffmanTableMarker >> put (TableList $ map fst tables)
101
putFrame (JpgHuffmanTable tables) = put JpgHuffmanTableMarker >> put (TableList $ map fst tables)
101
false
false
0
9
16
37
17
20
null
null
quyse/flaw
flaw-graphics/Flaw/Graphics/Program.hs
mit
ddy :: OfValueType a => Node a -> Node a ddy a = DdyNode (nodeValueType a) a
76
ddy :: OfValueType a => Node a -> Node a ddy a = DdyNode (nodeValueType a) a
76
ddy a = DdyNode (nodeValueType a) a
35
false
true
0
7
16
42
19
23
null
null
Numberartificial/workflow
snipets/src/Craft/Chapter8.hs
mit
playSvsS :: Strategy -> Strategy -> Integer -> Tournament playSvsS strategyA strategyB n = error "exercise"
113
playSvsS :: Strategy -> Strategy -> Integer -> Tournament playSvsS strategyA strategyB n = error "exercise"
112
playSvsS strategyA strategyB n = error "exercise"
54
false
true
0
7
21
33
16
17
null
null
bjornbm/astro
src/Astro/Coords/ECR.hs
bsd-3-clause
-- TODO ^^^ Use gmst instead?? -- | Convert coordinates from ECR frame to ECI frame. ecrToECI' :: RealFloat a => At UT1 a (Coord ECR a) -> At UT1 a (Coord ECI a) ecrToECI' At {..} = ecrToECI epoch value `At` epoch
213
ecrToECI' :: RealFloat a => At UT1 a (Coord ECR a) -> At UT1 a (Coord ECI a) ecrToECI' At {..} = ecrToECI epoch value `At` epoch
128
ecrToECI' At {..} = ecrToECI epoch value `At` epoch
51
true
true
1
9
42
83
39
44
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/GHC/Interface.hs
bsd-3-clause
derivedVs :: CoreProgram -> DFunId -> [Id] derivedVs cBinds fd = concatMap bindersOf cBinds' ++ deps where cBinds' = filter f cBinds f (NonRec x _) = eqFd x f (Rec xes ) = any eqFd (fst <$> xes) eqFd x = varName x == varName fd deps = concatMap unfoldDep unfolds unfolds = unfoldingInfo . idInfo <$> concatMap bindersOf cBinds'
393
derivedVs :: CoreProgram -> DFunId -> [Id] derivedVs cBinds fd = concatMap bindersOf cBinds' ++ deps where cBinds' = filter f cBinds f (NonRec x _) = eqFd x f (Rec xes ) = any eqFd (fst <$> xes) eqFd x = varName x == varName fd deps = concatMap unfoldDep unfolds unfolds = unfoldingInfo . idInfo <$> concatMap bindersOf cBinds'
393
derivedVs cBinds fd = concatMap bindersOf cBinds' ++ deps where cBinds' = filter f cBinds f (NonRec x _) = eqFd x f (Rec xes ) = any eqFd (fst <$> xes) eqFd x = varName x == varName fd deps = concatMap unfoldDep unfolds unfolds = unfoldingInfo . idInfo <$> concatMap bindersOf cBinds'
350
false
true
5
10
126
138
68
70
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2017-05-snoyman-applied-haskell-at-lambdaconf/S_MonadReader.hs
unlicense
smr2 :: IO () smr2 = runReaderT i [1,2::Int] where i = do xs0 <- ask lift $ print xs0 local (map (*2)) $ do xs1 <- ask liftIO $ print xs1
164
smr2 :: IO () smr2 = runReaderT i [1,2::Int] where i = do xs0 <- ask lift $ print xs0 local (map (*2)) $ do xs1 <- ask liftIO $ print xs1
164
smr2 = runReaderT i [1,2::Int] where i = do xs0 <- ask lift $ print xs0 local (map (*2)) $ do xs1 <- ask liftIO $ print xs1
150
false
true
1
12
58
96
44
52
null
null
sopvop/cabal
Cabal/Distribution/ParseUtils.hs
bsd-3-clause
ifelse (Section n "if" cond thenpart :Section _ "else" as elsepart:fs) | null cond = syntaxError n "'if' with missing condition" | null thenpart = syntaxError n "'then' branch of 'if' is empty" | not (null as) = syntaxError n "'else' takes no arguments" | null elsepart = syntaxError n "'else' branch of 'if' is empty" | otherwise = do tp <- ifelse thenpart ep <- ifelse elsepart fs' <- ifelse fs return (IfBlock n cond tp ep:fs')
570
ifelse (Section n "if" cond thenpart :Section _ "else" as elsepart:fs) | null cond = syntaxError n "'if' with missing condition" | null thenpart = syntaxError n "'then' branch of 'if' is empty" | not (null as) = syntaxError n "'else' takes no arguments" | null elsepart = syntaxError n "'else' branch of 'if' is empty" | otherwise = do tp <- ifelse thenpart ep <- ifelse elsepart fs' <- ifelse fs return (IfBlock n cond tp ep:fs')
570
ifelse (Section n "if" cond thenpart :Section _ "else" as elsepart:fs) | null cond = syntaxError n "'if' with missing condition" | null thenpart = syntaxError n "'then' branch of 'if' is empty" | not (null as) = syntaxError n "'else' takes no arguments" | null elsepart = syntaxError n "'else' branch of 'if' is empty" | otherwise = do tp <- ifelse thenpart ep <- ifelse elsepart fs' <- ifelse fs return (IfBlock n cond tp ep:fs')
570
false
false
0
11
217
170
73
97
null
null
beni55/texmath
tests/test-texmath.hs
gpl-2.0
runRoundTrip :: String -> ([Exp] -> String) -> (String -> Either String [Exp]) -> IO [Status] runRoundTrip fmt writer reader = do inps <- filter (\x -> takeExtension x == ".native") <$> map (("./readers/" ++ fmt ++ "/") ++) <$> getDirectoryContents ("./readers/" ++ fmt) mapM (runRoundTripTest fmt writer reader) inps
390
runRoundTrip :: String -> ([Exp] -> String) -> (String -> Either String [Exp]) -> IO [Status] runRoundTrip fmt writer reader = do inps <- filter (\x -> takeExtension x == ".native") <$> map (("./readers/" ++ fmt ++ "/") ++) <$> getDirectoryContents ("./readers/" ++ fmt) mapM (runRoundTripTest fmt writer reader) inps
390
runRoundTrip fmt writer reader = do inps <- filter (\x -> takeExtension x == ".native") <$> map (("./readers/" ++ fmt ++ "/") ++) <$> getDirectoryContents ("./readers/" ++ fmt) mapM (runRoundTripTest fmt writer reader) inps
257
false
true
0
14
122
140
71
69
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
action_461 (45#) = happyGoto action_188
39
action_461 (45#) = happyGoto action_188
39
action_461 (45#) = happyGoto action_188
39
false
false
0
6
4
15
7
8
null
null
snowleopard/alga
src/Algebra/Graph/Class.hs
mit
-- | The /path/ on a list of vertices. -- Complexity: /O(L)/ time, memory and size, where /L/ is the length of the -- given list. -- -- @ -- path [] == 'empty' -- path [x] == 'vertex' x -- path [x,y] == 'edge' x y -- @ path :: Graph g => [Vertex g] -> g path xs = case xs of [] -> empty [x] -> vertex x (_:ys) -> edges (zip xs ys) -- | The /circuit/ on a list of vertices. -- Complexity: /O(L)/ time, memory and size, where /L/ is the length of the -- given list. -- -- @ -- circuit [] == 'empty' -- circuit [x] == 'edge' x x -- circuit [x,y] == 'edges' [(x,y), (y,x)] -- @
633
path :: Graph g => [Vertex g] -> g path xs = case xs of [] -> empty [x] -> vertex x (_:ys) -> edges (zip xs ys) -- | The /circuit/ on a list of vertices. -- Complexity: /O(L)/ time, memory and size, where /L/ is the length of the -- given list. -- -- @ -- circuit [] == 'empty' -- circuit [x] == 'edge' x x -- circuit [x,y] == 'edges' [(x,y), (y,x)] -- @
409
path xs = case xs of [] -> empty [x] -> vertex x (_:ys) -> edges (zip xs ys) -- | The /circuit/ on a list of vertices. -- Complexity: /O(L)/ time, memory and size, where /L/ is the length of the -- given list. -- -- @ -- circuit [] == 'empty' -- circuit [x] == 'edge' x x -- circuit [x,y] == 'edges' [(x,y), (y,x)] -- @
374
true
true
0
10
186
102
58
44
null
null
ksaveljev/game-of-life
src/Life.hs
mit
nextCell :: Generation -> Int -> Int -> Int nextCell gen@(Generation _ _ _ _ brd) !idx !state | nc < 2 || nc > 3 = 0 | nc == 3 = 1 | otherwise = state where (!x, !y) = getCoords gen idx {- -- this way it creates a huge allocation rate nc = L.sum [ gn neg neg, gn zro neg, gn pos neg , gn neg zro, 0 , gn pos zro , gn neg pos, gn zro pos, gn pos pos] -} !nc = gn neg neg + gn zro neg + gn pos neg + gn neg zro + gn zro zro + gn pos zro + gn neg pos + gn zro pos + gn pos pos gn !mx !my | midx < 0 = 0 | midx >= U.length brd = 0 | otherwise = brd U.! midx where !midx = fromCoords gen (x + mx, y + my) !neg = -1 !pos = 1 !zro = 0
762
nextCell :: Generation -> Int -> Int -> Int nextCell gen@(Generation _ _ _ _ brd) !idx !state | nc < 2 || nc > 3 = 0 | nc == 3 = 1 | otherwise = state where (!x, !y) = getCoords gen idx {- -- this way it creates a huge allocation rate nc = L.sum [ gn neg neg, gn zro neg, gn pos neg , gn neg zro, 0 , gn pos zro , gn neg pos, gn zro pos, gn pos pos] -} !nc = gn neg neg + gn zro neg + gn pos neg + gn neg zro + gn zro zro + gn pos zro + gn neg pos + gn zro pos + gn pos pos gn !mx !my | midx < 0 = 0 | midx >= U.length brd = 0 | otherwise = brd U.! midx where !midx = fromCoords gen (x + mx, y + my) !neg = -1 !pos = 1 !zro = 0
762
nextCell gen@(Generation _ _ _ _ brd) !idx !state | nc < 2 || nc > 3 = 0 | nc == 3 = 1 | otherwise = state where (!x, !y) = getCoords gen idx {- -- this way it creates a huge allocation rate nc = L.sum [ gn neg neg, gn zro neg, gn pos neg , gn neg zro, 0 , gn pos zro , gn neg pos, gn zro pos, gn pos pos] -} !nc = gn neg neg + gn zro neg + gn pos neg + gn neg zro + gn zro zro + gn pos zro + gn neg pos + gn zro pos + gn pos pos gn !mx !my | midx < 0 = 0 | midx >= U.length brd = 0 | otherwise = brd U.! midx where !midx = fromCoords gen (x + mx, y + my) !neg = -1 !pos = 1 !zro = 0
718
false
true
10
10
301
333
147
186
null
null
osa1/sequent-core
src/Language/SequentCore/OccurAnal.hs
bsd-3-clause
occAnalTerm _ expr@(Lit _) = (emptyDetails, expr)
60
occAnalTerm _ expr@(Lit _) = (emptyDetails, expr)
60
occAnalTerm _ expr@(Lit _) = (emptyDetails, expr)
60
false
false
0
8
17
26
14
12
null
null
jorsn/blackknight
blackknight.hs
bsd-3-clause
getLineBuffered ('\DEL':x:xs) = getLineBuffered xs
50
getLineBuffered ('\DEL':x:xs) = getLineBuffered xs
50
getLineBuffered ('\DEL':x:xs) = getLineBuffered xs
50
false
false
0
8
4
23
11
12
null
null
kwibus/myLang
tests/ArbiRef.hs
bsd-3-clause
updateStateName :: GenState n -> Bool -> String -> Free -> GenState n updateStateName state@State {tEnv = env } newVar name free = state {tEnv = newTEnv} where newTEnv :: BruijnEnv (String, Free) newTEnv = bInsert (name, free) (if newVar then removeVar name env else env) -- TODO decouple bruijnMap
337
updateStateName :: GenState n -> Bool -> String -> Free -> GenState n updateStateName state@State {tEnv = env } newVar name free = state {tEnv = newTEnv} where newTEnv :: BruijnEnv (String, Free) newTEnv = bInsert (name, free) (if newVar then removeVar name env else env) -- TODO decouple bruijnMap
337
updateStateName state@State {tEnv = env } newVar name free = state {tEnv = newTEnv} where newTEnv :: BruijnEnv (String, Free) newTEnv = bInsert (name, free) (if newVar then removeVar name env else env) -- TODO decouple bruijnMap
267
false
true
1
9
88
112
60
52
null
null
dzhus/snaplet-redson
src/Snap/Snaplet/Redson/Snapless/CRUD.hs
bsd-3-clause
onlyFields :: Commit -> [FieldName] -> [Maybe FieldValue] onlyFields commit names = map (flip M.lookup commit) names
116
onlyFields :: Commit -> [FieldName] -> [Maybe FieldValue] onlyFields commit names = map (flip M.lookup commit) names
116
onlyFields commit names = map (flip M.lookup commit) names
58
false
true
0
8
16
48
24
24
null
null
Vlix/facebookmessenger
test/UnitTest/Internal.hs
mit
parseTest :: (FromJSON a, Eq a, Show a) => TestName -> Value -> a -> TestTree parseTest testName val = testCase testName . (eParse val @?=) . Right
147
parseTest :: (FromJSON a, Eq a, Show a) => TestName -> Value -> a -> TestTree parseTest testName val = testCase testName . (eParse val @?=) . Right
147
parseTest testName val = testCase testName . (eParse val @?=) . Right
69
false
true
0
8
27
67
34
33
null
null
exemplator/java-parser
Language/Java/Pretty.hs
bsd-3-clause
opPrec LThan = 6
18
opPrec LThan = 6
18
opPrec LThan = 6
18
false
false
0
5
5
9
4
5
null
null
rueshyna/gogol
gogol-apps-tasks/gen/Network/Google/Resource/Tasks/Tasks/Get.hs
mpl-2.0
-- | Creates a value of 'TasksGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'tgTaskList' -- -- * 'tgTask' tasksGet :: Text -- ^ 'tgTaskList' -> Text -- ^ 'tgTask' -> TasksGet tasksGet pTgTaskList_ pTgTask_ = TasksGet' { _tgTaskList = pTgTaskList_ , _tgTask = pTgTask_ }
389
tasksGet :: Text -- ^ 'tgTaskList' -> Text -- ^ 'tgTask' -> TasksGet tasksGet pTgTaskList_ pTgTask_ = TasksGet' { _tgTaskList = pTgTaskList_ , _tgTask = pTgTask_ }
191
tasksGet pTgTaskList_ pTgTask_ = TasksGet' { _tgTaskList = pTgTaskList_ , _tgTask = pTgTask_ }
110
true
true
0
8
92
56
32
24
null
null
snoyberg/ghc
libraries/base/Control/Monad.hs
bsd-3-clause
replicateM_ cnt0 f = loop cnt0 where loop cnt | cnt <= 0 = pure () | otherwise = f *> loop (cnt - 1) -- | The reverse of 'when'.
157
replicateM_ cnt0 f = loop cnt0 where loop cnt | cnt <= 0 = pure () | otherwise = f *> loop (cnt - 1) -- | The reverse of 'when'.
157
replicateM_ cnt0 f = loop cnt0 where loop cnt | cnt <= 0 = pure () | otherwise = f *> loop (cnt - 1) -- | The reverse of 'when'.
157
false
false
0
9
59
63
29
34
null
null
ItsLastDay/academic_university_2016-2018
subjects/Haskell/13/homework.hs
gpl-3.0
phiTSum :: Algebra (T Integer) Integer phiTSum Leaf = 0
55
phiTSum :: Algebra (T Integer) Integer phiTSum Leaf = 0
55
phiTSum Leaf = 0
16
false
true
0
7
9
25
12
13
null
null
songpp/my-haskell-playground
tests/Tests.hs
apache-2.0
prop_idempotent :: Ord a => [a] -> Bool prop_idempotent xs = qsort (qsort xs) == qsort xs
89
prop_idempotent :: Ord a => [a] -> Bool prop_idempotent xs = qsort (qsort xs) == qsort xs
89
prop_idempotent xs = qsort (qsort xs) == qsort xs
49
false
true
0
8
16
44
21
23
null
null
yu-i9/HaSS
src/Parser.hs
mit
addiOp :: Parser Instruction addiOp = do rb <- (symbol "ADDI") >> register d <- (symbol ",") >> immdval return $ AddI rb d
130
addiOp :: Parser Instruction addiOp = do rb <- (symbol "ADDI") >> register d <- (symbol ",") >> immdval return $ AddI rb d
130
addiOp = do rb <- (symbol "ADDI") >> register d <- (symbol ",") >> immdval return $ AddI rb d
101
false
true
0
10
31
60
28
32
null
null
ezyang/ghc
compiler/basicTypes/Id.hs
bsd-3-clause
isProbablyOneShotLambda :: Id -> Bool isProbablyOneShotLambda id = case idStateHackOneShotInfo id of OneShotLam -> True NoOneShotInfo -> False
207
isProbablyOneShotLambda :: Id -> Bool isProbablyOneShotLambda id = case idStateHackOneShotInfo id of OneShotLam -> True NoOneShotInfo -> False
207
isProbablyOneShotLambda id = case idStateHackOneShotInfo id of OneShotLam -> True NoOneShotInfo -> False
169
false
true
0
8
82
43
19
24
null
null
ifesdjeen/deflisp
src/DefLisp/Core.hs
bsd-3-clause
defineVars :: LispEnvironment -> [(LispExpression, LispExpression)] -> LispEnvironment defineVars env ((var, value):more) = defineVars (Map.insert var value env) more
169
defineVars :: LispEnvironment -> [(LispExpression, LispExpression)] -> LispEnvironment defineVars env ((var, value):more) = defineVars (Map.insert var value env) more
168
defineVars env ((var, value):more) = defineVars (Map.insert var value env) more
81
false
true
0
8
21
63
34
29
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/TargetPools/RemoveInstance.hs
mpl-2.0
-- | Creates a value of 'TargetPoolsRemoveInstance' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'tpriProject' -- -- * 'tpriTargetPool' -- -- * 'tpriPayload' -- -- * 'tpriRegion' targetPoolsRemoveInstance :: Text -- ^ 'tpriProject' -> Text -- ^ 'tpriTargetPool' -> TargetPoolsRemoveInstanceRequest -- ^ 'tpriPayload' -> Text -- ^ 'tpriRegion' -> TargetPoolsRemoveInstance targetPoolsRemoveInstance pTpriProject_ pTpriTargetPool_ pTpriPayload_ pTpriRegion_ = TargetPoolsRemoveInstance' { _tpriProject = pTpriProject_ , _tpriTargetPool = pTpriTargetPool_ , _tpriPayload = pTpriPayload_ , _tpriRegion = pTpriRegion_ }
746
targetPoolsRemoveInstance :: Text -- ^ 'tpriProject' -> Text -- ^ 'tpriTargetPool' -> TargetPoolsRemoveInstanceRequest -- ^ 'tpriPayload' -> Text -- ^ 'tpriRegion' -> TargetPoolsRemoveInstance targetPoolsRemoveInstance pTpriProject_ pTpriTargetPool_ pTpriPayload_ pTpriRegion_ = TargetPoolsRemoveInstance' { _tpriProject = pTpriProject_ , _tpriTargetPool = pTpriTargetPool_ , _tpriPayload = pTpriPayload_ , _tpriRegion = pTpriRegion_ }
479
targetPoolsRemoveInstance pTpriProject_ pTpriTargetPool_ pTpriPayload_ pTpriRegion_ = TargetPoolsRemoveInstance' { _tpriProject = pTpriProject_ , _tpriTargetPool = pTpriTargetPool_ , _tpriPayload = pTpriPayload_ , _tpriRegion = pTpriRegion_ }
266
true
true
0
8
136
77
50
27
null
null
snoyberg/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp dflags [res] CasByteArrayOp_Int [mba, ix, old, new] = doCasByteArray res mba ix (bWord dflags) old new
117
emitPrimOp dflags [res] CasByteArrayOp_Int [mba, ix, old, new] = doCasByteArray res mba ix (bWord dflags) old new
117
emitPrimOp dflags [res] CasByteArrayOp_Int [mba, ix, old, new] = doCasByteArray res mba ix (bWord dflags) old new
117
false
false
0
7
20
49
26
23
null
null
gnn/Hets
Driver/Options.hs
gpl-2.0
namedSpecsS = "named-specs"
27
namedSpecsS = "named-specs"
27
namedSpecsS = "named-specs"
27
false
false
0
4
2
6
3
3
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_1PASS_EXT :: GLenum gl_1PASS_EXT = 0x80A1
44
gl_1PASS_EXT :: GLenum gl_1PASS_EXT = 0x80A1
44
gl_1PASS_EXT = 0x80A1
21
false
true
0
4
5
11
6
5
null
null
david-caro/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkUncheckedCd3 = verifyNotTree checkUncheckedCd "set -e; cd ~/src; rm -r foo"
85
prop_checkUncheckedCd3 = verifyNotTree checkUncheckedCd "set -e; cd ~/src; rm -r foo"
85
prop_checkUncheckedCd3 = verifyNotTree checkUncheckedCd "set -e; cd ~/src; rm -r foo"
85
false
false
0
5
10
11
5
6
null
null
vTurbine/ghc
compiler/basicTypes/BasicTypes.hs
bsd-3-clause
isStrongLoopBreaker :: OccInfo -> Bool isStrongLoopBreaker (IAmALoopBreaker False) = True
89
isStrongLoopBreaker :: OccInfo -> Bool isStrongLoopBreaker (IAmALoopBreaker False) = True
89
isStrongLoopBreaker (IAmALoopBreaker False) = True
50
false
true
0
7
9
24
12
12
null
null
eriksvedang/Carp
src/Obj.hs
mpl-2.0
getPath (XObj (Lst (XObj (Interface _ _) _ _ : XObj (Sym path _) _ _ : _)) _ _) = path
86
getPath (XObj (Lst (XObj (Interface _ _) _ _ : XObj (Sym path _) _ _ : _)) _ _) = path
86
getPath (XObj (Lst (XObj (Interface _ _) _ _ : XObj (Sym path _) _ _ : _)) _ _) = path
86
false
false
0
14
21
67
32
35
null
null
kwibus/myLang
tests/TestModify.hs
bsd-3-clause
testMTable :: TestTree testMTable = testGroup "mtable" [ testCase "[1,0,2]" $ (reorder 0 (map Bound [1, 0, 2] ) $ insertUndefined 3 empty ) @?= (mTable 3 0){ _env = bFromList (map (\d ->(d,Undefined)) [0, 2, 1])} ]
238
testMTable :: TestTree testMTable = testGroup "mtable" [ testCase "[1,0,2]" $ (reorder 0 (map Bound [1, 0, 2] ) $ insertUndefined 3 empty ) @?= (mTable 3 0){ _env = bFromList (map (\d ->(d,Undefined)) [0, 2, 1])} ]
238
testMTable = testGroup "mtable" [ testCase "[1,0,2]" $ (reorder 0 (map Bound [1, 0, 2] ) $ insertUndefined 3 empty ) @?= (mTable 3 0){ _env = bFromList (map (\d ->(d,Undefined)) [0, 2, 1])} ]
215
false
true
0
14
61
115
62
53
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp IntQuotRemOp = _ILIT(14)
37
tagOf_PrimOp IntQuotRemOp = _ILIT(14)
37
tagOf_PrimOp IntQuotRemOp = _ILIT(14)
37
false
false
0
6
3
15
7
8
null
null
kawamuray/ganeti
src/Ganeti/HTools/Backend/Text.hs
gpl-2.0
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles, tags, excl_stor] = loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles, tags, excl_stor, "0"]
196
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles, tags, excl_stor] = loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles, tags, excl_stor, "0"]
196
loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles, tags, excl_stor] = loadNode ktg [name, tm, nm, fm, td, fd, tc, fo, gu, spindles, tags, excl_stor, "0"]
196
false
false
0
6
61
91
57
34
null
null
sopvop/cabal
Cabal/Distribution/Simple/Command.hs
bsd-3-clause
boolOpt' :: (b -> Maybe Bool) -> (Bool -> b) -> OptFlags -> OptFlags -> MkOptDescr (a -> b) (b -> a -> a) a boolOpt' g s ffT ffF _sf _lf d get set = BoolOpt d ffT ffF (set.s) (g . get)
196
boolOpt' :: (b -> Maybe Bool) -> (Bool -> b) -> OptFlags -> OptFlags -> MkOptDescr (a -> b) (b -> a -> a) a boolOpt' g s ffT ffF _sf _lf d get set = BoolOpt d ffT ffF (set.s) (g . get)
196
boolOpt' g s ffT ffF _sf _lf d get set = BoolOpt d ffT ffF (set.s) (g . get)
76
false
true
0
12
55
111
57
54
null
null
luite/hfsevents
System/OSX/FSEvents.hs
bsd-3-clause
-- These flags are only set if you enabled file events when creating the stream eventFlagItemCreated :: Word64 eventFlagItemCreated = 0x00000100
144
eventFlagItemCreated :: Word64 eventFlagItemCreated = 0x00000100
64
eventFlagItemCreated = 0x00000100
33
true
true
0
4
20
12
7
5
null
null
UBMLtonGroup/timberc
src/Syntax2Core.hs
bsd-3-clause
mkWild vs (TFun ts t) = TFun (map (mkWild vs) ts) (mkWild vs t)
73
mkWild vs (TFun ts t) = TFun (map (mkWild vs) ts) (mkWild vs t)
73
mkWild vs (TFun ts t) = TFun (map (mkWild vs) ts) (mkWild vs t)
73
false
false
0
9
23
46
22
24
null
null
hguenther/nbis
Simplifier.hs
agpl-3.0
isFalse _ = False
17
isFalse _ = False
17
isFalse _ = False
17
false
false
0
5
3
9
4
5
null
null
bkoropoff/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
isTCDict :: Name -> Context -> Bool isTCDict n ctxt = case lookupDefExact n ctxt of Just (Function _ _) -> False Just (Operator _ _ _) -> False Just (CaseOp ci _ _ _ _ _) -> tc_dictionary ci _ -> False
279
isTCDict :: Name -> Context -> Bool isTCDict n ctxt = case lookupDefExact n ctxt of Just (Function _ _) -> False Just (Operator _ _ _) -> False Just (CaseOp ci _ _ _ _ _) -> tc_dictionary ci _ -> False
279
isTCDict n ctxt = case lookupDefExact n ctxt of Just (Function _ _) -> False Just (Operator _ _ _) -> False Just (CaseOp ci _ _ _ _ _) -> tc_dictionary ci _ -> False
243
false
true
0
10
120
109
50
59
null
null
uuhan/Idris-dev
src/Idris/CaseSplit.hs
bsd-3-clause
addUpdate :: Name -> PTerm -> State MergeState () addUpdate n tm = do ms <- get put (ms { updates = ((n, stripNS tm) : updates ms) } )
154
addUpdate :: Name -> PTerm -> State MergeState () addUpdate n tm = do ms <- get put (ms { updates = ((n, stripNS tm) : updates ms) } )
154
addUpdate n tm = do ms <- get put (ms { updates = ((n, stripNS tm) : updates ms) } )
104
false
true
0
15
49
79
38
41
null
null
IreneKnapp/Faction
faction/Distribution/Client/FetchUtils.hs
bsd-3-clause
downloadIndex :: Verbosity -> RemoteRepo -> FilePath -> IO FilePath downloadIndex verbosity repo cacheDir = do let uri = (remoteRepoURI repo) { uriPath = uriPath (remoteRepoURI repo) `FilePath.Posix.combine` "00-index.tar.gz" } path = cacheDir </> "00-index" <.> "tar.gz" createDirectoryIfMissing True cacheDir downloadURI verbosity uri path return path -- ------------------------------------------------------------ -- * Path utilities -- ------------------------------------------------------------ -- | Generate the full path to the locally cached copy of -- the tarball for a given @PackageIdentifer@. --
678
downloadIndex :: Verbosity -> RemoteRepo -> FilePath -> IO FilePath downloadIndex verbosity repo cacheDir = do let uri = (remoteRepoURI repo) { uriPath = uriPath (remoteRepoURI repo) `FilePath.Posix.combine` "00-index.tar.gz" } path = cacheDir </> "00-index" <.> "tar.gz" createDirectoryIfMissing True cacheDir downloadURI verbosity uri path return path -- ------------------------------------------------------------ -- * Path utilities -- ------------------------------------------------------------ -- | Generate the full path to the locally cached copy of -- the tarball for a given @PackageIdentifer@. --
678
downloadIndex verbosity repo cacheDir = do let uri = (remoteRepoURI repo) { uriPath = uriPath (remoteRepoURI repo) `FilePath.Posix.combine` "00-index.tar.gz" } path = cacheDir </> "00-index" <.> "tar.gz" createDirectoryIfMissing True cacheDir downloadURI verbosity uri path return path -- ------------------------------------------------------------ -- * Path utilities -- ------------------------------------------------------------ -- | Generate the full path to the locally cached copy of -- the tarball for a given @PackageIdentifer@. --
610
false
true
0
15
142
117
60
57
null
null
rueshyna/gogol
gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs
mpl-2.0
-- | [Optional] The character encoding of the data. The supported values are -- UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the -- data after the raw, binary data has been split using the values of the -- quote and fieldDelimiter properties. jclEncoding :: Lens' JobConfigurationLoad (Maybe Text) jclEncoding = lens _jclEncoding (\ s a -> s{_jclEncoding = a})
383
jclEncoding :: Lens' JobConfigurationLoad (Maybe Text) jclEncoding = lens _jclEncoding (\ s a -> s{_jclEncoding = a})
119
jclEncoding = lens _jclEncoding (\ s a -> s{_jclEncoding = a})
64
true
true
0
9
63
51
28
23
null
null
da-x/ghc
compiler/main/HscMain.hs
bsd-3-clause
hscParseIdentifier :: HscEnv -> String -> IO (Located RdrName) hscParseIdentifier hsc_env str = runInteractiveHsc hsc_env $ hscParseThing parseIdentifier str
161
hscParseIdentifier :: HscEnv -> String -> IO (Located RdrName) hscParseIdentifier hsc_env str = runInteractiveHsc hsc_env $ hscParseThing parseIdentifier str
161
hscParseIdentifier hsc_env str = runInteractiveHsc hsc_env $ hscParseThing parseIdentifier str
98
false
true
0
9
22
45
21
24
null
null
xmonad/xmonad-contrib
XMonad/Layout/DecorationMadness.hs
bsd-3-clause
-- | A 'Tall' layout with the xmonad default decoration, default -- theme and default shrinker. -- -- Here you can find a screen shot: -- -- <http://code.haskell.org/~arossato/xmonadShots/tallSimpleDefault.png> tallSimpleDefault :: ModifiedLayout (Decoration DefaultDecoration DefaultShrinker) Tall Window tallSimpleDefault = decoration shrinkText def DefaultDecoration tall
374
tallSimpleDefault :: ModifiedLayout (Decoration DefaultDecoration DefaultShrinker) Tall Window tallSimpleDefault = decoration shrinkText def DefaultDecoration tall
163
tallSimpleDefault = decoration shrinkText def DefaultDecoration tall
68
true
true
0
7
42
41
23
18
null
null
spinda/liquidhaskell
tests/gsoc15/unknown/pos/maybe.hs
bsd-3-clause
bar' y (x:xs) | y > x = bar' y xs | y < x = x:xs | y == x = xs
79
bar' y (x:xs) | y > x = bar' y xs | y < x = x:xs | y == x = xs
79
bar' y (x:xs) | y > x = bar' y xs | y < x = x:xs | y == x = xs
79
false
false
2
8
39
64
29
35
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Upgrade.hs
mit
whatResearches ProtossGroundWeapons = ProtossForge
50
whatResearches ProtossGroundWeapons = ProtossForge
50
whatResearches ProtossGroundWeapons = ProtossForge
50
false
false
0
5
3
9
4
5
null
null
kelnage/tamarin-prover
lib/theory/src/Theory/Proof.hs
gpl-3.0
proofStepStatus (ProofStep Solved (Just _)) = TraceFound
59
proofStepStatus (ProofStep Solved (Just _)) = TraceFound
59
proofStepStatus (ProofStep Solved (Just _)) = TraceFound
59
false
false
0
9
9
23
11
12
null
null
dgonyeo/gatekeeper
Gatekeeper/Protobufs.hs
mit
blobToMsg :: String -> Either String Msg blobToMsg s = G.runGet P.decodeMessage =<< H.unhex (C.pack s)
102
blobToMsg :: String -> Either String Msg blobToMsg s = G.runGet P.decodeMessage =<< H.unhex (C.pack s)
102
blobToMsg s = G.runGet P.decodeMessage =<< H.unhex (C.pack s)
61
false
true
0
9
15
47
22
25
null
null
pparkkin/eta
compiler/ETA/CodeGen/Prim.hs
bsd-3-clause
doubleMathOp :: Text -> [FieldType] -> FieldType -> Code doubleMathOp f args ret = invokestatic $ mkMethodRef "java/lang/Math" f args (Just ret)
144
doubleMathOp :: Text -> [FieldType] -> FieldType -> Code doubleMathOp f args ret = invokestatic $ mkMethodRef "java/lang/Math" f args (Just ret)
144
doubleMathOp f args ret = invokestatic $ mkMethodRef "java/lang/Math" f args (Just ret)
87
false
true
0
8
21
52
26
26
null
null
christiannolte/tip-toi-reveng
src/PrettyPrint.hs
mit
ppCommand _ t xs (Unknown b r n) = printf "?(%s,%s) (%s)" (ppReg r) (ppTVal n) (prettyHex b)
92
ppCommand _ t xs (Unknown b r n) = printf "?(%s,%s) (%s)" (ppReg r) (ppTVal n) (prettyHex b)
92
ppCommand _ t xs (Unknown b r n) = printf "?(%s,%s) (%s)" (ppReg r) (ppTVal n) (prettyHex b)
92
false
false
0
7
17
52
25
27
null
null
ozgurakgun/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
refsIn (App s f a) = nub (refsIn f ++ refsIn a)
47
refsIn (App s f a) = nub (refsIn f ++ refsIn a)
47
refsIn (App s f a) = nub (refsIn f ++ refsIn a)
47
false
false
0
8
11
36
16
20
null
null
nukisman/elm-format-short
tests/Test/Property.hs
bsd-3-clause
reportFailedAst ast = let rendering = Render.render ElmVersion.Elm_0_17 ast |> Text.unpack result = Render.render ElmVersion.Elm_0_17 ast |> Parse.parse |> fmap stripRegion |> show in concat [ "=== Parsed as:\n" , result , "=== END OF parse\n" , "=== Rendering of failed AST:\n" , rendering , "=== END OF failed AST rendering\n" ]
506
reportFailedAst ast = let rendering = Render.render ElmVersion.Elm_0_17 ast |> Text.unpack result = Render.render ElmVersion.Elm_0_17 ast |> Parse.parse |> fmap stripRegion |> show in concat [ "=== Parsed as:\n" , result , "=== END OF parse\n" , "=== Rendering of failed AST:\n" , rendering , "=== END OF failed AST rendering\n" ]
506
reportFailedAst ast = let rendering = Render.render ElmVersion.Elm_0_17 ast |> Text.unpack result = Render.render ElmVersion.Elm_0_17 ast |> Parse.parse |> fmap stripRegion |> show in concat [ "=== Parsed as:\n" , result , "=== END OF parse\n" , "=== Rendering of failed AST:\n" , rendering , "=== END OF failed AST rendering\n" ]
506
false
false
0
13
227
87
44
43
null
null
tau-tao/DistField-2D
src/Grevera8SEDFast1.hs
bsd-3-clause
dXY = sqrt (dX * dX + dY * dY)
30
dXY = sqrt (dX * dX + dY * dY)
30
dXY = sqrt (dX * dX + dY * dY)
30
false
false
1
9
9
27
12
15
null
null
tonyday567/lucid-page
src/Web/Rep/Mathjax.hs
mit
mathjax3Lib :: Html () mathjax3Lib = with (script_ mempty) [ src_ "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js", id_ "MathJax-script", async_ "" ]
186
mathjax3Lib :: Html () mathjax3Lib = with (script_ mempty) [ src_ "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js", id_ "MathJax-script", async_ "" ]
186
mathjax3Lib = with (script_ mempty) [ src_ "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js", id_ "MathJax-script", async_ "" ]
163
false
true
0
7
42
52
23
29
null
null
florianpilz/autotool
src/Wash/HTMLMonad.hs
gpl-2.0
iframe :: Monad m => HTMLCons m a iframe = addMaker $ element_ "iframe" [] []
77
iframe :: Monad m => HTMLCons m a iframe = addMaker $ element_ "iframe" [] []
77
iframe = addMaker $ element_ "iframe" [] []
43
false
true
0
7
15
43
19
24
null
null
edsko/cabal
Cabal/src/Distribution/ParseUtils.hs
bsd-3-clause
ifelse :: [Field] -> ParseResult [Field] ifelse [] = return []
62
ifelse :: [Field] -> ParseResult [Field] ifelse [] = return []
62
ifelse [] = return []
21
false
true
0
7
10
34
17
17
null
null
abdulrahimnizamani/OccamStar
Niz.hs
gpl-2.0
rstrip = reverse . lstrip . reverse
35
rstrip = reverse . lstrip . reverse
35
rstrip = reverse . lstrip . reverse
35
false
false
2
5
6
18
7
11
null
null
rahulmutt/ghcvm
compiler/Eta/BasicTypes/Module.hs
bsd-3-clause
delModuleEnvList :: ModuleEnv a -> [Module] -> ModuleEnv a delModuleEnvList (ModuleEnv e) ms = ModuleEnv (Map.deleteList (map NDModule ms) e)
141
delModuleEnvList :: ModuleEnv a -> [Module] -> ModuleEnv a delModuleEnvList (ModuleEnv e) ms = ModuleEnv (Map.deleteList (map NDModule ms) e)
141
delModuleEnvList (ModuleEnv e) ms = ModuleEnv (Map.deleteList (map NDModule ms) e)
82
false
true
0
9
19
60
29
31
null
null
Kheldar/hw-koans
solution/Koan/Parser/Json.hs
bsd-3-clause
brackets :: Parser a -> Parser a brackets = between (symbol "[") (symbol "]")
77
brackets :: Parser a -> Parser a brackets = between (symbol "[") (symbol "]")
77
brackets = between (symbol "[") (symbol "]")
44
false
true
0
7
13
38
18
20
null
null
zachsully/hakaru
haskell/Language/Hakaru/CodeGen/AST.hs
bsd-3-clause
indirect, address :: CExpr -> CExpr indirect = CUnary CIndOp
60
indirect, address :: CExpr -> CExpr indirect = CUnary CIndOp
60
indirect = CUnary CIndOp
24
false
true
0
5
9
20
11
9
null
null
jperson/hgearman-client
Network/Gearman/Client.hs
mit
response :: Socket -> Gearman (Either GearmanError Packet) response s = do p <- readPacket s case (_type . _hdr) p of WORK_COMPLETE -> return $ Right p WORK_DATA -> return $ Left "WORK_DATA NOT IMPLEMENTED" WORK_STATUS -> return $ Left "WORK_STATUS NOT IMPLEMENTED" WORK_EXCEPTION -> return $ Left "WORK_EXCEPTION NOT IMPLEMENTED" WORK_FAIL -> return $ Left "WORK_FAIL NOT IMPLEMENTED" WORK_WARNING -> return $ Left "WORK_WARNING NOT IMPLEMENTED" _ -> response s
564
response :: Socket -> Gearman (Either GearmanError Packet) response s = do p <- readPacket s case (_type . _hdr) p of WORK_COMPLETE -> return $ Right p WORK_DATA -> return $ Left "WORK_DATA NOT IMPLEMENTED" WORK_STATUS -> return $ Left "WORK_STATUS NOT IMPLEMENTED" WORK_EXCEPTION -> return $ Left "WORK_EXCEPTION NOT IMPLEMENTED" WORK_FAIL -> return $ Left "WORK_FAIL NOT IMPLEMENTED" WORK_WARNING -> return $ Left "WORK_WARNING NOT IMPLEMENTED" _ -> response s
564
response s = do p <- readPacket s case (_type . _hdr) p of WORK_COMPLETE -> return $ Right p WORK_DATA -> return $ Left "WORK_DATA NOT IMPLEMENTED" WORK_STATUS -> return $ Left "WORK_STATUS NOT IMPLEMENTED" WORK_EXCEPTION -> return $ Left "WORK_EXCEPTION NOT IMPLEMENTED" WORK_FAIL -> return $ Left "WORK_FAIL NOT IMPLEMENTED" WORK_WARNING -> return $ Left "WORK_WARNING NOT IMPLEMENTED" _ -> response s
505
false
true
0
11
173
143
66
77
null
null
GaloisInc/ivory
ivory-quickcheck/test/Test.hs
bsd-3-clause
shouldFail :: TestTree shouldFail = testGroup "should be unsafe" [ mkFailure foo1 m1 , mkFailure foo14 m14 ]
147
shouldFail :: TestTree shouldFail = testGroup "should be unsafe" [ mkFailure foo1 m1 , mkFailure foo14 m14 ]
147
shouldFail = testGroup "should be unsafe" [ mkFailure foo1 m1 , mkFailure foo14 m14 ]
124
false
true
0
7
56
40
17
23
null
null
kishoredbn/barrelfish
tools/mackerel/BitFieldDriver.hs
mit
register_print_single r = C.inline "int" (reg_pr (RT.name r)) ( register_args [ ("char *","s"), ("size_t","sz") ] r [] ) ( ["int r=0;", "int _avail, _rc;" ] ++ (register_print_init r) ++ (C.snputsq (printf "Register %s (%s):" (RT.name r) (percent_escape (RT.desc r)))) ++ (register_print_value r) ++ ["return r;" ] )
405
register_print_single r = C.inline "int" (reg_pr (RT.name r)) ( register_args [ ("char *","s"), ("size_t","sz") ] r [] ) ( ["int r=0;", "int _avail, _rc;" ] ++ (register_print_init r) ++ (C.snputsq (printf "Register %s (%s):" (RT.name r) (percent_escape (RT.desc r)))) ++ (register_print_value r) ++ ["return r;" ] )
405
register_print_single r = C.inline "int" (reg_pr (RT.name r)) ( register_args [ ("char *","s"), ("size_t","sz") ] r [] ) ( ["int r=0;", "int _avail, _rc;" ] ++ (register_print_init r) ++ (C.snputsq (printf "Register %s (%s):" (RT.name r) (percent_escape (RT.desc r)))) ++ (register_print_value r) ++ ["return r;" ] )
405
false
false
0
18
135
144
76
68
null
null
brendanhay/gogol
gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs
mpl-2.0
-- | Collection type. pfflKind :: Lens' ProFileFilterLinks Text pfflKind = lens _pfflKind (\ s a -> s{_pfflKind = a})
117
pfflKind :: Lens' ProFileFilterLinks Text pfflKind = lens _pfflKind (\ s a -> s{_pfflKind = a})
95
pfflKind = lens _pfflKind (\ s a -> s{_pfflKind = a})
53
true
true
0
9
19
40
22
18
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Returnpolicy/List.hs
mpl-2.0
-- | JSONP reteCallback :: Lens' ReturnpolicyList (Maybe Text) reteCallback = lens _reteCallback (\ s a -> s{_reteCallback = a})
130
reteCallback :: Lens' ReturnpolicyList (Maybe Text) reteCallback = lens _reteCallback (\ s a -> s{_reteCallback = a})
119
reteCallback = lens _reteCallback (\ s a -> s{_reteCallback = a})
67
true
true
0
9
21
48
25
23
null
null
mvr/abyme
haskell-model/src/Abyme/Shapey/Universe.hs
bsd-3-clause
isInhabited :: Universe -> Location -> Bool isInhabited u l = isJust $ inhabitant u l
85
isInhabited :: Universe -> Location -> Bool isInhabited u l = isJust $ inhabitant u l
85
isInhabited u l = isJust $ inhabitant u l
41
false
true
0
8
15
38
17
21
null
null
NorfairKing/super-user-spark
src/SuperUserSpark/Deployer/Types.hs
mit
defaultDeploySettings :: DeploySettings defaultDeploySettings = DeploySettings { deploySetsReplaceLinks = False , deploySetsReplaceFiles = False , deploySetsReplaceDirectories = False , deployCheckSettings = defaultCheckSettings }
254
defaultDeploySettings :: DeploySettings defaultDeploySettings = DeploySettings { deploySetsReplaceLinks = False , deploySetsReplaceFiles = False , deploySetsReplaceDirectories = False , deployCheckSettings = defaultCheckSettings }
254
defaultDeploySettings = DeploySettings { deploySetsReplaceLinks = False , deploySetsReplaceFiles = False , deploySetsReplaceDirectories = False , deployCheckSettings = defaultCheckSettings }
214
false
true
0
7
46
47
25
22
null
null
philopon/hassistant.vim
src/Hassistant/Module.hs
bsd-3-clause
parenHasOccName :: OccName.HasOccName n => n -> Outputable.SDoc parenHasOccName ho = OccName.parenSymOcc occ (Outputable.ppr occ) where occ = OccName.occName ho
166
parenHasOccName :: OccName.HasOccName n => n -> Outputable.SDoc parenHasOccName ho = OccName.parenSymOcc occ (Outputable.ppr occ) where occ = OccName.occName ho
166
parenHasOccName ho = OccName.parenSymOcc occ (Outputable.ppr occ) where occ = OccName.occName ho
102
false
true
0
8
25
57
27
30
null
null
wayofthepie/emu-mos-6502
test/ExecutorSpec.hs
mit
prop_decodeOpCode_createsCorrectInstruction :: KnownOpCode -> Bool prop_decodeOpCode_createsCorrectInstruction (KnownOpCode w) = case decodeOpCode w of (Executable i@(Instruction mnem mode)) -> let info = ii i in (instOpCode info == w)
247
prop_decodeOpCode_createsCorrectInstruction :: KnownOpCode -> Bool prop_decodeOpCode_createsCorrectInstruction (KnownOpCode w) = case decodeOpCode w of (Executable i@(Instruction mnem mode)) -> let info = ii i in (instOpCode info == w)
247
prop_decodeOpCode_createsCorrectInstruction (KnownOpCode w) = case decodeOpCode w of (Executable i@(Instruction mnem mode)) -> let info = ii i in (instOpCode info == w)
180
false
true
1
9
39
73
37
36
null
null
michaxm/haskell-hdfs-thrift-client
src-gen-thrift/ThriftHadoopFileSystem_Client.hs
bsd-3-clause
stat (ip,op) arg_path = do send_stat op arg_path recv_stat ip
65
stat (ip,op) arg_path = do send_stat op arg_path recv_stat ip
65
stat (ip,op) arg_path = do send_stat op arg_path recv_stat ip
65
false
false
1
8
13
34
14
20
null
null
minoki/LambdaQuest
src/LambdaQuest/Finter/Parse.hs
bsd-3-clause
parseType :: SourceName -> String -> Either ParseError Type parseType name input = parse wholeParser name input where wholeParser = do whiteSpace t <- typeExpr [] eof return t
217
parseType :: SourceName -> String -> Either ParseError Type parseType name input = parse wholeParser name input where wholeParser = do whiteSpace t <- typeExpr [] eof return t
217
parseType name input = parse wholeParser name input where wholeParser = do whiteSpace t <- typeExpr [] eof return t
157
false
true
0
10
70
73
31
42
null
null
erikd/persistent
persistent-sqlite/Database/Persist/Sqlite.hs
mit
showSqlType SqlBool = "BOOLEAN"
31
showSqlType SqlBool = "BOOLEAN"
31
showSqlType SqlBool = "BOOLEAN"
31
false
false
1
5
3
13
4
9
null
null
ZenDevelopmentSystems/ICryptol
src/Notebook.hs
bsd-3-clause
getRW :: NB RW getRW = NB (\ref -> REPL.io (readIORef ref))
60
getRW :: NB RW getRW = NB (\ref -> REPL.io (readIORef ref))
60
getRW = NB (\ref -> REPL.io (readIORef ref))
45
false
true
0
10
12
42
19
23
null
null
kojiromike/Idris-dev
src/IRTS/JavaScript/AST.hs
bsd-3-clause
jsAst2Text (JsB2I x) = jsAst2Text $ JsBinOp "+" x (JsInt 0)
59
jsAst2Text (JsB2I x) = jsAst2Text $ JsBinOp "+" x (JsInt 0)
59
jsAst2Text (JsB2I x) = jsAst2Text $ JsBinOp "+" x (JsInt 0)
59
false
false
0
8
10
32
15
17
null
null
kfish/heapscope
HeapScope/ZoomCache.hs
bsd-3-clause
readHPHeader :: (Functor m, Monad m) => Iteratee ByteString m HPHeader readHPHeader = do hpJob <- readByteString0 hpDate <- readByteString0 hpSampleUnit <- readByteString0 hpValueUnit <- readByteString0 return HPHeader{..}
255
readHPHeader :: (Functor m, Monad m) => Iteratee ByteString m HPHeader readHPHeader = do hpJob <- readByteString0 hpDate <- readByteString0 hpSampleUnit <- readByteString0 hpValueUnit <- readByteString0 return HPHeader{..}
255
readHPHeader = do hpJob <- readByteString0 hpDate <- readByteString0 hpSampleUnit <- readByteString0 hpValueUnit <- readByteString0 return HPHeader{..}
171
false
true
0
9
60
78
35
43
null
null
spockwangs/scheme.in.haskell
list4.2.hs
unlicense
parseNumber :: Parser LispVal parseNumber = do base <- choice $ map char "bodx" liftM (Number . fst . head) $ case base of 'b' -> many1 binDigit >>= return . readBin 'o' -> many1 octDigit >>= return . readOct 'd' -> many1 digit >>= return . readDec 'x' -> many1 hexDigit >>= return . readHex
431
parseNumber :: Parser LispVal parseNumber = do base <- choice $ map char "bodx" liftM (Number . fst . head) $ case base of 'b' -> many1 binDigit >>= return . readBin 'o' -> many1 octDigit >>= return . readOct 'd' -> many1 digit >>= return . readDec 'x' -> many1 hexDigit >>= return . readHex
431
parseNumber = do base <- choice $ map char "bodx" liftM (Number . fst . head) $ case base of 'b' -> many1 binDigit >>= return . readBin 'o' -> many1 octDigit >>= return . readOct 'd' -> many1 digit >>= return . readDec 'x' -> many1 hexDigit >>= return . readHex
401
false
true
1
14
195
128
58
70
null
null
ekr/tamarin-prover
lib/theory/src/Theory/Proof.hs
gpl-3.0
-- | @prf `atPath` path@ returns the subproof at the @path@ in @prf@. atPathDiff :: DiffProof a -> ProofPath -> Maybe (DiffProof a) atPathDiff = foldM (flip M.lookup . children)
177
atPathDiff :: DiffProof a -> ProofPath -> Maybe (DiffProof a) atPathDiff = foldM (flip M.lookup . children)
107
atPathDiff = foldM (flip M.lookup . children)
45
true
true
0
9
29
47
23
24
null
null
abbradar/aeson
Data/Aeson/Types/Instances.hs
bsd-3-clause
parseRealFloat :: RealFloat a => String -> Value -> Parser a parseRealFloat _ (Number s) = pure $ Scientific.toRealFloat s
129
parseRealFloat :: RealFloat a => String -> Value -> Parser a parseRealFloat _ (Number s) = pure $ Scientific.toRealFloat s
129
parseRealFloat _ (Number s) = pure $ Scientific.toRealFloat s
68
false
true
0
8
26
49
23
26
null
null
omgbebebe/haste-lab
src/TriSphere/Sphere.hs
mit
canW = 800
10
canW = 800
10
canW = 800
10
false
false
0
4
2
6
3
3
null
null
brendanhay/gogol
gogol-vault/gen/Network/Google/Vault/Types/Product.hs
mpl-2.0
-- | Service-specific [search -- operators](https:\/\/support.google.com\/vault\/answer\/2474474) to -- filter search results. qTerms :: Lens' Query (Maybe Text) qTerms = lens _qTerms (\ s a -> s{_qTerms = a})
209
qTerms :: Lens' Query (Maybe Text) qTerms = lens _qTerms (\ s a -> s{_qTerms = a})
82
qTerms = lens _qTerms (\ s a -> s{_qTerms = a})
47
true
true
0
9
27
48
27
21
null
null
kazu-yamamoto/iproute
test/IPSpec.hs
bsd-3-clause
arbitraryIIPv4Str :: Gen IPv4 -> Int -> Gen InvalidIPv4Str arbitraryIIPv4Str adrGen msklen = toIv4 <$> adrGen <*> lenGen where toIv4 adr len = Iv4 $ show adr ++ "/" ++ show len lenGen = oneof [choose (minBound, -1), choose (msklen + 1, maxBound)]
256
arbitraryIIPv4Str :: Gen IPv4 -> Int -> Gen InvalidIPv4Str arbitraryIIPv4Str adrGen msklen = toIv4 <$> adrGen <*> lenGen where toIv4 adr len = Iv4 $ show adr ++ "/" ++ show len lenGen = oneof [choose (minBound, -1), choose (msklen + 1, maxBound)]
256
arbitraryIIPv4Str adrGen msklen = toIv4 <$> adrGen <*> lenGen where toIv4 adr len = Iv4 $ show adr ++ "/" ++ show len lenGen = oneof [choose (minBound, -1), choose (msklen + 1, maxBound)]
197
false
true
0
9
52
107
53
54
null
null
YLiLarry/compress-video
src/FFmpeg/Process.hs
bsd-3-clause
printFFmpegProgress :: StateT FFmpegProcess IO () printFFmpegProgress = do pc <- MT.get let fp = progressFilePath pc exists <- MT.lift $ doesFileExist fp when exists $ do triple <- getCurrentPercentage case triple of Nothing -> return () Just (total, current, percent) -> when (percent > percentage pc) (MT.lift $ putStrLn $ printf "{\"total\":%.2f, \"current\":%.2f, \"percentage\":%.4f}" total current percent)
504
printFFmpegProgress :: StateT FFmpegProcess IO () printFFmpegProgress = do pc <- MT.get let fp = progressFilePath pc exists <- MT.lift $ doesFileExist fp when exists $ do triple <- getCurrentPercentage case triple of Nothing -> return () Just (total, current, percent) -> when (percent > percentage pc) (MT.lift $ putStrLn $ printf "{\"total\":%.2f, \"current\":%.2f, \"percentage\":%.4f}" total current percent)
504
printFFmpegProgress = do pc <- MT.get let fp = progressFilePath pc exists <- MT.lift $ doesFileExist fp when exists $ do triple <- getCurrentPercentage case triple of Nothing -> return () Just (total, current, percent) -> when (percent > percentage pc) (MT.lift $ putStrLn $ printf "{\"total\":%.2f, \"current\":%.2f, \"percentage\":%.4f}" total current percent)
454
false
true
0
17
149
147
69
78
null
null
kevintvh/sodium
haskell/src/FRP/Sodium/Plain.hs
bsd-3-clause
modifyMVar_ :: MVar a -> (a -> IO a) -> IO () modifyMVar_ mv f = MV.modifyMVar_ mv $ \a -> do a' <- f a evaluate a' return a'
137
modifyMVar_ :: MVar a -> (a -> IO a) -> IO () modifyMVar_ mv f = MV.modifyMVar_ mv $ \a -> do a' <- f a evaluate a' return a'
137
modifyMVar_ mv f = MV.modifyMVar_ mv $ \a -> do a' <- f a evaluate a' return a'
91
false
true
0
10
41
78
35
43
null
null
markus1189/SmartCheck
examples/RedBlackTrees/RedBlackSet.hs
bsd-3-clause
remove (T B E _ (T R a x b)) = T B a x b
40
remove (T B E _ (T R a x b)) = T B a x b
40
remove (T B E _ (T R a x b)) = T B a x b
40
false
false
0
9
15
42
20
22
null
null
rrnewton/accelerate
Data/Array/Accelerate/Trafo/Vectorise.hs
bsd-3-clause
--liftedGenerate :: (Elt e, Shape sh) -- => S.Acc (Vector sh) -- -> (S.Acc (Vector sh) -> S.Acc (Vector e)) -- -> S.Acc (LiftedArray sh e) --liftedGenerate extents fun -- = liftedArray extents (fun (enumSeg extents)) liftedZip :: (Elt a, Elt b, Shape sh) => S.Acc (LiftedArray sh a) -> S.Acc (LiftedArray sh b) -> S.Acc (Segments sh, Vector a, Vector b) liftedZip as bs = S.lift (segs, valsA, valsB) where segsA = segments as segsB = segments bs segs = S.zipWith S.intersect segsA segsB enums = enumSeg segs enumsA = S.zipWith S.toIndex (replicateSeg segs segsA) enums enumsB = S.zipWith S.toIndex (replicateSeg segs segsB) enums (offsA, _) = offsets segsA (offsB, _) = offsets segsB valsA = S.map (values as S.!!) (S.zipWith (+) enumsA (replicateSeg segs offsA)) valsB = S.map (values bs S.!!) (S.zipWith (+) enumsB (replicateSeg segs offsB)) --liftedFold :: (Elt e, Shape sh, Slice sh) -- => (S.Exp e -> S.Exp e -> S.Exp e) -- -> S.Exp e -- -> S.Acc (LiftedArray (sh:.Int) e) -- -> S.Acc (LiftedArray sh e) --liftedFold f z a = liftedArray segs' vals -- where -- vals = S.foldSeg f z (values a) (replicateSeg segs' heads') -- (segs, heads) = S.unzip $ S.map (\sh -> S.lift (S.indexTail sh, S.indexHead sh)) (segments a) -- segs' = makeNonEmpty segs -- heads' = S.zipWith (\sh h -> S.shapeSize sh S.==* 0 S.? (0,h)) segs heads --liftedFoldSeg :: (Elt e, Shape sh, Slice sh) -- => (S.Exp e -> S.Exp e -> S.Exp e) -- -> S.Exp e -- -> S.Acc (LiftedArray (sh:.Int) e) -- -> S.Acc (LiftedArray DIM1 Int) -- -> S.Acc (LiftedArray (sh:.Int) e) --liftedFoldSeg f z a is = liftedArray segs vals -- where -- tails = S.map S.indexTail (segments a) -- vals = S.foldSeg f z (values a) isegs -- segs = S.zipWith (\x y -> S.lift (x:.y)) tails -- (S.map S.unindex1 (segments is)) -- isegs = replicateVectors tails is --liftedBackpermute :: (Elt e, Shape sh, Shape sh') -- => S.Acc (Vector sh') -- -> (S.Acc (Vector sh') -> S.Acc (Vector sh)) -- -> S.Acc (LiftedArray sh e) -- -> S.Acc (LiftedArray sh' e) --liftedBackpermute shapes f a = liftedArray shapes vals' -- where -- segs = segments a -- vals = values a -- enums = enumSeg shapes -- ixs = f enums -- starts = replicateSeg shapes (fst $ offsets segs) -- ixs' = S.map S.index1 $ S.zipWith (+) starts (S.map S.shapeSize ixs) -- vals' = S.backpermute (S.shape ixs') (ixs' S.!) vals
2,735
liftedZip :: (Elt a, Elt b, Shape sh) => S.Acc (LiftedArray sh a) -> S.Acc (LiftedArray sh b) -> S.Acc (Segments sh, Vector a, Vector b) liftedZip as bs = S.lift (segs, valsA, valsB) where segsA = segments as segsB = segments bs segs = S.zipWith S.intersect segsA segsB enums = enumSeg segs enumsA = S.zipWith S.toIndex (replicateSeg segs segsA) enums enumsB = S.zipWith S.toIndex (replicateSeg segs segsB) enums (offsA, _) = offsets segsA (offsB, _) = offsets segsB valsA = S.map (values as S.!!) (S.zipWith (+) enumsA (replicateSeg segs offsA)) valsB = S.map (values bs S.!!) (S.zipWith (+) enumsB (replicateSeg segs offsB)) --liftedFold :: (Elt e, Shape sh, Slice sh) -- => (S.Exp e -> S.Exp e -> S.Exp e) -- -> S.Exp e -- -> S.Acc (LiftedArray (sh:.Int) e) -- -> S.Acc (LiftedArray sh e) --liftedFold f z a = liftedArray segs' vals -- where -- vals = S.foldSeg f z (values a) (replicateSeg segs' heads') -- (segs, heads) = S.unzip $ S.map (\sh -> S.lift (S.indexTail sh, S.indexHead sh)) (segments a) -- segs' = makeNonEmpty segs -- heads' = S.zipWith (\sh h -> S.shapeSize sh S.==* 0 S.? (0,h)) segs heads --liftedFoldSeg :: (Elt e, Shape sh, Slice sh) -- => (S.Exp e -> S.Exp e -> S.Exp e) -- -> S.Exp e -- -> S.Acc (LiftedArray (sh:.Int) e) -- -> S.Acc (LiftedArray DIM1 Int) -- -> S.Acc (LiftedArray (sh:.Int) e) --liftedFoldSeg f z a is = liftedArray segs vals -- where -- tails = S.map S.indexTail (segments a) -- vals = S.foldSeg f z (values a) isegs -- segs = S.zipWith (\x y -> S.lift (x:.y)) tails -- (S.map S.unindex1 (segments is)) -- isegs = replicateVectors tails is --liftedBackpermute :: (Elt e, Shape sh, Shape sh') -- => S.Acc (Vector sh') -- -> (S.Acc (Vector sh') -> S.Acc (Vector sh)) -- -> S.Acc (LiftedArray sh e) -- -> S.Acc (LiftedArray sh' e) --liftedBackpermute shapes f a = liftedArray shapes vals' -- where -- segs = segments a -- vals = values a -- enums = enumSeg shapes -- ixs = f enums -- starts = replicateSeg shapes (fst $ offsets segs) -- ixs' = S.map S.index1 $ S.zipWith (+) starts (S.map S.shapeSize ixs) -- vals' = S.backpermute (S.shape ixs') (ixs' S.!) vals
2,474
liftedZip as bs = S.lift (segs, valsA, valsB) where segsA = segments as segsB = segments bs segs = S.zipWith S.intersect segsA segsB enums = enumSeg segs enumsA = S.zipWith S.toIndex (replicateSeg segs segsA) enums enumsB = S.zipWith S.toIndex (replicateSeg segs segsB) enums (offsA, _) = offsets segsA (offsB, _) = offsets segsB valsA = S.map (values as S.!!) (S.zipWith (+) enumsA (replicateSeg segs offsA)) valsB = S.map (values bs S.!!) (S.zipWith (+) enumsB (replicateSeg segs offsB)) --liftedFold :: (Elt e, Shape sh, Slice sh) -- => (S.Exp e -> S.Exp e -> S.Exp e) -- -> S.Exp e -- -> S.Acc (LiftedArray (sh:.Int) e) -- -> S.Acc (LiftedArray sh e) --liftedFold f z a = liftedArray segs' vals -- where -- vals = S.foldSeg f z (values a) (replicateSeg segs' heads') -- (segs, heads) = S.unzip $ S.map (\sh -> S.lift (S.indexTail sh, S.indexHead sh)) (segments a) -- segs' = makeNonEmpty segs -- heads' = S.zipWith (\sh h -> S.shapeSize sh S.==* 0 S.? (0,h)) segs heads --liftedFoldSeg :: (Elt e, Shape sh, Slice sh) -- => (S.Exp e -> S.Exp e -> S.Exp e) -- -> S.Exp e -- -> S.Acc (LiftedArray (sh:.Int) e) -- -> S.Acc (LiftedArray DIM1 Int) -- -> S.Acc (LiftedArray (sh:.Int) e) --liftedFoldSeg f z a is = liftedArray segs vals -- where -- tails = S.map S.indexTail (segments a) -- vals = S.foldSeg f z (values a) isegs -- segs = S.zipWith (\x y -> S.lift (x:.y)) tails -- (S.map S.unindex1 (segments is)) -- isegs = replicateVectors tails is --liftedBackpermute :: (Elt e, Shape sh, Shape sh') -- => S.Acc (Vector sh') -- -> (S.Acc (Vector sh') -> S.Acc (Vector sh)) -- -> S.Acc (LiftedArray sh e) -- -> S.Acc (LiftedArray sh' e) --liftedBackpermute shapes f a = liftedArray shapes vals' -- where -- segs = segments a -- vals = values a -- enums = enumSeg shapes -- ixs = f enums -- starts = replicateSeg shapes (fst $ offsets segs) -- ixs' = S.map S.index1 $ S.zipWith (+) starts (S.map S.shapeSize ixs) -- vals' = S.backpermute (S.shape ixs') (ixs' S.!) vals
2,307
true
true
0
10
826
359
205
154
null
null
yihuang/cabal-install
Distribution/Client/PackageIndex.hs
bsd-3-clause
brokenPackages :: PackageFixedDeps pkg => PackageIndex pkg -> [(pkg, [PackageIdentifier])] brokenPackages index = [ (pkg, missing) | pkg <- allPackages index , let missing = [ pkg' | pkg' <- depends pkg , isNothing (lookupPackageId index pkg') ] , not (null missing) ]
332
brokenPackages :: PackageFixedDeps pkg => PackageIndex pkg -> [(pkg, [PackageIdentifier])] brokenPackages index = [ (pkg, missing) | pkg <- allPackages index , let missing = [ pkg' | pkg' <- depends pkg , isNothing (lookupPackageId index pkg') ] , not (null missing) ]
332
brokenPackages index = [ (pkg, missing) | pkg <- allPackages index , let missing = [ pkg' | pkg' <- depends pkg , isNothing (lookupPackageId index pkg') ] , not (null missing) ]
211
false
true
0
14
106
112
57
55
null
null
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Intents/Get.hs
mpl-2.0
-- | Required. The name of the intent. Format: -- \`projects\/\/locations\/\/agents\/\/intents\/\`. plaigName :: Lens' ProjectsLocationsAgentsIntentsGet Text plaigName = lens _plaigName (\ s a -> s{_plaigName = a})
216
plaigName :: Lens' ProjectsLocationsAgentsIntentsGet Text plaigName = lens _plaigName (\ s a -> s{_plaigName = a})
116
plaigName = lens _plaigName (\ s a -> s{_plaigName = a})
58
true
true
0
9
28
43
23
20
null
null
DavidAlphaFox/ghc
libraries/haskeline/tests/Unit.hs
bsd-3-clause
---------------------- utf8Test = testI . setUTF8
50
utf8Test = testI . setUTF8
26
utf8Test = testI . setUTF8
26
true
false
2
5
6
16
6
10
null
null
IreneKnapp/direct-http
Haskell/Network/HTTP.hs
mit
logInvalidRequest :: MonadHTTP m => m () logInvalidRequest = do connection <- getHTTPConnection httpLog $ "Invalid request from " ++ (show $ httpConnectionPeer connection) ++ "; closing its connection."
230
logInvalidRequest :: MonadHTTP m => m () logInvalidRequest = do connection <- getHTTPConnection httpLog $ "Invalid request from " ++ (show $ httpConnectionPeer connection) ++ "; closing its connection."
230
logInvalidRequest = do connection <- getHTTPConnection httpLog $ "Invalid request from " ++ (show $ httpConnectionPeer connection) ++ "; closing its connection."
189
false
true
0
11
56
55
26
29
null
null