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
{-# LANGUAGE UndecidableInstances, FlexibleInstances, TypeOperators, MultiParamTypeClasses, FunctionalDependencies, DatatypeContexts #-} -- This one crashed GHC 6.3 due to an error in TcSimplify.add_ors module Foo where data Zero = Zero deriving Show data One = One deriving Show infixl 9 :@ data (N...
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail133.hs
bsd-3-clause
2,142
0
9
512
718
374
344
-1
-1
module SimpleJSON where data JValue = JString String | JNumber Double | JBool Bool | JNull | JObject [(String, JValue)] | JArray [JValue] deriving (Eq, Ord, Show) getString :: JValue -> Maybe String getString (JString s) = Just s getString _ = Nothing getInt ::...
pauldoo/scratch
RealWorldHaskell/ch05/mypretty/SimpleJSON.hs
isc
784
0
8
197
315
163
152
28
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Kata.AdditionCommutes ( plusCommutes ) where import Kata.AdditionCommutes.Definitions ( Z, S , Natural(..), Equal(..) , (:+:)) -- These are some lemmas that may be helpful. -- They will *not* be tested, so ren...
delta4d/codewars
kata/a-plus-b-equals-b-plus-a-prove-it/AdditionCommutes.hs
mit
1,839
0
11
425
438
228
210
25
1
module Unison.Test.Cache where import EasyTest import Control.Monad import Control.Concurrent.STM import Control.Concurrent.Async import qualified U.Util.Cache as Cache test :: Test () test = scope "util.cache" $ tests [ scope "ex1" $ fits Cache.cache , scope "ex2" $ fits (Cache.semispaceCache n) , scope "ex3...
unisonweb/platform
parser-typechecker/tests/Unison/Test/Cache.hs
mit
2,988
0
16
838
974
485
489
57
1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.Node (getRootNode, getRootNode_, hasChildNodes, hasChildNodes_, normalize, cloneNode, cloneNode_, isEqual...
ghcjs/jsaddle-dom
src/JSDOM/Generated/Node.hs
mit
26,991
0
14
5,352
6,086
3,185
2,901
-1
-1
module Control.Flower.Applicative ( module Control.Flower.Applicative.Lazy, module Control.Flower.Applicative.Strict ) where import Control.Flower.Applicative.Lazy import Control.Flower.Applicative.Strict
expede/flower
src/Control/Flower/Applicative.hs
mit
210
0
5
18
39
28
11
5
0
import Data.List (find) import Data.Maybe (fromMaybe) --euler's formula for Pythagorean triples: a = m^2 - n^2, b = 2mn, c = m^2 + n^2 pythTriples = [(m * m - n * n, 2 * m * n, m * m + n * n) | m <- [1..], n <- [1..m], m /= n ] tuple3product :: (Num a) => (a, a, a) -> a tuple3product (a, b, c) = a * b * c solution ...
DylanSp/Project-Euler-in-Haskell
prob9/euler.hs
mit
410
0
13
100
215
121
94
6
1
module WoofToScheme (emitScheme) where import Monad import System.Environment import WoofParse -- Environment emitScheme :: WoofAST -> IO () emitScheme (ASTStatementList (statement:rest)) = do emitScheme statement emitScheme $ ASTStatementList rest emitSch...
aemoncannon/woof
compiler/woof_to_scheme.hs
mit
2,864
0
13
1,278
754
353
401
48
4
module ImportSort.SortSpec where import qualified ImportSort.Sort as S import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = parallel $ describe "sort" $ do it "sorts values correctly" $ do let string = "import qualified Data.List as L\n\ \im...
joshuaclayton/import-sort
test/ImportSort/SortSpec.hs
mit
2,854
0
13
1,294
223
108
115
27
1
{-# LANGUAGE OverloadedStrings #-} module Network.API.Shopify.Types.Metafield ( Metafield(..) , MetafieldId(..) ) where import Control.Applicative ((<$>), (<*>)) import Control.Monad (mzero) import Data.Aeson ( (.:) , (.:?) ...
aaronlevin/haskell-shopify
src/Network/API/Shopify/Types/Metafield.hs
mit
3,139
0
24
1,717
514
303
211
64
0
{-# OPTIONS -fglasgow-exts #-} ------------------------------------------------------------------------------- -- | -- Module : Timeout -- Copyright : (c) The University of Glasgow 2007 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability :...
msakai/folkung
Haskell/Timeout.hs
mit
3,605
0
5
727
39
32
7
22
1
-------------------------------------------------------------------------------- -- -- GAC Driver program -- -- (c) Tsitsimpis Ilias, 2011-2012 -- -------------------------------------------------------------------------------- module Main(main) where #include "config.h" import Lexer import Parser import SrcLoc impo...
iliastsi/gac
src/main/Main.hs
mit
12,996
4
27
4,273
2,832
1,398
1,434
235
9
import Control.Applicative import Control.Monad -- ------------------------------------------------------ {- class (Applicative m) => Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b -} -- ------------------------------------------------------ data Maybe' a = Just' a | Nothing' deri...
uroboros/haskell_design_patterns
chapter3/3_monad.hs
mit
3,527
0
11
926
782
415
367
58
2
{-# LANGUAGE RecordWildCards #-} -- they make your code clean and clear. -- Read about this extension here: -- https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html module Construction.Internal.Functions ...
mortum5/programming
haskell/BM-courses/construct-yourself/src/Construction/Internal/Functions.hs
mit
3,281
0
13
996
1,097
577
520
58
2
{-# LANGUAGE MultiParamTypeClasses , FlexibleInstances -- , UndecidableInstances #-} module Measures( Unit(..) , UnitDecomposition -- Atomic Units , Time(..) , Distance(..) , Mass(..) , Temperature(..) , Luminosity(..) , Angle(..) ------------------ , (:*)(..) , (:/)(..) , (:^)(..)...
fehu/hgt
core-universe/src/Measures.hs
mit
1,920
0
8
516
604
354
250
56
0
prfac2 :: Integral a => a -> a -> [a] prfac2 n m | n == m = [n] | n `mod` m == 0 = m : prfac2 (n `quot` m) m | otherwise = prfac2 n (m+1) prfac :: Integral a => a -> [a] prfac n | n == 1 = [1] | otherwise = prfac2 n 2 -- maximum (prfac 600851475143)
MakerBar/haskell-euler
3/3.hs
mit
271
0
9
86
160
80
80
9
1
import System.Random import qualified Data.Map as Map ns = [7,6..1] chunks n xs | n <= length xs = fst (splitAt n xs) : chunks n (tail xs) | otherwise = [] rootmap str = Map.fromListWith (Map.unionWith (+)) t where t = [(init s, Map.singleton (last s) 1) | s <- chks str] chks str = concat [ch...
jsavatgy/dit-doo
code/look-accum-01.hs
gpl-2.0
1,280
0
12
323
641
325
316
39
1
-- | This is a parser for HTML documents. Unlike for XML documents, it -- must include a certain amount of error-correction to account for -- HTML features like self-terminating tags, unterminated tags, and -- incorrect nesting. The input is tokenised by the -- XML lexer (a separate lexer is not required for ...
jgoerzen/dtmconv
HaXml-1.12/src/Text/XML/HaXml/Html/Parse.hs
gpl-2.0
21,622
0
24
5,999
4,964
2,720
2,244
304
6
{- | Module : ./OWL2/CreateOWL.hs Description : translate theories to OWL2 Copyright : (c) C. Maeder, DFKI GmbH 2012 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable (via Logic.Logic) -} module OWL2.CreateOWL wher...
gnn/Hets
OWL2/CreateOWL.hs
gpl-2.0
1,763
0
21
479
402
211
191
42
5
{-# LANGUAGE TemplateHaskell #-} module Dep.Ui.Utils.TableView ( textTable,textTable' ) where import Control.Monad((>=>)) import Data.IORef(readIORef) import Data.List(transpose,map) import Dep.Ui.Utils(EdgeEmit(..),EdgeWidget(..),linC) import Dep.Utils(mapN,Table(..),powerl) import Graphics.Vty.Attrib...
KommuSoft/dep-software
Dep.Ui.Utils.TableView.hs
gpl-3.0
3,063
0
13
774
1,268
701
567
61
5
{-# OPTIONS_GHC -F -pgmF htfpp #-} module Main where -- The main test program. import Test.Framework import Test.Framework.BlackBoxTest import {-@ HTF_TESTS @-} Codec.Archive.CnCMix.LocalMixDatabase import {-@ HTF_TESTS @-} Codec.Archive.CnCMix.TiberianDawn main :: IO () main = htfMain htf_importedTests
cnc-patch/cncmix
Test.hs
gpl-3.0
308
0
6
39
51
33
18
8
1
module Regex where import Control.Monad.Trans import Control.Monad.Writer import Data.Monoid import Fresh import X86 data Regex = Char Char | Regex :^ Regex | Regex :| Regex | Star Regex data Bytecode = CHAR Char | LABEL Label | SPLIT Label Label | JUMP Label compile :: Regex -> WriterT [Bytecode] (Fresh L...
orchid-hybrid/bee
Bee/Regex.hs
gpl-3.0
1,243
0
11
290
652
328
324
45
1
module Infsabot.Base.Interface ( RDirection(N,E,W,S), oppositeDirection, Team(A,B), BoardSpot(SpotEmpty, SpotMaterial), applyDirection, limitedOffset, InternalState(..), RobotAppearance(RobotA...
kavigupta/Infsabot
Infsabot/Base/Interface.hs
gpl-3.0
520
0
5
224
94
68
26
24
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Operations/List.hs
mpl-2.0
7,481
0
19
1,638
980
573
407
139
1
-- eidolon -- A simple gallery in Haskell and Yesod -- Copyright (C) 2015 Amedeo Molnár -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published -- by the Free Software Foundation, either version 3 of the License, or -- ...
Mic92/eidolon
Handler/Signup.hs
agpl-3.0
3,251
0
21
931
607
293
314
-1
-1
module DNA (toRNA) where toRNA :: String -> String toRNA = let translate 'C' = 'G' translate 'G' = 'C' translate 'A' = 'U' translate 'T' = 'A' in map translate
pierrebeaucamp/Exercism-Haskell
rna-transcription/DNA.hs
unlicense
207
0
9
78
64
33
31
7
4
module HelperSequences.A053645Spec (main, spec) where import Test.Hspec import HelperSequences.A053645 (a053645) main :: IO () main = hspec spec spec :: Spec spec = describe "A053645" $ it "correctly computes the first 20 elements" $ take 20 (map a053645 [1..]) `shouldBe` expectedValue where expectedValue...
peterokagey/haskellOEIS
test/HelperSequences/A053645Spec.hs
apache-2.0
365
0
10
59
160
95
65
10
1
splitBy :: Char -> String -> [String] splitBy _ [] = [] splitBy a x = let s = takeWhile (/= a) x x'= dropWhile (/= a) x in if x' == [] then [s] else s:(splitBy a $ drop 1 x') -- 直線QR y = -1*(y2-y1)/(x2-x1) (x-xq) + yq -- 直線P1P2 y = (y2-y1)/(x2-x1) (x-x1) + y1 -- 2つの直線の交点 -- (y2-y1)/(x2-x1) (x...
a143753/AOJ
0081.hs
apache-2.0
859
0
17
262
452
239
213
22
3
-- Factorial [tail recursion] in Haskell -- Prashanth Babu V V :: 02nd Dec, 2016. factorial :: Integer -> Integer factorial n = tailrecFact n 1 tailrecFact :: Integer -> Integer -> Integer tailrecFact n acc | n == 1 = acc | otherwise = tailrecFact (n-1) (acc * n) -- ghci factorial --...
P7h/FutureLearn__FP_in_Haskell
factorial.hs
apache-2.0
395
0
8
117
89
46
43
5
1
{-# LANGUAGE CPP #-} import Scaffolding.Scaffolder import System.Environment (getArgs) import System.Exit (exitWith) import System.Process (rawSystem) import Yesod.Core(yesodVersion) #ifndef WINDOWS import Build (touch) #endif import Devel (devel) windowsWarning :: String #ifdef WINDOWS windowsWarning = "\n ...
chreekat/yesod
yesod/main.hs
bsd-2-clause
1,733
0
13
563
361
185
176
38
9
{-# LANGUAGE OverloadedStrings, TupleSections, ScopedTypeVariables, TypeFamilies, FlexibleContexts, PackageImports #-} module Network.XmlPush.HttpPush.Tls ( HttpPushTls, HttpPushTlsArgs(..), HttpPushArgs(..), TlsArgsCl, tlsArgsCl, TlsArgsSv, tlsArgsSv) where import Network.XmlPush.HttpPush.Tls.Body
YoshikuniJujo/xml-push
src/Network/XmlPush/HttpPush/Tls.hs
bsd-3-clause
306
4
5
28
52
36
16
7
0
-- | -- Module: Database.TinkerPop.Types -- Copyright: (c) 2015 The gremlin-haskell Authors -- License : BSD3 -- Maintainer : nakaji.dayo@gmail.com -- Stability : experimental -- Portability : non-portable -- module Database.TinkerPop.Types where import Data.Text hiding (drop, toLower) import Data.Char (toLower...
nakaji-dayo/gremlin-haskell
src/Database/TinkerPop/Types.hs
bsd-3-clause
3,953
4
17
692
715
417
298
-1
-1
module Pickle ( module Pickle.Config , module Pickle.Files , module Pickle.Everything , module Pickle.Template ) where import Pickle.Config import Pickle.Files import Pickle.Everything import Pickle.Template
themattchan/pickle
src/Pickle.hs
bsd-3-clause
219
0
5
35
50
32
18
9
0
{-# LANGUAGE ScopedTypeVariables, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, FlexibleInstances #-} module Simple where import Language.XHaskell [xh| g :: Choice Int Bool -> Choice Int Bool g (x :: Int) = x f :: Star Int -> Star (Choice Int Bool) f (x::Star Int, y::Int) = g y h :: Star (Choice Int a) ->...
luzhuomi/xhaskell
test/Simple.hs
bsd-3-clause
359
0
4
70
17
12
5
4
0
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.FramebufferSRGB -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/FramebufferSRGB.hs
bsd-3-clause
660
0
4
78
37
31
6
3
0
{-#LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, TypeApplications #-} {-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} module DirectoryServer where import Network hiding (a...
Garygunn94/DFS
.stack-work/intero/intero3310OlW.hs
bsd-3-clause
15,432
456
15
4,001
4,189
2,160
2,029
276
7
{-# LANGUAGE CPP, NondecreasingIndentation, TupleSections #-} {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- -- -- GHC Driver program -- -- (c) The University of Glasgow 2005 -- ----------------------------------------...
urbanslug/ghc
ghc/Main.hs
bsd-3-clause
34,965
10
27
9,749
7,130
3,681
3,449
547
15
import Test.FFmpeg as FFmpeg import Test.FFmpeg.H264 as H264 main :: IO () main = do H264.test FFmpeg.test
YLiLarry/compress-video
test/Spec.hs
bsd-3-clause
114
0
7
24
41
23
18
6
1
{-| Module : Data.Network.MRT Description : Multi-Threaded Routing Toolkit Export Information Format types License : BSD3 Stability : Experimental MRT is a library for parsing Multi-Threaded Routing Toolkit (MRT) export files, of the kind you might find on the RouteViews archive. -} {-# LANGUAGE LambdaCase...
codebje/hask-mrt
src/Data/Network/MRT.hs
bsd-3-clause
4,659
0
13
1,405
1,097
604
493
110
4
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveGeneric #-} -- | Lua 5.3 syntax tree, as specified in <http://www.lua.org/manual/5.3/manual.html#9>. -- Annotation implementation is inspired by haskell-src-exts. module Language.Lua.Annotated.Syntax where import Control.DeepSeq (NFData) import ...
osa1/language-lua
src/Language/Lua/Annotated/Syntax.hs
bsd-3-clause
10,126
0
10
2,984
5,105
2,580
2,525
249
0
{- buddhabrot reimplementation based on C source at: http://paulbourke.net/fractals/buddhabrot/ see also: http://www.superliminal.com/fractals/bbrot/bbrot.htm http://erleuchtet.org/2010/07/ridiculously-large-buddhabrot.html http://www.steckles.com/buddha/ http://softologyblog.wordpress.com/2011/06/26/...
saffroy/buddhabrot
buddhabrot.hs
bsd-3-clause
2,213
0
14
881
402
214
188
34
3
{-# OPTIONS_HADDOCK hide #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.Functions.F07 -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : por...
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F07.hs
bsd-3-clause
56,864
0
19
7,273
9,165
4,742
4,423
1,002
1
import Data.List import Control.Monad d3 = [999,998..100] n2dr :: Int -> [Int] n2dr n | n < 10 = [n] | otherwise = d : n2dr (n `div` 10) where d = n `mod` 10 main = do let ans = fmap maximum . sequence . filter (/= Nothing) . fmap (find (\n -> let d = n2dr n in reverse ...
mskmysht/ProjectEuler
src/Problem4.hs
bsd-3-clause
435
0
22
161
223
116
107
16
2
module Newt.Utilities ( copyDirectory , cleanup , trim , isValueArg ) where import Prelude hiding ( catch ) import Control.Exception ( IOException, catch, finally ) import Data.Char (isSpace) import System.Directory ( removeFile, removeDirectory ) import System.Process ( rawSystem ) isValueAr...
creswick/Newt
src/Newt/Utilities.hs
bsd-3-clause
1,302
1
10
314
327
176
151
28
1
-------------------------------------------------------------------------------- -- Copyright © 2011 National Institute of Aerospace / Galois, Inc. -------------------------------------------------------------------------------- -- | Let expressions. {-# LANGUAGE Trustworthy #-} module Copilot.Language.Operators.Loc...
leepike/copilot-language
src/Copilot/Language/Operators/Local.hs
bsd-3-clause
675
0
10
68
97
58
39
7
1
module LambdaQuest.SystemFsub.PrettyPrint (prettyPrintTypeP ,prettyPrintType ,prettyPrintTermP ,prettyPrintTerm ) where import LambdaQuest.SystemFsub.Type import LambdaQuest.SystemFsub.Parse (NameBinding(..)) varNames :: [NameBinding] -> [String] varNames = foldr (\x ys -> case x of ...
minoki/LambdaQuest
src/LambdaQuest/SystemFsub/PrettyPrint.hs
bsd-3-clause
5,123
0
18
1,427
1,774
842
932
82
30
-- | The Language type that is the core of GroteTrap. module Language.GroteTrap.Language ( -- * Language Language(..), language, -- * Operators Operator(..), Fixity1(..), Fixity2(..), isUnary, isBinary, isAssoc, findOperator, -- * Functions Function(..), findFunction, function1, function2 ...
MedeaMelana/GroteTrap
Language/GroteTrap/Language.hs
bsd-3-clause
3,739
0
11
974
843
483
360
67
3
module Geometry.Cuboid ( volume, area ) where volume :: Float -> Float -> Float -> Float volume a b c = rectangleArea a b * c area :: Float -> Float -> Float -> Float area a b c = rectangleArea a b * 2 + rectangleArea a c * 2 + rectangleArea c b * 2 rectangleArea :: Float -> Float -...
kyk0704/haskell-test
src/Geometry/Cuboid.hs
bsd-3-clause
354
0
10
108
143
73
70
11
1
{-# LANGUAGE DeriveDataTypeable #-} -- | These module exposes internals of the library module Control.IO.Region.Internal where import Prelude (($!), Enum(..)) import Data.Typeable import Data.Bool import Data.Int import Data.Either import Data.Eq import Data.Function import qualified Data.List as List import Data.Tu...
Yuras/io-region
lib/Control/IO/Region/Internal.hs
bsd-3-clause
5,401
0
17
1,189
1,346
682
664
119
3
import Common.Numbers.Numbers (multiBinomial) import Data.List (group) g d f | d == 0 = [[]] | otherwise = concatMap (\f0 -> map (f0:) (g (d - 1) f0)) [1 .. f] combinations :: Int -> Int -> Int -> Int -> [[Int]] combinations d f top s = concatMap r possibles where possibles = filter (\xs -> sum xs == s) $...
foreverbell/project-euler-solutions
src/240.hs
bsd-3-clause
568
2
13
150
317
162
155
12
1
module Utils.UnificationTest where {- This module defines -} import Utils.Unification import Utils.Utils import Data.Map (Map, (!), member) import qualified Data.Map as M import Data.Set (Set, insert, findMin, deleteMin) import qualified Data.Set as S import qualified Data.List as L import Data.Maybe import Data.Bifu...
pietervdvn/ALGT
src/Utils/UnificationTest.hs
bsd-3-clause
1,449
58
13
309
663
396
267
38
1
{-# LANGUAGE BangPatterns, MultiWayIf #-} module Geom2D.CubicBezier.Approximate (approximatePath, approximateQuadPath, approximatePathMax, approximateQuadPathMax, approximateCubic) where import Geom2D import Geom2D.CubicBezier.Basic import Geom2D.CubicBezier.Numeric import Data.Maybe import Data.L...
kuribas/cubicbezier
Geom2D/CubicBezier/Approximate.hs
bsd-3-clause
20,273
1
23
6,385
5,969
3,142
2,827
318
4
module Main where import Text.Show.Pretty infixr 3 :->: infix 2 ::: infixl 1 :$: data T = TVar String | T :->: T | Int deriving (Show,Read,Eq) data E = String ::: T | E :$: E | Lit Int deriving (Show,Read,Eq) iii :: T iii = Int :->: (Int :->: Int) f :: E f = "f" ::: iii x :: E x = "x" ::: Int e :: E e = f :...
phadej/pretty-show
test/infix/Infix.hs
mit
477
0
10
137
250
139
111
24
1
{- Copyright © 2017-2019 Albert Krewinkel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distrib...
tarleb/hslua
test/Test/HsLua/Util.hs
mit
3,140
0
13
647
615
325
290
51
2
module EVT.ParseEVT ( evtBasicSpec , parseEVTGuards , parseEVTActions , parseGuard , parseAction ) where import Common.AnnoState import Common.Id import Text.ParserCombinators.Parsec import Common.GlobalAnnotations (PrefixMap) import Common.Token (sortId)...
keithodulaigh/Hets
EVT/ParseEVT.hs
gpl-2.0
1,933
0
9
813
438
218
220
64
1
-- C->Haskell Compiler: CHS file abstraction -- -- Author : Manuel M T Chakravarty -- Created: 16 August 99 -- -- Version $Revision: 1.3 $ from $Date: 2005/01/23 15:44:36 $ -- -- Copyright (c) [1999..2004] Manuel M T Chakravarty -- -- This file is free software; you can redistribute it and/or modify -- it under ...
k0001/gtk2hs
tools/c2hs/chs/CHS.hs
gpl-3.0
49,978
0
22
18,238
12,203
6,261
5,942
876
22
{-# LANGUAGE OverloadedStrings #-} -- Module : Test.AWS.Route53 -- Copyright : (c) 2013-2015 Brendan Hay -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- ...
fmapfmapfmap/amazonka
amazonka-route53/test/Test/AWS/Route53.hs
mpl-2.0
740
0
5
201
73
50
23
11
1
{-# LANGUAGE CPP #-} module Distribution.Client.Dependency.Modular.Builder (buildTree) where -- Building the search tree. -- -- In this phase, we build a search tree that is too large, i.e, it contains -- invalid solutions. We keep track of the open goals at each point. We -- nondeterministically pick an open goal (vi...
garetxe/cabal
cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
bsd-3-clause
9,685
0
23
2,643
2,253
1,236
1,017
89
10
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric #-} module SafeCounter ( startCounter, getCount, getCountAsync, incCount, resetCount, wait, waitTimeout, ...
qnikst/distributed-process-client-server
tests/SafeCounter.hs
bsd-3-clause
3,425
0
13
701
681
391
290
69
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module : Yi.Keymap.Vim.Ex.Commands.BufferDelete -- License : GPL-2 -- Maintainer : yi-devel@googlegroups.com -- Stability : experimental -- Portability : portable module Yi.Keymap.Vim.Ex.Commands.BufferDelete (parse) w...
siddhanathan/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Ex/Commands/BufferDelete.hs
gpl-2.0
1,233
0
14
366
252
156
96
18
1
module Data.Graph.Inductive.Monad (GraphM(..), ufoldM, nodesM, edgesM, newNodesM, delNodeM, delNodesM, mkUGraphM, contextM, labM) where { import Data.Graph.Inductive.Graph; class (Monad m) => GraphM m gr where { emptyM :: m (gr a b); isEmptyM...
ckaestne/CIDE
other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Monad.hs
gpl-3.0
3,391
0
16
1,471
1,669
896
773
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 2000 FunDeps - functional dependencies It's better to read it as: "if we know these, then we're going to know these" -} {-# LANGUAGE CPP #-} module FunDeps ( FunDepEqn(..), pprEquation, improveFromInstEnv, improve...
vikraman/ghc
compiler/typecheck/FunDeps.hs
bsd-3-clause
25,542
0
19
8,459
2,793
1,509
1,284
-1
-1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} module Futhark.IR.SeqMem ( SeqMem, -- * Simplification simplifyProg, simpleSeqMem, -- * Module re-exports module Futhark.IR....
HIPERFIT/futhark
src/Futhark/IR/SeqMem.hs
isc
2,241
0
9
372
586
318
268
-1
-1
-- -- 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. -- What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? -- import List factors :: (Integral a) => a -> [a] factors x = filter (\ y -> x `mod` y == 0) ...
stu-smith/project-euler-haskell
Euler-005.hs
mit
1,005
0
10
248
360
191
169
16
1
module Main where import Lib printInt :: Int -> IO () printInt x = print x main :: IO () main = str <- getLine printInt (read str)
gitrookie/functionalcode
code/Haskell/stmonads/app/Main.hs
mit
138
1
7
35
62
32
30
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE CPP #-} module Yesod.Core.Dispatch ( -- * Quasi-quoted routing parseRoutes , parseRoutesNoCheck , parseRoutesFile ...
ygale/yesod
yesod-core/Yesod/Core/Dispatch.hs
mit
7,617
0
19
1,857
1,412
798
614
157
3
{-# LANGUAGE OverloadedStrings #-} module FeatureSpec where import qualified Data.Text as T import qualified Data.Map as Map import SpaceWeather.Feature import SpaceWeather.Format import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck.Arbitrary newtype SmallPositive = SmallPositive Int deriving (Eq,Sho...
nushio3/UFCORIN
test/FeatureSpec.hs
mit
1,910
0
18
364
598
315
283
46
1
{-# LANGUAGE OverloadedStrings #-} module Tests.Bed (tests) where import Bio.Data.Bed import Bio.Data.Bed.Types import Bio.Data.Bed.Utils import Bio.Utils.BitVector hiding (size) import Lens.Micro import Conduit import Data.Function (on) import Data.List ...
kaizhang/bioinformatics-toolkit
bioinformatics-toolkit/tests/Tests/Bed.hs
mit
4,837
0
20
1,403
1,696
960
736
122
3
{-# LANGUAGE ExistentialQuantification #-} module Contract.Type ( Contract(..) -- constructors exported , MContract -- managed contract, including a start date , Party -- smart constructors and convenience functions , zero, transfOne, transl, iff, checkWithin, both, allCs, scale, flow, foreach ...
annenkov/contracts
Haskell/Contract/Type.hs
mit
4,758
0
20
1,309
1,398
717
681
81
7
module Sync.MerkleTree.Server where import Codec.Compression.GZip import Control.Monad.State import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BL import Data.Map (Map) import qualified Data.Map as M import Data.String.Interpolate.IsString import qualified Data.Text.IO as T import Data.Tim...
ekarayel/sync-mht
src/Sync/MerkleTree/Server.hs
mit
2,212
0
17
538
670
357
313
-1
-1
module StringCalculator.Coercion (integer, string) where integer n = read n :: Integer string n = show n
jtrim/string-calculator-hs
src/StringCalculator/Coercion.hs
mit
110
0
5
22
39
21
18
3
1
module LensUtil where import Prelude import Control.Lens import Language.Haskell.TH makeLensesCustom :: Name -> DecsQ makeLensesCustom = makeLensesWith $ lensRules & lensField .~ \_ _ name -> [TopName (mkName $ nameBase name ++ "L")]
jonschoning/pinboard
gen/LensUtil.hs
mit
238
0
12
37
73
41
32
7
1
{-# LANGUAGE BangPatterns #-} -- Sutherland-Hodgman polygon clipping module Graphics.Perfract.PolyClip ( clipTo , ConvPoly , polyArea , polyLines , (.|) , (.@) ) where import Control.Applicative import qualified Data.Vector as Vec import Graphics.Perfract.Pt import Graphics.Perfract.Tupelo -- | Note:...
dancor/perfract
src/Graphics/Perfract/PolyClip.hs
mit
3,342
0
11
776
1,169
622
547
59
5
--Replicate the elemtns of a list a given number of times module Problem15 where repli:: (Eq b, Num b, Ord b) => [a] -> b -> [a] repli _ t | t < 0 = error "times < 0" repli [] _ = [] repli (x:xs) times = let rep _ 0 = [] rep y times' = y : rep y (times'-1) in...
Matt-Renfro/haskell
H-99/Problem15.hs
mit
354
0
12
133
160
81
79
8
2
module GHCJS.DOM.IDBOpenDBRequest ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/IDBOpenDBRequest.hs
mit
46
0
3
7
10
7
3
1
0
{-# LANGUAGE OverloadedStrings #-} module Site.Action where import BasePrelude import Prelude () import Heist import Snap (ifTop) import Snap.Snaplet.Heist.Compiled import Site.Internal actionRoutes :: PhbRoutes actionRoutes = [("/actions",ifTop $ render "actions/all")] allActionSplice...
benkolera/phb
hs/Site/Action.hs
mit
369
0
8
71
78
48
30
13
1
module Demiurge.Utils where import Demiurge.Common updateAt :: Same a => a -> [a] -> [a] updateAt xx yys = let helper x acc (y:ys) = if same x y then (x:ys ++ acc) else helper x (y:acc) ys helper x acc [] = x:acc in helper xx [] yys fs...
olive/demiurge
src/Demiurge/Utils.hs
mit
374
0
12
149
184
100
84
11
3
module Cis194.Spring13.HW04Spec (spec) where import Cis194.Spring13.HW04 import Test.Hspec spec :: Spec spec = describe "HW04" $ do describe "fun1'" $ do it "treats empty lists like fun1" $ fun1' [] `shouldBe` fun1 [] it "treats single-value odd lists like fun1" $...
tylerjl/cis194
test-suite/Cis194/Spring13/HW04Spec.hs
mit
1,928
0
14
870
391
205
186
30
1
{-# htermination plusFM :: FiniteMap Ordering b -> FiniteMap Ordering b -> FiniteMap Ordering b #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_plusFM_11.hs
mit
117
0
3
18
5
3
2
1
0
module P07RoomArea where import Library main :: IO () main = do l <- promptNonNegFloat "length in feet: " w <- promptNonNegFloat "width in feet: " let f2 = f2ed w l putStrLn $ "Dimensions: " ++ show l ++ " feet by " ++ show w ++ " feet" putStrLn $ "Area: " ++ show f2 ++ " square feet" putSt...
ciderpunx/57-exercises-for-programmers
src/P07RoomArea.hs
gpl-3.0
568
0
11
156
181
89
92
16
1
import Data.Text import Control.Exception.Base import Control.Monad.Trans.Either import Control.Monad.IO.Class import Control.Monad.State import Control.Monad.RWS import Control.Monad.Reader data MyException = MyException String deriving (Show) instance Exception MyException foo x | x < 0 = "foo" foo x = "fee" d...
redfish64/MpvLangLearn
Learn.hs
gpl-3.0
2,504
0
12
714
858
433
425
65
2
module Analysis.Graph.Plot where import Data.Packed.Vector (Vector, toList) import Graphics.Rendering.Plot import qualified Graphics.Rendering.Cairo as C import Graphics.Rendering.Pango.Enums import Graphics.UI.Gtk hiding (Circle, Cross) import Data.Colour.Names (red, lightgray) import Control.Monad.Trans -- Create ...
acardona/haskell-lib
CATMAID/Analysis/Graph/Plot.hs
gpl-3.0
2,823
0
18
838
669
330
339
52
1
module PrimeFactors where primeFactors :: Integer -> [Integer] primeFactors = factors 2 factors :: Integer -> Integer -> [Integer] factors d n | n == 1 = [] | d * d > n = [n] | n `mod` d == 0 = d : factors d (n `div` d) | otherwise = factors (d + 1) n
ciderpunx/exercismo
src/PrimeFactors.hs
gpl-3.0
292
0
9
98
140
73
67
9
1
module LanguageDef.Interpreter (resolveAndRun, constructParseTree, VariableStore', VariableStore, patternMatchAll, evalExpression) where {- Interprets functions -} import Utils.All import LanguageDef.Data.LanguageDef import LanguageDef.Data.SyntacticForm hiding (assert') import LanguageDef.Data.ParseTree import Lang...
pietervdvn/ALGT2
src/LanguageDef/Interpreter.hs
gpl-3.0
12,149
414
11
1,982
2,463
1,347
1,116
153
2
{-# LANGUAGE ScopedTypeVariables #-} import Control.Exception (SomeException) import Control.Monad.Catch (throwM, try) import Data.Functor (void) import Data.Monoid ((<>)) import System.Directory (doesFileExist) import RSCoin.Core ...
input-output-hk/rscoin-haskell
src/Mintette/Main.hs
gpl-3.0
3,139
1
13
849
764
376
388
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | Implementation of the @Bruce@ binary protocol. -- -- cf. <https://github.com/tagged/bruce/blob/master/doc/sending_messages.md> module Network.Bruce.Protocol ( -- * Protocol Types Message (..) , Topic (..) , Timestamp (..) , Payload (..) ...
romanb/bruce-protocol
src/Network/Bruce/Protocol.hs
mpl-2.0
5,745
0
13
1,233
1,550
797
753
160
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-games-management/gen/Network/Google/Resource/GamesManagement/Scores/ResetAll.hs
mpl-2.0
2,682
0
12
570
229
144
85
42
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-youtube/gen/Network/Google/Resource/YouTube/Videos/List.hs
mpl-2.0
10,442
0
24
2,592
1,362
796
566
172
1
{-# Language CPP, OverloadedStrings, NamedFieldPuns, RecordWildCards #-} module PrivateCloud.Cloud.DirTree ( makeTree , unrollTreeFiles ) where import Data.List import Data.Function import System.Directory.Tree #ifdef WINBUILD import System.Directory import System.Win32.File #else import System.Posix.Files...
rblaze/private-cloud
src/PrivateCloud/Cloud/DirTree.hs
apache-2.0
1,685
0
14
433
420
218
202
30
3
module Parse.Location ( -- * Location Location(..) , Path -- * Located , HasLocation(..) , getLocation , getLine , getColumn , Located(..) , dislocate ) where import Prelude hiding (getLine) -- | An inhabitant of this type describes where a character is in a text file. data ...
edom/ptt
src/Parse/Location.hs
apache-2.0
1,283
0
8
366
319
184
135
35
1
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE GADTs #-} module D...
ekmett/predictors
src/Data/Predictor.hs
bsd-2-clause
2,077
0
12
472
928
480
448
-1
-1
{-# LANGUAGE ParallelListComp, TemplateHaskell, RankNTypes #-} {-| TemplateHaskell helper for Ganeti Haskell code. As TemplateHaskell require that splices be defined in a separate module, we combine all the TemplateHaskell functionality that HTools needs in this module (except the one for unittests). -} {- Copyrig...
ganeti/ganeti
src/Ganeti/THH.hs
bsd-2-clause
66,190
497
20
18,613
13,904
7,556
6,348
-1
-1
{-| Module: HaskHOL.Deductive Copyright: (c) Evan Austin 2015 LICENSE: BSD3 Maintainer: e.c.austin@gmail.com Stability: unstable Portability: unknown This module is the one to import for users looking to include the entirety of the deductive reasoning engine of the HaskHOL proof system. It re...
ecaustin/haskhol-deductive
src/HaskHOL/Deductive.hs
bsd-2-clause
2,258
0
5
413
283
194
89
46
1
-- | Pretty-print TOML. module Text.Toml.Pretty (ppr) where import Data.Aeson (encode, toJSON) import qualified Data.ByteString.Lazy.UTF8 as B import Data.Foldable import qualified Data.Map as M import Data.Text (Text) import Data.Time.ISO8601 import Text.Toml import Text.PrettyPrint.ANSI.Leijen -- | Pretty-prints TO...
pikajude/toml
src/Text/Toml/Pretty.hs
bsd-2-clause
2,848
0
15
633
593
346
247
34
1
LevelPreds { lpredPre = NameT "p_galois'rows_width'P" [ TyCon "map" [ TyCon "int" [] , TyCon "int" [] ] , TyCon "map" [ TyCon "addr" [] , TyCon "addr" [] ] , TyCon "map" [ TyCon "addr" [] , TyCon "int" [] ] , TyCon "map" [ TyCon "addr" [] , TyCon "int" [] ] , TyCo...
GaloisInc/verification-game
web-prover/demo-levels/rows_width/holes.hs
bsd-3-clause
2,601
0
13
1,030
1,065
534
531
-1
-1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GLU.Quadrics -- Copyright : (c) Sven Panne 2002-2005 -- License : BSD-style (see the file libraries/OpenGL/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability : provi...
FranklinChen/hugs98-plus-Sep2006
packages/OpenGL/Graphics/Rendering/OpenGL/GLU/Quadrics.hs
bsd-3-clause
7,510
48
13
1,200
1,570
840
730
-1
-1
module Text.Highlighter.Lexers.Modula2 (lexer) where import Text.Regex.PCRE.Light import Text.Highlighter.Types lexer :: Lexer lexer = Lexer { lName = "Modula-2" , lAliases = ["modula2", "m2"] , lExtensions = [".def", ".mod"] , lMimetypes = ["text/x-modula2"] , lStart = root' , lFlags = [multi...
chemist/highlighter
src/Text/Highlighter/Lexers/Modula2.hs
bsd-3-clause
2,626
0
10
522
744
385
359
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} {-| Module : Web.Mastodon.API.Accounts Description : Logic for generating API stuff related to accounts (based on arbitrary id) -} module Web.Mastodon.API.Accounts ( Accounts , accountsApi , getAccountByUid ...
cmdd/mastodon-api
src/Web/Mastodon/API/Accounts.hs
bsd-3-clause
5,199
0
59
1,224
1,563
793
770
96
1
-- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_4_A -- A / B Problem -- input: 3 2 -- output: 1 1 1.50000 import Control.Applicative import Data.Fixed main = do [a,b] <- map (read :: String -> Int) . words <$> getLine putStrLn $ show (a `div` b) ++ " " ++ show (a `mod` b) ++...
ku00/aoj-haskell
src/ITP1_4_A.hs
bsd-3-clause
387
0
14
98
129
70
59
8
1
{-# LANGUAGE TupleSections, OverloadedStrings #-} module Handler.Home where import Import -- This is a handler function for the GET request method on the HomeR -- resource pattern. All of your resource patterns are defined in -- config/routes -- -- The majority of the code you will write in Yesod lives in these handl...
mkrauskopf/ouch-web
Handler/Home.hs
bsd-3-clause
760
0
12
170
109
54
55
15
1