code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
y = f(x1) + g(Foo.x2)
mpickering/hlint-refactor
tests/examples/Bracket38.hs
bsd-3-clause
22
1
8
5
27
12
15
1
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Vimus.Render ( Render , runRender , getWindowSize , addstr , addLine , chgat , withColor -- * exported to silence warnings , Environment (..) -- * exported for testing , fitToColumn ) where import Control.Applicative import Control.Monad.Reader...
haasn/vimus
src/Vimus/Render.hs
mit
2,872
0
20
785
990
509
481
64
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-sqs/gen/Network/AWS/SQS/ReceiveMessage.hs
mpl-2.0
9,521
0
10
1,885
855
538
317
88
1
{-# LANGUAGE CPP, RecordWildCards, GADTs #-} module CmmLayoutStack ( cmmLayoutStack, setInfoTableStackMap ) where import StgCmmUtils ( callerSaveVolatileRegs ) -- XXX layering violation import StgCmmForeign ( saveThreadState, loadThreadState ) -- XXX layering violation import BasicTypes import Cmm im...
tjakway/ghcjvm
compiler/cmm/CmmLayoutStack.hs
bsd-3-clause
42,312
1
25
12,462
7,335
3,924
3,411
510
6
module Main (main) where main :: IO () main = return ()
sonyandy/wart
tools/wartc.hs
bsd-3-clause
57
0
6
13
29
16
13
3
1
{- (c) The University of Glasgow, 2004-2006 Module ~~~~~~~~~~ Simply the name of a module, represented as a FastString. These are Uniquable, hence we can build Maps with Modules as the keys. -} {-# LANGUAGE DeriveDataTypeable #-} module Module ( -- * The ModuleName type ModuleName, pprMo...
green-haskell/ghc
compiler/basicTypes/Module.hs
bsd-3-clause
18,016
0
16
4,292
3,472
1,865
1,607
283
3
{-# LANGUAGE TemplateHaskell, TypeFamilies, DeriveDataTypeable, NamedFieldPuns #-} module Distribution.Server.Features.TarIndexCache.State ( TarIndexCache(..) , initialTarIndexCache , GetTarIndexCache(GetTarIndexCache) , ReplaceTarIndexCache(ReplaceTarIndexCache) , FindTarIndex(FindTarIndex) , SetTarIndex...
ocharles/hackage-server
Distribution/Server/Features/TarIndexCache/State.hs
bsd-3-clause
2,048
0
9
312
499
283
216
54
1
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ViewPatterns #-} module Yesod.Auth.Route...
pikajude/yesod
yesod-auth/Yesod/Auth/Routes.hs
mit
582
0
5
130
49
33
16
-1
-1
{-# LANGUAGE OverloadedStrings #-} module System.Logging.Facade.Journald.Internal where import Data.HashMap.Strict import Data.Monoid import Data.String import qualified Data.Text.Encoding as Text import System.Logging.Facade.Types import Systemd.Journal l...
zalora/logging-facade-journald
src/System/Logging/Facade/Journald/Internal.hs
mit
977
0
14
202
244
133
111
27
5
{-# htermination (^^) :: (Ratio Int) -> Int -> (Ratio Int) #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_CARETCARET_3.hs
mit
63
0
2
12
3
2
1
1
0
module RAE where import Blaze import Tree import Text.Printf import Data.Number.LogFloat (logFloat,fromLogFloat) import Data.List -- Pretty-print expressions showE :: State -> String showE (Node (SNode _ (DoubleDatum d)) [] _) = printf "%0.3f" d showE (Node (SNode _ (StringDatum s)) [] _) =...
othercriteria/blaze
RAE.hs
mit
12,894
0
17
3,767
5,240
2,757
2,483
251
2
module HTML where import Text.Blaze.Html5 hiding (map) import qualified Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes import Data.List import DataTypes import Data.Monoid proof2html :: BinTree DecoratedSequent -> Html proof2html (Leaf lab s) = table $ do tr $ toHtml "" tr $ do td $ hr td ...
gianlucagiorgolo/glue-tp
HTML.hs
mit
2,746
8
14
619
1,168
540
628
90
1
{-| Module : BreadU.Pages.Markup.Common.Utils Description : HTML markup utils. Stability : experimental Portability : POSIX HTML markup utils. -} module BreadU.Pages.Markup.Common.Utils where import Prelude hiding ( span, div ) import Data.Monoid (...
denisshevchenko/breadu.info
src/lib/BreadU/Pages/Markup/Common/Utils.hs
mit
1,433
0
11
397
311
183
128
37
1
module LMH_Interpreter where import LMH_Lex import LMH_Parse import LMH_ExpType import LMH_TypeInference import LMH_Evaluator toString :: Type -> String toString (TypeVar str) = str toString (TypeConst str) = str toString (Arrow (TypeVar str, t)) = str ++ " -> " ++ (toString t) toString (Arrow (TypeConst str,...
jaanos/TPJ-2015-16
lmh/LMH_Interpreter.hs
mit
2,531
7
18
725
795
402
393
59
3
{-# LANGUAGE DeriveGeneric #-} module Bce.RestTypes where import Bce.BlockChain import Bce.Hash import Bce.BlockChainSerialization import Bce.BlockChainHash import GHC.Generics import qualified Data.Set as Set import Data.Aeson hiding (json) data WalletBalance = WalletBalance { outputs :: Set.Set TxOut...
dehun/bce
src/Bce/RestTypes.hs
mit
1,320
0
15
315
347
188
159
36
1
module PythagorianTriple54 where pythagoreanTriple :: Int -> [(Int, Int, Int)] pythagoreanTriple x = if x <= 0 then [] else do a <- [1..x] b <- [1..x] c <- [1..x] let a' = a^3 let b' = b^2 let c' = c^2 if a < b && (a' + b' == c') then "_" else [] return (a,b,c) main' :: IO () main' = do putStrLn "W...
raventid/coursera_learning
haskell/stepik/5.4pythagorian_triple.hs
mit
441
6
17
125
234
118
116
19
3
{-# LANGUAGE TemplateHaskell #-} module Oczor.Parser.ParserState where import Oczor.Syntax.Operators import Control.Lens import Text.Megaparsec.Expr import Control.Monad.State import ClassyPrelude as C hiding (try) import Oczor.Syntax.Syntax import qualified Text.Megaparsec.String as Megaparsec type Parser = StateT Pa...
ptol/oczor
src/Oczor/Parser/ParserState.hs
mit
946
0
11
156
282
161
121
32
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.MessageChannel (js_newMessageChannel, newMessageChannel, js_getPort1, getPort1, js_getPort2, getPort2, MessageChannel, castToMessageChannel, gTypeMessageChannel) where import Prelude ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/MessageChannel.hs
mit
2,189
16
11
264
535
321
214
34
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Language.PureScript.Binding.TH where import Co...
philopon/haskell-purescript-binding
Language/PureScript/Binding/TH.hs
mit
10,545
0
18
2,573
3,180
1,646
1,534
185
6
data Type = T | S | O Type Type deriving Show splits :: [a] -> [([a],[a])] splits ts = zip (inits ts) (tails ts) inits :: [a] -> [[a]] inits [x] = [] inits (x:xs) = map (x:) ([]:inits xs) tails :: [a] -> [[a]] tails [x] = [] tails (x:xs) = xs : tails xs alltypes :: [Type] -> [Type] alltypes [t] = [t] alltypes ts =...
craynafinal/cs557_functional_languages
practice/week4/practice.hs
mit
388
1
8
90
296
155
141
13
1
module Ch22.PodTypes where import Data.Text (Text) data Podcast = Podcast { castId :: Integer , castURL :: Text } deriving (Eq, Show, Read) data Episode = Episode { epId :: Integer , epCast :: Podcast , epURL :: Text , epDone :: Bool } deriving (...
futtetennista/IntroductionToFunctionalProgramming
RWH/src/Ch22/PodTypes.hs
mit
336
0
8
122
100
60
40
12
0
{-# LANGUAGE NoMonomorphismRestriction #-} module Web.HBrowser.Scripting where import qualified Graphics.UI.Gtk.WebKit.WebView as Web import Web.HBrowser.WebMonad import Web.HBrowser.ViewContainer import Control.Monad.Reader import Control.Monad.Trans import Control.Exception import System.IO import System.IO.Error ...
Philonous/hbrowser
src/Web/HBrowser/Scripting.hs
mit
975
0
17
220
259
133
126
26
1
module Model ( module Model.DB , module Model.Open , module Database.Persist ) where import Database.Persist import Model.DB import Model.Open
flipstone/glados
src/Model.hs
mit
153
0
5
29
39
25
14
7
0
{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveGeneric #-} {-# OPTIONS_GHC -Wno-orphans #-} module Instances.Static where import GHC.Generics import Test.QuickCheck.Arbitrary.Generic import Test.QuickCheck.Instances() import Web.Facebook.Messenger ------------ -- STATIC -- ------------ deriving instance ...
Vlix/facebookmessenger
test/Instances/Static.hs
mit
3,015
0
5
414
559
308
251
88
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module Test.Quorums (quorums_tests) where import Hetcons.Hetcons_Exception ( Hetcons_Exception ) import Hetcons.Instances_Proof_of_Consensus () import Hetcons.Signed_Message ( Encodable ,encode ,Recursive_1a(recursive_1a_filled_in)...
isheff/hetcons
test/Test/Quorums.hs
mit
11,892
0
31
5,285
3,266
2,004
1,262
194
1
-- | Framebuffers. You can render on them. -- -- If you come from the OpenGL world, for simplicity, we have combined the -- concept of draw buffers and color attachments. Nth color attachment is bound -- exactly to Nth draw buffer. Caramia only talks about draw buffers. -- -- <https://www.opengl.org/wiki/Framebuffer_Ob...
Noeda/caramia
src/Graphics/Caramia/Framebuffer.hs
mit
11,943
0
23
3,676
2,371
1,218
1,153
234
7
module GiveYouAHead.Help ( helpInfo ) where import System.Environment(getProgName) import GiveYouAHead.Version(gyahver) helpInfo :: IO() helpInfo = getProgName >>= (putStrLn.unlines.helpAll) where helpAll pN = [ "\n", "GiveYouAHead\t\t...
Qinka/GiveYouAHead
lib/GiveYouAHead/Help.hs
mit
1,978
0
9
653
242
142
100
41
1
{-# LANGUAGE OverloadedStrings #-} module CoinApi.Types.Period where import CoinApi.Types.Internal data Period = Period { period_id :: !Text , length_seconds :: !Int , length_months :: !Int , unit_count :: !Int , unit_name ...
coinapi/coinapi-sdk
data-api/haskell-rest/CoinApi/Types/Period.hs
mit
877
0
19
459
149
82
67
30
0
module App where import Network.Wai import Network.Wai.Handler.Warp import Servant.Server -- import qualified Data.ByteString as B import Network.Wai.Middleware.RequestLogger import Greet import Handlers haskapi :: Application haskapi = serve haskApi handlers -- Run the server. -- -- 'run' comes from Network.Wai....
mooreniemi/haskapi
app.hs
mit
413
0
7
58
85
50
35
11
1
{-# LANGUAGE OverloadedStrings #-} module FileCacheSpec (main, spec) where import Test.Hspec import Prelude as P import Control.Monad.IO.Class import Data.Map.Lazy as Map import System.IO.Temp import Data.Conduit import qualified Data.Conduit.List as DCL -- import Data.Conduit.Binary import System.IO import Control.M...
danoctavian/bit-smuggler
BitSmuggler/test/unit/FileCacheSpec.hs
gpl-2.0
1,913
0
21
451
640
329
311
54
1
module Main where import Bio.Core.Sequence import Bio.Sequence.Fasta import Control.Monad(unless) import qualified Data.ByteString.Lazy.Char8 as B import Data.Foldable (forM_) import Data.Monoid import Options.Applicative import System.FilePath.Posix (joinPath, takeBaseName) import System.Directory import System.IO im...
hurwitzlab/kmerizer
Main.hs
gpl-2.0
2,747
0
14
789
774
393
381
64
1
{-# LANGUAGE Rank2Types, MultiWayIf, CPP #-} module Text.Pandoc.CrossRef.References.Blocks ( replaceAll ) where import Text.Pandoc.Definition import Text.Pandoc.Builder (text, toList) import Text.Pandoc.Shared (stringify, normalizeSpaces) import Control.Monad.State hiding (get, modify) import Data.List import Data...
infotroph/pandoc-crossref
lib/Text/Pandoc/CrossRef/References/Blocks.hs
gpl-2.0
10,803
0
23
3,091
3,866
1,959
1,907
246
6
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module Main where import System.Process import Control.Monad.Identity #if MIN_VERSION_optparse_applicative(0,13,0) import Data.Monoid ((<>)) #endif import Data.Yaml hiding (Parser) import Data....
jyp/styx
styx/Main.hs
gpl-2.0
8,489
71
22
2,421
2,055
1,102
953
154
4
{-# LANGUAGE TemplateHaskell, FlexibleInstances, FlexibleContexts, ViewPatterns, RecordWildCards, NamedFieldPuns, ScopedTypeVariables, TypeSynonymInstances, NoMonomorphismRestriction, TupleSections, StandaloneDeriving, GeneralizedNewtypeDeriving #-} module Tetrahedron.Tests where import Tetrahedron import Test.QuickCh...
DanielSchuessler/hstri
Tetrahedron/Tests.hs
gpl-3.0
11,846
0
20
3,253
3,160
1,671
1,489
-1
-1
{-# LANGUAGE OverlappingInstances, EmptyDataDecls, MultiParamTypeClasses, DataKinds, FunctionalDependencies, FlexibleContexts, RankNTypes, TypeSynonymInstances, ScopedTypeVariables, UnicodeSyntax, ...
ejlilley/AbstractMusic
Music.hs
gpl-3.0
44,845
0
17
11,040
17,275
8,943
8,332
787
9
module P20StateTaxSpec (main,spec) where import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck((==>)) import P20StateTax hiding (main) main :: IO () main = hspec spec spec :: Spec spec = do describe "getTaxAmt" $ do prop "has the property of returning 0.005 times amount for wisconsin, eau c...
ciderpunx/57-exercises-for-programmers
test/P20StateTaxSpec.hs
gpl-3.0
4,595
0
16
1,337
1,011
509
502
77
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings, DeriveFunctor #-} module Graphics.UI.Bottle.Widgets.EventMapDoc ( makeView , IsHelpShown(..) , addHelp , makeToggledHelpAdder , Config(..) ) where import Prelude.Compat import qualified Control.Lens as Lens import Control.L...
rvion/lamdu
bottlelib/Graphics/UI/Bottle/Widgets/EventMapDoc.hs
gpl-3.0
7,343
0
21
1,927
2,339
1,273
1,066
-1
-1
import Data.List import Data.Char isPangram :: String -> Bool isPangram str = size == 26 where size = length $ foldl (\y x -> if not (x `elem` y) && isAlpha x then [x] ++ y else y ) [] $ map toUpper str
yannxia-self/code-war-hasekell-training
detect_pangram.hs
gpl-3.0
207
0
14
48
104
55
49
5
2
module Estuary.Widgets.PatternChain where import Reflex import Reflex.Dom import qualified Sound.Tidal.Context as Tidal import Estuary.Tidal.Types import Estuary.Reflex.Container import Estuary.Widgets.Generic import Estuary.Reflex.Utility import Control.Monad import Data.Map -- from Estuary.Tidal.Types: -- data Patt...
Moskau/estuary
Estuary/Widgets/PatternChain.hs
gpl-3.0
1,497
0
17
221
389
200
189
20
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Create.hs
mpl-2.0
7,716
0
17
1,599
817
491
326
115
1
-- This Source Code Form is subject to the terms of the Mozilla Public -- License, v. 2.0. If a copy of the MPL was not distributed with this -- file, You can obtain one at http://mozilla.org/MPL/2.0/. {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-#...
whitehead1415/cql
src/Database/CQL/Protocol/Tuple.hs
mpl-2.0
851
0
5
160
91
63
28
18
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-fusiontables/gen/Network/Google/Resource/FusionTables/Style/Get.hs
mpl-2.0
2,990
0
14
708
404
241
163
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-analytics/gen/Network/Google/Resource/Analytics/Management/CustomMetrics/List.hs
mpl-2.0
4,763
0
18
1,095
592
345
247
92
1
{- Copyright (C) 2009 Andrejs Sisojevs <andrejs.sisojevs@nextmail.ru> All rights reserved. For license and copyright information, see the file COPYRIGHT -} -------------------------------------------------------------------------- -------------------------------------------------------------------------- -- | Taken...
Andrey-Sisoyev/haskell-PCLT
Text/PCLT/Parser/ParserInternals.hs
lgpl-2.1
10,972
0
19
4,388
2,619
1,304
1,315
-1
-1
{-# LANGUAGE TemplateHaskell, TypeOperators #-} module Object.Templates( makeName, makeObject ) where import Object.Letters import Object.Types import Prelude hiding ((.)) import Language.Haskell.TH import Language.Haskell.TH.Syntax import Data.Char import Data.Maybe -- | -- takes lower case 'foo' and makes -- ...
yokto/Object
Object/Templates.hs
apache-2.0
3,482
16
16
659
1,024
541
483
-1
-1
import System.Random -- import Debug.Trace -- uncomment for tracing removeAt :: Int -> [a] -> (a, [a]) removeAt 1 (x:xs) = (x,xs) removeAt n (x:xs) = (a,x:b) where (a,b) = removeAt (n-1) xs rnd_select :: [a] -> Int -> IO [a] rnd_select _ 0 = return [] rnd_select [] _ = return [] rnd_select xs n = randomRIO(1, le...
alephnil/h99
23.hs
apache-2.0
502
0
13
115
259
141
118
11
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.ClusterNetworkList where import GHC.Generics import Data.Text import Openshift.Unversioned.ListMeta import Openshift.V1.ClusterNet...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/ClusterNetworkList.hs
apache-2.0
1,235
0
9
173
125
77
48
19
0
module Language.Livescript.Lexer ( lexeme , identifier , reserved , operator , reservedOp , charLiteral , stringLiteral , natural , integer , float , naturalOrFloat , decimal , hexadecimal , octal , symbol , whiteSpace , parens , braces , bra...
jystic/language-livescript
src/Language/Livescript/Lexer.hs
apache-2.0
2,778
0
8
672
832
451
381
99
1
{- | Module : Codec.Goat.Util Description : Various utility functions Copyright : (c) Daniel Lovasko, 2016-2017 License : BSD3 Maintainer : Daniel Lovasko <daniel.lovasko@gmail.com> Stability : stable Portability : portable Various utility functions used throughout the codebase. -} module Codec.Goat.Ut...
lovasko/goat
src/Codec/Goat/Util.hs
bsd-2-clause
2,857
0
11
745
661
376
285
62
1
{-# LANGUAGE CPP, MultiParamTypeClasses, OverloadedStrings #-} module HTIG.Session ( HSession(HSession) ) where import Control.Applicative ((<$>)) import Control.Monad (forM_, when) import Data.Binary (decodeFile, encodeFile) import Data.List (delete) import Data.Maybe (isJust) import System.Directory (doesFil...
nakamuray/htig
HTIG/Session.hs
bsd-3-clause
6,853
0
26
2,242
2,000
987
1,013
167
2
module Str( Str, linesCR, S.stripPrefix, readFileUTF8, S.null, S.isPrefixOf, S.drop, S.span, S.length, S.toList, S.all, S.uncons, ugly, showLength ) where import qualified Foundation as S import qualified Foundation.String as S import qualified Foundation.IO as S import Data.Tuple.Extra type...
ndmitchell/weeder
str/Str-Foundation.hs
bsd-3-clause
573
0
11
112
203
119
84
18
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} module Game where import Prelude hiding (lookup) import qualified Data.Map.Strict as M import Data.IORef import Data.Maybe import Control.Monad import Linear.V2 import Types lookup :: Ord k => M.Map k v -> k -> Maybe v lookup = flip M.lookup i...
korrix/Warcaby
Game.hs
bsd-3-clause
4,198
0
19
1,468
1,752
894
858
79
11
-- | Main module to manipulate a git repository. module Data.Git( -- * Repository Git , gitRepoPath , openRepo , closeRepo , withRepo , findRepository -- * Most important question ...
Twinside/hit-simple
Data/Git.hs
bsd-3-clause
1,730
0
5
896
179
124
55
44
0
module Program( toCProgram, ILProgram, ilProgram, ILFunction, ilFunc) where import Data.Map as M import CCodeGen import RPN import Syntax data ILProgram = Prog [ILFunction] [RecordDef] deriving (Show) ilProgram = Prog toCProgram :: ILProgram -> CProgram toCProgram (Prog funcs recDefs) = cPro...
dillonhuff/IntLang
src/Program.hs
bsd-3-clause
1,730
0
11
334
562
294
268
36
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE ViewPatterns, PatternSynonyms, RankNTypes #-} module Homework01 ( toDigits, toDigitsRev, myReverse, doubleEveryOther, sumDigits, sumList, sumDigitsFoldWorker, validate, checkSum, hanoi, ) where -- | Convert a number [like 1234] into a ...
jeyoor/haskell-learning-challenge
learn_haskell_github_courses/Cis194/src/Homework01.hs
bsd-3-clause
3,336
0
11
616
799
439
360
53
1
module Candide.Server ( runCandideDaemon ) where import Control.Applicative import Control.Concurrent (threadDelay) import Control.Concurrent.Async import qualified Control.Concurrent.Async.Lifted as AL import Control.Concurrent.MVar import Control.Exc...
anchor/candide
lib/Candide/Server.hs
bsd-3-clause
12,628
4
23
4,394
2,594
1,298
1,296
227
4
module Test4 ( DAbs , DAll(..) , DRecAll(..) , DRec(DRec) -- no fields , DSome(One, Two) , foo , bar ) where foo x = 1 :: Int bar y = 2 :: Int lam :: Int -> Int lam x = 2 * x data DAbs = NotExported data DAll = Me | AndMe data DRec = DRec { drNotExported :: Int } data DRecAll = DRecAll { drA :: Int,...
robinp/nemnem
tsrc/Test4.hs
bsd-3-clause
383
0
8
107
161
99
62
21
1
{-# LANGUAGE ScopedTypeVariables #-} module Sort3Spec where import qualified Sort3 import Test.Hspec (Spec, hspec, describe, shouldSatisfy) import Test.Hspec.QuickCheck (prop) -- | Required for auto-discovery. spec :: Spec spec = describe "Sort3" $ do prop "sort3 sorts correctly" $ do \(triple :: (Int, ...
FranklinChen/twenty-four-days2015-of-hackage
test/Sort3Spec.hs
bsd-3-clause
452
0
17
101
147
82
65
14
1
module Eval(eval) where import Syntax eval :: Expr -> Env -> Value eval (ELit (LInt n)) _ = VInt n eval (ELit (LBool b)) _ = VBool b eval (EOp op e1 e2) env = binop op e1 e2 env eval (EVar x) env = case lookupEnv x env of VThunk (EFix f e) env' -> eval (EFix f e) env' v -> v eval...
succzero/fino
src/Eval.hs
bsd-3-clause
1,511
0
13
506
798
408
390
34
10
{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, CPP #-} {- Note: [The need for Ar.hs] Building `-staticlib` required the presence of libtool, and was a such restricted to mach-o only. As libtool on macOS and gnu libtool are very different, there was no simple portable way to support this. libtool for stati...
sdiehl/ghc
compiler/main/Ar.hs
bsd-3-clause
10,051
0
20
2,713
2,466
1,267
1,199
187
8
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} module DataStore.QueueStore ( enqueue , dequeue , dequeueAll ) where import qualified Da...
bgwines/hueue
src/DataStore/QueueStore.hs
bsd-3-clause
1,597
0
14
270
446
233
213
41
1
------------------------------------------------------------------------------- -- -- | Dynamic flags -- -- Most flags are dynamic flags, which means they can change from compilation -- to compilation using @OPTIONS_GHC@ pragmas, and in a multi-session GHC each -- session can be using different dynamic flags. Dynamic f...
ilyasergey/GHC-XAppFix
compiler/main/DynFlags.hs
bsd-3-clause
111,305
0
28
30,676
21,070
11,946
9,124
1,804
4
module Test.Utils ( testProvider , (@=~?) , (?=~@) , (=~) ) where import qualified Data.Array.Repa as R import qualified Data.Vector.Generic as VG import qualified Data.Vector.Storable as VS import qualified Data.Vector.Unboxed as VU import qualified Test.Frame...
jstolarek/lattice-structure-hs
tests/Test/Utils.hs
bsd-3-clause
2,737
0
12
820
1,147
626
521
-1
-1
module Main where import Data.Monoid input = ".^^.^^^..^.^..^.^^.^^^^.^^.^^...^..^...^^^..^^...^..^^^^^^..^.^^^..^.^^^^.^^^.^...^^^.^^.^^^.^.^^.^." isTrap "^^." = '^' -- Its left and center tiles are traps, but its right tile is not. isTrap ".^^" = '^' -- Its center and right tiles are traps, but its left ...
shapr/adventofcode2016
src/Eighteen/Main.hs
bsd-3-clause
850
0
11
189
235
124
111
15
1
module PrefAttachment (runPrefAttachment) where import Graph import Data.List import System.Random import Test.QuickCheck import qualified Data.IntMap.Strict as Map runPrefAttachment :: Int -> IO ((Graph Int),Int) runPrefAttachment 1 = return ((createGraph 1),0) runPrefAttachment num = let graph = createGraph n...
jbddc/sdc-graph
src/PrefAttachment.hs
bsd-3-clause
726
0
14
145
313
165
148
23
3
{- Euler discovered the remarkable quadratic formula: n^2 + n + 41 It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 40^2 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 41^2 + 41 + 41 is clearly divisible by 41. The incredib...
bgwines/project-euler
src/solved/problem27.hs
bsd-3-clause
1,843
2
13
340
399
232
167
27
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE DeriveGeneric #-} module Main ( main ) where import GHC.Generics ( Generic ) import Criterion.Main import qualified Data.Binary as B import qualified Data.Serialize as S data SerializeMe a = SerializeMe [[(a,[a])]] [[(a,[a])]] [[(a,[a])]] [[(a,[a])]] [[(a,[a])]] [[(a,[a])]] ...
ghorn/binary-counterexample
src/Main.hs
bsd-3-clause
855
0
11
163
368
211
157
22
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------ module Snap.Internal.Http.Server.Session ( httpSession ) where ----------------------------------------------------------------...
afcowie/new-snap-server
src/Snap/Internal/Http/Server/Session.hs
bsd-3-clause
14,889
0
17
5,493
2,223
1,186
1,037
237
6
{-# LANGUAGE PackageImports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS -w #-} module Prelude (print, Base.Int) where import Fay.Types (Fay) import Fay.FFI import qualified "base" Prelude as Base import "base" Prelude ...
faylang/fay-prim
src/Prelude.hs
bsd-3-clause
2,030
0
11
340
479
277
202
36
1
{-# LANGUAGE TemplateHaskell #-} module Main where import qualified Data.Map as M import Network import NetworkedGame.Packet import NetworkedGame.Server import Control.Concurrent import Control.Monad import Control.Lens import Data.Maybe import System.IO import System.Exit import AnimatedDangerzone.Types import Graphi...
glguy/animated-dangerzone
src/GlossClient.hs
bsd-3-clause
4,792
6
17
1,168
1,693
850
843
-1
-1
{-# LANGUAGE CPP, ForeignFunctionInterface, BangPatterns #-} #if __GLASGOW_HASKELL__ {-# LANGUAGE UnliftedFFITypes, MagicHash, UnboxedTuples, DeriveDataTypeable #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Unsafe #-} #endif #endif {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.ByteString.Intern...
jwiegley/ghc-release
libraries/bytestring/Data/ByteString/Internal.hs
gpl-3.0
23,651
0
19
5,633
4,782
2,601
2,181
283
3
main :: Bool -> Bool -> () main = \True False -> ()
roberth/uu-helium
test/staticwarnings/Lambda2.hs
gpl-3.0
53
0
7
14
30
16
14
2
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-swf/gen/Network/AWS/SWF/RespondDecisionTaskCompleted.hs
mpl-2.0
5,522
0
10
1,037
510
314
196
61
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-route53-domains/gen/Network/AWS/Route53Domains/GetDomainDetail.hs
mpl-2.0
15,725
0
32
3,214
2,346
1,406
940
241
1
-- Copyright (c) 2014 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions...
emc2/compiler-misc
src/Control/Monad/SourceFiles/Class.hs
bsd-3-clause
3,514
0
11
725
455
262
193
38
0
-- | Elliptic Curve Arithmetic. -- -- /WARNING:/ These functions are vulnerable to timing attacks. {-# LANGUAGE ScopedTypeVariables #-} module Crypto.ECC.Simple.Prim ( scalarGenerate , scalarFromInteger , pointAdd , pointDouble , pointBaseMul , pointMul , pointAddTwoMuls , pointFromInteg...
tekul/cryptonite
Crypto/ECC/Simple/Prim.hs
bsd-3-clause
7,400
0
24
2,197
2,275
1,196
1,079
133
5
module Koan where allEnrolled :: Bool allEnrolled = False
Kheldar/hw-koans
koan/Koan.hs
bsd-3-clause
59
0
4
10
14
9
5
3
1
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, PatternGuards #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.Mosaic -- Copyright : (c) 2009 Adam Vogt, 2007 James Webb -- License : BSD-style (see xmonad/LICENSE) --...
adinapoli/xmonad-contrib
XMonad/Layout/Mosaic.hs
bsd-3-clause
7,814
0
18
1,934
2,449
1,321
1,128
118
1
module Options.OptimizationLevels where import Types optimizationLevelsOptions :: [Flag] optimizationLevelsOptions = [ flag { flagName = "-O0" , flagDescription = "Disable optimisations (default)" , flagType = DynamicFlag , flagReverse = "-O" } , flag { flagName = "-O, -O1" ...
siddhanathan/ghc
utils/mkUserGuidePart/Options/OptimizationLevels.hs
bsd-3-clause
870
0
9
281
140
90
50
22
1
module T5385a where data T = Int ::: Int
urbanslug/ghc
testsuite/tests/rename/should_fail/T5385a.hs
bsd-3-clause
42
0
6
10
15
9
6
2
0
digitSum :: (Integral a) => a -> a digitSum 0 = 0 digitSum x = digit + (digitSum rest) where (rest, digit) = x `divMod` 10 fac n = product [1..n] main = print $ digitSum $ fac 100
derdon/euler-solutions
20/20.hs
isc
186
0
7
45
97
51
46
6
1
import Data.List import Control.Applicative import Control.Arrow import Control.Monad import RankSelection type Matrix a = (Int->Int->a, Int, Int) -- The input is an matrix sorted in both row and column order -- This selects the kth smallest element. (0th is the smallest) selectMatrixRank :: Ord a => Int -> Matrix a ...
chaoxu/haskell-algorithm
MatrixRankSelection.hs
mit
2,220
0
14
631
1,121
607
514
44
2
-- ------------------------------------------------------ -- -- Copyright © 2014 AlephCloud Systems, Inc. -- ------------------------------------------------------ -- {-# LANGUAGE CPP #-} {-# LANGUAGE UnicodeSyntax #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} ...
alephcloud/bayhac2014
src/BayHac2014/Cryptmail/Json/Instances.hs
mit
6,101
0
14
1,352
1,541
825
716
162
1
{-# htermination min :: Int -> Int -> Int #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_min_5.hs
mit
46
0
2
10
3
2
1
1
0
-- | Old compilers, will not compile with newer language changes. -- ======================================================================================= -- | First compiler turns everything into a dynamic type. Uses a lot of unnecessary -- | casting to work though. compileDyn :: DL.Exp -> StaticExp Dynamic compile...
plclub/cis670-16fa
projects/DynamicLang/src/OldCompilers.hs
mit
4,098
0
14
949
986
497
489
-1
-1
module Main where import Game.Poker.Simple main :: IO () main = putStrLn "Hello World"
tobynet/java-poker
app/Main.hs
mit
88
0
6
15
28
16
12
4
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE QuasiQuotes #-} {- | Module : Language.Egison.Math.Expr Licence : MIT This module defines the internal representation of mathematic objects such as polynominals, and som...
egison/egison
hs-src/Language/Egison/Math/Expr.hs
mit
8,536
0
14
2,367
3,131
1,644
1,487
198
2
{-# LANGUAGE ConstraintKinds #-} module Mem where import Control.Applicative import Data.Traversable import SplitEval memInt :: (Int -> a) -> (Int -> a) memInt f = (map f [0..] !!) memIntA :: (Applicative m) => (Int -> m a) -> m (Int -> a) memIntA f = (!!) <$> traverse f [0..] memIntS :: (Applicative n, MonadEv...
vladfi1/hs-misc
PFP/Mem.hs
mit
416
0
9
89
190
104
86
13
1
{-# LANGUAGE CPP #-} module Stackage.Config where import Control.Monad (when, unless) import Control.Monad.Trans.Writer (Writer, execWriter, tell) import Data.Char (toLower) import qualified Data.Map as Map import Data.Maybe ...
feuerbach/stackage
Stackage/Config.hs
mit
29,848
0
17
7,185
4,676
2,164
2,512
479
2
{-# LANGUAGE OverloadedStrings #-} module Day15 where import Data.Either (rights) import Data.List (sortOn) import Text.Parsec ((<|>) , Parsec , ParseError) import qualified Text.Parsec as P data Disc = Disc { discIndex :: Int , discPositions :: Int , discOffset :: Int } deriving (Eq, Show) parseInpu...
brianshourd/adventOfCode2016
src/Day15.hs
mit
1,957
0
11
422
790
420
370
47
1
-- This file is part of the 'union-find-array' library. It is licensed -- under an MIT license. See the accompanying 'LICENSE' file for details. -- -- Authors: Bertram Felgenhauer {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} module Control.Mona...
haskell-rewriting/union-find-array
src/Control/Monad/Union/Class.hs
mit
1,408
0
12
332
329
185
144
-1
-1
module Data.Smashy.Types where import Control.Concurrent.STM (TVar, newTVarIO) import Control.Concurrent.STM.TQueue (TQueue, newTQueueIO) import Data.Hashable (Hashable, hashWithSalt) import Data.Vector.Storable (Vector) import...
jahaynes/smashy2
src/Data/Smashy/Types.hs
mit
1,760
0
10
468
450
254
196
43
1
module AST where import qualified Data.Map as Map import Data.Semigroup type Name = String type Form = String data Pattern = Binding Name | Succ Pattern deriving (Show, Eq) data Param = FreeParam Name | LiteralParam Int | PatternParam Pattern | WildcardParam deriving (Show, E...
andreasfrom/natlang
AST.hs
mit
1,674
0
10
403
617
333
284
43
2
import Data.List takemax n (x:xs) = if x > n then [] else x: (takemax n xs) main = print (foldl1 (+) (filter even (takemax 4000000 fibonacci))) where fibonacci = unfoldr (\(a, b) -> Just (a + b, (b, a + b))) (1, 1)
cptroot/ProjectEuler-Haskell
Euler2.hs
mit
218
0
13
47
138
76
62
4
2
{-# LANGUAGE ForeignFunctionInterface #-} module System.Random.SplitMix.MathOperations ( c_mix32 , c_mix64 , c_mixGamma , xorShift33 ,) where import Data.Word (Word32, Word64) import Data.Bits (xor, shiftR) -- | Mixing fuction to produce 32 bit values as per the paper foreign import ccall unsafe "mix32" c_m...
nkartashov/SplitMix
src/System/Random/SplitMix/MathOperations.hs
mit
895
0
6
166
162
95
67
15
1
{-# LANGUAGE ScopedTypeVariables, ViewPatterns, FlexibleContexts #-} {-| Module : Labyrinth.Pathing.Util Description : pathfinding utilities Copyright : (c) deweyvm 2014 License : MIT Maintainer : deweyvm Stability : experimental Portability : unknown Functions shared across different pathfinding algorit...
deweyvm/labyrinth
src/Labyrinth/Pathing/Util.hs
mit
1,385
0
13
362
522
283
239
32
2
main = print getProblem15Value getProblem15Value :: Integer getProblem15Value = getNumberOfPaths 20 20 getNumberOfPaths :: Integer -> Integer -> Integer getNumberOfPaths x y = (fact (x+y)) `div` ((fact x) * (fact y)) fact :: Integer -> Integer fact 0 = 1 fact 1 = 1 fact x = x * (fact (x-1))
jchitel/ProjectEuler.hs
Problems/Problem0015.hs
mit
296
0
9
55
135
71
64
9
1
{-# LANGUAGE CPP #-} {- ghcjs-run runs a program compiled by ghcjs with node.js -} module Main where import Control.Applicative import Data.Char import System.Directory import System.Environment import System.Exit import System.FilePath import System.Process main = do args <- getArgs path <- getExecutablePa...
ghcjs/ghcjs
src-bin/Run.hs
mit
993
0
12
184
276
141
135
27
1
{-# LANGUAGE OverloadedStrings #-} {- | Module : $Header$ Description : Author : Nils 'bash0r' Jonsson Copyright : (c) 2015 Nils 'bash0r' Jonsson License : MIT Maintainer : aka.bash0r@gmail.com Stability : unstable Portability : non-portable (Portability is untested.) The 'Configuration' ...
aka-bash0r/headergen
src/Headergen/Configuration.hs
mit
2,034
0
21
628
407
235
172
50
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalytics-applicationreferencedatasource-referenceschema.html module Stratosphere.ResourceProperties.K...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsApplicationReferenceDataSourceReferenceSchema.hs
mit
4,548
0
13
268
356
209
147
36
1