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
import Data.Ratio #include "../Prelude.hs" lit0'Rational = 0 :: Rational rational = (Data.Ratio.%) :: Integer -> Integer -> Rational show'Rational = show :: Rational -> String add'Rational = (Prelude.+) :: Rational -> Rational -> Rational subtract'Rational = (Prelude.-) :: Rational -> Rational -> Rational
batterseapower/chsc
examples/imaginary/Bernouilli.hs
bsd-3-clause
312
0
6
48
88
53
35
6
1
module Options () where import Prelude () import Prelude.Compat import Data.Aeson.Types opts :: Options opts = defaultOptions { sumEncoding = ObjectWithSingleField }
tolysz/prepare-ghcjs
spec-lts8/aeson/benchmarks/Options.hs
bsd-3-clause
183
0
6
39
42
27
15
7
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# OPTIONS_GHC -Wno-redundant-constraints -Wno-name-shadowing #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Compact -- Copyright : (c) The Univ...
sdiehl/ghc
libraries/ghc-compact/GHC/Compact.hs
bsd-3-clause
10,499
0
13
2,070
1,110
661
449
71
1
module GUI.SaveAs (saveAsPDF, saveAsPNG) where -- Imports for ThreadScope import GUI.Timeline.Render (renderTraces, renderYScaleArea) import GUI.Timeline.Render.Constants import GUI.Timeline.Ticks (renderXScaleArea) import GUI.Types import Events.HECs -- Imports for GTK import Graphics.UI.Gtk hiding (rectangle) impor...
ml9951/ThreadScope
GUI/SaveAs.hs
bsd-3-clause
2,796
2
14
646
703
370
333
-1
-1
module Bot.Test.TestUtil ( testGroupGenerator, testCase, (@?=), captureStdOut ) where import Bot.Util ( Text ) import Control.Exception ( bracket ) import Data.Text.Lazy.IO ( hGetContents ) import GHC.IO.Handle ( hDuplicate, hDuplicateTo) i...
andregr/bot
test/src/Bot/Test/TestUtil.hs
bsd-3-clause
1,587
0
12
500
448
235
213
41
1
{-# LANGUAGE ScopedTypeVariables, BangPatterns #-} import Timing import Vectorised import System.IO import Foreign.Storable import Foreign.Marshal.Alloc import Data.Array.Parallel import System.Environment import qualified Data.Vector as V import qualified Vector as V import...
mainland/dph
dph-examples/examples/spectral/SMVM/dph/Main.hs
bsd-3-clause
6,312
70
20
2,207
1,513
782
731
-1
-1
------------------------------------------------------------------------------- -- | -- Module : Reinforce.Spaces -- Copyright : (c) Sentenai 2017 -- License : BSD3 -- Maintainer: sam@sentenai.com -- Stability : experimental -- Portability: non-portable -- -- re-exports of Action- and State- types. ----------...
stites/reinforce
reinforce/src/Reinforce/Spaces.hs
bsd-3-clause
549
0
5
67
49
37
12
3
0
------------------------------------------------------------------------------ -- | -- Module: Database.PostgreSQL.Simple.HStore -- Copyright: (c) 2013 Leon P Smith -- License: BSD3 -- Maintainer: Leon P Smith <leon@melding-monads.com> -- Stability: experimental -- -- Parsers and printers for hstore, a e...
avieth/postgresql-simple
src/Database/PostgreSQL/Simple/HStore.hs
bsd-3-clause
1,221
0
5
208
85
66
19
12
0
{-# OPTIONS_GHC -Wall #-} module AST.Pattern where import qualified AST.Helpers as Help import AST.PrettyPrint import Text.PrettyPrint as PP import qualified Data.Set as Set import qualified AST.Variable as Var import AST.Literal as Literal data Pattern var = Data var [Pattern var] | Record [String] | Al...
JoeyEremondi/haskelm
src/AST/Pattern.hs
bsd-3-clause
2,254
0
18
606
840
420
420
62
6
{-# LANGUAGE OverloadedStrings #-} module Yesod.Form.I18n.Spanish where import Yesod.Form.Types (FormMessage (..)) import Data.Monoid (mappend) import Data.Text (Text) spanishFormMessage :: FormMessage -> Text spanishFormMessage (MsgInvalidInteger t) = "Número entero inválido: " `Data.Monoid.mappend` t spanishFormMe...
s9gf4ult/yesod
yesod-form/Yesod/Form/I18n/Spanish.hs
mit
1,520
0
7
176
320
178
142
24
1
module ParenFunBind where (foo x) y = x + y ((bar x)) y = x + y ((baz x)) (y) = x + y
mpickering/ghc-exactprint
tests/examples/ghc8/ParenFunBind.hs
bsd-3-clause
91
3
9
29
73
36
37
4
1
{-@ LIQUID "--no-termination" @-} module RedBlackTree where import Language.Haskell.Liquid.Prelude data RBTree a = Leaf | Node Color a !(RBTree a) !(RBTree a) deriving (Show) data Color = B -- ^ Black | R -- ^ Red deriving (Eq,Show) -----------------------------...
mightymoose/liquidhaskell
tests/pos/RBTree-color.hs
bsd-3-clause
7,263
0
17
2,345
2,020
1,022
998
77
7
module B6 (myFringe, sumSquares) where import D6 hiding (myFringe) import C6 hiding () myFringe :: (Tree a) -> [a] myFringe (Leaf x) = [x] myFringe (Branch left right) = myFringe right sumSquares1 ((x : xs)) = (x ^ 2) + (sumSquares xs) sumSquares1 [] = 0
kmate/HaRe
old/testing/moveDefBtwMods/B6_AstOut.hs
bsd-3-clause
270
0
8
61
127
71
56
8
1
module MultiOccur1 where --Generalise the function 'idid' on the second 'id' with a new parameter 'two' idid = id $ id main x = idid x
kmate/HaRe
old/testing/generaliseDef/MultiOccur1.hs
bsd-3-clause
138
0
5
29
25
14
11
3
1
{-| Module : Idris.Directives Description : Act upon Idris directives. Copyright : License : BSD3 Maintainer : The Idris Community. -} module Idris.Directives(directiveAction) where import Idris.AbsSyntax import Idris.ASTUtils import Idris.Core.Evaluate import Idris.Core.TT import Idris.Imports import Idri...
mpkh/Idris-dev
src/Idris/Directives.hs
bsd-3-clause
4,011
0
20
991
1,524
733
791
101
3
module TypeVariable1 where -- checks for introdution over a type variable. Should error. f :: a -> a f x = x
kmate/HaRe
old/testing/introPattern/TypeVariable1_TokOut.hs
bsd-3-clause
110
0
5
23
22
13
9
3
1
module Mod159_C(C(..)) where import Mod159_A(C(m2))
ghc-android/ghc
testsuite/tests/module/Mod159_C.hs
bsd-3-clause
53
0
6
6
25
17
8
2
0
module Main where myEven 0 = True myEven n = not (myEven (n-1)) allEven [] = True allEven (h:t) = (myEven h) && (allEven t) myReverse lst = foldl (\result next -> next:result) [] lst colourCombinations = let colours = ["black", "white", "blue", "yellow", "red"] in ...
pauldoo/scratch
SevenLanguages/Haskell/day1.hs
isc
1,047
0
9
500
402
219
183
31
1
module NotQuickCheck ( module Test.QuickCheck.Arbitrary , module Test.QuickCheck.Gen , quickCheck ) where import qualified Test.QuickCheck as QC import Test.QuickCheck.Arbitrary import Test.QuickCheck.Gen import Test.QuickCheck.Gen.Unsafe (promote) import Test.QuickCheck.Property (Rose (MkR...
koengit/cyphy
src/NotQuickCheck.hs
mit
5,861
0
18
1,371
2,089
1,112
977
137
3
module ProjectEuler.Problem015Spec (main, spec) where import Test.Hspec import ProjectEuler.Problem015 main :: IO () main = hspec spec spec :: Spec spec = parallel $ describe "solve" $ it "finds the numbers of routes in a 20 x 20 grid" $ solve 20 `shouldBe` 137846528820
hachibu/project-euler
test/ProjectEuler/Problem015Spec.hs
mit
286
0
9
59
79
43
36
10
1
data Cor = V|P deriving Show data Arvore a = No a Cor ( Arvore a ) ( Arvore a ) | Folha deriving Show ins' e Folha = No e V Folha Folha ins' e a@( No e1 c esq dir ) | e < e1 = rot ( No e1 c ( ins' e esq ) dir ) | e > e1 = rot ( No e1 c esq ( ins' e esq ) dir ) | e == e1 = a ins e a = No e1 P esq dir where ( No e1...
AndressaUmetsu/PapaEhPop
redBlack.hs
mit
712
3
11
267
549
267
282
-1
-1
-- Functors are things that can be mapped over. -- fmap :: (a -> b) -> f a -> f b instance Functor IO where fmap f action = do result <- action return (f result) main = do line <- fmap reverse getLine putStrLn line -- if fmap was just limited to IO: -- fmap :: (a -> b) -> IO a -> IO b ...
v0lkan/learning-haskell
applicative-functors.hs
mit
1,912
19
14
566
808
403
405
-1
-1
import Control.Monad main :: IO () main = do n <- readLn :: IO Int str <- replicateM n getLine let ans = map (sum . map read . words) str mapM_ print ans
mgrebenets/hackerrank
alg/warmup/solve-me-second.hs
mit
163
1
14
43
85
38
47
7
1
module Globber (matchGlob) where import AParser (runParser) import GlobParser (Token (..), anyChar, parsePattern, setToList) import Data.Maybe (isJust) type GlobPattern = String matchGlob :: GlobPattern -> String -> Bool matchGlob p = maybe (const False) go (parsePattern p) wher...
ssbl/globber
globber-1.0.0/Globber.hs
mit
759
0
13
325
290
153
137
16
8
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- | <http://strava.github.io/api/v3/activities/> module Strive.Types.Activities ( ActivityDetailed(..) , ActivitySummary(..) , ActivityZoneDetailed(..) , ActivityZoneDistributionBucket(..) , ActivityLapSummary(...
tfausak/strive
source/library/Strive/Types/Activities.hs
mit
11,110
0
99
2,673
2,180
1,240
940
369
4
module Level.Grid.Types where import Coord.Types import qualified Data.Map as M type CellMap = M.Map Coord Cell data Cell = GridEmpty -- Nothing done - default value | GridFloor -- vertex in-graph or presence of edge | GridEdgeWall -- Absence of an edge | GridEdgeDoor -- Presence of an edge (special) deriv...
wmarvel/haskellrogue
src/Level/Grid/Types.hs
mit
6,251
0
14
1,374
2,417
1,305
1,112
132
1
{-# LANGUAGE RecordWildCards #-} module UART.Tx (txInit, txRun) where import CLaSH.Prelude import Control.Lens import Control.Monad import Control.Monad.Trans.State import Data.Tuple import Types data TxState = TxState { _tx :: Bit , _tx_done_tick :: Bool , _tx_state :: Unsigned 2 , _s_reg ...
aufheben/Y86
SEQ/UART/Tx.hs
mit
1,570
0
14
557
534
281
253
-1
-1
module Proxy.PathFinding.FloydWarshall where import Proxy.Math.Graph import Data.Array import Data.Monoid import Control.Monad import Proxy.PathFinding.Specification import Proxy.Math.InfNumber sp :: (WeightedGraph g b) => g a b -> Node -> Node -> Maybe Path sp g o d = floWar g ! (o,d,0) shortestPaths :: (WeightedG...
mapinguari/SC_HS_Proxy
src/Proxy/PathFinding/FloydWarshall.hs
mit
4,754
0
19
2,004
1,367
750
617
59
2
-- Sequence convergence -- https://www.codewars.com/kata/59971e64bfccc70748000068 module SequenceConvergence.Kata (convergence) where import Data.Char (digitToInt) import Data.List (find) import Data.Maybe (fromJust) convergence :: Int -> Int convergence = length . takeWhile (\e -> fromJust . fmap ( /= e) . find (>=...
gafiatulin/codewars
src/Beta/SequenceConvergence.hs
mit
499
0
14
96
201
109
92
10
1
coprime :: Int -> Int -> Bool coprime x y = gcd x y == 1 main :: IO () main = do x <- getLine y <- getLine let value = coprime (read x) (read y) print value
zeyuanxy/haskell-playground
ninety-nine-haskell-problems/vol4/33.hs
mit
174
1
12
56
97
44
53
8
1
{-# LANGUAGE OverloadedStrings #-} module Day17 (day17, day17', run, Container(..), minimalCombinations, parseInput, validCombinations) where import Data.Function (on) import Data.List (delete, groupBy, sortBy) import Data.Maybe (mapMaybe) import Data.Text (Text, pack) data Container = Container Int deriving (Show, E...
brianshourd/adventOfCode2015
src/Day17.hs
mit
1,374
0
11
262
494
267
227
35
1
{-# OPTIONS -fno-warn-type-defaults #-} {-| Constants contains the Haskell constants The constants in this module are used in Haskell and are also converted to Python. Do not write any definitions in this file other than constants. Do not even write helper functions. The definitions in this module are automatically...
badp/ganeti
src/Ganeti/Constants.hs
gpl-2.0
122,814
0
13
23,977
21,945
12,966
8,979
3,059
1
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module BN.Types where import BN.Common import qualified Data.Map as M import Data.Maybe() data TyDict = TyDict { tynames :: [String] , tyvals :: M.Map String [String] , tyvars :: M.Map String String } deriving Show type Ty = State...
VictorCMiraldo/hs-bn
BN/Types.hs
gpl-2.0
2,975
0
14
659
1,001
537
464
48
2
{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables, RankNTypes #-} -- | To make it easier to build (multithreaded) tests module TestHelpers ( -- * Testing parameters numElems, getNumAgents, producerRatio, -- * Utility for controlling the number of threads used by generated tests. setTestThreads, -...
MathiasBartl/Concurrent_Datastructures
tests/TestHelpers.hs
gpl-2.0
14,821
0
29
3,874
3,392
1,733
1,659
252
6
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE Der...
kmilner/tamarin-prover
lib/theory/src/Theory/Model/Formula.hs
gpl-3.0
10,491
0
18
3,136
2,994
1,574
1,420
191
11
-- We have two command line frontends (one with GNU-style arguments, and one -- that follows the requirements for COP5555). There are a lot of common -- components. They go here. module OptionHandler ( versionNumber , versionString , Opt(..) , optDefaults ...
bgw/hs-rpal
src/OptionHandler.hs
gpl-3.0
2,482
0
21
884
542
299
243
54
3
import Criterion.Main import Control.Concurrent import System.Process import Control.Monad import Control.Parallel.Strategies import qualified Data.Map as M import Data.Graph import Data.List import System.Random -- TYPES data Workers a b = Workers {toThread :: Chan a, fromThread :: Chan b} -- | A triple o...
christetreault/graph-solver
src/Main.hs
gpl-3.0
6,041
14
15
1,836
1,785
939
846
122
2
{-# LANGUAGE OverloadedStrings #-} module Database.Design.Ampersand.Output.ToPandoc.ChapterFunctionPointAnalysis where import Database.Design.Ampersand.Output.ToPandoc.SharedAmongChapters import Database.Design.Ampersand.FSpec.FPA fatal :: Int -> String -> a fatal = fatalMsg "Output.ToPandoc.ChapterFunctionPointAnaly...
guoy34/ampersand
src/Database/Design/Ampersand/Output/ToPandoc/ChapterFunctionPointAnalysis.hs
gpl-3.0
2,815
0
17
1,141
732
399
333
54
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.BinaryAutho...
brendanhay/gogol
gogol-binaryauthorization/gen/Network/Google/BinaryAuthorization/Types/Product.hs
mpl-2.0
62,418
0
20
12,916
7,991
4,687
3,304
914
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-plus-domains/gen/Network/Google/Resource/PlusDomains/Circles/Remove.hs
mpl-2.0
2,666
0
12
602
306
188
118
48
1
module Currying where import Data.Char diffFunc :: String -> Int -> Char -> String diffFunc string int char = string ++ " " ++ [intToDigit int] ++ " " ++ [char]
thewoolleyman/haskellbook
05/09/chad/Currying.hs
unlicense
164
0
9
34
63
34
29
4
1
----------------------------------------------------------------------------- -- Copyright 2019, Ideas project team. This file is distributed under the -- terms of the Apache License 2.0. For more information, see the files -- "LICENSE.txt" and "NOTICE.txt", which are included in the distribution. -----------------...
ideas-edu/ideas
src/Ideas/Text/OpenMath/FMP.hs
apache-2.0
1,807
0
11
369
333
198
135
29
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 A ``lint'' pass to check for Core correctness -} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fprof-auto #-} module CoreLint ( lintCoreBindings, lintUnfolding, lintPassResult, lintInteractiveExpr, lintExpr, lintAn...
gcampax/ghc
compiler/coreSyn/CoreLint.hs
bsd-3-clause
70,867
50
25
20,579
16,656
8,443
8,213
1,105
17
module CircGen.TestCircs.CS ( cs ) where import CircUtils.Circuit import CircGen.Add.SimpleRipple import CircGen.Misc cs :: Circuit cs = Circuit csLines csGates [] where csLines = LineInfo clines clines clines clines csGates :: [Gate] csGates = copies ++ adders ++ applyMux "ctrl" ylines yclines where adders = c...
aparent/qacg
src/QACG/CircGen/TestCircs/CS.hs
bsd-3-clause
934
0
13
165
380
212
168
23
1
{-#LANGUAGE OverloadedStrings#-} {- Min Zhang 3-29-2015 ListToFa Turn tab separated tables to Fasta and can be loaded to UCSC blat mapping. -} module Main where import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.IO as TextIO import Data.List (foldl') import System.Environment import Con...
Min-/fourseq
src/utils/ListToFa.hs
bsd-3-clause
758
0
10
140
223
124
99
22
1
module FizzBuzz where -- | Compute Fizz-Buzz with guard -- >>> fizzBuzz 1 -- "1" -- >>> fizzBuzz 3 -- "Fizz" -- >>> fizzBuzz 5 -- "Buzz" -- >>> fizzBuzz 15 -- "FizzBuzz" fizzBuzz n | isFizz && isBuzz = "FizzBuzz" | isBuzz = "Buzz" | isFizz = "Fizz" | otherwise = show n where isFizz = (mod n 3) == 0 i...
temmings/FizzBuzz
Haskell/FizzBuzz.hs
bsd-3-clause
388
0
9
96
119
64
55
9
1
module Main (main) where import System.Giraffe.ApplicationTest (applicationTest) import System.Giraffe.TrackerTest (trackerTest) import Test.Framework (defaultMain) main :: IO () main = defaultMain [ applicationTest , trackerTest ]
ameingast/giraffe
test/TestMain.hs
bsd-3-clause
296
0
6
89
65
39
26
8
1
module DB.Acid where import Data.Acid import Framework.Location import Framework.Profile import Framework.Auth data Acid = Acid { authState :: AcidState AuthState , profileState :: AcidState ProfileState , locationState :: AcidState LocationState }
ojw/admin-and-dev
src/DB/Acid.hs
bsd-3-clause
269
0
9
51
62
36
26
9
0
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} module Lecture.DT.April15 where impor...
athanclark/dt-haskell-intro
src/Lecture/DT/April15.hs
bsd-3-clause
1,333
0
10
339
440
239
201
37
0
module Control.Monad.Incremental.Adapton ( module Control.Monad.Incremental , module Control.Monad.Incremental.Display , module Control.Monad.Incremental.Draw , module Control.Monad.Incremental.Internal.Adapton.Algorithm , module Control.Monad.Incremental.Internal.Adapton.Display , module Control.Monad.Increm...
cornell-pl/HsAdapton
src/Control/Monad/Incremental/Adapton.hs
bsd-3-clause
1,050
4
6
67
209
155
54
19
0
{-# LANGUAGE RecordWildCards #-} -- | read/write ImpulseTracker file headers module Codec.Tracker.IT.Header ( Header (..) , getHeader , putHeader ) where import Control.Monad import Data.Binary import Data.Binary.Get import Data.Binary.Put -- | ImpulseTracker...
riottracker/modfile
src/Codec/Tracker/IT/Header.hs
bsd-3-clause
4,476
0
28
2,425
517
303
214
82
1
------------------------------------------------------------------------------ -- | -- Module : Data.Datamining.Clustering.Gsom.Node.Lattice -- Copyright : (c) 2009 Stephan Günther -- License : BSD3 -- -- Maintainer : gnn.github@gmail.com -- Stability : experimental -- Portability : non-portable (re...
gnn/hsgsom
Data/Datamining/Clustering/Gsom/lattice.hs
bsd-3-clause
8,460
0
23
1,471
1,599
845
754
106
4
{- | Module : Data.Set.BKTree.Internal Copyright : (c) Josef Svenningsson 2010 License : BSD-style Maintainer : josef.svenningsson@gmail.com Stability : Alpha quality. Interface may change without notice. Portability : portable This module exposes the internal representation of Burk...
josefs/bktrees
Data/Set/BKTree/Internal.hs
bsd-3-clause
561
0
10
137
50
31
19
6
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 GHC.Hs.ImpExp: Abstract syntax: imports, exports, interfaces -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Typ...
sdiehl/ghc
compiler/GHC/Hs/ImpExp.hs
bsd-3-clause
14,775
0
19
4,322
3,022
1,612
1,410
193
3
{-| Module : ZFS Description : ZFS API bindings Copyright : (c) Ian Duncan License : BSD3 Maintainer : ian@iankduncan.com Stability : experimental Portability : Only tested on Linux x86_64 Here is a longer description of this module, containing some commentary with @some markup@. -} {-# LANGUAGE Overloa...
iand675/hs-zfs
src/ZFS.hs
bsd-3-clause
18,207
0
17
3,733
4,344
2,275
2,069
269
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} -- | This module describes the todo API in all of it's simplistic glory. This -- follows the 'Api' and 'handler' pattern establisehd in the Files part. module PureFlowy.Api.Todos where impor...
parsonsmatt/pureflowy
src/PureFlowy/Api/Todos.hs
bsd-3-clause
3,394
0
14
856
609
334
275
57
2
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable, UndecidableInstances #-} module AST where import Data.Foldable (Foldable) import Data.Traversable (Traversable) type AId = String data AEntry t = AProgram [t] | AClass AId [t] [t] | AVar AVar...
davnils/minijava-compiler
src/AST.hs
bsd-3-clause
1,564
0
10
498
423
244
179
-1
-1
module Data.CounterSpec where import Control.Applicative import Data.Binary import Data.Counter (Counter) import Data.Map (Map) import Data.Monoid import Data.Set (Set) import Prelude import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck import qualified Data.Map as Map import qualified Data.Set as Set...
intolerable/data-counter
test/Data/CounterSpec.hs
bsd-3-clause
3,712
0
17
914
1,351
673
678
-1
-1
{-# LANGUAGE CPP, MagicHash, UnboxedTuples, DeriveDataTypeable, BangPatterns #-} -- | -- Module : Data.Primitive.Array -- Copyright : (c) Roman Leshchinskiy 2009-2012 -- License : BSD-style -- -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au> -- Portability : non-portable -- -- Primitive boxed arrays...
fpco/primitive
Data/Primitive/Array.hs
bsd-3-clause
8,486
0
13
2,336
1,431
772
659
109
1
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Tests.Readers.RST (tests) where import Text.Pandoc.Definition import Test.Framework import Tests.Helpers import Tests.Arbitrary() import Text.Pandoc.Builder import Text.Pandoc rst :: String -> Pandoc rst = readRST defaultParserState{ stateStandalone = True } inf...
Lythimus/lptv
sites/all/modules/jgm-pandoc-8be6cc2/src/Tests/Readers/RST.hs
gpl-2.0
2,517
0
18
810
440
241
199
-1
-1
-- https://projecteuler.net/problem=9 import Data.List specialPythagoreanTripletProduct :: Integer specialPythagoreanTripletProduct = (\(a,b,c) -> a*b*c) specialPythagoreanTriplet where specialPythagoreanTriplet = head $ filter isPythagoreanTriplet specialTriplets specialTriplets = [(a,b,1000-a-b) | a <- [1....
nothiphop/project-euler
009/solution.hs
apache-2.0
412
0
9
59
166
91
75
6
1
-- Copyright 2017 Google Inc. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/haskell-indexer
haskell-indexer-translate/src/Language/Haskell/Indexer/Translate.hs
apache-2.0
10,096
0
11
2,316
1,144
705
439
183
1
module Language.Hakaru.Util.Finite (CanonicallyFinite(..), enumEverything, enumCardinality, suchThat) where import Data.List (tails) import Data.Maybe (fromJust) import Data.Bits (shiftL) import qualified Data.Set as S import qualified Data.Map as M -- This used to be called Finite, but that is not quite what was imp...
suhailshergill/hakaru
Language/Hakaru/Util/Finite.hs
bsd-3-clause
4,170
0
14
942
1,535
809
726
66
1
-- -fno-warn-deprecations for use of Map.foldWithKey {-# OPTIONS_GHC -fno-warn-deprecations #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.PackageDescription.Configuration -- Copyright : Thomas Schilling, 2007 -- License : BSD3 -- -- Maintai...
martinvlk/cabal
Cabal/Distribution/PackageDescription/Configuration.hs
bsd-3-clause
26,656
0
20
7,285
6,295
3,389
2,906
376
19
module Tools.Quarry.Cache ( CacheTable , emptyCache , withCache ) where import Control.Concurrent.MVar import qualified Data.Map as M import Control.Monad.Trans type CacheTable a b = MVar (M.Map a b) emptyCache :: MonadIO m => m (CacheTable a b) emptyCache = liftIO $ newMVar M.empty withCache :: (Or...
vincenthz/quarry
Tools/Quarry/Cache.hs
bsd-3-clause
714
0
21
235
275
139
136
19
3
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE QuasiQuotes, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Copyright : (c) Microsoft License : MIT Maintainer : adamsap@microsoft...
jdubrule/bond
compiler/src/Language/Bond/Codegen/Util.hs
mit
4,356
0
12
851
702
407
295
49
2
module Top.Menu where import Data.SelectTree import Data.List as List import Text.Logging import Control.Monad.Error import System.FilePath import Utils import Base import Editor.Scene (initEditorScene) import Editor.Menu (editLevel) import Editor.Pickle import Editor.Pickle.LevelFile import Editor.Pickle.Leve...
geocurnoff/nikki
src/Top/Menu.hs
lgpl-3.0
5,346
0
18
1,259
1,594
799
795
103
2
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sr-SP"> <title>Active Scan Rules - Alpha | ZAP Extension</title> <maps> <homeID>top</homeID>...
kingthorin/zap-extensions
addOns/ascanrulesAlpha/src/main/javahelp/org/zaproxy/zap/extension/ascanrulesAlpha/resources/help_sr_SP/helpset_sr_SP.hs
apache-2.0
986
83
53
162
403
212
191
-1
-1
module Invariant where {-@ using [a] as {v : [a] | (len v) > 0 } @-} xs = [] add x xs = x:xs bar xs = head xs foo xs = tail xs
mightymoose/liquidhaskell
tests/neg/StreamInvariants.hs
bsd-3-clause
133
0
5
41
48
25
23
5
1
-- Salesman's Travel -- http://www.codewars.com/kata/56af1a20509ce5b9b000001e module Codewars.G964.Salesmantravel where import Data.List (intercalate, isInfixOf) import Data.List.Split (splitOn) travel :: String -> String -> String travel r zipcode = zipcode ++ ":" ++ cityStreat ss ++ "/" ++ houses ss where ss |...
gafiatulin/codewars
src/6 kyu/Salesmantravel.hs
mit
638
0
14
159
228
119
109
11
3
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module StrSpec (spec) where import Test.Hspec import Test.HUnit import Str spec :: Spec spec = do testStrT testStrMultiT testStrCrMultiT testStrCrMultiBlank testStrT :: Spec testStrT = it "works on basic Text" $ do let converted = [strT| ...
emmanueltouzery/cigale-timesheet
tests/StrSpec.hs
mit
1,526
0
10
490
290
150
140
36
1
{-# LANGUAGE OverloadedStrings #-} import qualified Data.Conduit as C import qualified Data.Conduit.List as CL import qualified Data.Text.IO as T import qualified Data.Text as T import Control.Monad.IO.Class (liftIO) import Text.JSON.Yocto import Web.Twitter.Conduit (stream, statusesFilterByTrack) import Common impor...
DanielTomlinson/Twitter-Stream-Haskell
Main.hs
mit
1,022
1
13
159
381
212
169
29
1
module Haskeroids.Bullet ( Bullet , initBullet , updateBullets ) where import Haskeroids.Render import Haskeroids.Collision import Haskeroids.Particles import Haskeroids.Geometry import Haskeroids.Geometry.Body import Control.Applicative -- | Speed of a bullet in pixels per tick bulletSpeed :: Float...
shangaslammi/haskeroids
Haskeroids/Bullet.hs
mit
2,151
0
12
535
551
306
245
50
1
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0...
cbrghostrider/Hacking
HackerRank/Mathematics/Probability/sherlockAndProbabilityArrays.hs
mit
1,972
1
14
462
623
324
299
33
4
{-# LANGUAGE ForeignFunctionInterface #-} module Main where import Control.Concurrent (MVar, takeMVar, newMVar) import Foreign import Foreign.C type Callback = CInt -> IO () -- | rs_function function from Rust library foreign import ccall "rs_function" rs_function :: Int -> IO () -- | Register a callback wit...
creichert/haskellrustdemo
Rust.hs
mit
1,031
0
10
250
261
134
127
25
1
-- Copyright © 2013 Bart Massey -- [This work is licensed under the "MIT License"] -- Please see the file COPYING in the source -- distribution of this software for license terms. -- Priority Queue for O'Neill Sieve module MPQ (empty, deleteMin, insert, deleteMinAndInsert, findMin, minKey) where -- | I choose to use...
BartMassey/genuine-sieve
MPQ.hs
mit
1,730
0
10
413
498
266
232
32
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} import Control.Applicative import Control.Concurrent import Control.Lens import qualified Control.Exception as Exception import Con...
sigrlami/pollock
app-snap/src/Main.hs
mit
3,429
1
12
957
761
431
330
75
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE DeriveGeneric #-} -- | This module implements type checking on the 'Term' language. module HM.Typecheck ( -- * Type checking operations NameSource(..) , TcError(..) , typecheck ) where import Control.Lens import Control.Monad import ...
glguy/hm
src/HM/Typecheck.hs
mit
6,191
0
18
1,729
1,974
996
978
128
6
-- Hutton's Razor -- http://www.codewars.com/kata/543833d86f032f0942000264/ module Razor where data Razor = Lit Int | Add Razor Razor interpret :: Razor -> Int interpret (Lit a) = a interpret (Add a b) = interpret a + interpret b pretty :: Razor -> String pretty (Lit a) = show a pretty (Add a b) = "(" ++ pretty a...
gafiatulin/codewars
src/6 kyu/Razor.hs
mit
348
0
9
71
135
69
66
8
1
module Ch23.FizzBuzz where import Control.Monad import Control.Monad.Trans.State fizzBuzz :: Integer -> String fizzBuzz n | n `mod` 15 == 0 = "FizzBuzz" | n `mod` 5 == 0 = "Buzz" | n `mod` 3 == 0 = "Fizz" | otherwise = show n fizzbuzzList :: [Integer] -> [String] fizzbuzzList list = execState (mapM_ addResul...
andrewMacmurray/haskell-book-solutions
src/ch23/FizzBuzz.hs
mit
636
0
10
130
269
138
131
20
1
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} module Main where import Data.ByteString (ByteString) import Data.Conduit import Data.Conduit.Binary (sourceHandle, sinkHandle) import Data.Conduit.List as CL import Data.CSV.Conduit import Data.Text (Text) import System.Environment import System.IO (stdout, stdin, ...
danchoi/csv2dsv
Main2.hs
mit
1,566
0
15
471
391
205
186
45
2
module EC where import EC.ES import EC.GA
banacorn/evolutionary-computation
EC.hs
mit
42
0
4
7
14
9
5
3
0
-- Author: David Fonenot, 2014 fontenod@onid.oregonstate.edu -- compile with -main-is SudokuSolver to get to work with GHC module SudokuSolver where import SudokuReader import System.Environment import System.Exit import Data.Array import Data.List import Data.Char import Data.Ord sudokuToStr :: SBoard -> String su...
davidfontenot/haskell_sudoku
SudokuSolver.hs
gpl-2.0
3,739
0
17
1,101
1,351
727
624
60
3
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE TemplateHaskell #-} import Control.Lens import Data.Default import qualified Data.Map as M import qualified GHC.Generics as GHC import Reflex import Reflex.Dom ...
artuuge/reflex-examples
todoListReflex.hs
gpl-2.0
8,671
284
12
2,548
3,014
1,633
1,381
-1
-1
module TestParse ( testParse ) where import Data.Either import Test.HUnit import Quenelle.Parse isSuccess (Success _ _) = True isSuccess _ = False t rule = TestCase $ assertBool ("Failed to parse: " ++ show rule) (isSuccess $ parseRuleFromString "rule" rule) f rule = TestCase $ assertBool ("Successfully parsed:...
philipturnbull/quenelle
test/TestParse.hs
gpl-2.0
734
0
9
141
198
101
97
19
1
import Data.Time import Data.Time.Clock import Data.List import Text.Printf import Control.Monad import Control.Concurrent import System.Environment import System.Locale import System.IO showTimeDiff :: Double -> String showTimeDiff d = sgn ++ printf "%02d:%04.1f" min (abs sec) where min = abs (truncate (d / 60)) ::...
3of8/haskell_playground
laptime/Laptime.hs
gpl-2.0
3,543
108
10
926
1,130
587
543
73
3
import Control.Applicative import Control.Monad import System.IO import Control.Monad.Writer.Lazy import Data.Char import Data.List import Control.Monad.Error import Control.Exception import Calculator {-calculate :: String -> IO String calculate x = (show $ eval $ calculateLine x) `Control.Exception.catc...
collia/SimpleCalc
src/Main.hs
gpl-3.0
1,100
0
13
290
205
106
99
22
3
module HTCF.TcfLayers ( TcfLayers(..) , getTextLayer , getTokens , getSentences , getPOStags , getLemmas ) where import qualified HTCF.TokenLayer as T import qualified HTCF.SentenceLayer as S import qualified HTCF.POStagLayer as P import qualified HTCF.LemmaLayer as L import qualified HTCF.TextLayer as T...
lueck/htcf
src/HTCF/TcfLayers.hs
gpl-3.0
993
0
10
194
327
193
134
29
1
{-# language LambdaCase, OverloadedStrings #-} module HMail.Brick.MailView ( handleEvent , draw ) where import HMail.Types import HMail.Brick.EventH import HMail.State import HMail.ImapMail import HMail.Header import HMail.Brick.Widgets import HMail.Brick.Util import HMail.Brick.ViewSwitching import HMail.Brick.Ba...
xaverdh/hmail
HMail/Brick/MailView.hs
gpl-3.0
2,921
0
16
671
929
479
450
-1
-1
{- This file is part of pia. pia is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. pia is distributed in the hope that it will be usef...
swoertz/pia
src/TRS/Rule.hs
gpl-3.0
1,522
0
10
344
201
111
90
12
1
--project euler problem 45 {-- Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: Triangle T_(n)=n(n+1)/2 1, 3, 6, 10, 15, ... Pentagonal P_(n)=n(3n−1)/2 1, 5, 12, 22, 35, ... Hexagonal H_(n)=n(2n−1) 1, 6, 15, 28, 45, ... It can be verified that T_...
goalieca/haskelling
045.hs
gpl-3.0
923
0
10
198
206
111
95
7
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-blogger/gen/Network/Google/Resource/Blogger/Posts/Search.hs
mpl-2.0
3,769
0
17
977
544
322
222
82
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -Wall -fno-warn-orphans #-} ---------------------------------------------------------------------- -- | -- Module : FRP.Reactive.Future -- Copyright : (c) Conal Elliott 2007-2008 -- License : GNU AGPLv3 (see COPYING) -- -- Maintainer : conal@...
ekmett/reactive
src/FRP/Reactive/Future.hs
agpl-3.0
8,306
0
11
1,827
1,286
729
557
47
1
{-# LANGUAGE OverloadedStrings #-} import Control.Monad.IO.Class (liftIO) import Data.Aeson (Value (Object, String)) import Data.Aeson (encode, object, (.=)) import Data.Aeson.Parser (json) import Data.Conduit (($$+-)) import ...
igraves/relay-server
cruft/yesodclient.hs
agpl-3.0
2,720
0
14
902
621
363
258
50
1
resource = plugin { function = map toUpper }
Changaco/haskell-plugins
testsuite/shell/shell/Plugin.hs
lgpl-2.1
55
0
7
19
17
9
8
2
1
------------------------------------------------------------------------------ -- | -- Module : Semaphore -- Copyright : (C) 2010 Aliaksiej Artamonaŭ -- License : LGPL -- -- Maintainer : aliaksiej.artamonau@gmail.com -- Stability : unstable -- Portability : unportable -- -- Eating philosophers using semap...
aartamonau/haskell-condition
examples/Philosophers.hs
lgpl-3.0
6,987
0
20
1,363
1,326
694
632
106
1
-- Copyright (c) 2013-2014 PivotCloud, Inc. -- -- Control.Concurrent.STM.CloseableQueue -- -- Please feel free to contact us at licensing@pivotmail.com with any -- contributions, additions, or other feedback; we would love to hear from -- you. -- -- Licensed under the Apache License, Version 2.0 (the "License"); you ma...
alephcloud/hs-stm-queue-extras
src/Control/Concurrent/STM/CloseableQueue.hs
apache-2.0
1,433
0
9
226
149
94
55
22
0
-- Copyright 2015 Robin Bate Boerop <me@robinbb.com> -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- http://www.apache.org/licenses/LICENSE-2.0 -- Unless required by applicable law...
robinbb/haskell-snippets
sort-by-list-size/src/Main.hs
apache-2.0
3,649
0
11
1,000
1,330
732
598
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ms-MY"> <title>HTTPS Info Add-on</title> <maps> <homeID>httpsinfo</homeID> <mapref loca...
secdec/zap-extensions
addOns/httpsInfo/src/main/javahelp/org/zaproxy/zap/extension/httpsinfo/resources/help_ms_MY/helpset_ms_MY.hs
apache-2.0
968
77
67
157
413
209
204
-1
-1
{-# LANGUAGE ExistentialQuantification #-} {- - Copyright (c) 2015, Peter Lebbing <peter@digitalbrains.com> - 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 ...
DigitalBrains1/clash-lt24
Simul/Common.hs
bsd-2-clause
3,667
0
12
800
372
199
173
16
1