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
23Skidoo/aeson
Data/Aeson/Encode/Builder.hs
bsd-3-clause
emptyObject__ :: Builder emptyObject__ = BP.primBounded (ascii2 ('{','}')) ()
77
emptyObject__ :: Builder emptyObject__ = BP.primBounded (ascii2 ('{','}')) ()
77
emptyObject__ = BP.primBounded (ascii2 ('{','}')) ()
52
false
true
0
8
8
32
17
15
null
null
nickbart1980/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
verbatim :: OrgParser (F Inlines) verbatim = return . B.rawInline "" <$> verbatimBetween '~'
94
verbatim :: OrgParser (F Inlines) verbatim = return . B.rawInline "" <$> verbatimBetween '~'
94
verbatim = return . B.rawInline "" <$> verbatimBetween '~'
59
false
true
0
8
15
36
17
19
null
null
stschiff/rarecoal
src-rarecoal/Main.hs
gpl-3.0
parseModelByText :: OP.Parser ModelOptions parseModelByText = ModelByText <$> OP.strOption (OP.metavar "MODEL_SPECS" <> OP.short 't' <> OP.help "model template passed directly via the command line.")
203
parseModelByText :: OP.Parser ModelOptions parseModelByText = ModelByText <$> OP.strOption (OP.metavar "MODEL_SPECS" <> OP.short 't' <> OP.help "model template passed directly via the command line.")
203
parseModelByText = ModelByText <$> OP.strOption (OP.metavar "MODEL_SPECS" <> OP.short 't' <> OP.help "model template passed directly via the command line.")
160
false
true
1
11
27
54
24
30
null
null
oldmanmike/sdl2
src/SDL/Raw/Video.hs
bsd-3-clause
setWindowFullscreen :: MonadIO m => Window -> Word32 -> m CInt setWindowFullscreen v1 v2 = liftIO $ setWindowFullscreenFFI v1 v2
128
setWindowFullscreen :: MonadIO m => Window -> Word32 -> m CInt setWindowFullscreen v1 v2 = liftIO $ setWindowFullscreenFFI v1 v2
128
setWindowFullscreen v1 v2 = liftIO $ setWindowFullscreenFFI v1 v2
65
false
true
0
8
19
43
20
23
null
null
Hi-Angel/yi
yi-core/src/Yi/Buffer/HighLevel.hs
gpl-2.0
scrollB :: Int -> BufferM () scrollB n = do MarkSet fr _ _ <- askMarks savingPointB $ do moveTo =<< use (markPointA fr) void $ gotoLnFrom n (markPointA fr .=) =<< pointB w <- askWindow wkey (%=) pointFollowsWindowA (\old w' -> ((w == w') || old w')) -- Scroll line above window to the bottom.
314
scrollB :: Int -> BufferM () scrollB n = do MarkSet fr _ _ <- askMarks savingPointB $ do moveTo =<< use (markPointA fr) void $ gotoLnFrom n (markPointA fr .=) =<< pointB w <- askWindow wkey (%=) pointFollowsWindowA (\old w' -> ((w == w') || old w')) -- Scroll line above window to the bottom.
314
scrollB n = do MarkSet fr _ _ <- askMarks savingPointB $ do moveTo =<< use (markPointA fr) void $ gotoLnFrom n (markPointA fr .=) =<< pointB w <- askWindow wkey (%=) pointFollowsWindowA (\old w' -> ((w == w') || old w')) -- Scroll line above window to the bottom.
285
false
true
0
13
77
132
63
69
null
null
Fermat/Gottlob
Language/TypeInference.hs
bsd-3-clause
infer (TApp p1 p2) = do (a1, c1) <- infer p1 n <- get modify (+1) return (EVar $ "X"++ show n, (a1, To Ind (EVar $ "X"++ show n)):c1)
143
infer (TApp p1 p2) = do (a1, c1) <- infer p1 n <- get modify (+1) return (EVar $ "X"++ show n, (a1, To Ind (EVar $ "X"++ show n)):c1)
143
infer (TApp p1 p2) = do (a1, c1) <- infer p1 n <- get modify (+1) return (EVar $ "X"++ show n, (a1, To Ind (EVar $ "X"++ show n)):c1)
143
false
false
0
14
39
103
50
53
null
null
myShoggoth/shakespeare
Text/Hamlet/Parse.hs
mit
stripD3Content :: [Content] -> [Doc] stripD3Content ((ContentVar (DerefString _)):_) = [DocContent $ ContentRaw ""]
166
stripD3Content :: [Content] -> [Doc] stripD3Content ((ContentVar (DerefString _)):_) = [DocContent $ ContentRaw ""]
166
stripD3Content ((ContentVar (DerefString _)):_) = [DocContent $ ContentRaw ""]
129
false
true
0
11
64
53
28
25
null
null
nablaa/hchesslib
src/Chess/Internal/Move.hs
gpl-2.0
generateAllMoves :: GameState -> [Move] generateAllMoves game = filter isLegalMove $ generateAllPotentialMoves game where isLegalMove move = isNothing (isMoveError game move)
182
generateAllMoves :: GameState -> [Move] generateAllMoves game = filter isLegalMove $ generateAllPotentialMoves game where isLegalMove move = isNothing (isMoveError game move)
182
generateAllMoves game = filter isLegalMove $ generateAllPotentialMoves game where isLegalMove move = isNothing (isMoveError game move)
142
false
true
0
7
28
56
26
30
null
null
christiaanb/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
92
andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
92
andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
92
false
false
0
7
20
19
9
10
null
null
AlexanderPankiv/ghc
compiler/basicTypes/DataCon.hs
bsd-3-clause
-- | The existentially-quantified type variables of the constructor dataConExTyVars :: DataCon -> [TyVar] dataConExTyVars = dcExTyVars
134
dataConExTyVars :: DataCon -> [TyVar] dataConExTyVars = dcExTyVars
66
dataConExTyVars = dcExTyVars
28
true
true
0
6
16
19
11
8
null
null
exercism/xhaskell
exercises/practice/saddle-points/src/Matrix.hs
mit
saddlePoints :: Array i e -> [i] saddlePoints matrix = error "You need to implement this function."
99
saddlePoints :: Array i e -> [i] saddlePoints matrix = error "You need to implement this function."
99
saddlePoints matrix = error "You need to implement this function."
66
false
true
0
6
16
29
14
15
null
null
gereeter/bounded-intmap
src/Data/IntMap/Bounded/Base.hs
mit
-- | /O(n+m)/. The (left-biased) union of two maps. -- It prefers the first map when duplicate keys are encountered, -- i.e. (@'union' == 'unionWith' 'const'@). -- -- > union (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "a"), (7, "C")] union :: IntMap a -> IntMap a -> IntMap a union (IntMap m1) (IntMap m2) = IntMap (W.union m1 m2)
378
union :: IntMap a -> IntMap a -> IntMap a union (IntMap m1) (IntMap m2) = IntMap (W.union m1 m2)
96
union (IntMap m1) (IntMap m2) = IntMap (W.union m1 m2)
54
true
true
0
8
67
63
32
31
null
null
nohernan/Marimba
Parser.hs
gpl-3.0
eTheta (ProbOp :LeftSqBrckt :Comp c :Range x :RightSqBrckt :tkns) bs = if 0<=x && x<=1 then let (path, rmndr) = parsePathA tkns bs in (Prob c x path, rmndr) else error "The number that is used to define the probability range is not a number between 0 and 1." --
401
parseTheta (ProbOp :LeftSqBrckt :Comp c :Range x :RightSqBrckt :tkns) bs = if 0<=x && x<=1 then let (path, rmndr) = parsePathA tkns bs in (Prob c x path, rmndr) else error "The number that is used to define the probability range is not a number between 0 and 1."
401
parseTheta (ProbOp :LeftSqBrckt :Comp c :Range x :RightSqBrckt :tkns) bs = if 0<=x && x<=1 then let (path, rmndr) = parsePathA tkns bs in (Prob c x path, rmndr) else error "The number that is used to define the probability range is not a number between 0 and 1."
401
false
false
1
11
189
103
50
53
null
null
dgvncsz0f/hoauth
src/test/haskell/Test/Network/OAuth/Consumer.hs
bsd-3-clause
ftest2 = T.TestCase $ do let app = Application "foo" "bar" OOB payload = B.pack . map (fromIntegral.ord) $ "oauth_token_secret=foobar&oauth_callback_confirmed=true" message = "missing required keys" errorMsg = "Missing at least one required oauth parameter [expecting=[\"oauth_token\",\"oauth_token_secret\",\"oauth_callback_confirmed\"], response=status: 200, reason: missing required keys]" Left result = fromResponse (RspHttp 200 message empty payload) (fromApplication app) T.assertEqual "test response without oauth_token do nothing" errorMsg result
614
ftest2 = T.TestCase $ do let app = Application "foo" "bar" OOB payload = B.pack . map (fromIntegral.ord) $ "oauth_token_secret=foobar&oauth_callback_confirmed=true" message = "missing required keys" errorMsg = "Missing at least one required oauth parameter [expecting=[\"oauth_token\",\"oauth_token_secret\",\"oauth_callback_confirmed\"], response=status: 200, reason: missing required keys]" Left result = fromResponse (RspHttp 200 message empty payload) (fromApplication app) T.assertEqual "test response without oauth_token do nothing" errorMsg result
614
ftest2 = T.TestCase $ do let app = Application "foo" "bar" OOB payload = B.pack . map (fromIntegral.ord) $ "oauth_token_secret=foobar&oauth_callback_confirmed=true" message = "missing required keys" errorMsg = "Missing at least one required oauth parameter [expecting=[\"oauth_token\",\"oauth_token_secret\",\"oauth_callback_confirmed\"], response=status: 200, reason: missing required keys]" Left result = fromResponse (RspHttp 200 message empty payload) (fromApplication app) T.assertEqual "test response without oauth_token do nothing" errorMsg result
614
false
false
1
16
120
109
51
58
null
null
brianshourd/adventOfCode2015
src/Day16.hs
mit
parseInput :: String -> Either String (Set SueMemory) parseInput = fmap Set.fromList . parseOnly (many' parseSueMemory) . pack
126
parseInput :: String -> Either String (Set SueMemory) parseInput = fmap Set.fromList . parseOnly (many' parseSueMemory) . pack
126
parseInput = fmap Set.fromList . parseOnly (many' parseSueMemory) . pack
72
false
true
0
9
17
48
23
25
null
null
brendanhay/gogol
gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs
mpl-2.0
-- | For CHOICE or MULTISELECT properties, the list of possible entries. mpEntries :: Lens' ManagedProperty [ManagedPropertyEntry] mpEntries = lens _mpEntries (\ s a -> s{_mpEntries = a}) . _Default . _Coerce
222
mpEntries :: Lens' ManagedProperty [ManagedPropertyEntry] mpEntries = lens _mpEntries (\ s a -> s{_mpEntries = a}) . _Default . _Coerce
149
mpEntries = lens _mpEntries (\ s a -> s{_mpEntries = a}) . _Default . _Coerce
91
true
true
2
10
45
57
28
29
null
null
nullobject/flatland-haskell
src/Visibility.hs
bsd-3-clause
snapPoint :: Point -> Point snapPoint (p1, p2) = (round' p1 8, round' p2 8) where round' f n = (fromInteger $ round $ f * (10 ^ n)) / (10.0 ^^ n)
147
snapPoint :: Point -> Point snapPoint (p1, p2) = (round' p1 8, round' p2 8) where round' f n = (fromInteger $ round $ f * (10 ^ n)) / (10.0 ^^ n)
147
snapPoint (p1, p2) = (round' p1 8, round' p2 8) where round' f n = (fromInteger $ round $ f * (10 ^ n)) / (10.0 ^^ n)
119
false
true
0
9
34
85
45
40
null
null
athanclark/Idris-dev
src/Idris/CaseSplit.hs
bsd-3-clause
argTys :: IState -> PTerm -> [Maybe Name] argTys ist (PRef fc hls n) = case lookupTy n (tt_ctxt ist) of [ty] -> map (tyName . snd) (getArgTys ty) ++ repeat Nothing _ -> repeat Nothing where tyName (Bind _ (Pi _ _ _) _) = Just (sUN "->") tyName t | (P _ n _, _) <- unApply t = Just n | otherwise = Nothing
358
argTys :: IState -> PTerm -> [Maybe Name] argTys ist (PRef fc hls n) = case lookupTy n (tt_ctxt ist) of [ty] -> map (tyName . snd) (getArgTys ty) ++ repeat Nothing _ -> repeat Nothing where tyName (Bind _ (Pi _ _ _) _) = Just (sUN "->") tyName t | (P _ n _, _) <- unApply t = Just n | otherwise = Nothing
358
argTys ist (PRef fc hls n) = case lookupTy n (tt_ctxt ist) of [ty] -> map (tyName . snd) (getArgTys ty) ++ repeat Nothing _ -> repeat Nothing where tyName (Bind _ (Pi _ _ _) _) = Just (sUN "->") tyName t | (P _ n _, _) <- unApply t = Just n | otherwise = Nothing
316
false
true
0
11
120
186
88
98
null
null
johnpmayer/elm-compiler
src/Canonicalize/Sort.hs
bsd-3-clause
free :: String -> State (Set.Set String) () free x = modify (Set.insert x)
76
free :: String -> State (Set.Set String) () free x = modify (Set.insert x)
76
free x = modify (Set.insert x)
32
false
true
0
9
15
44
21
23
null
null
blanu/arbre-go
Arbre/NewNative.hs
gpl-2.0
mult params = integerError params
33
mult params = integerError params
33
mult params = integerError params
33
false
false
0
5
4
12
5
7
null
null
shockkolate/containers
Data/IntMap/Strict.hs
bsd-3-clause
-- | /O(n*min(n,W))/. Build a map from a list of key\/value pairs with a combining function. See also fromAscListWithKey'. -- -- > fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] == fromList [(3, "ab"), (5, "aba")] -- > fromListWith (++) [] == empty fromListWithKey :: (Key -> a -> a -> a) -> [(Key,a)] -> IntMap a fromListWithKey f xs = foldlStrict ins empty xs where ins t (k,x) = insertWithKey f k x t -- | /O(n)/. Build a map from a list of key\/value pairs where -- the keys are in ascending order. -- -- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")] -- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
688
fromListWithKey :: (Key -> a -> a -> a) -> [(Key,a)] -> IntMap a fromListWithKey f xs = foldlStrict ins empty xs where ins t (k,x) = insertWithKey f k x t -- | /O(n)/. Build a map from a list of key\/value pairs where -- the keys are in ascending order. -- -- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")] -- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
421
fromListWithKey f xs = foldlStrict ins empty xs where ins t (k,x) = insertWithKey f k x t -- | /O(n)/. Build a map from a list of key\/value pairs where -- the keys are in ascending order. -- -- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")] -- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
356
true
true
0
10
136
102
54
48
null
null
oldmanmike/ghc
libraries/base/System/Posix/Internals.hs
bsd-3-clause
tcSetAttr :: FD -> (Ptr CTermios -> IO a) -> IO a tcSetAttr fd fun = do allocaBytes sizeof_termios $ \p_tios -> do throwErrnoIfMinus1Retry_ "tcSetAttr" (c_tcgetattr fd p_tios) -- Save a copy of termios, if this is a standard file descriptor. -- These terminal settings are restored in hs_exit(). when (fd <= 2) $ do p <- get_saved_termios fd when (p == nullPtr) $ do saved_tios <- mallocBytes sizeof_termios copyBytes saved_tios p_tios sizeof_termios set_saved_termios fd saved_tios -- tcsetattr() when invoked by a background process causes the process -- to be sent SIGTTOU regardless of whether the process has TOSTOP set -- in its terminal flags (try it...). This function provides a -- wrapper which temporarily blocks SIGTTOU around the call, making it -- transparent. allocaBytes sizeof_sigset_t $ \ p_sigset -> do allocaBytes sizeof_sigset_t $ \ p_old_sigset -> do throwErrnoIfMinus1_ "sigemptyset" $ c_sigemptyset p_sigset throwErrnoIfMinus1_ "sigaddset" $ c_sigaddset p_sigset const_sigttou throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask const_sig_block p_sigset p_old_sigset r <- fun p_tios -- do the business throwErrnoIfMinus1Retry_ "tcSetAttr" $ c_tcsetattr fd const_tcsanow p_tios throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask const_sig_setmask p_old_sigset nullPtr return r
1,644
tcSetAttr :: FD -> (Ptr CTermios -> IO a) -> IO a tcSetAttr fd fun = do allocaBytes sizeof_termios $ \p_tios -> do throwErrnoIfMinus1Retry_ "tcSetAttr" (c_tcgetattr fd p_tios) -- Save a copy of termios, if this is a standard file descriptor. -- These terminal settings are restored in hs_exit(). when (fd <= 2) $ do p <- get_saved_termios fd when (p == nullPtr) $ do saved_tios <- mallocBytes sizeof_termios copyBytes saved_tios p_tios sizeof_termios set_saved_termios fd saved_tios -- tcsetattr() when invoked by a background process causes the process -- to be sent SIGTTOU regardless of whether the process has TOSTOP set -- in its terminal flags (try it...). This function provides a -- wrapper which temporarily blocks SIGTTOU around the call, making it -- transparent. allocaBytes sizeof_sigset_t $ \ p_sigset -> do allocaBytes sizeof_sigset_t $ \ p_old_sigset -> do throwErrnoIfMinus1_ "sigemptyset" $ c_sigemptyset p_sigset throwErrnoIfMinus1_ "sigaddset" $ c_sigaddset p_sigset const_sigttou throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask const_sig_block p_sigset p_old_sigset r <- fun p_tios -- do the business throwErrnoIfMinus1Retry_ "tcSetAttr" $ c_tcsetattr fd const_tcsanow p_tios throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask const_sig_setmask p_old_sigset nullPtr return r
1,644
tcSetAttr fd fun = do allocaBytes sizeof_termios $ \p_tios -> do throwErrnoIfMinus1Retry_ "tcSetAttr" (c_tcgetattr fd p_tios) -- Save a copy of termios, if this is a standard file descriptor. -- These terminal settings are restored in hs_exit(). when (fd <= 2) $ do p <- get_saved_termios fd when (p == nullPtr) $ do saved_tios <- mallocBytes sizeof_termios copyBytes saved_tios p_tios sizeof_termios set_saved_termios fd saved_tios -- tcsetattr() when invoked by a background process causes the process -- to be sent SIGTTOU regardless of whether the process has TOSTOP set -- in its terminal flags (try it...). This function provides a -- wrapper which temporarily blocks SIGTTOU around the call, making it -- transparent. allocaBytes sizeof_sigset_t $ \ p_sigset -> do allocaBytes sizeof_sigset_t $ \ p_old_sigset -> do throwErrnoIfMinus1_ "sigemptyset" $ c_sigemptyset p_sigset throwErrnoIfMinus1_ "sigaddset" $ c_sigaddset p_sigset const_sigttou throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask const_sig_block p_sigset p_old_sigset r <- fun p_tios -- do the business throwErrnoIfMinus1Retry_ "tcSetAttr" $ c_tcsetattr fd const_tcsanow p_tios throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask const_sig_setmask p_old_sigset nullPtr return r
1,594
false
true
0
23
527
277
124
153
null
null
ksaveljev/hake-2
src/Client/MenuGlobals.hs
bsd-3-clause
loadGameActionRef :: Ref MenuActionS loadGameActionRef = Ref 5
62
loadGameActionRef :: Ref MenuActionS loadGameActionRef = Ref 5
62
loadGameActionRef = Ref 5
25
false
true
0
5
7
17
8
9
null
null
norm2782/uuagc
cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
bsd-3-clause
uuagc' :: ([String] -> FilePath -> IO (ExitCode, [FilePath])) -> BuildInfo -> LocalBuildInfo -> PreProcessor uuagc' uuagc build lbi = PreProcessor { platformIndependent = True, runPreProcessor = mkSimplePreProcessor $ \ inFile outFile verbosity -> do notice verbosity $ "[UUAGC] processing: " ++ inFile ++ " generating: " ++ outFile let classesPath = buildDir lbi </> agClassesFile info verbosity $ "uuagc-preprocessor: Assuming AG classesPath: " ++ classesPath fileOpts <- readFileOptions classesPath opts <- case Map.lookup inFile fileOpts of Nothing -> do warn verbosity $ "No options found for " ++ inFile return noOptions Just (opt,gen) -> return opt let search = dropFileName inFile options = opts { searchPath = search : hsSourceDirs build ++ searchPath opts , outputFiles = outFile : (outputFiles opts) } (eCode,_) <- uuagc (optionsToString options) inFile case eCode of ExitSuccess -> writeFileOptions classesPath (Map.insert inFile (opts, Just (outFile, searchPath options)) fileOpts) ex@(ExitFailure _) -> throwIO ex }
1,567
uuagc' :: ([String] -> FilePath -> IO (ExitCode, [FilePath])) -> BuildInfo -> LocalBuildInfo -> PreProcessor uuagc' uuagc build lbi = PreProcessor { platformIndependent = True, runPreProcessor = mkSimplePreProcessor $ \ inFile outFile verbosity -> do notice verbosity $ "[UUAGC] processing: " ++ inFile ++ " generating: " ++ outFile let classesPath = buildDir lbi </> agClassesFile info verbosity $ "uuagc-preprocessor: Assuming AG classesPath: " ++ classesPath fileOpts <- readFileOptions classesPath opts <- case Map.lookup inFile fileOpts of Nothing -> do warn verbosity $ "No options found for " ++ inFile return noOptions Just (opt,gen) -> return opt let search = dropFileName inFile options = opts { searchPath = search : hsSourceDirs build ++ searchPath opts , outputFiles = outFile : (outputFiles opts) } (eCode,_) <- uuagc (optionsToString options) inFile case eCode of ExitSuccess -> writeFileOptions classesPath (Map.insert inFile (opts, Just (outFile, searchPath options)) fileOpts) ex@(ExitFailure _) -> throwIO ex }
1,567
uuagc' uuagc build lbi = PreProcessor { platformIndependent = True, runPreProcessor = mkSimplePreProcessor $ \ inFile outFile verbosity -> do notice verbosity $ "[UUAGC] processing: " ++ inFile ++ " generating: " ++ outFile let classesPath = buildDir lbi </> agClassesFile info verbosity $ "uuagc-preprocessor: Assuming AG classesPath: " ++ classesPath fileOpts <- readFileOptions classesPath opts <- case Map.lookup inFile fileOpts of Nothing -> do warn verbosity $ "No options found for " ++ inFile return noOptions Just (opt,gen) -> return opt let search = dropFileName inFile options = opts { searchPath = search : hsSourceDirs build ++ searchPath opts , outputFiles = outFile : (outputFiles opts) } (eCode,_) <- uuagc (optionsToString options) inFile case eCode of ExitSuccess -> writeFileOptions classesPath (Map.insert inFile (opts, Just (outFile, searchPath options)) fileOpts) ex@(ExitFailure _) -> throwIO ex }
1,434
false
true
0
20
687
352
174
178
null
null
HIPERFIT/futhark
src/Language/Futhark/Prop.hs
isc
typeVars :: Monoid as => TypeBase dim as -> S.Set VName typeVars t = case t of Scalar Prim {} -> mempty Scalar (TypeVar _ _ tn targs) -> mconcat $ typeVarFree tn : map typeArgFree targs Scalar (Arrow _ _ t1 (RetType _ t2)) -> typeVars t1 <> typeVars t2 Scalar (Record fields) -> foldMap typeVars fields Scalar (Sum cs) -> mconcat $ (foldMap . fmap) typeVars cs Array _ _ rt _ -> typeVars $ Scalar rt where typeVarFree = S.singleton . typeLeaf typeArgFree (TypeArgType ta _) = typeVars ta typeArgFree TypeArgDim {} = mempty -- | @orderZero t@ is 'True' if the argument type has order 0, i.e., it is not -- a function type, does not contain a function type as a subcomponent, and may -- not be instantiated with a function type.
773
typeVars :: Monoid as => TypeBase dim as -> S.Set VName typeVars t = case t of Scalar Prim {} -> mempty Scalar (TypeVar _ _ tn targs) -> mconcat $ typeVarFree tn : map typeArgFree targs Scalar (Arrow _ _ t1 (RetType _ t2)) -> typeVars t1 <> typeVars t2 Scalar (Record fields) -> foldMap typeVars fields Scalar (Sum cs) -> mconcat $ (foldMap . fmap) typeVars cs Array _ _ rt _ -> typeVars $ Scalar rt where typeVarFree = S.singleton . typeLeaf typeArgFree (TypeArgType ta _) = typeVars ta typeArgFree TypeArgDim {} = mempty -- | @orderZero t@ is 'True' if the argument type has order 0, i.e., it is not -- a function type, does not contain a function type as a subcomponent, and may -- not be instantiated with a function type.
773
typeVars t = case t of Scalar Prim {} -> mempty Scalar (TypeVar _ _ tn targs) -> mconcat $ typeVarFree tn : map typeArgFree targs Scalar (Arrow _ _ t1 (RetType _ t2)) -> typeVars t1 <> typeVars t2 Scalar (Record fields) -> foldMap typeVars fields Scalar (Sum cs) -> mconcat $ (foldMap . fmap) typeVars cs Array _ _ rt _ -> typeVars $ Scalar rt where typeVarFree = S.singleton . typeLeaf typeArgFree (TypeArgType ta _) = typeVars ta typeArgFree TypeArgDim {} = mempty -- | @orderZero t@ is 'True' if the argument type has order 0, i.e., it is not -- a function type, does not contain a function type as a subcomponent, and may -- not be instantiated with a function type.
717
false
true
3
12
183
260
119
141
null
null
jozefg/pcf
src/Language/Pcf.hs
mit
taggedTy :: CDeclSpec taggedTy = CTypeSpec "tagged_ptr"
55
taggedTy :: CDeclSpec taggedTy = CTypeSpec "tagged_ptr"
55
taggedTy = CTypeSpec "tagged_ptr"
33
false
true
0
5
6
14
7
7
null
null
markborkum/json2rdf-hs
src/JSON2RDF/Parser/Text.hs
unlicense
bindDecl_ :: P.Parser Expression bindDecl_ = do caseInsensitiveKeyword "BIND" ws_ key <- bareword_ ws_ void $ P.char ':' ws_ createRDFLabel <- choice [literal_, uriResource_] return (SetRDFLabel key createRDFLabel)
230
bindDecl_ :: P.Parser Expression bindDecl_ = do caseInsensitiveKeyword "BIND" ws_ key <- bareword_ ws_ void $ P.char ':' ws_ createRDFLabel <- choice [literal_, uriResource_] return (SetRDFLabel key createRDFLabel)
230
bindDecl_ = do caseInsensitiveKeyword "BIND" ws_ key <- bareword_ ws_ void $ P.char ':' ws_ createRDFLabel <- choice [literal_, uriResource_] return (SetRDFLabel key createRDFLabel)
197
false
true
0
9
43
80
35
45
null
null
k-bx/riak-haskell-client
src/Network/Riak/CRDT/Ops.hs
apache-2.0
setSpecificOp (MapSetOp sop) u = u { PBMap.set_op = Just $ setOpPB [sop] }
84
setSpecificOp (MapSetOp sop) u = u { PBMap.set_op = Just $ setOpPB [sop] }
84
setSpecificOp (MapSetOp sop) u = u { PBMap.set_op = Just $ setOpPB [sop] }
84
false
false
0
9
23
37
19
18
null
null
duplode/threepenny-gui
src/Graphics/UI/Threepenny/SVG/Attributes.hs
bsd-3-clause
onabort = strAttr "onabort"
49
onabort = strAttr "onabort"
49
onabort = strAttr "onabort"
49
false
false
1
5
25
12
4
8
null
null
lukexi/stack
src/Stack/Types/Config.hs
bsd-3-clause
getWhichCompiler :: (MonadReader env m, HasEnvConfig env) => m WhichCompiler getWhichCompiler = asks (whichCompiler . envConfigCompilerVersion . getEnvConfig)
158
getWhichCompiler :: (MonadReader env m, HasEnvConfig env) => m WhichCompiler getWhichCompiler = asks (whichCompiler . envConfigCompilerVersion . getEnvConfig)
158
getWhichCompiler = asks (whichCompiler . envConfigCompilerVersion . getEnvConfig)
81
false
true
0
8
17
45
23
22
null
null
hvr/time
test/Test/TestParseTime.hs
bsd-3-clause
getMilZoneLetter h | h < 0 = enumAdd (negate h) 'M'
51
getMilZoneLetter h | h < 0 = enumAdd (negate h) 'M'
51
getMilZoneLetter h | h < 0 = enumAdd (negate h) 'M'
51
false
false
1
7
10
31
13
18
null
null
apyrgio/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
stDiskless :: String stDiskless = Types.storageTypeToRaw StorageDiskless
72
stDiskless :: String stDiskless = Types.storageTypeToRaw StorageDiskless
72
stDiskless = Types.storageTypeToRaw StorageDiskless
51
false
true
0
6
6
16
8
8
null
null
themoritz/cabal
Cabal/Distribution/Simple/Build/Macros.hs
bsd-3-clause
ifndefDefine :: String -> Maybe [String] -> String -> HeaderLines ifndefDefine macro params str = ifndef macro (define macro params str)
140
ifndefDefine :: String -> Maybe [String] -> String -> HeaderLines ifndefDefine macro params str = ifndef macro (define macro params str)
140
ifndefDefine macro params str = ifndef macro (define macro params str)
74
false
true
0
8
24
51
25
26
null
null
rueshyna/gogol
gogol-dns/gen/Network/Google/Resource/DNS/Changes/Get.hs
mpl-2.0
-- | The identifier of the requested change, from a previous -- ResourceRecordSetsChangeResponse. cgChangeId :: Lens' ChangesGet Text cgChangeId = lens _cgChangeId (\ s a -> s{_cgChangeId = a})
195
cgChangeId :: Lens' ChangesGet Text cgChangeId = lens _cgChangeId (\ s a -> s{_cgChangeId = a})
97
cgChangeId = lens _cgChangeId (\ s a -> s{_cgChangeId = a})
61
true
true
0
9
30
43
23
20
null
null
bvdelft/parac2
src/Language/Java/Paragon/TypeCheck/Monad.hs
bsd-3-clause
substParPrgPols subst (Join p q) = do pp <- substParPrgPols subst p qq <- substParPrgPols subst q pp `lub` qq
116
substParPrgPols subst (Join p q) = do pp <- substParPrgPols subst p qq <- substParPrgPols subst q pp `lub` qq
116
substParPrgPols subst (Join p q) = do pp <- substParPrgPols subst p qq <- substParPrgPols subst q pp `lub` qq
116
false
false
0
8
26
52
24
28
null
null
ssaavedra/liquidhaskell
benchmarks/vector-0.10.0.1/Data/Vector/Fusion/Stream/Size.hs
bsd-3-clause
-- | Compute the maximum size from a size hint if possible {-@ upperBound :: Size -> Maybe Nat @-} upperBound :: Size -> Maybe Int upperBound (Exact n) = Just n
161
upperBound :: Size -> Maybe Int upperBound (Exact n) = Just n
61
upperBound (Exact n) = Just n
29
true
true
0
7
32
32
16
16
null
null
AlexanderPankiv/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
isListCompExpr PArrComp = True
39
isListCompExpr PArrComp = True
39
isListCompExpr PArrComp = True
39
false
false
1
5
12
13
4
9
null
null
rcook/catnplus
src/CatNPlus/App.hs
mit
withSGRCond False _ action = action
35
withSGRCond False _ action = action
35
withSGRCond False _ action = action
35
false
false
0
5
5
13
6
7
null
null
BartAdv/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v (LURem (ITFixed ty)) [x, y] = bitOp v "URem" ty [x, y]
61
doOp v (LURem (ITFixed ty)) [x, y] = bitOp v "URem" ty [x, y]
61
doOp v (LURem (ITFixed ty)) [x, y] = bitOp v "URem" ty [x, y]
61
false
false
0
9
13
46
24
22
null
null
ku-fpg/aframe-server
src/Text/AFrame/Geometry.hs
bsd-3-clause
position :: Num a => (a,a,a) -> Geometry a position (xd,yd,zd) = Geometry $ \ (Position (x,y,z)) -> Position (x + xd,y + yd,z + zd)
131
position :: Num a => (a,a,a) -> Geometry a position (xd,yd,zd) = Geometry $ \ (Position (x,y,z)) -> Position (x + xd,y + yd,z + zd)
131
position (xd,yd,zd) = Geometry $ \ (Position (x,y,z)) -> Position (x + xd,y + yd,z + zd)
88
false
true
0
9
25
94
52
42
null
null
susoDominguez/eNominalTerms-Alpha
RewritingX.hs
unlicense
findMatch fAtms fc ((pos,t):xs) (ctx,l) = case solveMatch (anEConstr l t:ctx2Constr ctx) of Nothing -> findMatch fAtms fc xs (ctx,l) Just (sigma,fc2)-> if derives fc fc2 then Just (pos,sigma) else Nothing --else findMatch ctx xs (fc,l) -} --one rewrite step, when no match in rule is reflexive step
361
findMatch fAtms fc ((pos,t):xs) (ctx,l) = case solveMatch (anEConstr l t:ctx2Constr ctx) of Nothing -> findMatch fAtms fc xs (ctx,l) Just (sigma,fc2)-> if derives fc fc2 then Just (pos,sigma) else Nothing --else findMatch ctx xs (fc,l) -} --one rewrite step, when no match in rule is reflexive step
361
findMatch fAtms fc ((pos,t):xs) (ctx,l) = case solveMatch (anEConstr l t:ctx2Constr ctx) of Nothing -> findMatch fAtms fc xs (ctx,l) Just (sigma,fc2)-> if derives fc fc2 then Just (pos,sigma) else Nothing --else findMatch ctx xs (fc,l) -} --one rewrite step, when no match in rule is reflexive step
361
false
false
0
10
110
116
62
54
null
null
walkie/Hagl
Hagl/Game.hs
bsd-3-clause
-- | Get the PlayerID corresponding to a decision node. playerID :: GameTree t => t s mv -> Maybe PlayerID playerID t = case treeAction t of Decision p -> Just p _ -> Nothing -- ** Discrete game trees -- -- | A discrete game tree provides a finite list of outbound edges from -- each location, providing a discrete and finite list of available moves.
394
playerID :: GameTree t => t s mv -> Maybe PlayerID playerID t = case treeAction t of Decision p -> Just p _ -> Nothing -- ** Discrete game trees -- -- | A discrete game tree provides a finite list of outbound edges from -- each location, providing a discrete and finite list of available moves.
338
playerID t = case treeAction t of Decision p -> Just p _ -> Nothing -- ** Discrete game trees -- -- | A discrete game tree provides a finite list of outbound edges from -- each location, providing a discrete and finite list of available moves.
287
true
true
0
8
111
68
32
36
null
null
mightymoose/liquidhaskell
benchmarks/containers-0.5.0.0/Data/Sequence.hs
bsd-3-clause
appendTree3 xs a b c Empty = xs `snocTree` a `snocTree` b `snocTree` c
74
appendTree3 xs a b c Empty = xs `snocTree` a `snocTree` b `snocTree` c
74
appendTree3 xs a b c Empty = xs `snocTree` a `snocTree` b `snocTree` c
74
false
false
2
4
17
36
17
19
null
null
ekarayel/HTF
Test/Framework/TestManager.hs
lgpl-2.1
runAllFlatTests :: TestConfig -> [FlatTest] -> TR () runAllFlatTests tc tests' = do reportGlobalStart tests tc <- ask case tc_threads tc of Nothing -> let entries = map (mkFlatTestRunner tc) tests in tp_run sequentialThreadPool entries Just i -> let (ptests, stests) = List.partition (\t -> to_parallel (wto_options (ft_payload t))) tests pentries' = map (mkFlatTestRunner tc) ptests sentries = map (mkFlatTestRunner tc) stests in do tp <- parallelThreadPool i pentries <- if tc_shuffle tc then liftIO (shuffleIO pentries') else return pentries' tp_run tp pentries tp_run sequentialThreadPool sentries where tests = sortTests tests' sortTests ts = if not (tc_sortByPrevTime tc) then ts else map snd $ List.sortBy compareTests (map (\t -> (historyKey t, t)) ts) compareTests (t1, _) (t2, _) = case (max (fmap htr_timeMs (findHistoricSuccessfulTestResult t1 (tc_history tc))) (fmap htr_timeMs (findHistoricTestResult t1 (tc_history tc))) ,max (fmap htr_timeMs (findHistoricSuccessfulTestResult t2 (tc_history tc))) (fmap htr_timeMs (findHistoricTestResult t2 (tc_history tc)))) of (Just t1, Just t2) -> compare t1 t2 (Just _, Nothing) -> GT (Nothing, Just _) -> LT (Nothing, Nothing) -> EQ -- | Run something testable using the 'Test.Framework.TestConfig.defaultCmdlineOptions'.
1,693
runAllFlatTests :: TestConfig -> [FlatTest] -> TR () runAllFlatTests tc tests' = do reportGlobalStart tests tc <- ask case tc_threads tc of Nothing -> let entries = map (mkFlatTestRunner tc) tests in tp_run sequentialThreadPool entries Just i -> let (ptests, stests) = List.partition (\t -> to_parallel (wto_options (ft_payload t))) tests pentries' = map (mkFlatTestRunner tc) ptests sentries = map (mkFlatTestRunner tc) stests in do tp <- parallelThreadPool i pentries <- if tc_shuffle tc then liftIO (shuffleIO pentries') else return pentries' tp_run tp pentries tp_run sequentialThreadPool sentries where tests = sortTests tests' sortTests ts = if not (tc_sortByPrevTime tc) then ts else map snd $ List.sortBy compareTests (map (\t -> (historyKey t, t)) ts) compareTests (t1, _) (t2, _) = case (max (fmap htr_timeMs (findHistoricSuccessfulTestResult t1 (tc_history tc))) (fmap htr_timeMs (findHistoricTestResult t1 (tc_history tc))) ,max (fmap htr_timeMs (findHistoricSuccessfulTestResult t2 (tc_history tc))) (fmap htr_timeMs (findHistoricTestResult t2 (tc_history tc)))) of (Just t1, Just t2) -> compare t1 t2 (Just _, Nothing) -> GT (Nothing, Just _) -> LT (Nothing, Nothing) -> EQ -- | Run something testable using the 'Test.Framework.TestConfig.defaultCmdlineOptions'.
1,693
runAllFlatTests tc tests' = do reportGlobalStart tests tc <- ask case tc_threads tc of Nothing -> let entries = map (mkFlatTestRunner tc) tests in tp_run sequentialThreadPool entries Just i -> let (ptests, stests) = List.partition (\t -> to_parallel (wto_options (ft_payload t))) tests pentries' = map (mkFlatTestRunner tc) ptests sentries = map (mkFlatTestRunner tc) stests in do tp <- parallelThreadPool i pentries <- if tc_shuffle tc then liftIO (shuffleIO pentries') else return pentries' tp_run tp pentries tp_run sequentialThreadPool sentries where tests = sortTests tests' sortTests ts = if not (tc_sortByPrevTime tc) then ts else map snd $ List.sortBy compareTests (map (\t -> (historyKey t, t)) ts) compareTests (t1, _) (t2, _) = case (max (fmap htr_timeMs (findHistoricSuccessfulTestResult t1 (tc_history tc))) (fmap htr_timeMs (findHistoricTestResult t1 (tc_history tc))) ,max (fmap htr_timeMs (findHistoricSuccessfulTestResult t2 (tc_history tc))) (fmap htr_timeMs (findHistoricTestResult t2 (tc_history tc)))) of (Just t1, Just t2) -> compare t1 t2 (Just _, Nothing) -> GT (Nothing, Just _) -> LT (Nothing, Nothing) -> EQ -- | Run something testable using the 'Test.Framework.TestConfig.defaultCmdlineOptions'.
1,640
false
true
1
24
593
504
248
256
null
null
peterokagey/haskellOEIS
src/Tables/A276162.hs
apache-2.0
a276162T :: Integral a => a -> a -> a a276162T n k = product $ map (gcd n) [1..k]
81
a276162T :: Integral a => a -> a -> a a276162T n k = product $ map (gcd n) [1..k]
81
a276162T n k = product $ map (gcd n) [1..k]
43
false
true
0
8
19
51
25
26
null
null
ku-fpg/thrust-gen
src/Ion/Private/Lang.hs
bsd-3-clause
interp (Free d@(DeclEmpty v next)) = putStrLn (show d) >> interp next
80
interp (Free d@(DeclEmpty v next)) = putStrLn (show d) >> interp next
80
interp (Free d@(DeclEmpty v next)) = putStrLn (show d) >> interp next
80
false
false
0
9
22
43
20
23
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
-- newtype TExp a = ... tExpDataConName :: Name tExpDataConName = thCon (fsLit "TExp") tExpDataConKey
101
tExpDataConName :: Name tExpDataConName = thCon (fsLit "TExp") tExpDataConKey
77
tExpDataConName = thCon (fsLit "TExp") tExpDataConKey
53
true
true
0
7
14
29
13
16
null
null
gridaphobe/ghc
compiler/utils/Outputable.hs
bsd-3-clause
pprTrace :: String -> SDoc -> a -> a -- ^ If debug output is on, show some 'SDoc' on the screen pprTrace str doc x | opt_NoDebugOutput = x | otherwise = pprDebugAndThen unsafeGlobalDynFlags trace (text str) doc x
226
pprTrace :: String -> SDoc -> a -> a pprTrace str doc x | opt_NoDebugOutput = x | otherwise = pprDebugAndThen unsafeGlobalDynFlags trace (text str) doc x
167
pprTrace str doc x | opt_NoDebugOutput = x | otherwise = pprDebugAndThen unsafeGlobalDynFlags trace (text str) doc x
130
true
true
1
7
53
61
30
31
null
null
jnonce/azure-docdb
lib/Azure/DocDB/ServiceHeader.hs
bsd-3-clause
msDate :: HT.HeaderName msDate = "x-ms-date"
44
msDate :: HT.HeaderName msDate = "x-ms-date"
44
msDate = "x-ms-date"
20
false
true
0
5
5
13
7
6
null
null
hguenther/smtlib2
Language/SMTLib2/Internals/Expression.hs
gpl-3.0
renderExpr _ _ f _ _ _ _ (QVar x) = f x
39
renderExpr _ _ f _ _ _ _ (QVar x) = f x
39
renderExpr _ _ f _ _ _ _ (QVar x) = f x
39
false
false
2
6
12
30
13
17
null
null
fboyer/craft3e
Index.hs
mit
amalgamate :: [ ([Int],Word) ] -> [ ([Int],Word) ] amalgamate [] = []
70
amalgamate :: [ ([Int],Word) ] -> [ ([Int],Word) ] amalgamate [] = []
69
amalgamate [] = []
18
false
true
0
8
13
46
27
19
null
null
sajith/cis194
hw05/Calc.hs
mit
moper :: (Num a) => (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a moper op (Just x) (Just y) = Just (x `op` y)
111
moper :: (Num a) => (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a moper op (Just x) (Just y) = Just (x `op` y)
111
moper op (Just x) (Just y) = Just (x `op` y)
44
false
true
0
9
29
87
43
44
null
null
ruben2020/small-haskell-proj
convert_CPPtoC_comments/convert_comments.hs
mit
ccomment [] = []
16
ccomment [] = []
16
ccomment [] = []
16
false
false
1
6
3
17
6
11
null
null
marcelosousa/poet
src/Domain/Concrete/API.hs
gpl-2.0
read_memory_addr :: ConState -> ConMAddr -> ConValue read_memory_addr st addr = mytrace False ("read_memaddr: addr = " ++ show addr ) $ let (base_addr, off) = from_addr addr in case _level base_addr of Global -> case read_addr_from_region (cs_heap st) base_addr off of Nothing -> error $ "read_memory_addr: " ++ show addr ++ " not found" Just val -> val Local tid -> case M.lookup tid (cs_tstates st) of Nothing -> error $ "read_memory_addr: tid " ++ show tid ++ " not found, addr " ++ show addr Just th -> case read_addr_from_region (th_locals th) base_addr off of Nothing -> -- Check if the variable is in the heap let addr' = addr { level = Global } in read_memory_addr st addr' Just val -> val
788
read_memory_addr :: ConState -> ConMAddr -> ConValue read_memory_addr st addr = mytrace False ("read_memaddr: addr = " ++ show addr ) $ let (base_addr, off) = from_addr addr in case _level base_addr of Global -> case read_addr_from_region (cs_heap st) base_addr off of Nothing -> error $ "read_memory_addr: " ++ show addr ++ " not found" Just val -> val Local tid -> case M.lookup tid (cs_tstates st) of Nothing -> error $ "read_memory_addr: tid " ++ show tid ++ " not found, addr " ++ show addr Just th -> case read_addr_from_region (th_locals th) base_addr off of Nothing -> -- Check if the variable is in the heap let addr' = addr { level = Global } in read_memory_addr st addr' Just val -> val
788
read_memory_addr st addr = mytrace False ("read_memaddr: addr = " ++ show addr ) $ let (base_addr, off) = from_addr addr in case _level base_addr of Global -> case read_addr_from_region (cs_heap st) base_addr off of Nothing -> error $ "read_memory_addr: " ++ show addr ++ " not found" Just val -> val Local tid -> case M.lookup tid (cs_tstates st) of Nothing -> error $ "read_memory_addr: tid " ++ show tid ++ " not found, addr " ++ show addr Just th -> case read_addr_from_region (th_locals th) base_addr off of Nothing -> -- Check if the variable is in the heap let addr' = addr { level = Global } in read_memory_addr st addr' Just val -> val
735
false
true
0
22
215
244
116
128
null
null
wangwangwar/cis194
src/ch7/JoinList.hs
bsd-3-clause
tag (JAppend m _ _) = m
23
tag (JAppend m _ _) = m
23
tag (JAppend m _ _) = m
23
false
false
0
6
6
20
9
11
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/cmm/CmmUtils.hs
bsd-3-clause
blankWord :: DynFlags -> CmmStatic blankWord dflags = CmmUninitialised (wORD_SIZE dflags)
89
blankWord :: DynFlags -> CmmStatic blankWord dflags = CmmUninitialised (wORD_SIZE dflags)
89
blankWord dflags = CmmUninitialised (wORD_SIZE dflags)
54
false
true
0
7
10
27
13
14
null
null
nevrenato/Hets_Fork
DFOL/AS_DFOL.hs
gpl-2.0
translateType m s (Pi [([x], t)] a) = let t1 = translate m s t x1 = getNewName x s a1 = translate (Map.insert x (Identifier x1) m) (Set.insert x1 s) a in Pi [([x1], t1)] a1
192
translateType m s (Pi [([x], t)] a) = let t1 = translate m s t x1 = getNewName x s a1 = translate (Map.insert x (Identifier x1) m) (Set.insert x1 s) a in Pi [([x1], t1)] a1
192
translateType m s (Pi [([x], t)] a) = let t1 = translate m s t x1 = getNewName x s a1 = translate (Map.insert x (Identifier x1) m) (Set.insert x1 s) a in Pi [([x1], t1)] a1
192
false
false
0
13
56
118
61
57
null
null
jean-edouard/manager
xenmgr/Vm/Config.hs
gpl-2.0
-- this one is stored directly under /vm node as two entries portica-installed and portica-enabled vmPorticaStatus = ConfigProperty { property_name = "portica-status" , property_location = dbPath}
229
vmPorticaStatus = ConfigProperty { property_name = "portica-status" , property_location = dbPath}
130
vmPorticaStatus = ConfigProperty { property_name = "portica-status" , property_location = dbPath}
130
true
false
0
6
58
21
13
8
null
null
jlamothe/passman
test/Spec/ValidatePWData.hs
lgpl-3.0
invalidPolicy :: PWData invalidPolicy = set (pwPolicy.pwLength) (-1) new
72
invalidPolicy :: PWData invalidPolicy = set (pwPolicy.pwLength) (-1) new
72
invalidPolicy = set (pwPolicy.pwLength) (-1) new
48
false
true
0
7
8
28
15
13
null
null
thewoolleyman/haskellbook
08/06/maor/ch8exercises.hs
unlicense
dividedBy :: Integral a => a -> a-> DividedResult dividedBy num denom | denom == 0 = DividedByZero | otherwise = signCheck (go (abs num) (abs denom) 0) where go n d count | n < d = count | otherwise = go (n - d) d (count + 1) signCheck result | num > 0 && denom < 0 = Result (negate result) | num < 0 && denom > 0 = Result (negate result) | otherwise = Result result
529
dividedBy :: Integral a => a -> a-> DividedResult dividedBy num denom | denom == 0 = DividedByZero | otherwise = signCheck (go (abs num) (abs denom) 0) where go n d count | n < d = count | otherwise = go (n - d) d (count + 1) signCheck result | num > 0 && denom < 0 = Result (negate result) | num < 0 && denom > 0 = Result (negate result) | otherwise = Result result
529
dividedBy num denom | denom == 0 = DividedByZero | otherwise = signCheck (go (abs num) (abs denom) 0) where go n d count | n < d = count | otherwise = go (n - d) d (count + 1) signCheck result | num > 0 && denom < 0 = Result (negate result) | num < 0 && denom > 0 = Result (negate result) | otherwise = Result result
479
false
true
2
10
243
217
100
117
null
null
clupascu/codegolf
135541-toggle-the-box/toggleBox_golfed.hs
mit
h=and.a i z
11
h=and.a i z
11
h=and.a i z
11
false
false
1
6
2
17
6
11
null
null
edsko/cabal
cabal-install/Distribution/Client/IndexUtils.hs
bsd-3-clause
readRepoIndex :: Verbosity -> RepoContext -> Repo -> IO (PackageIndex SourcePackage, [Dependency]) readRepoIndex verbosity repoCtxt repo = handleNotFound $ do warnIfIndexIsOld =<< getIndexFileAge repo updateRepoIndexCache verbosity (RepoIndex repoCtxt repo) readPackageIndexCacheFile mkAvailablePackage (RepoIndex repoCtxt repo) where mkAvailablePackage pkgEntry = SourcePackage { packageInfoId = pkgid, packageDescription = packageDesc pkgEntry, packageSource = case pkgEntry of NormalPackage _ _ _ _ -> RepoTarballPackage repo pkgid Nothing BuildTreeRef _ _ _ path _ -> LocalUnpackedPackage path, packageDescrOverride = case pkgEntry of NormalPackage _ _ pkgtxt _ -> Just pkgtxt _ -> Nothing } where pkgid = packageId pkgEntry handleNotFound action = catchIO action $ \e -> if isDoesNotExistError e then do case repo of RepoRemote{..} -> warn verbosity $ errMissingPackageList repoRemote RepoSecure{..} -> warn verbosity $ errMissingPackageList repoRemote RepoLocal{..} -> warn verbosity $ "The package list for the local repo '" ++ repoLocalDir ++ "' is missing. The repo is invalid." return mempty else ioError e isOldThreshold = 15 --days warnIfIndexIsOld dt = do when (dt >= isOldThreshold) $ case repo of RepoRemote{..} -> warn verbosity $ errOutdatedPackageList repoRemote dt RepoSecure{..} -> warn verbosity $ errOutdatedPackageList repoRemote dt RepoLocal{..} -> return () errMissingPackageList repoRemote = "The package list for '" ++ remoteRepoName repoRemote ++ "' does not exist. Run 'cabal update' to download it." errOutdatedPackageList repoRemote dt = "The package list for '" ++ remoteRepoName repoRemote ++ "' is " ++ shows (floor dt :: Int) " days old.\nRun " ++ "'cabal update' to get the latest list of available packages." -- | Return the age of the index file in days (as a Double).
2,159
readRepoIndex :: Verbosity -> RepoContext -> Repo -> IO (PackageIndex SourcePackage, [Dependency]) readRepoIndex verbosity repoCtxt repo = handleNotFound $ do warnIfIndexIsOld =<< getIndexFileAge repo updateRepoIndexCache verbosity (RepoIndex repoCtxt repo) readPackageIndexCacheFile mkAvailablePackage (RepoIndex repoCtxt repo) where mkAvailablePackage pkgEntry = SourcePackage { packageInfoId = pkgid, packageDescription = packageDesc pkgEntry, packageSource = case pkgEntry of NormalPackage _ _ _ _ -> RepoTarballPackage repo pkgid Nothing BuildTreeRef _ _ _ path _ -> LocalUnpackedPackage path, packageDescrOverride = case pkgEntry of NormalPackage _ _ pkgtxt _ -> Just pkgtxt _ -> Nothing } where pkgid = packageId pkgEntry handleNotFound action = catchIO action $ \e -> if isDoesNotExistError e then do case repo of RepoRemote{..} -> warn verbosity $ errMissingPackageList repoRemote RepoSecure{..} -> warn verbosity $ errMissingPackageList repoRemote RepoLocal{..} -> warn verbosity $ "The package list for the local repo '" ++ repoLocalDir ++ "' is missing. The repo is invalid." return mempty else ioError e isOldThreshold = 15 --days warnIfIndexIsOld dt = do when (dt >= isOldThreshold) $ case repo of RepoRemote{..} -> warn verbosity $ errOutdatedPackageList repoRemote dt RepoSecure{..} -> warn verbosity $ errOutdatedPackageList repoRemote dt RepoLocal{..} -> return () errMissingPackageList repoRemote = "The package list for '" ++ remoteRepoName repoRemote ++ "' does not exist. Run 'cabal update' to download it." errOutdatedPackageList repoRemote dt = "The package list for '" ++ remoteRepoName repoRemote ++ "' is " ++ shows (floor dt :: Int) " days old.\nRun " ++ "'cabal update' to get the latest list of available packages." -- | Return the age of the index file in days (as a Double).
2,159
readRepoIndex verbosity repoCtxt repo = handleNotFound $ do warnIfIndexIsOld =<< getIndexFileAge repo updateRepoIndexCache verbosity (RepoIndex repoCtxt repo) readPackageIndexCacheFile mkAvailablePackage (RepoIndex repoCtxt repo) where mkAvailablePackage pkgEntry = SourcePackage { packageInfoId = pkgid, packageDescription = packageDesc pkgEntry, packageSource = case pkgEntry of NormalPackage _ _ _ _ -> RepoTarballPackage repo pkgid Nothing BuildTreeRef _ _ _ path _ -> LocalUnpackedPackage path, packageDescrOverride = case pkgEntry of NormalPackage _ _ pkgtxt _ -> Just pkgtxt _ -> Nothing } where pkgid = packageId pkgEntry handleNotFound action = catchIO action $ \e -> if isDoesNotExistError e then do case repo of RepoRemote{..} -> warn verbosity $ errMissingPackageList repoRemote RepoSecure{..} -> warn verbosity $ errMissingPackageList repoRemote RepoLocal{..} -> warn verbosity $ "The package list for the local repo '" ++ repoLocalDir ++ "' is missing. The repo is invalid." return mempty else ioError e isOldThreshold = 15 --days warnIfIndexIsOld dt = do when (dt >= isOldThreshold) $ case repo of RepoRemote{..} -> warn verbosity $ errOutdatedPackageList repoRemote dt RepoSecure{..} -> warn verbosity $ errOutdatedPackageList repoRemote dt RepoLocal{..} -> return () errMissingPackageList repoRemote = "The package list for '" ++ remoteRepoName repoRemote ++ "' does not exist. Run 'cabal update' to download it." errOutdatedPackageList repoRemote dt = "The package list for '" ++ remoteRepoName repoRemote ++ "' is " ++ shows (floor dt :: Int) " days old.\nRun " ++ "'cabal update' to get the latest list of available packages." -- | Return the age of the index file in days (as a Double).
2,046
false
true
7
16
612
508
240
268
null
null
siddhanathan/ghc
compiler/utils/Outputable.hs
bsd-3-clause
quotedListWithOr xs = quotedList xs
35
quotedListWithOr xs = quotedList xs
35
quotedListWithOr xs = quotedList xs
35
false
false
0
5
4
12
5
7
null
null
christiaanb/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
tVarPrimTyConName = mkPrimTc (fsLit "TVar#") tVarPrimTyConKey tVarPrimTyCon
87
tVarPrimTyConName = mkPrimTc (fsLit "TVar#") tVarPrimTyConKey tVarPrimTyCon
87
tVarPrimTyConName = mkPrimTc (fsLit "TVar#") tVarPrimTyConKey tVarPrimTyCon
87
false
false
0
7
18
19
9
10
null
null
yusent/cfdis
src/CFDI/Types/Currency.hs
mit
decimalPlaces CUR_SEK = 2
25
decimalPlaces CUR_SEK = 2
25
decimalPlaces CUR_SEK = 2
25
false
false
0
5
3
9
4
5
null
null
gbwey/persistent
persistent-postgresql/Database/Persist/Postgresql.hs
mit
mockMigration :: Migration -> IO () mockMigration mig = do smap <- newIORef $ Map.empty let sqlbackend = SqlBackend { connPrepare = \_ -> do return Statement { stmtFinalize = return () , stmtReset = return () , stmtExecute = undefined , stmtQuery = \_ -> return $ return () }, connInsertManySql = Nothing, connInsertSql = undefined, connUpsertSql = Nothing, connPutManySql = Nothing, connStmtMap = smap, connClose = undefined, connMigrateSql = mockMigrate, connBegin = undefined, connCommit = undefined, connRollback = undefined, connEscapeName = escape, connNoLimit = undefined, connRDBMS = undefined, connLimitOffset = undefined, connLogFunc = undefined, connMaxParams = Nothing, connRepsertManySql = Nothing } result = runReaderT $ runWriterT $ runWriterT mig resp <- result sqlbackend mapM_ T.putStrLn $ map snd $ snd resp
1,687
mockMigration :: Migration -> IO () mockMigration mig = do smap <- newIORef $ Map.empty let sqlbackend = SqlBackend { connPrepare = \_ -> do return Statement { stmtFinalize = return () , stmtReset = return () , stmtExecute = undefined , stmtQuery = \_ -> return $ return () }, connInsertManySql = Nothing, connInsertSql = undefined, connUpsertSql = Nothing, connPutManySql = Nothing, connStmtMap = smap, connClose = undefined, connMigrateSql = mockMigrate, connBegin = undefined, connCommit = undefined, connRollback = undefined, connEscapeName = escape, connNoLimit = undefined, connRDBMS = undefined, connLimitOffset = undefined, connLogFunc = undefined, connMaxParams = Nothing, connRepsertManySql = Nothing } result = runReaderT $ runWriterT $ runWriterT mig resp <- result sqlbackend mapM_ T.putStrLn $ map snd $ snd resp
1,687
mockMigration mig = do smap <- newIORef $ Map.empty let sqlbackend = SqlBackend { connPrepare = \_ -> do return Statement { stmtFinalize = return () , stmtReset = return () , stmtExecute = undefined , stmtQuery = \_ -> return $ return () }, connInsertManySql = Nothing, connInsertSql = undefined, connUpsertSql = Nothing, connPutManySql = Nothing, connStmtMap = smap, connClose = undefined, connMigrateSql = mockMigrate, connBegin = undefined, connCommit = undefined, connRollback = undefined, connEscapeName = escape, connNoLimit = undefined, connRDBMS = undefined, connLimitOffset = undefined, connLogFunc = undefined, connMaxParams = Nothing, connRepsertManySql = Nothing } result = runReaderT $ runWriterT $ runWriterT mig resp <- result sqlbackend mapM_ T.putStrLn $ map snd $ snd resp
1,651
false
true
0
21
983
264
148
116
null
null
ekmett/indexed
examples/FH.hs
bsd-3-clause
fhOpen :: FilePath -> (Free FH FHSTATE) FClosed fhOpen f = Free $ FHOpen f Return
81
fhOpen :: FilePath -> (Free FH FHSTATE) FClosed fhOpen f = Free $ FHOpen f Return
81
fhOpen f = Free $ FHOpen f Return
33
false
true
0
8
15
38
18
20
null
null
asr/apia
src/Apia/ATPs.hs
mit
- Metis 2.4 (release 20180301). atpProvedMsg Metis = "SZS status Theorem"
74
atpProvedMsg Metis = "SZS status Theorem"
41
atpProvedMsg Metis = "SZS status Theorem"
41
true
false
2
8
11
26
12
14
null
null
nau/lasca-compiler
src/lib/Lasca/EmitStatic.hs
bsd-3-clause
cgen ctx (S.Apply meta expr args) = cgenApply ctx meta expr args
64
cgen ctx (S.Apply meta expr args) = cgenApply ctx meta expr args
64
cgen ctx (S.Apply meta expr args) = cgenApply ctx meta expr args
64
false
false
0
8
11
32
15
17
null
null
holoed/Junior
src/BaseParsers.hs
apache-2.0
digit :: Parser Char digit = sat isDigit
40
digit :: Parser Char digit = sat isDigit
40
digit = sat isDigit
19
false
true
0
6
7
23
9
14
null
null
zhangjiji/real-world-haskell
ch25/A.hs
mit
mean :: [Double] -> Double mean xs = sum xs / fromIntegral (length xs)
70
mean :: [Double] -> Double mean xs = sum xs / fromIntegral (length xs)
70
mean xs = sum xs / fromIntegral (length xs)
43
false
true
0
8
13
37
18
19
null
null
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
specTyConKey :: Unique specTyConKey = mkPreludeTyConUnique 180
62
specTyConKey :: Unique specTyConKey = mkPreludeTyConUnique 180
62
specTyConKey = mkPreludeTyConUnique 180
39
false
true
0
6
6
20
8
12
null
null
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss/Graphics/Gloss/Data/ViewState.hs
mit
-- | Zoom out a `ViewState` by the scale step. controlZoomOut :: ViewState -> ViewState controlZoomOut viewState@ViewState { viewStateViewPort = port , viewStateScaleStep = scaleStep } = viewState { viewStateViewPort = port { viewPortScale = viewPortScale port / scaleStep } }
332
controlZoomOut :: ViewState -> ViewState controlZoomOut viewState@ViewState { viewStateViewPort = port , viewStateScaleStep = scaleStep } = viewState { viewStateViewPort = port { viewPortScale = viewPortScale port / scaleStep } }
285
controlZoomOut viewState@ViewState { viewStateViewPort = port , viewStateScaleStep = scaleStep } = viewState { viewStateViewPort = port { viewPortScale = viewPortScale port / scaleStep } }
244
true
true
0
10
96
61
34
27
null
null
nh2/shake
Development/Shake/Types.hs
bsd-3-clause
-- | The default set of 'ShakeOptions'. shakeOptions :: ShakeOptions shakeOptions = ShakeOptions ".shake" 1 "1" Normal False Nothing False (Just 10) Nothing [] False True False (const $ return ()) (const $ BS.putStrLn . BS.pack)
236
shakeOptions :: ShakeOptions shakeOptions = ShakeOptions ".shake" 1 "1" Normal False Nothing False (Just 10) Nothing [] False True False (const $ return ()) (const $ BS.putStrLn . BS.pack)
196
shakeOptions = ShakeOptions ".shake" 1 "1" Normal False Nothing False (Just 10) Nothing [] False True False (const $ return ()) (const $ BS.putStrLn . BS.pack)
167
true
true
0
9
43
87
41
46
null
null
d0kt0r0/InnerEar
src/InnerEar/Widgets/Navigation.hs
gpl-3.0
navigationPage sysResources responses currentRole stores (ExercisePage FiveBandBoostCut) = runExerciseForNavigationPage sysResources fiveBandBoostCutExercise responses currentRole stores
188
navigationPage sysResources responses currentRole stores (ExercisePage FiveBandBoostCut) = runExerciseForNavigationPage sysResources fiveBandBoostCutExercise responses currentRole stores
188
navigationPage sysResources responses currentRole stores (ExercisePage FiveBandBoostCut) = runExerciseForNavigationPage sysResources fiveBandBoostCutExercise responses currentRole stores
188
false
false
0
7
15
35
16
19
null
null
jsavatgy/hatupist
hatupist-104.hs
gpl-2.0
createFrame container title fileName = do box <- vBoxNew False 0 image <- imageNewFromFile fileName boxPackStart box image PackNatural 0 label <- labelNew (Just (title ++ "\n" ++ fileName)) miscSetAlignment label 0 0 miscSetPadding label 10 0 labelSetSelectable label True eventbox <- eventBoxNew containerAdd eventbox label boxPackStart box eventbox PackNatural 0 widgetModifyBg eventbox StateNormal (toGtkColor white) boxPackStart container box PackNatural 10
490
createFrame container title fileName = do box <- vBoxNew False 0 image <- imageNewFromFile fileName boxPackStart box image PackNatural 0 label <- labelNew (Just (title ++ "\n" ++ fileName)) miscSetAlignment label 0 0 miscSetPadding label 10 0 labelSetSelectable label True eventbox <- eventBoxNew containerAdd eventbox label boxPackStart box eventbox PackNatural 0 widgetModifyBg eventbox StateNormal (toGtkColor white) boxPackStart container box PackNatural 10
490
createFrame container title fileName = do box <- vBoxNew False 0 image <- imageNewFromFile fileName boxPackStart box image PackNatural 0 label <- labelNew (Just (title ++ "\n" ++ fileName)) miscSetAlignment label 0 0 miscSetPadding label 10 0 labelSetSelectable label True eventbox <- eventBoxNew containerAdd eventbox label boxPackStart box eventbox PackNatural 0 widgetModifyBg eventbox StateNormal (toGtkColor white) boxPackStart container box PackNatural 10
490
false
false
0
13
89
157
67
90
null
null
brendanhay/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Create.hs
mpl-2.0
-- | OAuth access token. ccAccessToken :: Lens' CoursesCreate (Maybe Text) ccAccessToken = lens _ccAccessToken (\ s a -> s{_ccAccessToken = a})
151
ccAccessToken :: Lens' CoursesCreate (Maybe Text) ccAccessToken = lens _ccAccessToken (\ s a -> s{_ccAccessToken = a})
126
ccAccessToken = lens _ccAccessToken (\ s a -> s{_ccAccessToken = a})
76
true
true
0
9
29
46
25
21
null
null
vkomenda/CoALP
lib/CoALP/Derivation.hs
lgpl-3.0
initDerivation :: Hashable n => n -> (n -> [(e, n)]) -> (Context n e -> Gr n e -> Observ v) -> Derivation n e v initDerivation t f h = Derivation { derivation = Graph.mkGraph [(0, t)] [] , derivationNodes = HashMap.singleton t 0 , derivationQueue = [0] , derivationStep = f , derivationObserv = h , derivationMaxSize = 10000 }
397
initDerivation :: Hashable n => n -> (n -> [(e, n)]) -> (Context n e -> Gr n e -> Observ v) -> Derivation n e v initDerivation t f h = Derivation { derivation = Graph.mkGraph [(0, t)] [] , derivationNodes = HashMap.singleton t 0 , derivationQueue = [0] , derivationStep = f , derivationObserv = h , derivationMaxSize = 10000 }
397
initDerivation t f h = Derivation { derivation = Graph.mkGraph [(0, t)] [] , derivationNodes = HashMap.singleton t 0 , derivationQueue = [0] , derivationStep = f , derivationObserv = h , derivationMaxSize = 10000 }
249
false
true
0
12
133
154
83
71
null
null
eryx67/haskell-libtorrent
src/Network/Libtorrent/Alert.hs
bsd-3-clause
scrapeReplyAlertIncomplete :: MonadIO m => ScrapeReplyAlert -> m CInt scrapeReplyAlertIncomplete ho = liftIO . withPtr (SubAlert ho) $ \hoPtr -> [CU.exp| int { $(scrape_reply_alert * hoPtr)->incomplete } |]
210
scrapeReplyAlertIncomplete :: MonadIO m => ScrapeReplyAlert -> m CInt scrapeReplyAlertIncomplete ho = liftIO . withPtr (SubAlert ho) $ \hoPtr -> [CU.exp| int { $(scrape_reply_alert * hoPtr)->incomplete } |]
210
scrapeReplyAlertIncomplete ho = liftIO . withPtr (SubAlert ho) $ \hoPtr -> [CU.exp| int { $(scrape_reply_alert * hoPtr)->incomplete } |]
140
false
true
0
9
31
56
29
27
null
null
amulcahy/LambdaMC
src/DgAndr.hs
mit
spinnerSetSelection :: Text -> JObject -> JNI () spinnerSetSelection txt sp = do jtxt <- newString txt jadapter <- callObjectMethod sp (jmethodid absSpinnerClass "getAdapter" "()Landroid/widget/SpinnerAdapter;") [] jid <- callIntMethod jadapter (jmethodid arrayAdapterClass "getPosition" "(Ljava/lang/Object;)I") [jv jtxt] callVoidMethod sp (jmethodid spinnerClass "setSelection" "(I)V") [jv jid]
444
spinnerSetSelection :: Text -> JObject -> JNI () spinnerSetSelection txt sp = do jtxt <- newString txt jadapter <- callObjectMethod sp (jmethodid absSpinnerClass "getAdapter" "()Landroid/widget/SpinnerAdapter;") [] jid <- callIntMethod jadapter (jmethodid arrayAdapterClass "getPosition" "(Ljava/lang/Object;)I") [jv jtxt] callVoidMethod sp (jmethodid spinnerClass "setSelection" "(I)V") [jv jid]
444
spinnerSetSelection txt sp = do jtxt <- newString txt jadapter <- callObjectMethod sp (jmethodid absSpinnerClass "getAdapter" "()Landroid/widget/SpinnerAdapter;") [] jid <- callIntMethod jadapter (jmethodid arrayAdapterClass "getPosition" "(Ljava/lang/Object;)I") [jv jtxt] callVoidMethod sp (jmethodid spinnerClass "setSelection" "(I)V") [jv jid]
355
false
true
0
11
91
126
57
69
null
null
Chattered/PhilEdCommon
Philed/Data/NNeg.hs
mit
fromWord :: Word -> NNeg Word fromWord = NNeg
45
fromWord :: Word -> NNeg Word fromWord = NNeg
45
fromWord = NNeg
15
false
true
0
6
8
18
9
9
null
null
jwodder/Chess.hs
tests/pgnEnd.hs
mit
printBoard :: Board -> IO () printBoard b = putStrLn inter >> mapM_ (\r -> putStrLn $ '|' : concat [maybe (sp:sp:"|") (($ sp:"|") . showsPiece') $ getSquare b (f,r) | f <- [FileA .. FileH], let sp = if (fromEnum r `xor` fromEnum f) .&. 1 == 0 then '▒' else ' '] ++ '\n' : inter) [Rank8, Rank7 .. Rank1] >> putChar '\n' where inter = "+--+--+--+--+--+--+--+--+"
367
printBoard :: Board -> IO () printBoard b = putStrLn inter >> mapM_ (\r -> putStrLn $ '|' : concat [maybe (sp:sp:"|") (($ sp:"|") . showsPiece') $ getSquare b (f,r) | f <- [FileA .. FileH], let sp = if (fromEnum r `xor` fromEnum f) .&. 1 == 0 then '▒' else ' '] ++ '\n' : inter) [Rank8, Rank7 .. Rank1] >> putChar '\n' where inter = "+--+--+--+--+--+--+--+--+"
367
printBoard b = putStrLn inter >> mapM_ (\r -> putStrLn $ '|' : concat [maybe (sp:sp:"|") (($ sp:"|") . showsPiece') $ getSquare b (f,r) | f <- [FileA .. FileH], let sp = if (fromEnum r `xor` fromEnum f) .&. 1 == 0 then '▒' else ' '] ++ '\n' : inter) [Rank8, Rank7 .. Rank1] >> putChar '\n' where inter = "+--+--+--+--+--+--+--+--+"
338
false
true
3
22
75
200
101
99
null
null
triplepointfive/hogldev
tutorial13/Tutorial13.hs
mit
initializeGlutCallbacks :: BufferObject -> BufferObject -> UniformLocation -> IORef GLfloat -> IO () initializeGlutCallbacks vbo ibo gWorldLocation gScale = do displayCallback $= renderSceneCB vbo ibo gWorldLocation gScale idleCallback $= Just (idleCB gScale)
366
initializeGlutCallbacks :: BufferObject -> BufferObject -> UniformLocation -> IORef GLfloat -> IO () initializeGlutCallbacks vbo ibo gWorldLocation gScale = do displayCallback $= renderSceneCB vbo ibo gWorldLocation gScale idleCallback $= Just (idleCB gScale)
366
initializeGlutCallbacks vbo ibo gWorldLocation gScale = do displayCallback $= renderSceneCB vbo ibo gWorldLocation gScale idleCallback $= Just (idleCB gScale)
169
false
true
0
10
138
76
35
41
null
null
jthornber/xdrgen
Data/XDR/PrettyPrintRpc.hs
gpl-3.0
ppFuncSig :: String -> TypedefInternal -> Doc ppFuncSig n ti = text "bool_t" <$> text ("xdr_" ++ n) <> ppFuncParam n ti
123
ppFuncSig :: String -> TypedefInternal -> Doc ppFuncSig n ti = text "bool_t" <$> text ("xdr_" ++ n) <> ppFuncParam n ti
123
ppFuncSig n ti = text "bool_t" <$> text ("xdr_" ++ n) <> ppFuncParam n ti
77
false
true
0
9
25
50
24
26
null
null
deepakjois/hs-logo
src/Logo/Evaluator.hs
bsd-3-clause
evalFinal (VarLiteral v) = lookupVar v
38
evalFinal (VarLiteral v) = lookupVar v
38
evalFinal (VarLiteral v) = lookupVar v
38
false
false
0
6
5
19
8
11
null
null
brendanhay/gogol
gogol-file/gen/Network/Google/File/Types/Product.hs
mpl-2.0
-- | Creates a value of 'LocationMetadata' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'lmAddtional' locationMetadata :: HashMap Text JSONValue -- ^ 'lmAddtional' -> LocationMetadata locationMetadata pLmAddtional_ = LocationMetadata' {_lmAddtional = _Coerce # pLmAddtional_}
373
locationMetadata :: HashMap Text JSONValue -- ^ 'lmAddtional' -> LocationMetadata locationMetadata pLmAddtional_ = LocationMetadata' {_lmAddtional = _Coerce # pLmAddtional_}
183
locationMetadata pLmAddtional_ = LocationMetadata' {_lmAddtional = _Coerce # pLmAddtional_}
93
true
true
0
7
62
41
24
17
null
null
brendanhay/amazonka-limited
src/Network/AWS/Internal/Types.hs
mpl-2.0
getRegion :: AWS Region getRegion = awsRegion <$> getEnv
56
getRegion :: AWS Region getRegion = awsRegion <$> getEnv
56
getRegion = awsRegion <$> getEnv
32
false
true
0
5
8
18
9
9
null
null
bgamari/shaking-up-ghc
src/Base.hs
bsd-3-clause
-- | Path to the package database for the given stage of GHC, -- relative to the build root. relativePackageDbPath :: Stage -> FilePath relativePackageDbPath stage = stageString stage -/- "lib" -/- "package.conf.d"
216
relativePackageDbPath :: Stage -> FilePath relativePackageDbPath stage = stageString stage -/- "lib" -/- "package.conf.d"
121
relativePackageDbPath stage = stageString stage -/- "lib" -/- "package.conf.d"
78
true
true
0
7
34
31
16
15
null
null
green-haskell/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
exprIsWorkFree :: CoreExpr -> Bool -- See Note [exprIsWorkFree] exprIsWorkFree e = go 0 e where -- n is the number of value arguments go _ (Lit {}) = True go _ (Type {}) = True go _ (Coercion {}) = True go n (Cast e _) = go n e go n (Case scrut _ _ alts) = foldl (&&) (exprIsWorkFree scrut) [ go n rhs | (_,_,rhs) <- alts ] -- See Note [Case expressions are work-free] go _ (Let {}) = False go n (Var v) = isCheapApp v n go n (Tick t e) | tickishCounts t = False | otherwise = go n e go n (Lam x e) | isRuntimeVar x = n==0 || go (n-1) e | otherwise = go n e go n (App f e) | isRuntimeArg e = exprIsWorkFree e && go (n+1) f | otherwise = go n f {- Note [Case expressions are work-free] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Are case-expressions work-free? Consider let v = case x of (p,q) -> p go = \y -> ...case v of ... Should we inline 'v' at its use site inside the loop? At the moment we do. I experimented with saying that case are *not* work-free, but that increased allocation slightly. It's a fairly small effect, and at the moment we go for the slightly more aggressive version which treats (case x of ....) as work-free if the alternatives are. Note [exprIsCheap] See also Note [Interaction of exprIsCheap and lone variables] ~~~~~~~~~~~~~~~~~~ in CoreUnfold.lhs @exprIsCheap@ looks at a Core expression and returns \tr{True} if it is obviously in weak head normal form, or is cheap to get to WHNF. [Note that that's not the same as exprIsDupable; an expression might be big, and hence not dupable, but still cheap.] By ``cheap'' we mean a computation we're willing to: push inside a lambda, or inline at more than one place That might mean it gets evaluated more than once, instead of being shared. The main examples of things which aren't WHNF but are ``cheap'' are: * case e of pi -> ei (where e, and all the ei are cheap) * let x = e in b (where e and b are cheap) * op x1 ... xn (where op is a cheap primitive operator) * error "foo" (because we are happy to substitute it inside a lambda) Notice that a variable is considered 'cheap': we can push it inside a lambda, because sharing will make sure it is only evaluated once. Note [exprIsCheap and exprIsHNF] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note that exprIsHNF does not imply exprIsCheap. Eg let x = fac 20 in Just x This responds True to exprIsHNF (you can discard a seq), but False to exprIsCheap. -}
2,788
exprIsWorkFree :: CoreExpr -> Bool exprIsWorkFree e = go 0 e where -- n is the number of value arguments go _ (Lit {}) = True go _ (Type {}) = True go _ (Coercion {}) = True go n (Cast e _) = go n e go n (Case scrut _ _ alts) = foldl (&&) (exprIsWorkFree scrut) [ go n rhs | (_,_,rhs) <- alts ] -- See Note [Case expressions are work-free] go _ (Let {}) = False go n (Var v) = isCheapApp v n go n (Tick t e) | tickishCounts t = False | otherwise = go n e go n (Lam x e) | isRuntimeVar x = n==0 || go (n-1) e | otherwise = go n e go n (App f e) | isRuntimeArg e = exprIsWorkFree e && go (n+1) f | otherwise = go n f {- Note [Case expressions are work-free] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Are case-expressions work-free? Consider let v = case x of (p,q) -> p go = \y -> ...case v of ... Should we inline 'v' at its use site inside the loop? At the moment we do. I experimented with saying that case are *not* work-free, but that increased allocation slightly. It's a fairly small effect, and at the moment we go for the slightly more aggressive version which treats (case x of ....) as work-free if the alternatives are. Note [exprIsCheap] See also Note [Interaction of exprIsCheap and lone variables] ~~~~~~~~~~~~~~~~~~ in CoreUnfold.lhs @exprIsCheap@ looks at a Core expression and returns \tr{True} if it is obviously in weak head normal form, or is cheap to get to WHNF. [Note that that's not the same as exprIsDupable; an expression might be big, and hence not dupable, but still cheap.] By ``cheap'' we mean a computation we're willing to: push inside a lambda, or inline at more than one place That might mean it gets evaluated more than once, instead of being shared. The main examples of things which aren't WHNF but are ``cheap'' are: * case e of pi -> ei (where e, and all the ei are cheap) * let x = e in b (where e and b are cheap) * op x1 ... xn (where op is a cheap primitive operator) * error "foo" (because we are happy to substitute it inside a lambda) Notice that a variable is considered 'cheap': we can push it inside a lambda, because sharing will make sure it is only evaluated once. Note [exprIsCheap and exprIsHNF] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note that exprIsHNF does not imply exprIsCheap. Eg let x = fac 20 in Just x This responds True to exprIsHNF (you can discard a seq), but False to exprIsCheap. -}
2,759
exprIsWorkFree e = go 0 e where -- n is the number of value arguments go _ (Lit {}) = True go _ (Type {}) = True go _ (Coercion {}) = True go n (Cast e _) = go n e go n (Case scrut _ _ alts) = foldl (&&) (exprIsWorkFree scrut) [ go n rhs | (_,_,rhs) <- alts ] -- See Note [Case expressions are work-free] go _ (Let {}) = False go n (Var v) = isCheapApp v n go n (Tick t e) | tickishCounts t = False | otherwise = go n e go n (Lam x e) | isRuntimeVar x = n==0 || go (n-1) e | otherwise = go n e go n (App f e) | isRuntimeArg e = exprIsWorkFree e && go (n+1) f | otherwise = go n f {- Note [Case expressions are work-free] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Are case-expressions work-free? Consider let v = case x of (p,q) -> p go = \y -> ...case v of ... Should we inline 'v' at its use site inside the loop? At the moment we do. I experimented with saying that case are *not* work-free, but that increased allocation slightly. It's a fairly small effect, and at the moment we go for the slightly more aggressive version which treats (case x of ....) as work-free if the alternatives are. Note [exprIsCheap] See also Note [Interaction of exprIsCheap and lone variables] ~~~~~~~~~~~~~~~~~~ in CoreUnfold.lhs @exprIsCheap@ looks at a Core expression and returns \tr{True} if it is obviously in weak head normal form, or is cheap to get to WHNF. [Note that that's not the same as exprIsDupable; an expression might be big, and hence not dupable, but still cheap.] By ``cheap'' we mean a computation we're willing to: push inside a lambda, or inline at more than one place That might mean it gets evaluated more than once, instead of being shared. The main examples of things which aren't WHNF but are ``cheap'' are: * case e of pi -> ei (where e, and all the ei are cheap) * let x = e in b (where e and b are cheap) * op x1 ... xn (where op is a cheap primitive operator) * error "foo" (because we are happy to substitute it inside a lambda) Notice that a variable is considered 'cheap': we can push it inside a lambda, because sharing will make sure it is only evaluated once. Note [exprIsCheap and exprIsHNF] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note that exprIsHNF does not imply exprIsCheap. Eg let x = fac 20 in Just x This responds True to exprIsHNF (you can discard a seq), but False to exprIsCheap. -}
2,724
true
true
18
12
873
350
182
168
null
null
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Locations/Buckets/Patch.hs
mpl-2.0
-- | Required. Field mask that specifies the fields in bucket that need an -- update. A bucket field will be overwritten if, and only if, it is in the -- update mask. name and output only fields cannot be updated.For a -- detailed FieldMask definition, see -- https:\/\/developers.google.com\/protocol-buffers\/docs\/reference\/google.protobuf#google.protobuf.FieldMaskExample: -- updateMask=retention_days. lbpUpdateMask :: Lens' LocationsBucketsPatch (Maybe GFieldMask) lbpUpdateMask = lens _lbpUpdateMask (\ s a -> s{_lbpUpdateMask = a})
548
lbpUpdateMask :: Lens' LocationsBucketsPatch (Maybe GFieldMask) lbpUpdateMask = lens _lbpUpdateMask (\ s a -> s{_lbpUpdateMask = a})
140
lbpUpdateMask = lens _lbpUpdateMask (\ s a -> s{_lbpUpdateMask = a})
76
true
true
0
9
75
53
30
23
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/original/TAMInterpreter.hs
bsd-3-clause
pop :: TAMState -> Either String (MTInt, TAMState) pop s@(TAMState {tsST = st, tsStk = x : stk}) = Right (x, s {tsST = st - 1, tsStk = stk})
145
pop :: TAMState -> Either String (MTInt, TAMState) pop s@(TAMState {tsST = st, tsStk = x : stk}) = Right (x, s {tsST = st - 1, tsStk = stk})
145
pop s@(TAMState {tsST = st, tsStk = x : stk}) = Right (x, s {tsST = st - 1, tsStk = stk})
94
false
true
0
11
34
81
46
35
null
null
bgamari/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
acute 'O' = "Ó"
15
acute 'O' = "Ó"
15
acute 'O' = "Ó"
15
false
false
1
5
3
13
4
9
null
null
danr/hipspec
tfp1/tests/PuoF.hs
gpl-3.0
(==),(/=) :: Nat -> Nat -> Bool Z == Z = True
49
(==),(/=) :: Nat -> Nat -> Bool Z == Z = True
49
Z == Z = True
17
false
true
2
9
15
37
18
19
null
null
emmanueltouzery/imprint
src/SettingsWindowData.hs
mit
placeHolders :: [PlaceHolder] placeHolders = [ PlaceHolder (__ "File name") "%file" "%file", PlaceHolder (__ "Folder name") "%folder" "%folder", PlaceHolder (__ "Folder hierarchy") "%folderhier" "%folderhier", PlaceHolder (__ "Date") "%date{%x}" "%date{%x}", PlaceHolder (__ "Date and time") "%date{%x %R}" "%date{%x %R}", PlaceHolder (__ "Date and time, seconds") "%date{%x %X}" "%date{%x %X}", PlaceHolder (__ "Exposition time") "%expo" "%expo", PlaceHolder (__ "Aperture") "%aper" "f/%aper", PlaceHolder (__ "ISO") "%iso" "ISO %iso", PlaceHolder (__ "Exposure bias") "%expo_bias" "%expo_bias", PlaceHolder (__ "Make") "%make" "%make", PlaceHolder (__ "Model") "%model" "%model", PlaceHolder (__ "Software") "%soft" "%soft", PlaceHolder (__ "Copyright") "%copy" "©%copy", PlaceHolder (__ "Focal length (35mm)") "%focal35" "%focal35mm" ]
902
placeHolders :: [PlaceHolder] placeHolders = [ PlaceHolder (__ "File name") "%file" "%file", PlaceHolder (__ "Folder name") "%folder" "%folder", PlaceHolder (__ "Folder hierarchy") "%folderhier" "%folderhier", PlaceHolder (__ "Date") "%date{%x}" "%date{%x}", PlaceHolder (__ "Date and time") "%date{%x %R}" "%date{%x %R}", PlaceHolder (__ "Date and time, seconds") "%date{%x %X}" "%date{%x %X}", PlaceHolder (__ "Exposition time") "%expo" "%expo", PlaceHolder (__ "Aperture") "%aper" "f/%aper", PlaceHolder (__ "ISO") "%iso" "ISO %iso", PlaceHolder (__ "Exposure bias") "%expo_bias" "%expo_bias", PlaceHolder (__ "Make") "%make" "%make", PlaceHolder (__ "Model") "%model" "%model", PlaceHolder (__ "Software") "%soft" "%soft", PlaceHolder (__ "Copyright") "%copy" "©%copy", PlaceHolder (__ "Focal length (35mm)") "%focal35" "%focal35mm" ]
902
placeHolders = [ PlaceHolder (__ "File name") "%file" "%file", PlaceHolder (__ "Folder name") "%folder" "%folder", PlaceHolder (__ "Folder hierarchy") "%folderhier" "%folderhier", PlaceHolder (__ "Date") "%date{%x}" "%date{%x}", PlaceHolder (__ "Date and time") "%date{%x %R}" "%date{%x %R}", PlaceHolder (__ "Date and time, seconds") "%date{%x %X}" "%date{%x %X}", PlaceHolder (__ "Exposition time") "%expo" "%expo", PlaceHolder (__ "Aperture") "%aper" "f/%aper", PlaceHolder (__ "ISO") "%iso" "ISO %iso", PlaceHolder (__ "Exposure bias") "%expo_bias" "%expo_bias", PlaceHolder (__ "Make") "%make" "%make", PlaceHolder (__ "Model") "%model" "%model", PlaceHolder (__ "Software") "%soft" "%soft", PlaceHolder (__ "Copyright") "%copy" "©%copy", PlaceHolder (__ "Focal length (35mm)") "%focal35" "%focal35mm" ]
872
false
true
0
8
162
254
128
126
null
null
snoyberg/ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
lookupLocalRdrEnv :: LocalRdrEnv -> RdrName -> Maybe Name lookupLocalRdrEnv (LRE { lre_env = env, lre_in_scope = ns }) rdr | Unqual occ <- rdr = lookupOccEnv env occ -- See Note [Local bindings with Exact Names] | Exact name <- rdr , name `elemNameSet` ns = Just name | otherwise = Nothing
307
lookupLocalRdrEnv :: LocalRdrEnv -> RdrName -> Maybe Name lookupLocalRdrEnv (LRE { lre_env = env, lre_in_scope = ns }) rdr | Unqual occ <- rdr = lookupOccEnv env occ -- See Note [Local bindings with Exact Names] | Exact name <- rdr , name `elemNameSet` ns = Just name | otherwise = Nothing
307
lookupLocalRdrEnv (LRE { lre_env = env, lre_in_scope = ns }) rdr | Unqual occ <- rdr = lookupOccEnv env occ -- See Note [Local bindings with Exact Names] | Exact name <- rdr , name `elemNameSet` ns = Just name | otherwise = Nothing
249
false
true
0
9
69
107
52
55
null
null
isomorphism/csound-expression
src/Csound/Air/Misc.hs
bsd-3-clause
genConga :: D -> TrSpec -> SE Sig genConga dt spec = rndAmp =<< addDur =<< asig where dur = trDur spec tune = trTune spec cps = trCps spec ifrq = cps * octave tune fullDur = dt * dur aenv = transeg [0.7,1/ifrq,1,1,fullDur,-6,0.001] afmod = expsega [3,0.25/ifrq,1] asig = mul (-0.25 * aenv) $ rndOsc (sig ifrq * afmod)
399
genConga :: D -> TrSpec -> SE Sig genConga dt spec = rndAmp =<< addDur =<< asig where dur = trDur spec tune = trTune spec cps = trCps spec ifrq = cps * octave tune fullDur = dt * dur aenv = transeg [0.7,1/ifrq,1,1,fullDur,-6,0.001] afmod = expsega [3,0.25/ifrq,1] asig = mul (-0.25 * aenv) $ rndOsc (sig ifrq * afmod)
399
genConga dt spec = rndAmp =<< addDur =<< asig where dur = trDur spec tune = trTune spec cps = trCps spec ifrq = cps * octave tune fullDur = dt * dur aenv = transeg [0.7,1/ifrq,1,1,fullDur,-6,0.001] afmod = expsega [3,0.25/ifrq,1] asig = mul (-0.25 * aenv) $ rndOsc (sig ifrq * afmod)
365
false
true
7
10
142
176
91
85
null
null
markuspf/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
processLibs :: Archive -> Idris () processLibs ar = do ls <- getEntry [] "ibc_libs" ar mapM_ (uncurry addLib) ls
120
processLibs :: Archive -> Idris () processLibs ar = do ls <- getEntry [] "ibc_libs" ar mapM_ (uncurry addLib) ls
120
processLibs ar = do ls <- getEntry [] "ibc_libs" ar mapM_ (uncurry addLib) ls
85
false
true
0
9
27
53
24
29
null
null
pushkinma/frag
src/Game.hs
gpl-2.0
game :: BSPMap -> [ILKey -> Object] -> SF GameInput [ObsObjState] game bspmap objs = loop (game' (case listToILA objs of x -> x) bspmap >>> arr (\ oos -> (oos, oos))) >>> arr (\ oos -> case map ooObsObjState (elemsIL oos) of y -> y)
337
game :: BSPMap -> [ILKey -> Object] -> SF GameInput [ObsObjState] game bspmap objs = loop (game' (case listToILA objs of x -> x) bspmap >>> arr (\ oos -> (oos, oos))) >>> arr (\ oos -> case map ooObsObjState (elemsIL oos) of y -> y)
337
game bspmap objs = loop (game' (case listToILA objs of x -> x) bspmap >>> arr (\ oos -> (oos, oos))) >>> arr (\ oos -> case map ooObsObjState (elemsIL oos) of y -> y)
271
false
true
0
13
150
123
63
60
null
null
ckkashyap/Dancer
Moves.hs
bsd-3-clause
moveLowerLeftLeg :: Double -> Axis -> Pose -> Pose moveLowerLeftLeg diff axis pose = pose { lowerLeftLegAngle = modifyCoordinate3D axis (lowerLeftLegAngle pose) (+ diff) }
171
moveLowerLeftLeg :: Double -> Axis -> Pose -> Pose moveLowerLeftLeg diff axis pose = pose { lowerLeftLegAngle = modifyCoordinate3D axis (lowerLeftLegAngle pose) (+ diff) }
171
moveLowerLeftLeg diff axis pose = pose { lowerLeftLegAngle = modifyCoordinate3D axis (lowerLeftLegAngle pose) (+ diff) }
120
false
true
0
10
24
61
30
31
null
null
juodaspaulius/clafer
src/Language/Clafer/Optimizer/Optimizer.hs
mit
getUniqExtended :: [IClafer] -> [String] getUniqExtended used = nub $ used >>= getExtended
90
getUniqExtended :: [IClafer] -> [String] getUniqExtended used = nub $ used >>= getExtended
90
getUniqExtended used = nub $ used >>= getExtended
49
false
true
0
6
12
32
17
15
null
null