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
shlevy/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
-- Takes a list of printable things and prints them separated by semicolons -- followed by space. semiSep :: Ppr a => [a] -> Doc semiSep = sep . punctuate semi . map ppr
169
semiSep :: Ppr a => [a] -> Doc semiSep = sep . punctuate semi . map ppr
71
semiSep = sep . punctuate semi . map ppr
40
true
true
0
7
33
41
21
20
null
null
vincenthz/hs-foundation
foundation/Foundation/Timing/Main.hs
bsd-3-clause
parseArgs ("--list-benchs":xs) cfg = parseArgs xs $ cfg { mainListBenchs = True }
81
parseArgs ("--list-benchs":xs) cfg = parseArgs xs $ cfg { mainListBenchs = True }
81
parseArgs ("--list-benchs":xs) cfg = parseArgs xs $ cfg { mainListBenchs = True }
81
false
false
0
7
12
33
17
16
null
null
karamellpelle/grid
source/OpenGL/Helpers.hs
gpl-3.0
-------------------------------------------------------------------------------- -- index buffer object -- | create ibo for 'm' disjoint groups of size 'size'. -- bytesize is: m * (size + 2) * 2 -- (gl_TRIANGLE_STRIP, gl_UNSIGNED_SHORT, max different indices: 2^16) makeGroupIBO :: UInt -> UInt -> IO GLuint makeGroupIBO size m = do ibo <- bindNewBuf gl_ELEMENT_ARRAY_BUFFER let bytesize = (m * (size + 2)) * 2 withArray (helper 0) $ \ptr -> glBufferData gl_ELEMENT_ARRAY_BUFFER (fI bytesize) ptr gl_STATIC_DRAW return ibo where helper :: UInt -> [GLushort] helper n | n == m = [] -- prevent index out of bounds on last element: | n + 1 == m = let n' = n + 1 in range (fI $ n * size) (fI $ n' * size) ++ [fI $ n' * size - 1, fI $ n' * size - 1] | otherwise = let n' = n + 1 in range (fI $ n * size) (fI $ n' * size) ++ [fI $ n' * size - 1, fI $ n' * size] ++ helper (n + 1) range i j = if i == j then [] else i : range (i + 1) j -------------------------------------------------------------------------------- --
1,275
makeGroupIBO :: UInt -> UInt -> IO GLuint makeGroupIBO size m = do ibo <- bindNewBuf gl_ELEMENT_ARRAY_BUFFER let bytesize = (m * (size + 2)) * 2 withArray (helper 0) $ \ptr -> glBufferData gl_ELEMENT_ARRAY_BUFFER (fI bytesize) ptr gl_STATIC_DRAW return ibo where helper :: UInt -> [GLushort] helper n | n == m = [] -- prevent index out of bounds on last element: | n + 1 == m = let n' = n + 1 in range (fI $ n * size) (fI $ n' * size) ++ [fI $ n' * size - 1, fI $ n' * size - 1] | otherwise = let n' = n + 1 in range (fI $ n * size) (fI $ n' * size) ++ [fI $ n' * size - 1, fI $ n' * size] ++ helper (n + 1) range i j = if i == j then [] else i : range (i + 1) j -------------------------------------------------------------------------------- --
1,004
makeGroupIBO size m = do ibo <- bindNewBuf gl_ELEMENT_ARRAY_BUFFER let bytesize = (m * (size + 2)) * 2 withArray (helper 0) $ \ptr -> glBufferData gl_ELEMENT_ARRAY_BUFFER (fI bytesize) ptr gl_STATIC_DRAW return ibo where helper :: UInt -> [GLushort] helper n | n == m = [] -- prevent index out of bounds on last element: | n + 1 == m = let n' = n + 1 in range (fI $ n * size) (fI $ n' * size) ++ [fI $ n' * size - 1, fI $ n' * size - 1] | otherwise = let n' = n + 1 in range (fI $ n * size) (fI $ n' * size) ++ [fI $ n' * size - 1, fI $ n' * size] ++ helper (n + 1) range i j = if i == j then [] else i : range (i + 1) j -------------------------------------------------------------------------------- --
962
true
true
0
14
458
377
191
186
null
null
ckaestne/CIDE
other/CaseStudies/Arith/CIDEArithFine/Arith.hs
gpl-3.0
zipResult :: (a -> b -> Result c err) -> Result a err -> Result b err -> Result c err; zipResult f (Result x) (Result y) = f x y
163
zipResult :: (a -> b -> Result c err) -> Result a err -> Result b err -> Result c err zipResult f (Result x) (Result y) = f x y
159
zipResult f (Result x) (Result y) = f x y
41
false
true
0
9
65
79
38
41
null
null
tyehle/euler-haskell
src/P093.hs
bsd-3-clause
allChoices n xs = [ y:ys | y:rest <- tails xs , ys <- allChoices (n-1) rest ]
102
allChoices n xs = [ y:ys | y:rest <- tails xs , ys <- allChoices (n-1) rest ]
102
allChoices n xs = [ y:ys | y:rest <- tails xs , ys <- allChoices (n-1) rest ]
102
false
false
0
10
42
53
26
27
null
null
abbradar/elm-reactor
backend/Main.hs
bsd-3-clause
flags :: Flags flags = Flags { address = "0.0.0.0" &= help "set the address of the server (0.0.0.0, localhost, 127.0.0.1)" &= typ "ADDRESS" , port = 8000 &= help "set the port of the reactor (default: 8000)" } &= help "Interactive development tool that makes it easy to develop and debug Elm programs.\n\ \ Read more about it at <https://github.com/elm-lang/elm-reactor>." &= helpArg [ explicit , name "help" , name "h" ] &= versionArg [ explicit, name "version", name "v" , summary (Version.showVersion version) ] &= summary startupMessage
653
flags :: Flags flags = Flags { address = "0.0.0.0" &= help "set the address of the server (0.0.0.0, localhost, 127.0.0.1)" &= typ "ADDRESS" , port = 8000 &= help "set the port of the reactor (default: 8000)" } &= help "Interactive development tool that makes it easy to develop and debug Elm programs.\n\ \ Read more about it at <https://github.com/elm-lang/elm-reactor>." &= helpArg [ explicit , name "help" , name "h" ] &= versionArg [ explicit, name "version", name "v" , summary (Version.showVersion version) ] &= summary startupMessage
653
flags = Flags { address = "0.0.0.0" &= help "set the address of the server (0.0.0.0, localhost, 127.0.0.1)" &= typ "ADDRESS" , port = 8000 &= help "set the port of the reactor (default: 8000)" } &= help "Interactive development tool that makes it easy to develop and debug Elm programs.\n\ \ Read more about it at <https://github.com/elm-lang/elm-reactor>." &= helpArg [ explicit , name "help" , name "h" ] &= versionArg [ explicit, name "version", name "v" , summary (Version.showVersion version) ] &= summary startupMessage
638
false
true
0
13
200
121
60
61
null
null
mcschroeder/ghc
compiler/prelude/THNames.hs
bsd-3-clause
decTyConName = thTc (fsLit "Dec") decTyConKey
61
decTyConName = thTc (fsLit "Dec") decTyConKey
61
decTyConName = thTc (fsLit "Dec") decTyConKey
61
false
false
0
7
21
17
8
9
null
null
pontarius/pontarius-service
source/Transactions.hs
agpl-3.0
synchronousCreateGpgKey :: (MonadIO m, Functor m) => PSM (MethodHandlerT m) BS.ByteString synchronousCreateGpgKey = do liftIO $ logDebug "Creating new identity" sem <- view psGpgCreateKeySempahore tid <- liftIO myThreadId liftIO (atomically $ tryPutTMVar sem tid) >>= \case False ->do lift . methodError $ MsgError "org.pontarius.Error.createIdentity" (Just $ "Identity creation is already running") [] True -> do setState CreatingIdentity keyFpr <- liftIO newGpgKey now <- liftIO $ getCurrentTime liftIO $ logDebug "Done creating new key" addIdentity "gpg" (toKeyID keyFpr) (Just now) Nothing as <- view psAccountState liftIO (atomically (readTVar as)) >>= \case AccountEnabled -> setState Authenticating AccountDisabled -> setState Disabled void . liftIO . atomically $ takeTMVar sem return keyFpr
1,081
synchronousCreateGpgKey :: (MonadIO m, Functor m) => PSM (MethodHandlerT m) BS.ByteString synchronousCreateGpgKey = do liftIO $ logDebug "Creating new identity" sem <- view psGpgCreateKeySempahore tid <- liftIO myThreadId liftIO (atomically $ tryPutTMVar sem tid) >>= \case False ->do lift . methodError $ MsgError "org.pontarius.Error.createIdentity" (Just $ "Identity creation is already running") [] True -> do setState CreatingIdentity keyFpr <- liftIO newGpgKey now <- liftIO $ getCurrentTime liftIO $ logDebug "Done creating new key" addIdentity "gpg" (toKeyID keyFpr) (Just now) Nothing as <- view psAccountState liftIO (atomically (readTVar as)) >>= \case AccountEnabled -> setState Authenticating AccountDisabled -> setState Disabled void . liftIO . atomically $ takeTMVar sem return keyFpr
1,081
synchronousCreateGpgKey = do liftIO $ logDebug "Creating new identity" sem <- view psGpgCreateKeySempahore tid <- liftIO myThreadId liftIO (atomically $ tryPutTMVar sem tid) >>= \case False ->do lift . methodError $ MsgError "org.pontarius.Error.createIdentity" (Just $ "Identity creation is already running") [] True -> do setState CreatingIdentity keyFpr <- liftIO newGpgKey now <- liftIO $ getCurrentTime liftIO $ logDebug "Done creating new key" addIdentity "gpg" (toKeyID keyFpr) (Just now) Nothing as <- view psAccountState liftIO (atomically (readTVar as)) >>= \case AccountEnabled -> setState Authenticating AccountDisabled -> setState Disabled void . liftIO . atomically $ takeTMVar sem return keyFpr
964
false
true
0
18
389
269
121
148
null
null
headprogrammingczar/cabal
cabal-install/Distribution/Solver/Modular/IndexConversion.hs
bsd-3-clause
-- With convenience libraries, we have to do some work. Imagine you -- have the following Cabal file: -- -- name: foo -- library foo-internal -- build-depends: external-a -- library -- build-depends: foo-internal, external-b -- library foo-helper -- build-depends: foo, external-c -- test-suite foo-tests -- build-depends: foo-helper, external-d -- -- What should the final flagged dependency tree be? Ideally, it -- should look like this: -- -- [ Simple (Dep external-a) (Library foo-internal) -- , Simple (Dep external-b) (Library foo) -- , Stanza (SN foo TestStanzas) $ -- [ Simple (Dep external-c) (Library foo-helper) -- , Simple (Dep external-d) (TestSuite foo-tests) ] -- ] -- -- There are two things to note: -- -- 1. First, we eliminated the "local" dependencies foo-internal -- and foo-helper. This are implicitly assumed to refer to "foo" -- so we don't need to have them around. If you forget this, -- Cabal will then try to pick a version for "foo-helper" but -- no such package exists (this is the cost of overloading -- build-depends to refer to both packages and components.) -- -- 2. Second, it is more precise to have external-c be qualified -- by a test stanza, since foo-helper only needs to be built if -- your are building the test suite (and not the main library). -- If you omit it, Cabal will always attempt to depsolve for -- foo-helper even if you aren't building the test suite. -- | Create a flagged dependency tree from a list @fds@ of flagged -- dependencies, using @f@ to form the tree node (@f@ will be -- something like @Stanza sn@). prefix :: (FlaggedDeps comp qpn -> FlaggedDep comp' qpn) -> [FlaggedDeps comp qpn] -> FlaggedDeps comp' qpn prefix _ [] = []
1,859
prefix :: (FlaggedDeps comp qpn -> FlaggedDep comp' qpn) -> [FlaggedDeps comp qpn] -> FlaggedDeps comp' qpn prefix _ [] = []
132
prefix _ [] = []
17
true
true
0
8
456
98
68
30
null
null
adarqui/Abstract-Impl-Redis
src/Abstract/Utilities/Redis/Helpers.hs
bsd-3-clause
gentleReset :: ConnectionWrapper -> B.ByteString -> Int -> IO (Either () Bool) gentleReset w key n = do setnx w key (B.pack $ show n)
134
gentleReset :: ConnectionWrapper -> B.ByteString -> Int -> IO (Either () Bool) gentleReset w key n = do setnx w key (B.pack $ show n)
134
gentleReset w key n = do setnx w key (B.pack $ show n)
55
false
true
0
11
25
67
32
35
null
null
konn/pandoc-japanese-docx
src/Text/Pandoc/Readers/Docx/Japanese.hs
gpl-2.0
evalDocxContext :: DocxContext a -> DEnv -> DState -> a evalDocxContext ctx env st = evalState (runReaderT ctx env) st
118
evalDocxContext :: DocxContext a -> DEnv -> DState -> a evalDocxContext ctx env st = evalState (runReaderT ctx env) st
118
evalDocxContext ctx env st = evalState (runReaderT ctx env) st
62
false
true
0
7
19
46
22
24
null
null
massysett/prednote
genCabal.hs
bsd-3-clause
tests :: FlagName -- ^ Visual-tests flag -> [String] -- ^ Library modules -> [String] -- ^ Test modules -> (Section, Section) -- ^ The prednote-tests test suite, and the prednote-visual-tests -- executable tests fl ls ts = ( testSuite "prednote-tests" $ commonTestOpts ls ts ++ [ mainIs "prednote-tests.hs" , exitcodeStdio ] , testSuite "prednote-visual-tests" $ [ mainIs "prednote-visual-tests.hs" , exitcodeStdio ] ++ commonTestOpts ls ts )
494
tests :: FlagName -- ^ Visual-tests flag -> [String] -- ^ Library modules -> [String] -- ^ Test modules -> (Section, Section) tests fl ls ts = ( testSuite "prednote-tests" $ commonTestOpts ls ts ++ [ mainIs "prednote-tests.hs" , exitcodeStdio ] , testSuite "prednote-visual-tests" $ [ mainIs "prednote-visual-tests.hs" , exitcodeStdio ] ++ commonTestOpts ls ts )
410
tests fl ls ts = ( testSuite "prednote-tests" $ commonTestOpts ls ts ++ [ mainIs "prednote-tests.hs" , exitcodeStdio ] , testSuite "prednote-visual-tests" $ [ mainIs "prednote-visual-tests.hs" , exitcodeStdio ] ++ commonTestOpts ls ts )
270
true
true
0
10
118
109
57
52
null
null
phischu/fragnix
builtins/base/Data.Bool.hs
bsd-3-clause
-- | Case analysis for the 'Bool' type. @'bool' x y p@ evaluates to @x@ -- when @p@ is 'False', and evaluates to @y@ when @p@ is 'True'. -- -- This is equivalent to @if p then y else x@; that is, one can -- think of it as an if-then-else construct with its arguments -- reordered. -- -- @since 4.7.0.0 -- -- ==== __Examples__ -- -- Basic usage: -- -- >>> bool "foo" "bar" True -- "bar" -- >>> bool "foo" "bar" False -- "foo" -- -- Confirm that @'bool' x y p@ and @if p then y else x@ are -- equivalent: -- -- >>> let p = True; x = "bar"; y = "foo" -- >>> bool x y p == if p then y else x -- True -- >>> let p = False -- >>> bool x y p == if p then y else x -- True -- bool :: a -> a -> Bool -> a bool f _ False = f
714
bool :: a -> a -> Bool -> a bool f _ False = f
46
bool f _ False = f
18
true
true
0
7
168
63
44
19
null
null
BigEndian/tasks
src/Tasks/Task.hs
gpl-2.0
-- | Edit a given task's due date taskEditDue :: Task -> Maybe DateTime -> Task taskEditDue tsk@(Task { taskMetadata = tmd }) mdd = tsk { taskMetadata = mdEditDue tmd mdd }
175
taskEditDue :: Task -> Maybe DateTime -> Task taskEditDue tsk@(Task { taskMetadata = tmd }) mdd = tsk { taskMetadata = mdEditDue tmd mdd }
141
taskEditDue tsk@(Task { taskMetadata = tmd }) mdd = tsk { taskMetadata = mdEditDue tmd mdd }
95
true
true
4
6
35
45
25
20
null
null
AndreasPK/stack
src/Stack/PackageDump.hs
bsd-3-clause
-- | Call ghc-pkg dump with appropriate flags and stream to the given @Sink@, for a single database ghcPkgDump :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -- ^ if empty, use global -> Sink Text IO a -> m a ghcPkgDump = ghcPkgCmdArgs ["dump"]
338
ghcPkgDump :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -- ^ if empty, use global -> Sink Text IO a -> m a ghcPkgDump = ghcPkgCmdArgs ["dump"]
238
ghcPkgDump = ghcPkgCmdArgs ["dump"]
35
true
true
0
11
78
87
43
44
null
null
jano017/Discord.hs
src/Network/Discord/Framework.hs
mit
handle a@(GuildRoleCreateEvent p) (D.GuildRoleCreate o) = runAsync (clientProxy a) $ p o
100
handle a@(GuildRoleCreateEvent p) (D.GuildRoleCreate o) = runAsync (clientProxy a) $ p o
100
handle a@(GuildRoleCreateEvent p) (D.GuildRoleCreate o) = runAsync (clientProxy a) $ p o
100
false
false
0
8
23
44
21
23
null
null
meditans/documentator
src/Documentator/Descriptors.hs
gpl-3.0
resultTyCon t@(TyList _ _) = t
30
resultTyCon t@(TyList _ _) = t
30
resultTyCon t@(TyList _ _) = t
30
false
false
0
8
5
20
10
10
null
null
gwright83/Wheeler
src/Math/Symbolic/Wheeler/TensorBasics.hs
bsd-3-clause
getIndices (Sum ts) = concatMap getIndices ts
50
getIndices (Sum ts) = concatMap getIndices ts
50
getIndices (Sum ts) = concatMap getIndices ts
50
false
false
0
7
11
20
9
11
null
null
shlevy/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
fmap_RDR, replace_RDR, pure_RDR, ap_RDR, liftA2_RDR, foldable_foldr_RDR, foldMap_RDR, null_RDR, all_RDR, traverse_RDR, mempty_RDR, mappend_RDR :: RdrName fmap_RDR = varQual_RDR gHC_BASE (fsLit "fmap")
223
fmap_RDR, replace_RDR, pure_RDR, ap_RDR, liftA2_RDR, foldable_foldr_RDR, foldMap_RDR, null_RDR, all_RDR, traverse_RDR, mempty_RDR, mappend_RDR :: RdrName fmap_RDR = varQual_RDR gHC_BASE (fsLit "fmap")
223
fmap_RDR = varQual_RDR gHC_BASE (fsLit "fmap")
61
false
true
0
7
42
44
33
11
null
null
spechub/Hets
Comorphisms/HasCASL2IsabelleHOL.hs
gpl-2.0
transProgEq :: Env -> ProgEq -> (IsaSign.Term, IsaSign.Term) transProgEq sign (ProgEq pat t _) = (transPattern sign pat, transPattern sign t)
147
transProgEq :: Env -> ProgEq -> (IsaSign.Term, IsaSign.Term) transProgEq sign (ProgEq pat t _) = (transPattern sign pat, transPattern sign t)
147
transProgEq sign (ProgEq pat t _) = (transPattern sign pat, transPattern sign t)
86
false
true
0
8
26
60
31
29
null
null
ezyang/ghc
testsuite/tests/indexed-types/should_fail/T13674.hs
bsd-3-clause
x :: GF 5 x = GF 3
18
x :: GF 5 x = GF 3
18
x = GF 3
8
false
true
1
5
7
20
8
12
null
null
nushio3/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
isEmptyLocalBinds (HsIPBinds ds) = isEmptyIPBinds ds
53
isEmptyLocalBinds (HsIPBinds ds) = isEmptyIPBinds ds
53
isEmptyLocalBinds (HsIPBinds ds) = isEmptyIPBinds ds
53
false
false
0
6
6
19
8
11
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
-- | The Availability Zone. niAvailabilityZone :: Lens' NetworkInterface (Maybe Text) niAvailabilityZone = lens _niAvailabilityZone (\s a -> s { _niAvailabilityZone = a })
175
niAvailabilityZone :: Lens' NetworkInterface (Maybe Text) niAvailabilityZone = lens _niAvailabilityZone (\s a -> s { _niAvailabilityZone = a })
147
niAvailabilityZone = lens _niAvailabilityZone (\s a -> s { _niAvailabilityZone = a })
89
true
true
2
9
27
55
25
30
null
null
danieldk/approx-rand-test
src/Statistics/Test/ApproxRand.hs
apache-2.0
-- | Generate Int numbers within a range randomIntR :: PureMT -> (Int, Int) -> (Int, PureMT) randomIntR gen (a, b) | n == 0 = randomInt gen | otherwise = loop gen where (a', b') = if a < b then (a, b) else (b, a) -- Number of different Ints that should be generated n = 1 + subIIW b' a' -- The total range of Word can hold x complete n ranges x = maxBound `div` n -- Pick from a range the is dividable by n without remainders s = x * n loop gen' | r >= s = loop gen'' -- r is outside the range, discard it... | otherwise = (addIWI a' (r `div` x), gen'') where (!r, !gen'') = randomWord gen'
662
randomIntR :: PureMT -> (Int, Int) -> (Int, PureMT) randomIntR gen (a, b) | n == 0 = randomInt gen | otherwise = loop gen where (a', b') = if a < b then (a, b) else (b, a) -- Number of different Ints that should be generated n = 1 + subIIW b' a' -- The total range of Word can hold x complete n ranges x = maxBound `div` n -- Pick from a range the is dividable by n without remainders s = x * n loop gen' | r >= s = loop gen'' -- r is outside the range, discard it... | otherwise = (addIWI a' (r `div` x), gen'') where (!r, !gen'') = randomWord gen'
621
randomIntR gen (a, b) | n == 0 = randomInt gen | otherwise = loop gen where (a', b') = if a < b then (a, b) else (b, a) -- Number of different Ints that should be generated n = 1 + subIIW b' a' -- The total range of Word can hold x complete n ranges x = maxBound `div` n -- Pick from a range the is dividable by n without remainders s = x * n loop gen' | r >= s = loop gen'' -- r is outside the range, discard it... | otherwise = (addIWI a' (r `div` x), gen'') where (!r, !gen'') = randomWord gen'
569
true
true
8
11
200
214
115
99
null
null
bgamari/navigate
Navigate.hs
bsd-3-clause
main :: IO () main = do args <- execParser $ info (helper <*> config) mempty putStrLn "Opening XY stage" queue <- newMotorQueue (xyDevice args) let enqueue :: (MM.Bus -> IO ()) -> IO () enqueue = atomically . writeTQueue queue initialVar <- newEmptyMVar enqueue $ \bus->do initialPos <- T.forM axes $ \axis->do MM.select bus axis --MM.getError bus >>= print MM.setBrake bus False MM.setDriveCurrent bus (driveCurrent args) MM.setHoldCurrent bus (holdCurrent args) MM.setMotorPower bus True either (error "Error fetching initial position") fromIntegral <$> MM.getPosition bus putMVar initialVar initialPos initial <- takeMVar initialVar let moveStage :: MM.Axis -> Mover moveStage axis (Pos n) = enqueue $ \bus->do MM.select bus axis MM.moveAbs bus (MM.Pos $ fromIntegral n) putStrLn $ "Move "++show axis++" to "++show n putStrLn "Opening Z stage" zMotor <- Z.open (zDevice args) let moveZStage (Pos n) = do Z.move zMotor n putStrLn $ "Move Z to "++show n --forkIO $ forever $ threadDelay 1000000 >> enqueue reportPositions navAxes <- T.sequence $ V3 (newNavAxis updateRate (moveStage (axes ^. _x)) (initial ^. _x)) (newNavAxis updateRate (moveStage (axes ^. _y)) (initial ^. _y)) (newNavAxis updateRate moveZStage 0) putStrLn "Opening joystick" joystick <- openFile (inputDevice args) ReadMode listenEvDev joystick navAxes
1,633
main :: IO () main = do args <- execParser $ info (helper <*> config) mempty putStrLn "Opening XY stage" queue <- newMotorQueue (xyDevice args) let enqueue :: (MM.Bus -> IO ()) -> IO () enqueue = atomically . writeTQueue queue initialVar <- newEmptyMVar enqueue $ \bus->do initialPos <- T.forM axes $ \axis->do MM.select bus axis --MM.getError bus >>= print MM.setBrake bus False MM.setDriveCurrent bus (driveCurrent args) MM.setHoldCurrent bus (holdCurrent args) MM.setMotorPower bus True either (error "Error fetching initial position") fromIntegral <$> MM.getPosition bus putMVar initialVar initialPos initial <- takeMVar initialVar let moveStage :: MM.Axis -> Mover moveStage axis (Pos n) = enqueue $ \bus->do MM.select bus axis MM.moveAbs bus (MM.Pos $ fromIntegral n) putStrLn $ "Move "++show axis++" to "++show n putStrLn "Opening Z stage" zMotor <- Z.open (zDevice args) let moveZStage (Pos n) = do Z.move zMotor n putStrLn $ "Move Z to "++show n --forkIO $ forever $ threadDelay 1000000 >> enqueue reportPositions navAxes <- T.sequence $ V3 (newNavAxis updateRate (moveStage (axes ^. _x)) (initial ^. _x)) (newNavAxis updateRate (moveStage (axes ^. _y)) (initial ^. _y)) (newNavAxis updateRate moveZStage 0) putStrLn "Opening joystick" joystick <- openFile (inputDevice args) ReadMode listenEvDev joystick navAxes
1,633
main = do args <- execParser $ info (helper <*> config) mempty putStrLn "Opening XY stage" queue <- newMotorQueue (xyDevice args) let enqueue :: (MM.Bus -> IO ()) -> IO () enqueue = atomically . writeTQueue queue initialVar <- newEmptyMVar enqueue $ \bus->do initialPos <- T.forM axes $ \axis->do MM.select bus axis --MM.getError bus >>= print MM.setBrake bus False MM.setDriveCurrent bus (driveCurrent args) MM.setHoldCurrent bus (holdCurrent args) MM.setMotorPower bus True either (error "Error fetching initial position") fromIntegral <$> MM.getPosition bus putMVar initialVar initialPos initial <- takeMVar initialVar let moveStage :: MM.Axis -> Mover moveStage axis (Pos n) = enqueue $ \bus->do MM.select bus axis MM.moveAbs bus (MM.Pos $ fromIntegral n) putStrLn $ "Move "++show axis++" to "++show n putStrLn "Opening Z stage" zMotor <- Z.open (zDevice args) let moveZStage (Pos n) = do Z.move zMotor n putStrLn $ "Move Z to "++show n --forkIO $ forever $ threadDelay 1000000 >> enqueue reportPositions navAxes <- T.sequence $ V3 (newNavAxis updateRate (moveStage (axes ^. _x)) (initial ^. _x)) (newNavAxis updateRate (moveStage (axes ^. _y)) (initial ^. _y)) (newNavAxis updateRate moveZStage 0) putStrLn "Opening joystick" joystick <- openFile (inputDevice args) ReadMode listenEvDev joystick navAxes
1,619
false
true
0
19
505
535
245
290
null
null
GaloisInc/ivory
ivory-stdlib/src/Ivory/Stdlib/Control.hs
bsd-3-clause
-- | A multi-way if. This is useful for avoiding an explosion of -- nesting and parentheses in complex conditionals. -- -- Instead of writing nested chains of ifs: -- -- > ifte_ (x >? 100) -- > (store result 10) -- > (ifte_ (x >? 50) -- > (store result 5) -- > (ifte_ (x >? 0) -- > (store result 1) -- > (store result 0))) -- -- You can write: -- -- > cond_ -- > [ x >? 100 ==> store result 10 -- > , x >? 50 ==> store result 5 -- > , x >? 0 ==> store result 1 -- > , true ==> store result 0 -- > ] -- -- Note that "==>" is non-associative and has precedence 0, so you -- will need parentheses to call functions with "$" on the left-hand -- side: -- -- > cond_ [ (f $ g x) ==> y ] -- -- rather than: -- -- > cond_ [ f $ g x ==> y ] cond_ :: [Cond eff ()] -> Ivory eff () cond_ [] = return ()
833
cond_ :: [Cond eff ()] -> Ivory eff () cond_ [] = return ()
59
cond_ [] = return ()
20
true
true
0
8
228
73
51
22
null
null
quickdudley/phaser
Codec/Phaser/Core.hs
bsd-3-clause
put i = Phase (\_ c -> run' (c ()) i)
37
put i = Phase (\_ c -> run' (c ()) i)
37
put i = Phase (\_ c -> run' (c ()) i)
37
false
false
1
11
10
38
17
21
null
null
marcmo/hsDiagnosis
other/DiagClientCallback.hs
bsd-3-clause
main = sendData c callback [] where callback resp = when (isNegativeResponse resp) $ do let (Just (DiagnosisMessage _ _ (_:_:err:_))) = resp print err print $ "negative response: " ++ nameOfError err -- c = MkDiagConfig "10.40.39.19" 6801 0xf4 0x40 True c = MkDiagConfig "localhost" 6801 0xf4 0x40 True
380
main = sendData c callback [] where callback resp = when (isNegativeResponse resp) $ do let (Just (DiagnosisMessage _ _ (_:_:err:_))) = resp print err print $ "negative response: " ++ nameOfError err -- c = MkDiagConfig "10.40.39.19" 6801 0xf4 0x40 True c = MkDiagConfig "localhost" 6801 0xf4 0x40 True
380
main = sendData c callback [] where callback resp = when (isNegativeResponse resp) $ do let (Just (DiagnosisMessage _ _ (_:_:err:_))) = resp print err print $ "negative response: " ++ nameOfError err -- c = MkDiagConfig "10.40.39.19" 6801 0xf4 0x40 True c = MkDiagConfig "localhost" 6801 0xf4 0x40 True
380
false
false
2
19
127
120
55
65
null
null
kim/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/Types.hs
mpl-2.0
-- | A value that indicates the starting point for the next set of response -- records in a subsequent request. If a value is returned in a response, you -- can retrieve the next set of records by providing this returned marker value -- in the 'Marker' parameter and retrying the command. If the 'Marker' field is -- empty, all response records have been retrieved for the request. dcpMarker :: Lens' DefaultClusterParameters (Maybe Text) dcpMarker = lens _dcpMarker (\s a -> s { _dcpMarker = a })
497
dcpMarker :: Lens' DefaultClusterParameters (Maybe Text) dcpMarker = lens _dcpMarker (\s a -> s { _dcpMarker = a })
115
dcpMarker = lens _dcpMarker (\s a -> s { _dcpMarker = a })
58
true
true
0
9
87
50
29
21
null
null
ecaustin/haskhol-core
src/HaskHOL/Core/Overloadings.hs
bsd-2-clause
destBinary :: HOLTermRep tm cls thry => Text -> tm -> HOL cls thry (HOLTerm, HOLTerm) destBinary s = overload1 (B.destBinary s)
139
destBinary :: HOLTermRep tm cls thry => Text -> tm -> HOL cls thry (HOLTerm, HOLTerm) destBinary s = overload1 (B.destBinary s)
139
destBinary s = overload1 (B.destBinary s)
41
false
true
0
9
33
57
28
29
null
null
GaloisInc/saw-script
saw-core/src/Verifier/SAW/SharedTerm.hs
bsd-3-clause
scTupleReduced sc (t : ts) = scPairValueReduced sc t =<< scTupleReduced sc ts
77
scTupleReduced sc (t : ts) = scPairValueReduced sc t =<< scTupleReduced sc ts
77
scTupleReduced sc (t : ts) = scPairValueReduced sc t =<< scTupleReduced sc ts
77
false
false
0
7
12
32
15
17
null
null
schell/lamdu
Lamdu/Sugar/Convert/Monad.hs
gpl-3.0
run :: MonadA m => Context m -> ConvertM m a -> CT m a run ctx (ConvertM action) = runReaderT action ctx
104
run :: MonadA m => Context m -> ConvertM m a -> CT m a run ctx (ConvertM action) = runReaderT action ctx
104
run ctx (ConvertM action) = runReaderT action ctx
49
false
true
0
11
22
59
26
33
null
null
ribag/ganeti-experiments
src/Ganeti/OpParams.hs
gpl-2.0
pTagsName :: Field pTagsName = withDoc "Name of object" . renameField "TagsGetName" . optionalField $ simpleField "name" [t| String |]
140
pTagsName :: Field pTagsName = withDoc "Name of object" . renameField "TagsGetName" . optionalField $ simpleField "name" [t| String |]
140
pTagsName = withDoc "Name of object" . renameField "TagsGetName" . optionalField $ simpleField "name" [t| String |]
121
false
true
0
6
25
44
21
23
null
null
josefs/autosar
oldARSim/NewABS.hs
bsd-3-clause
v4 = curve1
11
v4 = curve1
11
v4 = curve1
11
false
false
1
5
2
10
3
7
null
null
futufeld/eclogues
eclogues-impl/gen-hs/AuroraSchedulerManager.hs
bsd-3-clause
default_RestartShards_result :: RestartShards_result default_RestartShards_result = RestartShards_result{ restartShards_result_success = default_Response}
156
default_RestartShards_result :: RestartShards_result default_RestartShards_result = RestartShards_result{ restartShards_result_success = default_Response}
156
default_RestartShards_result = RestartShards_result{ restartShards_result_success = default_Response}
103
false
true
0
6
10
19
11
8
null
null
codemac/yi-editor
src/Yi/Buffer/Misc.hs
gpl-2.0
file :: FBuffer -> (Maybe FilePath) file b = case b ^. identA of Right f -> Just f _ -> Nothing
103
file :: FBuffer -> (Maybe FilePath) file b = case b ^. identA of Right f -> Just f _ -> Nothing
103
file b = case b ^. identA of Right f -> Just f _ -> Nothing
67
false
true
0
9
29
56
25
31
null
null
oldmanmike/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprGInstr (GTAN fmt _ _ src dst) = pprFormatRegReg (sLit "gtan") fmt src dst
76
pprGInstr (GTAN fmt _ _ src dst) = pprFormatRegReg (sLit "gtan") fmt src dst
76
pprGInstr (GTAN fmt _ _ src dst) = pprFormatRegReg (sLit "gtan") fmt src dst
76
false
false
0
7
13
38
18
20
null
null
FranklinChen/hugs98-plus-Sep2006
packages/base/Data/ByteString/Lazy.hs
bsd-3-clause
-- The representation uses lists of packed chunks. When we have to convert from -- a lazy list to the chunked representation, then by default we'll use this -- chunk size. Some functions give you more control over the chunk size. -- -- Measurements here: -- http://www.cse.unsw.edu.au/~dons/tmp/chunksize_v_cache.png -- -- indicate that a value around 0.5 to 1 x your L2 cache is best. -- The following value assumes people have something greater than 128k, -- and need to share the cache with other programs. -- defaultChunkSize :: Int defaultChunkSize = 32 * k - overhead where k = 1024 overhead = 2 * sizeOf (undefined :: Int)
642
defaultChunkSize :: Int defaultChunkSize = 32 * k - overhead where k = 1024 overhead = 2 * sizeOf (undefined :: Int)
128
defaultChunkSize = 32 * k - overhead where k = 1024 overhead = 2 * sizeOf (undefined :: Int)
104
true
true
0
9
119
55
35
20
null
null
rimmington/eclogues
eclogues-impl/app/api/Eclogues/State.hs
bsd-3-clause
jobsProgressingOnScheduler :: AppState -> [Job.Status] jobsProgressingOnScheduler = (^.. jobs . filtered (p . (^. Job.stage))) where p = (&&) <$> sentToScheduler <*> isActiveStage -- | Update the status of a set of jobs with new data from the scheduler, -- scheduling any new actions required (eg. dependencies).
319
jobsProgressingOnScheduler :: AppState -> [Job.Status] jobsProgressingOnScheduler = (^.. jobs . filtered (p . (^. Job.stage))) where p = (&&) <$> sentToScheduler <*> isActiveStage -- | Update the status of a set of jobs with new data from the scheduler, -- scheduling any new actions required (eg. dependencies).
319
jobsProgressingOnScheduler = (^.. jobs . filtered (p . (^. Job.stage))) where p = (&&) <$> sentToScheduler <*> isActiveStage -- | Update the status of a set of jobs with new data from the scheduler, -- scheduling any new actions required (eg. dependencies).
264
false
true
3
11
53
74
38
36
null
null
msakai/icfpc2015
test/Test.hs
bsd-3-clause
case_problem_9_score = checkScore "problems/problem_9.json" ub tags where ub = 836 -- from http://icfpcontest.org/leader_board.html tags = [ "problem9-seed1-15-53-11.315530000000" , "problem9-seed4-15-52-56.994058000000" , "problem9-seed3-2-21-25.444377000000" , "problem9-seed2-2-21-18.213047000000" , "problem9-seed0-2-21-55.147434000000" ]
388
case_problem_9_score = checkScore "problems/problem_9.json" ub tags where ub = 836 -- from http://icfpcontest.org/leader_board.html tags = [ "problem9-seed1-15-53-11.315530000000" , "problem9-seed4-15-52-56.994058000000" , "problem9-seed3-2-21-25.444377000000" , "problem9-seed2-2-21-18.213047000000" , "problem9-seed0-2-21-55.147434000000" ]
388
case_problem_9_score = checkScore "problems/problem_9.json" ub tags where ub = 836 -- from http://icfpcontest.org/leader_board.html tags = [ "problem9-seed1-15-53-11.315530000000" , "problem9-seed4-15-52-56.994058000000" , "problem9-seed3-2-21-25.444377000000" , "problem9-seed2-2-21-18.213047000000" , "problem9-seed0-2-21-55.147434000000" ]
388
false
false
1
6
71
44
24
20
null
null
jdubrule/bond
compiler/src/Language/Bond/Lexer.hs
mit
braces :: Parser a -> Parser a braces = between (symbol "{") (symbol "}")
73
braces :: Parser a -> Parser a braces = between (symbol "{") (symbol "}")
73
braces = between (symbol "{") (symbol "}")
42
false
true
0
7
13
38
18
20
null
null
lukexi/cabal
Cabal/tests/PackageTests/PackageTester.hs
bsd-3-clause
prefixDir :: TestM FilePath prefixDir = do top_dir <- topDir return $ top_dir </> "usr" -- | The absolute path to the build directory that should be used -- for the current package in a test.
200
prefixDir :: TestM FilePath prefixDir = do top_dir <- topDir return $ top_dir </> "usr" -- | The absolute path to the build directory that should be used -- for the current package in a test.
200
prefixDir = do top_dir <- topDir return $ top_dir </> "usr" -- | The absolute path to the build directory that should be used -- for the current package in a test.
172
false
true
0
8
44
34
17
17
null
null
phylake/avm3
abc/json2.hs
mit
multiname s_res nsi_res nss_res m@(Multiname_MultinameLA a) = show m
68
multiname s_res nsi_res nss_res m@(Multiname_MultinameLA a) = show m
68
multiname s_res nsi_res nss_res m@(Multiname_MultinameLA a) = show m
68
false
false
0
8
8
28
13
15
null
null
basvandijk/lifted-base
Control/Concurrent/SampleVar/Lifted.hs
bsd-3-clause
-- | Generalized version of 'SampleVar.writeSampleVar'. writeSampleVar :: MonadBase IO m => SampleVar a -> a -> m () writeSampleVar sv = liftBase . SampleVar.writeSampleVar sv
175
writeSampleVar :: MonadBase IO m => SampleVar a -> a -> m () writeSampleVar sv = liftBase . SampleVar.writeSampleVar sv
119
writeSampleVar sv = liftBase . SampleVar.writeSampleVar sv
58
true
true
0
9
25
49
23
26
null
null
ndmitchell/hlint
src/Config/Type.hs
bsd-3-clause
getSeverity "suggest" = Just Suggestion
39
getSeverity "suggest" = Just Suggestion
39
getSeverity "suggest" = Just Suggestion
39
false
false
0
5
4
12
5
7
null
null
mettekou/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst extendTCvInScopeList (TCvSubst in_scope tenv cenv) vars = TCvSubst (extendInScopeSetList in_scope vars) tenv cenv
169
extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst extendTCvInScopeList (TCvSubst in_scope tenv cenv) vars = TCvSubst (extendInScopeSetList in_scope vars) tenv cenv
169
extendTCvInScopeList (TCvSubst in_scope tenv cenv) vars = TCvSubst (extendInScopeSetList in_scope vars) tenv cenv
115
false
true
0
7
21
52
26
26
null
null
bryant/haskid
src/Data/HaskID.hs
apache-2.0
to_base :: Integral a => a -> (a -> b) -> a -> [b] to_base base f n | base <= 1 = error "base <= 1" | n < 0 = error "negative" | otherwise = go (n `quot` base) [f $ n `rem` base] where go 0 accum = accum go q accum = go q' $ f r' : accum where (q', r') = quotRem q base
293
to_base :: Integral a => a -> (a -> b) -> a -> [b] to_base base f n | base <= 1 = error "base <= 1" | n < 0 = error "negative" | otherwise = go (n `quot` base) [f $ n `rem` base] where go 0 accum = accum go q accum = go q' $ f r' : accum where (q', r') = quotRem q base
293
to_base base f n | base <= 1 = error "base <= 1" | n < 0 = error "negative" | otherwise = go (n `quot` base) [f $ n `rem` base] where go 0 accum = accum go q accum = go q' $ f r' : accum where (q', r') = quotRem q base
242
false
true
2
9
93
166
83
83
null
null
MichielDerhaeg/stack
src/Stack/Constants/Config.hs
bsd-3-clause
-- | Output .o/.hi directory. objectInterfaceDirL :: HasBuildConfig env => Getting r env (Path Abs Dir) objectInterfaceDirL = to $ \env -> -- FIXME is this idomatic lens code? let workDir = view workDirL env root = view projectRootL env in root </> workDir </> $(mkRelDir "odir/")
291
objectInterfaceDirL :: HasBuildConfig env => Getting r env (Path Abs Dir) objectInterfaceDirL = to $ \env -> -- FIXME is this idomatic lens code? let workDir = view workDirL env root = view projectRootL env in root </> workDir </> $(mkRelDir "odir/")
261
objectInterfaceDirL = to $ \env -> -- FIXME is this idomatic lens code? let workDir = view workDirL env root = view projectRootL env in root </> workDir </> $(mkRelDir "odir/")
187
true
true
0
12
57
85
42
43
null
null
IreneKnapp/Faction
libfaction/Distribution/PackageDescription/Parse.hs
bsd-3-clause
storeXFieldsBI _ _ = Nothing
28
storeXFieldsBI _ _ = Nothing
28
storeXFieldsBI _ _ = Nothing
28
false
false
0
5
4
11
5
6
null
null
ku00/aoj-haskell
src/ITP1_5_A.hs
bsd-3-clause
main = loop
11
main = loop
11
main = loop
11
false
false
0
4
2
6
3
3
null
null
ksaveljev/hake-2
src/Client/KeyConstants.hs
bsd-3-clause
kBackspace = 127 :: Int
26
kBackspace = 127 :: Int
26
kBackspace = 127 :: Int
26
false
false
0
4
7
9
5
4
null
null
astro/haskell-torrent
src/WireProtocol.hs
bsd-2-clause
-- Helper function to make code above clearer putW32be :: Integral a => a -> Builder putW32be = putWord32be . fromIntegral
122
putW32be :: Integral a => a -> Builder putW32be = putWord32be . fromIntegral
76
putW32be = putWord32be . fromIntegral
37
true
true
1
8
20
35
15
20
null
null
jschaf/hudson-dev
src/Language/Hudson/Scanner.hs
bsd-3-clause
-- | Parse an identifier and classify it as reserved word, lowercase -- identifier, uppercase identifier or object method name. identifier = mkToken (objMember <|> ident) toTok where toTok xs = maybe (toID xs) ReservedTok (Map.lookup (toString xs) keywordMap) toID [] = error "need at least one character for an identifier" toID ts@(t:_) | isUpper (cpChar t) = UpperIDTok $ toString ts | isLower (cpChar t) = LowerIDTok $ toString ts | cpChar t == '.' = ObjMemberIDTok $ toString ts | otherwise = error "Need upper or lowercase" -- | Association list of hudson operators with an abstract -- representation.
701
identifier = mkToken (objMember <|> ident) toTok where toTok xs = maybe (toID xs) ReservedTok (Map.lookup (toString xs) keywordMap) toID [] = error "need at least one character for an identifier" toID ts@(t:_) | isUpper (cpChar t) = UpperIDTok $ toString ts | isLower (cpChar t) = LowerIDTok $ toString ts | cpChar t == '.' = ObjMemberIDTok $ toString ts | otherwise = error "Need upper or lowercase" -- | Association list of hudson operators with an abstract -- representation.
573
identifier = mkToken (objMember <|> ident) toTok where toTok xs = maybe (toID xs) ReservedTok (Map.lookup (toString xs) keywordMap) toID [] = error "need at least one character for an identifier" toID ts@(t:_) | isUpper (cpChar t) = UpperIDTok $ toString ts | isLower (cpChar t) = LowerIDTok $ toString ts | cpChar t == '.' = ObjMemberIDTok $ toString ts | otherwise = error "Need upper or lowercase" -- | Association list of hudson operators with an abstract -- representation.
573
true
false
0
12
195
174
83
91
null
null
MichielDerhaeg/stack
src/System/Process/Read.hs
bsd-3-clause
-- | Produce a strict 'S.ByteString' from the stdout of a process. -- -- Throws a 'ReadProcessException' exception if the process fails. readProcessStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -- ^ Optional directory to run in -> EnvOverride -> String -- ^ Command -> [String] -- ^ Command line arguments -> m S.ByteString readProcessStdout wd menv name args = sinkProcessStdout wd menv name args CL.consume >>= liftIO . evaluate . S.concat
556
readProcessStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -- ^ Optional directory to run in -> EnvOverride -> String -- ^ Command -> [String] -- ^ Command line arguments -> m S.ByteString readProcessStdout wd menv name args = sinkProcessStdout wd menv name args CL.consume >>= liftIO . evaluate . S.concat
419
readProcessStdout wd menv name args = sinkProcessStdout wd menv name args CL.consume >>= liftIO . evaluate . S.concat
121
true
true
0
11
168
103
54
49
null
null
alanz/hdedalus
src/Database/Dedalus/DeSugar.hs
bsd-3-clause
uccST :: Pat succST = Pat (Atom (C (-1) (S "succ")) [tsVarT,tsVarS])
69
succST :: Pat succST = Pat (Atom (C (-1) (S "succ")) [tsVarT,tsVarS])
69
succST = Pat (Atom (C (-1) (S "succ")) [tsVarT,tsVarS])
55
false
true
0
10
12
53
26
27
null
null
nevrenato/Hets_Fork
CSL/Print_AS.hs
gpl-2.0
printBasicItems (Op_decl x) = pretty x
38
printBasicItems (Op_decl x) = pretty x
38
printBasicItems (Op_decl x) = pretty x
38
false
false
0
7
5
18
8
10
null
null
wereHamster/nauva
pkg/hs/nauva-css/src/Nauva/CSS/Typeface.hs
mit
-- | Apply the given 'Typeface' in a CSS block. -- -- > someTypeface = Typeface "brandBodyCopy" "Helvetica, sans-serif" "normal" "16px" "1.4" -- -- > rootStyle = mkStyle $ do -- > typeface someTypeface -- > color "black" typeface :: Typeface -> Writer [Statement] () typeface Typeface{..} = do fontFamily tfFontFamily fontWeight tfFontWeight fontSize tfFontSize lineHeight tfLineHeight
412
typeface :: Typeface -> Writer [Statement] () typeface Typeface{..} = do fontFamily tfFontFamily fontWeight tfFontWeight fontSize tfFontSize lineHeight tfLineHeight
182
typeface Typeface{..} = do fontFamily tfFontFamily fontWeight tfFontWeight fontSize tfFontSize lineHeight tfLineHeight
136
true
true
2
6
83
56
33
23
null
null
facebookincubator/duckling
Duckling/Time/PL/Rules.hs
bsd-3-clause
ruleNoon :: Rule ruleNoon = Rule { name = "noon" , pattern = [ regex "po(l|ł)udni(em|e|a|u)" ] , prod = \_ -> tt $ hour False 12 }
146
ruleNoon :: Rule ruleNoon = Rule { name = "noon" , pattern = [ regex "po(l|ł)udni(em|e|a|u)" ] , prod = \_ -> tt $ hour False 12 }
146
ruleNoon = Rule { name = "noon" , pattern = [ regex "po(l|ł)udni(em|e|a|u)" ] , prod = \_ -> tt $ hour False 12 }
129
false
true
0
10
43
55
30
25
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/program-structure/2015-06-george-wilson-classy-optics/src/P1.hs
unlicense
-- 10:06 {- -- instance MonadReader AppConfig App ask :: App AppConfig -- instance MonadError AppError App throwError :: AppError -> App a catchError :: App a -> (AppError -> App a) -> App q -- instance MonadIO App liftIO :: IO a -> App a -} -- 11:00 -- No type-safety in following: loadFromDb :: App MyData loadFromDb = undefined
336
loadFromDb :: App MyData loadFromDb = undefined
47
loadFromDb = undefined
22
true
true
0
6
66
24
12
12
null
null
DavidAlphaFox/darcs
containers-0.5.2.1/Darcs/Data/Map/Base.hs
gpl-2.0
{-------------------------------------------------------------------- [glue l r]: glues two trees together. Assumes that [l] and [r] are already balanced with respect to each other. --------------------------------------------------------------------} glue :: Map k a -> Map k a -> Map k a glue Tip r = r
308
glue :: Map k a -> Map k a -> Map k a glue Tip r = r
52
glue Tip r = r
14
true
true
0
8
43
45
20
25
null
null
murukeshm/scratchpad
haskell/Parser2.hs
gpl-2.0
paranthesized p = pack (symbol '(') p (symbol ')')
50
paranthesized p = pack (symbol '(') p (symbol ')')
50
paranthesized p = pack (symbol '(') p (symbol ')')
50
false
false
1
7
8
33
13
20
null
null
davbaumgartner/LAuREL
LAuREL/Parser.hs
bsd-3-clause
letStatement :: Parser Expr letStatement = do reserved "let" name <- identifier reservedOp ":=" value <- statement reserved "in" body <- statement return Let { letName = name, letValue = value, letMain = body }
333
letStatement :: Parser Expr letStatement = do reserved "let" name <- identifier reservedOp ":=" value <- statement reserved "in" body <- statement return Let { letName = name, letValue = value, letMain = body }
331
letStatement = do reserved "let" name <- identifier reservedOp ":=" value <- statement reserved "in" body <- statement return Let { letName = name, letValue = value, letMain = body }
285
false
true
0
9
157
81
37
44
null
null
balez/lambda-coinduction
ModularDatatypes/Existential.hs
gpl-3.0
example2 :: String example2 = render example1 ++ " == " ++ show (eval example1)
79
example2 :: String example2 = render example1 ++ " == " ++ show (eval example1)
79
example2 = render example1 ++ " == " ++ show (eval example1)
60
false
true
0
8
14
31
15
16
null
null
juhp/stack
src/Stack/Types/Build.hs
bsd-3-clause
taskTargetIsMutable :: Task -> IsMutable taskTargetIsMutable task = case taskType task of TTLocalMutable _ -> Mutable TTRemotePackage mutable _ _ -> mutable
176
taskTargetIsMutable :: Task -> IsMutable taskTargetIsMutable task = case taskType task of TTLocalMutable _ -> Mutable TTRemotePackage mutable _ _ -> mutable
176
taskTargetIsMutable task = case taskType task of TTLocalMutable _ -> Mutable TTRemotePackage mutable _ _ -> mutable
135
false
true
0
8
41
53
23
30
null
null
mfpi/OpenGL
Graphics/Rendering/OpenGL/GL/BufferObjects.hs
bsd-3-clause
setBindBuffer :: BufferTarget -> Maybe BufferObject -> IO () setBindBuffer t = glBindBuffer (marshalBufferTarget t) . bufferID . fromMaybe noBufferObject
156
setBindBuffer :: BufferTarget -> Maybe BufferObject -> IO () setBindBuffer t = glBindBuffer (marshalBufferTarget t) . bufferID . fromMaybe noBufferObject
156
setBindBuffer t = glBindBuffer (marshalBufferTarget t) . bufferID . fromMaybe noBufferObject
95
false
true
0
9
22
50
23
27
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
singleCt :: Ct -> Cts singleCt = unitBag
40
singleCt :: Ct -> Cts singleCt = unitBag
40
singleCt = unitBag
18
false
true
0
5
7
15
8
7
null
null
wavewave/lhc-analysis-collection
analysis/XQLD_sqsg_ATLASMultiLeptonJetMETAnalysis.hs
gpl-3.0
atlasresult_4_7fb wdavcfg wdavrdir bname = do let fp1 = bname ++ "_ATLAS7TeVMultiL2to4J.json" fp2 = bname ++ "_total_count.json" runMaybeT $ do (_,mr1) <- MaybeT . boolToMaybeM (doesFileExistInDAV wdavcfg wdavrdir fp1) . downloadFile True wdavcfg wdavrdir $ fp1 r1 <- liftM LB.pack (MaybeT . return $ mr1) (result :: [(JESParam,[(EventTypeCode,Int)])]) <- MaybeT . return $ G.decode r1 (_,mr2) <- MaybeT . boolToMaybeM (doesFileExistInDAV wdavcfg wdavrdir fp2) . downloadFile True wdavcfg wdavrdir $ fp2 r2 <- liftM LB.pack (MaybeT . return $ mr2) (xsec :: CrossSectionAndCount) <- MaybeT . return $ G.decode r2 let weight = crossSectionInPb xsec * 4700 / fromIntegral (numberOfEvent xsec) hist = map (\(x,y) -> (x,fromIntegral y * weight)) ((snd.head) result) let getratio (x,y) = do y' <- lookup x nbsmlimit return (y/ y') maxf (x,y) acc = do r <- getratio (x,y) return (max acc r) maxratio <- MaybeT . return $ foldrM maxf 0 hist return (xsec,result,hist,maxratio) {- getCount n1 n2 = do let nlst = [1] rdir = "montecarlo/admproject/XQLD/scan" basename = "ADMXQLD111MG"++n1++ "MQ" ++ n2 ++ "ML50000.0MN50000.0_2sd_2l2j2x_LHC7ATLAS_NoMatch_NoCut_AntiKT0.4_NoTau_Set" r1 <- work (\wdavcfg wdavrdir nm -> getXSecNCount XSecLHE wdavcfg wdavrdir nm >>= getJSONFileAndUpload wdavcfg wdavrdir nm) "config1.txt" rdir basename nlst print r1 r2 <- work (atlas_7TeV_MultiL2to4J (JESParam 5 2)) "config1.txt" rdir basename nlst print r2 -}
1,737
atlasresult_4_7fb wdavcfg wdavrdir bname = do let fp1 = bname ++ "_ATLAS7TeVMultiL2to4J.json" fp2 = bname ++ "_total_count.json" runMaybeT $ do (_,mr1) <- MaybeT . boolToMaybeM (doesFileExistInDAV wdavcfg wdavrdir fp1) . downloadFile True wdavcfg wdavrdir $ fp1 r1 <- liftM LB.pack (MaybeT . return $ mr1) (result :: [(JESParam,[(EventTypeCode,Int)])]) <- MaybeT . return $ G.decode r1 (_,mr2) <- MaybeT . boolToMaybeM (doesFileExistInDAV wdavcfg wdavrdir fp2) . downloadFile True wdavcfg wdavrdir $ fp2 r2 <- liftM LB.pack (MaybeT . return $ mr2) (xsec :: CrossSectionAndCount) <- MaybeT . return $ G.decode r2 let weight = crossSectionInPb xsec * 4700 / fromIntegral (numberOfEvent xsec) hist = map (\(x,y) -> (x,fromIntegral y * weight)) ((snd.head) result) let getratio (x,y) = do y' <- lookup x nbsmlimit return (y/ y') maxf (x,y) acc = do r <- getratio (x,y) return (max acc r) maxratio <- MaybeT . return $ foldrM maxf 0 hist return (xsec,result,hist,maxratio) {- getCount n1 n2 = do let nlst = [1] rdir = "montecarlo/admproject/XQLD/scan" basename = "ADMXQLD111MG"++n1++ "MQ" ++ n2 ++ "ML50000.0MN50000.0_2sd_2l2j2x_LHC7ATLAS_NoMatch_NoCut_AntiKT0.4_NoTau_Set" r1 <- work (\wdavcfg wdavrdir nm -> getXSecNCount XSecLHE wdavcfg wdavrdir nm >>= getJSONFileAndUpload wdavcfg wdavrdir nm) "config1.txt" rdir basename nlst print r1 r2 <- work (atlas_7TeV_MultiL2to4J (JESParam 5 2)) "config1.txt" rdir basename nlst print r2 -}
1,737
atlasresult_4_7fb wdavcfg wdavrdir bname = do let fp1 = bname ++ "_ATLAS7TeVMultiL2to4J.json" fp2 = bname ++ "_total_count.json" runMaybeT $ do (_,mr1) <- MaybeT . boolToMaybeM (doesFileExistInDAV wdavcfg wdavrdir fp1) . downloadFile True wdavcfg wdavrdir $ fp1 r1 <- liftM LB.pack (MaybeT . return $ mr1) (result :: [(JESParam,[(EventTypeCode,Int)])]) <- MaybeT . return $ G.decode r1 (_,mr2) <- MaybeT . boolToMaybeM (doesFileExistInDAV wdavcfg wdavrdir fp2) . downloadFile True wdavcfg wdavrdir $ fp2 r2 <- liftM LB.pack (MaybeT . return $ mr2) (xsec :: CrossSectionAndCount) <- MaybeT . return $ G.decode r2 let weight = crossSectionInPb xsec * 4700 / fromIntegral (numberOfEvent xsec) hist = map (\(x,y) -> (x,fromIntegral y * weight)) ((snd.head) result) let getratio (x,y) = do y' <- lookup x nbsmlimit return (y/ y') maxf (x,y) acc = do r <- getratio (x,y) return (max acc r) maxratio <- MaybeT . return $ foldrM maxf 0 hist return (xsec,result,hist,maxratio) {- getCount n1 n2 = do let nlst = [1] rdir = "montecarlo/admproject/XQLD/scan" basename = "ADMXQLD111MG"++n1++ "MQ" ++ n2 ++ "ML50000.0MN50000.0_2sd_2l2j2x_LHC7ATLAS_NoMatch_NoCut_AntiKT0.4_NoTau_Set" r1 <- work (\wdavcfg wdavrdir nm -> getXSecNCount XSecLHE wdavcfg wdavrdir nm >>= getJSONFileAndUpload wdavcfg wdavrdir nm) "config1.txt" rdir basename nlst print r1 r2 <- work (atlas_7TeV_MultiL2to4J (JESParam 5 2)) "config1.txt" rdir basename nlst print r2 -}
1,737
false
false
6
13
514
450
230
220
null
null
oldmanmike/ghc
compiler/types/Type.hs
bsd-3-clause
equalityTyCon Representational = eqReprPrimTyCon
48
equalityTyCon Representational = eqReprPrimTyCon
48
equalityTyCon Representational = eqReprPrimTyCon
48
false
false
0
4
3
10
4
6
null
null
jgm/texmath
src/Text/TeXMath/Readers/TeX.hs
gpl-2.0
alignsFromRows defaultAlignment (r:_) = replicate (length r) defaultAlignment
77
alignsFromRows defaultAlignment (r:_) = replicate (length r) defaultAlignment
77
alignsFromRows defaultAlignment (r:_) = replicate (length r) defaultAlignment
77
false
false
0
7
7
29
14
15
null
null
bravit/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
toplevel :: ElabInfo toplevel = EInfo [] emptyContext id [] Nothing "(toplevel)" 0 id (\_ _ _ -> fail "Not implemented")
120
toplevel :: ElabInfo toplevel = EInfo [] emptyContext id [] Nothing "(toplevel)" 0 id (\_ _ _ -> fail "Not implemented")
120
toplevel = EInfo [] emptyContext id [] Nothing "(toplevel)" 0 id (\_ _ _ -> fail "Not implemented")
99
false
true
0
8
20
57
26
31
null
null
catseye/ZOWIE
impl/zowie-hs/src/Language/ZOWIE/Parser.hs
unlicense
indirect = do string "R[R" n <- number string "]" return $ Indirect n
85
indirect = do string "R[R" n <- number string "]" return $ Indirect n
85
indirect = do string "R[R" n <- number string "]" return $ Indirect n
85
false
false
1
9
29
39
14
25
null
null
TomMD/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp _ [] WriteArrayArrayOp_MutableByteArray [obj,ix,v] = doWritePtrArrayOp obj ix v
97
emitPrimOp _ [] WriteArrayArrayOp_MutableByteArray [obj,ix,v] = doWritePtrArrayOp obj ix v
97
emitPrimOp _ [] WriteArrayArrayOp_MutableByteArray [obj,ix,v] = doWritePtrArrayOp obj ix v
97
false
false
1
6
16
37
17
20
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_READ_PIXEL_DATA_RANGE_LENGTH_NV :: GLenum gl_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B
88
gl_READ_PIXEL_DATA_RANGE_LENGTH_NV :: GLenum gl_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B
88
gl_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B
43
false
true
0
4
5
11
6
5
null
null
tonymorris/osmaustralia
src/Geo/Garmin/OsmAustralia.hs
bsd-3-clause
description QLD = "Queensland"
32
description QLD = "Queensland"
32
description QLD = "Queensland"
32
false
false
1
5
5
13
4
9
null
null
iblumenfeld/saw-core
src/Verifier/SAW/Typechecker/Context.hs
bsd-3-clause
globalContext (LetContext tc _) = globalContext tc
50
globalContext (LetContext tc _) = globalContext tc
50
globalContext (LetContext tc _) = globalContext tc
50
false
false
0
7
6
20
9
11
null
null
JustusAdam/hlinecount
src/LineCount/Filter/Values.hs
bsd-3-clause
hiddenFilter ∷ FileFilter hiddenFilter = FileFilter func where func (MainOptions { ignoreHidden = hidden }) | hidden = const $ (¬) ∘ isPrefixOf "." ∘ takeFileName | otherwise = const2 True
209
hiddenFilter ∷ FileFilter hiddenFilter = FileFilter func where func (MainOptions { ignoreHidden = hidden }) | hidden = const $ (¬) ∘ isPrefixOf "." ∘ takeFileName | otherwise = const2 True
209
hiddenFilter = FileFilter func where func (MainOptions { ignoreHidden = hidden }) | hidden = const $ (¬) ∘ isPrefixOf "." ∘ takeFileName | otherwise = const2 True
183
false
true
0
9
51
72
35
37
null
null
okue/Haskyapi
src/Web/Haskyapi/Config/Parser.hs
mit
sptab = many (oneOf " \t")
26
sptab = many (oneOf " \t")
26
sptab = many (oneOf " \t")
26
false
false
0
7
5
15
7
8
null
null
stu-smith/rendering-in-haskell
src/experiment06/Material.hs
mit
sumBrdfs :: [BRDF] -> BRDF sumBrdfs !brdfs incomingLight incomingVector outgoingVector surfaceNormal wp = sumLights $ map apply brdfs where apply f = f incomingLight incomingVector outgoingVector surfaceNormal wp
222
sumBrdfs :: [BRDF] -> BRDF sumBrdfs !brdfs incomingLight incomingVector outgoingVector surfaceNormal wp = sumLights $ map apply brdfs where apply f = f incomingLight incomingVector outgoingVector surfaceNormal wp
222
sumBrdfs !brdfs incomingLight incomingVector outgoingVector surfaceNormal wp = sumLights $ map apply brdfs where apply f = f incomingLight incomingVector outgoingVector surfaceNormal wp
195
false
true
1
8
37
73
32
41
null
null
stevezhee/pec
Pec/Base.hs
bsd-3-clause
fVoidT _ = Nothing
18
fVoidT _ = Nothing
18
fVoidT _ = Nothing
18
false
false
0
5
3
9
4
5
null
null
kaoskorobase/hsc3-server
Sound/SC3/Server/State/Monad/Command.hs
gpl-2.0
-- | Query a node. n_query :: (Node a, MonadIO m) => a -> Request m (Result N.NodeNotification) n_query n = do n_query_ n waitFor (N.n_info (nodeId n)) -- | Query a node.
175
n_query :: (Node a, MonadIO m) => a -> Request m (Result N.NodeNotification) n_query n = do n_query_ n waitFor (N.n_info (nodeId n)) -- | Query a node.
156
n_query n = do n_query_ n waitFor (N.n_info (nodeId n)) -- | Query a node.
79
true
true
0
11
37
74
36
38
null
null
piyush-kurur/shakespeare
shakespeare/Text/Shakespeare.hs
bsd-2-clause
shakespeare :: ShakespeareSettings -> QuasiQuoter shakespeare r = QuasiQuoter { quoteExp = shakespeareFromString r }
116
shakespeare :: ShakespeareSettings -> QuasiQuoter shakespeare r = QuasiQuoter { quoteExp = shakespeareFromString r }
116
shakespeare r = QuasiQuoter { quoteExp = shakespeareFromString r }
66
false
true
0
7
14
29
15
14
null
null
agocorona/MFlow
Demos/TestREST.hs
bsd-3-clause
options= h2 << "Choose between:" ++> absLink "a" << b << "letters " <++ i << " or " <|> absLink "1" << b << "numbers"
135
options= h2 << "Choose between:" ++> absLink "a" << b << "letters " <++ i << " or " <|> absLink "1" << b << "numbers"
135
options= h2 << "Choose between:" ++> absLink "a" << b << "letters " <++ i << " or " <|> absLink "1" << b << "numbers"
135
false
false
1
13
43
53
23
30
null
null
cauterize-tools/cauterize
src/Cauterize/Generate.hs
bsd-3-clause
genFields_ :: Gen (Identifier -> c) -> Gen [c] genFields_ cstorGen = do count <- fieldCount fieldCstors <- replicateM count cstorGen let withNames = zipWith ($) fieldCstors allNames return withNames where fieldCount = let ixs = [1..64] freqs = reverse ixs gens = map return ixs in frequency $ zip freqs gens
380
genFields_ :: Gen (Identifier -> c) -> Gen [c] genFields_ cstorGen = do count <- fieldCount fieldCstors <- replicateM count cstorGen let withNames = zipWith ($) fieldCstors allNames return withNames where fieldCount = let ixs = [1..64] freqs = reverse ixs gens = map return ixs in frequency $ zip freqs gens
380
genFields_ cstorGen = do count <- fieldCount fieldCstors <- replicateM count cstorGen let withNames = zipWith ($) fieldCstors allNames return withNames where fieldCount = let ixs = [1..64] freqs = reverse ixs gens = map return ixs in frequency $ zip freqs gens
333
false
true
1
10
124
134
62
72
null
null
fibsifan/pandoc
src/Text/Pandoc/Readers/MediaWiki.hs
gpl-2.0
endline :: MWParser () endline = () <$ try (newline <* notFollowedBy spaceChar <* notFollowedBy newline <* notFollowedBy' hrule <* notFollowedBy tableStart <* notFollowedBy' header <* notFollowedBy anyListStart)
337
endline :: MWParser () endline = () <$ try (newline <* notFollowedBy spaceChar <* notFollowedBy newline <* notFollowedBy' hrule <* notFollowedBy tableStart <* notFollowedBy' header <* notFollowedBy anyListStart)
337
endline = () <$ try (newline <* notFollowedBy spaceChar <* notFollowedBy newline <* notFollowedBy' hrule <* notFollowedBy tableStart <* notFollowedBy' header <* notFollowedBy anyListStart)
314
false
true
0
14
153
70
32
38
null
null
Shimuuar/protobuf
Data/Protobuf/Serialize/Protobuf.hs
bsd-3-clause
putOptional :: (a -> Put) -> Maybe a -> Put putOptional putter (Just x) = putter x
82
putOptional :: (a -> Put) -> Maybe a -> Put putOptional putter (Just x) = putter x
82
putOptional putter (Just x) = putter x
38
false
true
0
10
16
49
22
27
null
null
cocreature/leksah
src/IDE/BufferMode.hs
gpl-2.0
literalHaskellMode = Mode { modeName = "Literal Haskell", modeEditComment = do doForSelectedLines [] $ \ebuf lineNr -> do sol <- getIterAtLine ebuf lineNr sol2 <- forwardCharsC sol 1 str <- getText ebuf sol sol2 True when (str == ">") (delete ebuf sol sol2) return (), modeEditUncomment = do doForSelectedLines [] $ \ebuf lineNr -> do sol <- getIterAtLine ebuf lineNr sol <- getIterAtLine ebuf lineNr sol2 <- forwardCharsC sol 1 str <- getText ebuf sol sol2 True when (str /= ">") (insert ebuf sol ">") return (), modeSelectedModuleName = inActiveBufContext Nothing $ \_ _ ebuf currentBuffer _ -> case fileName currentBuffer of Just filePath -> liftIO $ moduleNameFromFilePath filePath Nothing -> return Nothing, modeTransformToCandy = \ inCommentOrString ebuf -> do ct <- readIDE candy transformToCandy ct ebuf inCommentOrString, modeEditToCandy = \ inCommentOrString -> do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> transformToCandy ct ebuf inCommentOrString, modeEditFromCandy = do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> transformFromCandy ct ebuf, modeEditKeystrokeCandy = \c inCommentOrString -> do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> keystrokeCandy ct c ebuf inCommentOrString, modeEditInsertCode = \ str iter buf -> insert buf iter (T.unlines $ map (\ s -> "> " <> s) $ T.lines str), modeEditInCommentOrString = \ line -> not (T.isPrefixOf ">" line) || odd (T.count "\"" line) }
1,881
literalHaskellMode = Mode { modeName = "Literal Haskell", modeEditComment = do doForSelectedLines [] $ \ebuf lineNr -> do sol <- getIterAtLine ebuf lineNr sol2 <- forwardCharsC sol 1 str <- getText ebuf sol sol2 True when (str == ">") (delete ebuf sol sol2) return (), modeEditUncomment = do doForSelectedLines [] $ \ebuf lineNr -> do sol <- getIterAtLine ebuf lineNr sol <- getIterAtLine ebuf lineNr sol2 <- forwardCharsC sol 1 str <- getText ebuf sol sol2 True when (str /= ">") (insert ebuf sol ">") return (), modeSelectedModuleName = inActiveBufContext Nothing $ \_ _ ebuf currentBuffer _ -> case fileName currentBuffer of Just filePath -> liftIO $ moduleNameFromFilePath filePath Nothing -> return Nothing, modeTransformToCandy = \ inCommentOrString ebuf -> do ct <- readIDE candy transformToCandy ct ebuf inCommentOrString, modeEditToCandy = \ inCommentOrString -> do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> transformToCandy ct ebuf inCommentOrString, modeEditFromCandy = do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> transformFromCandy ct ebuf, modeEditKeystrokeCandy = \c inCommentOrString -> do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> keystrokeCandy ct c ebuf inCommentOrString, modeEditInsertCode = \ str iter buf -> insert buf iter (T.unlines $ map (\ s -> "> " <> s) $ T.lines str), modeEditInCommentOrString = \ line -> not (T.isPrefixOf ">" line) || odd (T.count "\"" line) }
1,881
literalHaskellMode = Mode { modeName = "Literal Haskell", modeEditComment = do doForSelectedLines [] $ \ebuf lineNr -> do sol <- getIterAtLine ebuf lineNr sol2 <- forwardCharsC sol 1 str <- getText ebuf sol sol2 True when (str == ">") (delete ebuf sol sol2) return (), modeEditUncomment = do doForSelectedLines [] $ \ebuf lineNr -> do sol <- getIterAtLine ebuf lineNr sol <- getIterAtLine ebuf lineNr sol2 <- forwardCharsC sol 1 str <- getText ebuf sol sol2 True when (str /= ">") (insert ebuf sol ">") return (), modeSelectedModuleName = inActiveBufContext Nothing $ \_ _ ebuf currentBuffer _ -> case fileName currentBuffer of Just filePath -> liftIO $ moduleNameFromFilePath filePath Nothing -> return Nothing, modeTransformToCandy = \ inCommentOrString ebuf -> do ct <- readIDE candy transformToCandy ct ebuf inCommentOrString, modeEditToCandy = \ inCommentOrString -> do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> transformToCandy ct ebuf inCommentOrString, modeEditFromCandy = do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> transformFromCandy ct ebuf, modeEditKeystrokeCandy = \c inCommentOrString -> do ct <- readIDE candy inActiveBufContext () $ \_ _ ebuf _ _ -> keystrokeCandy ct c ebuf inCommentOrString, modeEditInsertCode = \ str iter buf -> insert buf iter (T.unlines $ map (\ s -> "> " <> s) $ T.lines str), modeEditInCommentOrString = \ line -> not (T.isPrefixOf ">" line) || odd (T.count "\"" line) }
1,881
false
false
1
16
662
572
274
298
null
null
olsner/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy :: Type [int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon) vecElemDataCons
568
int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy :: Type [int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon) vecElemDataCons
568
[int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy, doubleElemRepDataConTy] = map (mkTyConTy . promoteDataCon) vecElemDataCons
322
false
true
2
7
71
76
50
26
null
null
brendanhay/gogol
gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Operations/Get.hs
mpl-2.0
-- | Part of \`name\`. See documentation of \`appsId\`. aogOperationsId :: Lens' AppsOperationsGet Text aogOperationsId = lens _aogOperationsId (\ s a -> s{_aogOperationsId = a})
186
aogOperationsId :: Lens' AppsOperationsGet Text aogOperationsId = lens _aogOperationsId (\ s a -> s{_aogOperationsId = a})
130
aogOperationsId = lens _aogOperationsId (\ s a -> s{_aogOperationsId = a})
82
true
true
0
8
32
43
22
21
null
null
farnoy/torrent
test/PeerMonadSpec.hs
bsd-3-clause
evalPeerMonadTest (Catch action handler) = Catch.catch action handler
71
evalPeerMonadTest (Catch action handler) = Catch.catch action handler
71
evalPeerMonadTest (Catch action handler) = Catch.catch action handler
71
false
false
0
7
9
24
11
13
null
null
jtdaugherty/vty
src/Graphics/Vty/Inline.hs
bsd-3-clause
-- | Set the background color to the provided 'Color'. backColor :: Color -> InlineM () backColor c = modify $ \s -> s { inlineAttr = inlineAttr s `withBackColor` c }
176
backColor :: Color -> InlineM () backColor c = modify $ \s -> s { inlineAttr = inlineAttr s `withBackColor` c }
121
backColor c = modify $ \s -> s { inlineAttr = inlineAttr s `withBackColor` c }
88
true
true
2
9
41
59
29
30
null
null
vincenthz/cryptonite
Crypto/ECC/Simple/Types.hs
bsd-3-clause
paramSEC_t409k1 = CurveParameters { curveEccA = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 , curveEccB = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 , curveEccG = Point 0x0060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746 0x01e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b , curveEccN = 0x007ffffffffffffffffffffffffffffffffffffffffffffffffffe5f83b2d4ea20400ec4557d5ed3e3e7ca5b4b5c83b8e01e5fcf , curveEccH = 4 }
692
paramSEC_t409k1 = CurveParameters { curveEccA = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 , curveEccB = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 , curveEccG = Point 0x0060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746 0x01e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b , curveEccN = 0x007ffffffffffffffffffffffffffffffffffffffffffffffffffe5f83b2d4ea20400ec4557d5ed3e3e7ca5b4b5c83b8e01e5fcf , curveEccH = 4 }
692
paramSEC_t409k1 = CurveParameters { curveEccA = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 , curveEccB = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 , curveEccG = Point 0x0060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746 0x01e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b , curveEccN = 0x007ffffffffffffffffffffffffffffffffffffffffffffffffffe5f83b2d4ea20400ec4557d5ed3e3e7ca5b4b5c83b8e01e5fcf , curveEccH = 4 }
692
false
false
0
8
69
47
27
20
null
null
siddhanathan/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
getNonClobberedOperand (CmmLoad mem pk) = do is32Bit <- is32BitPlatform use_sse2 <- sse2Enabled if (not (isFloatType pk) || use_sse2) && (if is32Bit then not (isWord64 pk) else True) then do dflags <- getDynFlags let platform = targetPlatform dflags Amode src mem_code <- getAmode mem (src',save_code) <- if (amodeCouldBeClobbered platform src) then do tmp <- getNewRegNat (archWordFormat is32Bit) return (AddrBaseIndex (EABaseReg tmp) EAIndexNone (ImmInt 0), unitOL (LEA (archWordFormat is32Bit) (OpAddr src) (OpReg tmp))) else return (src, nilOL) return (OpAddr src', mem_code `appOL` save_code) else do getNonClobberedOperand_generic (CmmLoad mem pk)
911
getNonClobberedOperand (CmmLoad mem pk) = do is32Bit <- is32BitPlatform use_sse2 <- sse2Enabled if (not (isFloatType pk) || use_sse2) && (if is32Bit then not (isWord64 pk) else True) then do dflags <- getDynFlags let platform = targetPlatform dflags Amode src mem_code <- getAmode mem (src',save_code) <- if (amodeCouldBeClobbered platform src) then do tmp <- getNewRegNat (archWordFormat is32Bit) return (AddrBaseIndex (EABaseReg tmp) EAIndexNone (ImmInt 0), unitOL (LEA (archWordFormat is32Bit) (OpAddr src) (OpReg tmp))) else return (src, nilOL) return (OpAddr src', mem_code `appOL` save_code) else do getNonClobberedOperand_generic (CmmLoad mem pk)
911
getNonClobberedOperand (CmmLoad mem pk) = do is32Bit <- is32BitPlatform use_sse2 <- sse2Enabled if (not (isFloatType pk) || use_sse2) && (if is32Bit then not (isWord64 pk) else True) then do dflags <- getDynFlags let platform = targetPlatform dflags Amode src mem_code <- getAmode mem (src',save_code) <- if (amodeCouldBeClobbered platform src) then do tmp <- getNewRegNat (archWordFormat is32Bit) return (AddrBaseIndex (EABaseReg tmp) EAIndexNone (ImmInt 0), unitOL (LEA (archWordFormat is32Bit) (OpAddr src) (OpReg tmp))) else return (src, nilOL) return (OpAddr src', mem_code `appOL` save_code) else do getNonClobberedOperand_generic (CmmLoad mem pk)
911
false
false
0
20
344
268
130
138
null
null
adunning/pandoc-citeproc
src/Text/CSL/Proc/Collapse.hs
bsd-3-clause
groupCites (x:xs) = let equal = filter (hasSameNamesAs x) xs notequal = filter (not . hasSameNamesAs x) xs in x : equal ++ groupCites notequal where hasSameNamesAs w y = namesOf (snd w) == namesOf (snd y) contribsQ o | OContrib _ _ c _ _ <- o = [c] | otherwise = [] namesOf y = case query contribsQ y of [] -> [] (z:_) -> proc rmHashAndGivenNames z
501
groupCites (x:xs) = let equal = filter (hasSameNamesAs x) xs notequal = filter (not . hasSameNamesAs x) xs in x : equal ++ groupCites notequal where hasSameNamesAs w y = namesOf (snd w) == namesOf (snd y) contribsQ o | OContrib _ _ c _ _ <- o = [c] | otherwise = [] namesOf y = case query contribsQ y of [] -> [] (z:_) -> proc rmHashAndGivenNames z
501
groupCites (x:xs) = let equal = filter (hasSameNamesAs x) xs notequal = filter (not . hasSameNamesAs x) xs in x : equal ++ groupCites notequal where hasSameNamesAs w y = namesOf (snd w) == namesOf (snd y) contribsQ o | OContrib _ _ c _ _ <- o = [c] | otherwise = [] namesOf y = case query contribsQ y of [] -> [] (z:_) -> proc rmHashAndGivenNames z
501
false
false
2
12
222
197
92
105
null
null
elieux/ghc
compiler/utils/Util.hs
bsd-3-clause
foldl2 _ _ _ _ = panic "Util: foldl2"
47
foldl2 _ _ _ _ = panic "Util: foldl2"
47
foldl2 _ _ _ _ = panic "Util: foldl2"
47
false
false
0
5
18
18
8
10
null
null
iu-parfunc/AutoObsidian
interface_brainstorming/06_ExtensibleEffects/ExtensibleEffectTuning.hs
bsd-3-clause
test :: (Int,Int) test = run $ runParamRdr (SYM "a") (0,10) $ runParamRdr (SYM "b") (10,20) $ runParamRdr (SYM "c") (20,30) $ -- Ok to run with extra effects. example
205
test :: (Int,Int) test = run $ runParamRdr (SYM "a") (0,10) $ runParamRdr (SYM "b") (10,20) $ runParamRdr (SYM "c") (20,30) $ -- Ok to run with extra effects. example
205
test = run $ runParamRdr (SYM "a") (0,10) $ runParamRdr (SYM "b") (10,20) $ runParamRdr (SYM "c") (20,30) $ -- Ok to run with extra effects. example
187
false
true
0
11
68
85
46
39
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsV2ApplicationJSONMappingParameters.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-application-jsonmappingparameters.html#cfn-kinesisanalyticsv2-application-jsonmappingparameters-recordrowpath kavajsonmpRecordRowPath :: Lens' KinesisAnalyticsV2ApplicationJSONMappingParameters (Val Text) kavajsonmpRecordRowPath = lens _kinesisAnalyticsV2ApplicationJSONMappingParametersRecordRowPath (\s a -> s { _kinesisAnalyticsV2ApplicationJSONMappingParametersRecordRowPath = a })
486
kavajsonmpRecordRowPath :: Lens' KinesisAnalyticsV2ApplicationJSONMappingParameters (Val Text) kavajsonmpRecordRowPath = lens _kinesisAnalyticsV2ApplicationJSONMappingParametersRecordRowPath (\s a -> s { _kinesisAnalyticsV2ApplicationJSONMappingParametersRecordRowPath = a })
275
kavajsonmpRecordRowPath = lens _kinesisAnalyticsV2ApplicationJSONMappingParametersRecordRowPath (\s a -> s { _kinesisAnalyticsV2ApplicationJSONMappingParametersRecordRowPath = a })
180
true
true
0
9
21
46
25
21
null
null
nevrenato/HetsAlloy
Common/Lib/MapSet.hs
gpl-2.0
-- | map a function to all elements map :: (Ord b, Ord c) => (b -> c) -> MapSet a b -> MapSet a c map f = MapSet . Map.map (Set.map f) . toMap
142
map :: (Ord b, Ord c) => (b -> c) -> MapSet a b -> MapSet a c map f = MapSet . Map.map (Set.map f) . toMap
106
map f = MapSet . Map.map (Set.map f) . toMap
44
true
true
0
10
35
81
39
42
null
null
cdparks/mini-core
src/MiniCore/Types.hs
mit
boolTy = TCon "Bool" []
23
boolTy = TCon "Bool" []
23
boolTy = TCon "Bool" []
23
false
false
1
6
4
18
6
12
null
null
cunger/mule
src/Projection.hs
gpl-3.0
match _ _ = Nothing
19
match _ _ = Nothing
19
match _ _ = Nothing
19
false
false
0
5
4
11
5
6
null
null
beni55/aeson
tests/Properties.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- Value properties -------------------------------------------------------------------------------- isString :: Value -> Bool isString (String _) = True
235
isString :: Value -> Bool isString (String _) = True
52
isString (String _) = True
26
true
true
0
7
15
27
15
12
null
null