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
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Typechecking class declarations -} {-# LANGUAGE CPP #-} module TcClassDcl ( tcClassSigs, tcClassDecl2, findMethodBind, instantiateMethod, tcClassMinimalDef, HsS...
ml9951/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
19,570
0
20
6,343
3,377
1,769
1,608
248
3
{-# LANGUAGE Unsafe #-} {-# LANGUAGE MagicHash, UnboxedTuples #-} ----------------------------------------------------------------------------- -- | -- Module : Debug.Trace -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : ...
lukexi/ghc
libraries/base/Debug/Trace.hs
bsd-3-clause
9,104
0
17
1,845
914
532
382
79
1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Text/Encoding.hs" #-} {-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, GeneralizedNewtypeDeriving, MagicHash, UnliftedFFITypes #-} {-# LANGUAGE Trustworthy #-} -- | -- Module : Data.Text.Encodin...
phischu/fragnix
tests/packages/scotty/Data.Text.Encoding.hs
bsd-3-clause
18,760
0
39
4,932
3,556
1,931
1,625
259
4
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1998 Desugaring foreign declarations (see also DsCCall). -} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} module DsForeign ( dsForeigns ) where #include "HsVersions.h" import GhcPrelude import Tc...
shlevy/ghc
compiler/deSugar/DsForeign.hs
bsd-3-clause
31,422
0
26
10,716
5,859
3,025
2,834
-1
-1
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Core.DeepSeq where import Idris.Core.TT import Idris.Core.CaseTree import Idris.Core.Evaluate import Control.DeepSeq instance NFData Name where rnf (UN x1) = rnf x1 `seq` () rnf (NS x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf (MN x1 x...
raichoo/Idris-dev
src/Idris/Core/DeepSeq.hs
bsd-3-clause
9,317
0
12
3,168
4,919
2,581
2,338
215
0
{-# LANGUAGE TupleSections #-} ----------------------------------------------------------------------------- -- | -- Module : System.Taffybar.Information.CPU2 -- Copyright : (c) José A. Romero L. -- License : BSD3-style (see LICENSE) -- -- Maintainer : José A. Romero L. <escherdragon@gmail.com> -- Stability...
teleshoes/taffybar
src/System/Taffybar/Information/CPU2.hs
bsd-3-clause
2,733
0
13
452
563
306
257
42
2
{-# LANGUAGE CPP #-} -- | -- Module: Data.Aeson.Internal.Time -- Copyright: (c) 2015-2016 Bryan O'Sullivan -- License: BSD3 -- Maintainer: Bryan O'Sullivan <bos@serpentine.com> -- Stability: experimental -- Portability: portable module Data.Aeson.Internal.Time ( TimeOfDay64(..) , fromPico ...
dmjio/aeson
src/Data/Aeson/Internal/Time.hs
bsd-3-clause
425
0
5
92
44
33
11
9
0
module M (T(..), k) where data T = C2 Float Float k = 54
kmate/HaRe
old/testing/removeCon/M_TokOut.hs
bsd-3-clause
61
0
6
18
32
20
12
3
1
module TFFMonad where import Syntax import TypesTerms import Char(chr,ord) -------------------------------------------------------------------------------- -- The monad -- type Env = [(HsName, Term)] type FreshVars = (Int, Int, Int) tvarCtr (x,_,_) = x funCtr (_,x,_) = x valCtr (_,_,x) = x incTvarCtr...
forste/haReFork
tools/TFF/TFFMonad.hs
bsd-3-clause
1,623
0
13
461
804
442
362
38
2
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Prelude hiding ( mod, id, mapM ) import GHC --import Packages import HscTypes ( isBootSummary ) import Digraph ( flattenSCCs ) import DriverPhases ( isHaskellSrcFilename ) import HscTypes ( msHsFilePath ) import Name ...
olsner/ghc
utils/ghctags/Main.hs
bsd-3-clause
14,654
0
19
4,227
3,908
1,982
1,926
275
24
module ListSort () where import Language.Haskell.Liquid.Prelude split :: [a] -> ([a], [a]) split (x:(y:zs)) = (x:xs, y:ys) where (xs, ys) = split zs split xs = (xs, []) merge :: Ord a => [a] -> [a] -> [a] merge xs [] = xs merge [] ys = ys merge (x:xs) (y:ys) | x <= y = x:(merge xs (y:ys)) | ...
abakst/liquidhaskell
tests/neg/ListMSort.hs
bsd-3-clause
824
2
11
238
436
232
204
24
2
module Poly0 () where import Language.Haskell.Liquid.Prelude myabs x = if x `gt` 0 then x else 0 `minus` x myid arg = arg ---------------------------------------------------------- x = choose 0 prop_id1 = let x' = myabs x in let x'' = myid x' in liquidAssertB (x'' `geq` 0) prop_id...
mightymoose/liquidhaskell
tests/neg/poly0.hs
bsd-3-clause
467
0
11
130
170
94
76
13
2
{-# LANGUAGE CPP #-} -- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 1994-2004 -- -- ----------------------------------------------------------------------------- module PPC.Regs ( -- squeeze functions virtualRegSqueeze, real...
snoyberg/ghc
compiler/nativeGen/PPC/Regs.hs
bsd-3-clause
10,210
0
15
3,235
2,541
1,319
1,222
229
13
{- This module handles generation of position independent code and dynamic-linking related issues for the native code generator. This depends both the architecture and OS, so we define it here instead of in one of the architecture specific modules. Things outside this module which are related to this: + ...
urbanslug/ghc
compiler/nativeGen/PIC.hs
bsd-3-clause
33,373
0
20
10,002
5,190
2,629
2,561
409
8
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} -- This program must be called with GHC's libdir as the single command line -- argument. module Main where -- import Data.Generics import Data.Data import Data.List import System.IO import GHC import BasicTypes import...
acowley/ghc
testsuite/tests/ghc-api/annotations/stringSource.hs
bsd-3-clause
4,554
1
20
1,504
1,433
782
651
94
7
{-# LANGUAGE InstanceSigs, PartialTypeSignatures #-} module T11670 where import Foreign.C.Types import Foreign.Storable import Foreign.Ptr peek :: Ptr a -> IO CLong peek ptr = peekElemOff undefined 0 :: IO _ peek2 :: Ptr a -> IO CLong peek2 ptr = peekElemOff undefined 0 :: _ => IO _ -- castPtr :: Ptr a -> Ptr b --...
olsner/ghc
testsuite/tests/partial-sigs/should_compile/T11670.hs
bsd-3-clause
371
0
6
74
96
50
46
9
1
module ShouldFail where -- !!! constraining the type variable in a class head is illegal -- Simpler version of tcfail149 class Foo a where op :: Eq a => a -> a
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail150.hs
bsd-3-clause
163
0
8
35
31
17
14
3
0
module Language.Haskell.Expression.Lexer ( Token(..) , tokenize ) where data Token = Identifier String deriving (Eq, Show) tokenize :: String -> [Token] tokenize input = [Identifier input]
beni55/interpolate
src/Language/Haskell/Expression/Lexer.hs
mit
196
0
6
33
66
39
27
7
1
import Test.HUnit import Q14 assertEqualIntList :: String -> [Int] -> [Int] -> Assertion assertEqualIntList = assertEqual test1 = TestCase (assertEqualIntList "dupli [] should be [] ." ([] ) (dupli [] )) test2 = TestCase (assertEqualIntList "dupli [1] should be [1,1] ." ([1,1] ) (dupli [1...
cshung/MiscLab
Haskell99/q14.test.hs
mit
475
0
10
98
170
95
75
8
1
import Data.List isInAny2 needle haystack = any (\s -> needle `isInfixOf` s) haystack isInAny needle haystack = any inSequence haystack where inSequence s = needle `isInfixOf`s
tamasgal/haskell_exercises
Real_World_Haskell/ch04/Partial.hs
mit
182
0
8
31
66
35
31
4
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.WebGLCompressedTextureATC ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.WebGLCompressedTextureATC #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) impo...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/WebGLCompressedTextureATC.hs
mit
388
0
5
33
33
26
7
4
0
import System.Environment import Debug.Trace -- List of [I.C.] -> t -> [Xs] type Coord = Double type Coords = [Coord] type ODE = Coords->Time->Coord type Time = Double type ErrFun = Coords->Coords->Bool -- Applies each function to a single argument, returns list applyeach :: [a->b] -> a -> [b] -> [b] applyeach (h:t) ...
Renmusxd/rk4
rk4.hs
mit
2,981
0
34
697
1,333
693
640
55
3
{-# LANGUAGE OverloadedStrings #-} module View.Search where import Data.Time.Clock () import Lucid import Model import Static import View.Utils searchPage :: SessionInfo -> Int -> [Snippet] -> Html () searchPage u itermPerPage ss = doctypehtml_ . html_ ...
winterland1989/jsmServer
src/View/Search.hs
mit
592
0
17
192
168
83
85
16
1
{-# LANGUAGE OverloadedStrings #-} import System.Random import Network.WebSockets import Control.Concurrent import Control.Monad import Data.Text type Price = (String, Double) main :: IO () main = do chan <- newChan forkIO (notifyClients chan) runServer "127.0.0.1" 3000 $ \pc -> do conn <- acceptRequest pc...
iansullivan88/stock-ticker
Main.hs
mit
927
0
14
175
330
164
166
28
1
{-# LANGUAGE ScopedTypeVariables #-} module Data.Yaml.Frontmatter where import Data.Attoparsec.ByteString import Data.Frontmatter.Internal import Data.Yaml (FromJSON, Value, decodeEither) -- | -- Parses a YAML frontmatter or JSON frontmatter from a 'ByteString' as a -- '...
yamadapc/haskell-frontmatter
src/Data/Yaml/Frontmatter.hs
mit
700
0
12
181
112
61
51
12
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.Gamepad (js_getId, getId, js_getIndex, getIndex, js_getConnected, getConnected, js_getTimestamp, getTimestamp, js_getMapping, getMapping, js_getAxes, getAxes, js_getButtons, getButtons, ...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/Gamepad.hs
mit
3,400
42
10
469
821
475
346
50
1
module Main where import Solidran.Output import Solidran.Cons.Detail main :: IO () main = do c <- getContents let ls = readInput c putStrLn . consensus $ ls putStrLn . output . profileMat $ ls
Jefffrey/Solidran
src/Solidran/Cons/Main.hs
mit
211
0
10
52
75
38
37
9
1
{-# OPTIONS_GHC -F -pgmF htfpp #-} module Primes.Test (htf_thisModulesTests) where import Data.List import Primes import Test.Framework test_primeFactorisation_5 = assertEqual (primeFactorisation 5) [5] test_primeFactorisation_55 = assertEqual (primeFactorisation 55) [5,11] test_primeF...
NorfairKing/project-euler
test/haskell/Primes/Test.hs
gpl-2.0
385
0
7
69
94
54
40
8
1
{-# LANGUAGE TemplateHaskell, RankNTypes #-} module Ocram.Analysis.Filter -- exports {{{1 ( global_constraints, critical_constraints, ErrorCode(..) ) where -- imports {{{1 import Control.Monad (guard) import Data.Generics (mkQ, everything, extQ) import Data.Data (Data) import Data.List (findIndices) import Data.Mayb...
copton/ocram
ocram/src/Ocram/Analysis/Filter.hs
gpl-2.0
11,704
0
20
2,803
3,319
1,716
1,603
256
23
import XMonad import XMonad.Layout.NoBorders (noBorders) import XMonad.Layout.PerWorkspace (onWorkspace) import XMonad.Layout.Spacing import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Util.Run import XMonad.Util.EZConfig import System.IO import Control.Monad import qualified XMonad.StackSet ...
aitzol/dotfiles
.xmonad/xmonad.hs
gpl-2.0
3,287
0
15
790
771
443
328
61
1
{- | Module : $Header$ Description : A formula wrapper from formulae defined in CASL.AS_Basic_CASL to data Formula defined in Common.Normalization Copyright : (c) Immanuel Normann, Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : inormann@jacobs-university.de Stability : prov...
nevrenato/Hets_Fork
Search/CASL/FormulaWrapper.hs
gpl-2.0
6,339
12
14
1,240
1,498
765
733
64
2
-- PolOperaciones.hs -- Operaciones con polinomios. -- José A. Alonso Jiménez https://jaalonso.github.com -- ===================================================================== {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Tema_21.PolOperaciones (mo...
jaalonso/I1M-Cod-Temas
src/Tema_21/PolOperaciones.hs
gpl-2.0
10,157
0
11
2,609
1,670
892
778
95
1
data Vector t = Vector t t t deriving(Show) vplus::(Num t)=>Vector t->Vector t->Vector t Vector i j k `vplus` Vector x y z = Vector (i+x) (j+y) (k+z)
srijanshetty/haskell-sample
Vector.hs
gpl-2.0
152
0
8
30
108
55
53
3
1
{- Copyright (C) 2009 John Millikin <jmillikin@gmail.com> This program 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. This program is ...
astro/network-protocol-xmpp
Tests/Core.hs
gpl-3.0
4,198
36
16
799
1,228
630
598
79
2
{-# LANGUAGE DeriveDataTypeable #-} -- | -- Copyright : (c) 2010, 2011 Benedikt Schmidt & Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : GHC only -- -- Helpers for inspecting the environment of the Tamarin prover. module Main.Environment where ...
ekr/tamarin-prover
src/Main/Environment.hs
gpl-3.0
6,102
0
18
1,788
1,197
607
590
108
3
<?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN" "http://java.sun.com/products/javahelp/helpset_1_0.dtd"> <helpset version="1.0"> <!-- title --> <title>Xena - Help</title> <!-- maps --> <maps> <mapre...
srnsw/xena
plugins/basic/doc/BasicHelp.hs
gpl-3.0
585
41
32
104
213
108
105
-1
-1
{- ============================================================================ | Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/Fallback/View/Region.hs
gpl-3.0
5,589
0
26
1,752
1,155
607
548
80
5
-- Copyright 2016, 2017 Robin Raymond -- -- This file is part of Purple Muon -- -- Purple Muon 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 -- (at your option) an...
r-raymond/purple-muon
src/Client/States/Types.hs
gpl-3.0
1,774
0
10
389
175
120
55
20
0
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Rank2Types #-} module Object ( Object(..) , objectCenter, objectRadius, objectFaces , Face(..) , faceColor, facePlane , inReach , intersectObject ) where ...
MatthiasHu/4d-labyrinth
src/Object.hs
gpl-3.0
1,829
0
12
379
605
330
275
-1
-1
module Main ( main ) where import EightPuzzle import EightPuzzle.PriorityQueue import Control.Monad.ST (runST, ST) import Control.Monad.IO.Class (liftIO) import Control.Monad.Writer (runWriter, tell, runWriterT, Writer, writer, WriterT, execWriterT) import Control.Monad.Trans.Class (lift) impo...
cdepillabout/coursera
algorithms1/week4/src/Main.hs
gpl-3.0
3,400
0
12
1,136
992
446
546
76
1
module HTCF.TcfParser ( mkTcfElement , mkTcfElementButStructure , mkTcfText , mkTcfTextFromCharRef , mkTcfStructure , mkTcfLineBreak ) where import Text.XML.HXT.Core import qualified Text.XML.HXT.DOM.XmlNode as XN import Data.Maybe import HTCF.TcfParserTypeDefs import HTCF.Position import HTCF.ConfigPar...
lueck/htcf
src/HTCF/TcfParser.hs
gpl-3.0
2,883
0
13
532
784
421
363
62
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Settings/Filters/Create.hs
mpl-2.0
3,349
0
15
750
386
233
153
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/TargetHTTPSProxies/Delete.hs
mpl-2.0
3,615
0
15
793
388
233
155
66
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} module Language.Haskell.Brittany.Internal.Layouters.Pattern where import qualified Data.Foldable as Foldable import qualified Data.Sequence as Seq import qualified Data.Text as Text import GHC (GenLocated(L), ol_val) import GHC.Hs import qualified GHC.Old...
lspitzner/brittany
source/library/Language/Haskell/Brittany/Internal/Layouters/Pattern.hs
agpl-3.0
8,239
0
22
2,194
2,166
1,086
1,080
145
26
import System.Environment (getArgs) interactWith function inputFile outputFile = do input <- readFile inputFile writeFile outputFile (function input) splitLines [] = [] splitLines cs = let (pre, suf) = break isLineTerminator cs in pre : case suf of ('\r':'\n':rest) -> splitLines rest ...
caiorss/Functional-Programming
haskell/rwh/ch04/FixLines.hs
unlicense
909
0
12
288
266
131
135
22
4
module EKG.A169845Spec (main, spec) where import Test.Hspec import EKG.A169845 (a169845) main :: IO () main = hspec spec spec :: Spec spec = describe "A169845" $ it "correctly computes the first 20 elements" $ take 20 (map a169845 [1..]) `shouldBe` expectedValue where expectedValue = [7,14,2,4,6,3,9,12,8,...
peterokagey/haskellOEIS
test/EKG/A169845Spec.hs
apache-2.0
353
0
10
59
160
95
65
10
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/Service/FeedbackScript/Analysis.hs
apache-2.0
4,164
0
17
1,114
1,268
649
619
71
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE BangPatterns #-} module Main(main) where import Data.Int import qualified Data.Vector.Storable as S import DNA import DDP import DDP_Slice ---------------------------------------------------------------- -- Distributed dot product -...
SKA-ScienceDataProcessor/RC
MS2/dna-programs/ddp-in-memory-hierarchical.hs
apache-2.0
1,950
0
16
465
502
255
247
41
2
-- |Command-line interface to the Javascript analysis (jsaz). module Main where import System.Console.Editline.Readline import System.Console.GetOpt import System.Environment import System.IO import System.IO.Error import Data.Char (toLower) import Data.Maybe (fromJust) import Control.Monad import Control.Monad.Identi...
brownplt/ovid
src/Jsaz.hs
bsd-2-clause
8,255
0
16
1,546
2,163
1,104
1,059
-1
-1
module Main where import Code20 main :: IO () main = putStrLn $ display (countdown2 831 [1,3,7,10,25,50])
sampou-org/pfad
Code/countdown2.hs
bsd-3-clause
108
0
9
19
55
32
23
4
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} -- Module : Wwdcc -- Copyright : Copyright © 2013, Quixoftic, LLC <src@quixoftic.com> -- License : BSD3 (see LICENSE file) -- Maintainer : dhess-src@quixoftic.com -- Stability : experimental -- Portability : GHC -- -- Check https://developer.apple.co...
quixoftic/wwdcc
src/Wwdcc.hs
bsd-3-clause
7,091
0
17
2,325
1,728
904
824
138
3
module Settings.Builders.GenPrimopCode (genPrimopCodeBuilderArgs) where import Expression import Predicates (builder, file) -- Stdin/stdout are handled in a special way. See Rules/Actions.hs. genPrimopCodeBuilderArgs :: Args genPrimopCodeBuilderArgs = builder GenPrimopCode ? mconcat [ file "//PrimopWrappers.hs" ...
quchen/shaking-up-ghc
src/Settings/Builders/GenPrimopCode.hs
bsd-3-clause
1,614
0
9
385
281
136
145
23
1
module Frenetic.Pattern ( Matchable (..) ) where import Data.Maybe {-| A class for types that compose similar to wildcards. All instances must satisfy the following: * @match@ defines a partial order; @top@ is the top element of this order and @intersect@ is a meet. * Meets are exact: if @match x y@ and @mat...
frenetic-lang/netcore-1.0
src/Frenetic/Pattern.hs
bsd-3-clause
747
0
9
189
159
83
76
12
0
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, OverloadedStrings, GADTs, FlexibleContexts, MultiParamTypeClasses, GeneralizedNewtypeDeriving, RankNTypes, NamedFieldPuns #-} -- | Global sqlite database shared by all projects. -- Warning: this is currently only accessible from __outsi...
martin-kolinek/stack
src/Stack/Docker/GlobalDB.hs
bsd-3-clause
5,063
0
17
1,288
1,028
547
481
81
2
module RefacDuplicates(detectDuplicates,detectSpecDuplicates) where import PrettyPrint import PosSyntax import Maybe import TypedIds import UniqueNames hiding (srcLoc) import PNT import TiPNT import List import RefacUtils import PFE0 (findFile, getCurrentModuleGraph) import AbstractIO import Prelude hiding (putS...
forste/haReFork
refactorer/RefacDuplicates.hs
bsd-3-clause
13,540
178
15
3,339
3,397
1,831
1,566
-1
-1
{-# LANGUAGE TemplateHaskell, ViewPatterns, MultiParamTypeClasses, TypeFamilies #-} import Control.Lens import qualified Data.Indexed as I import qualified Data.Vector as V import Data.Vector ((!)) import qualified Data.Coordinates as C class (C.Coord co) => Grid grid co where type Elem grid :: * translate :: co...
onomatic/sigmund
src/Grid.hs
bsd-3-clause
1,074
28
12
244
342
198
144
15
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module Main where import Web.Twitter.Conduit hiding (lookup) import Web.Twitter.Types.Lens import Web.Authenticate.OAuth as OA import qualified Data.ByteString.Char8 as B8 import Network.HTTP.Client (Manager, newManager) import Network.HTTP.Client...
nomicflux/TwitterScraper
src/Main-Pin.hs
bsd-3-clause
2,038
0
13
666
444
227
217
40
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE...
rpereira/servant-blog
src/Models/User.hs
bsd-3-clause
1,099
0
7
334
85
56
29
18
0
module Pages ( findAllFiles ) where import System.Directory (getDirectoryContents, doesDirectoryExist) data Tree a = Directory a [Tree a] | File a deriving (Show) traverseBF :: Tree a -> [a] traverseBF tree = tbf [tree] where tbf [] = [] tbf xs = concatMap files xs ++ tbf (concatMap directories...
homam/stack-test
src/Pages.hs
bsd-3-clause
1,222
0
15
297
462
237
225
30
4
module EulerSpec where import Euler import Test.Hspec spec :: Spec spec = do describe "p1" $ do it "correctly calculates the example problem" $ do p1 10 `shouldBe` 23 describe "p2" $ do it "correctly calculates the example problem" $ do p2 100 `shouldBe` 44
tylerjl/euler-haskell
test/EulerSpec.hs
bsd-3-clause
309
0
14
96
86
42
44
11
1
{-# LANGUAGE GADTs , KindSignatures , DataKinds , ScopedTypeVariables , PatternGuards , Rank2Types , TypeOperators , FlexibleContexts , UndecidableInstances #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} ---------------------...
zachsully/hakaru
haskell/Language/Hakaru/Pretty/Concrete.hs
bsd-3-clause
25,260
0
28
8,903
9,310
4,730
4,580
495
7
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Session where import Control.Lens import Class.Name import Data.Type import Storage.Cache.Env import Storage.Db.Env data Session = Session { _sessionCache :: Cache, _sessionDbEnv :: DbEnv } class HasSess...
showpoint/refs
src/Session.hs
bsd-3-clause
1,013
0
10
237
264
147
117
30
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fplugin Brisk.Plugin #-} {-# OPTIONS_GHC -fplugin-opt Brisk.Plugin:main #-} module Simple03 where import Control.Distributed.Process import Data.Binary import Data.Typ...
abakst/brisk-prelude
examples/Simple03.hs
bsd-3-clause
791
0
11
209
182
94
88
24
2
{- - Capture.hs - By Steven Smith -} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} -- | 'Captureable' is a type class for types that can be parsed from 'Text'. -- It is used by the 'capture' 'Route' to automatically handle parsing. -- -- If you would like to make your own data type 'Capture...
stevely/DumpTruck
src/Web/DumpTruck/Capture.hs
bsd-3-clause
2,906
0
10
518
436
252
184
45
0
{-# LANGUAGE TemplateHaskell #-} module Render.GLModeT where import Control.Lens (makeLenses) import qualified Data.ByteString as B import Types data GLModeT = GLModeT { _glmName :: B.ByteString , _glmMinimize :: Int , _glmMaximize :: Int } makeLenses ''GLModeT
ksaveljev/hake-2
src/Render/GLModeT.hs
bsd-3-clause
302
0
9
76
65
40
25
10
0
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} -- | This module is a top-level convenience module which re-exports most of the -- @io-streams@ library. -- -- It is recommended to import this module qualified, as follows: -- -- @ -- import "System.IO.Streams" ('Generat...
LukeHoersten/io-streams
src/System/IO/Streams.hs
bsd-3-clause
4,358
0
5
787
338
264
74
51
0
module Scanner (scan) where import Control.Monad (liftM) import Dep (Dep(Dep)) -- Convert a list of dep files into a list of deps scan :: [FilePath] -> IO [Dep] scan = liftM concat . mapM mapper where mapper fn = liftM (parse_file fn) $ readFile fn -- ===============================================================...
ericmoritz/deps
src/Scanner.hs
bsd-3-clause
838
0
10
168
262
143
119
18
1
{-# LANGUAGE OverloadedStrings #-} module CacheDNS.Crypto.Common ( getSSLCryptor ) where import qualified Data.HashMap.Strict as HM import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as C import Data.IntMap.Strict (fromList, (!)) import Data.List (sortBy) import Data.Maybe (fromJus...
DavidAlphaFox/CacheDNS
src/CacheDNS/Crypto/Common.hs
bsd-3-clause
3,675
0
20
1,076
1,067
584
483
82
6
{-# LANGUAGE CPP #-} module Data.TrieMap.Representation.Instances.Vectors.Tests where import Data.TrieMap.Representation.Class import Data.TrieMap.Representation.Instances.Vectors () import Data.TrieMap.Representation.Instances.Prim () import Data.TrieMap.Representation.Tests import Data.TrieMap.Arbitrary () import D...
lowasser/TrieMap
Data/TrieMap/Representation/Instances/Vectors/Tests.hs
bsd-3-clause
715
0
8
108
203
124
79
25
1
module Game.World.Biome( Biome(..) ) where import Control.DeepSeq import Control.Monad (mzero) import Data.Range import Data.Text import Data.Yaml import GHC.Generics (Generic) -- | Describing type of climatic class data Biome = Biome { -- | Display name of biome biomeName :: !Text -- | Annual precipit...
Teaspot-Studio/gore-and-ash-game
src/server/Game/World/Biome.hs
bsd-3-clause
850
0
11
185
223
124
99
-1
-1
{-# LANGUAGE UndecidableInstances #-} module Reflex.Monad.Supply ( SupplyT , Supply , runSupplyT , evalSupplyT , runSupply , evalSupply , runSplit , getFresh , getSplit ) where import Reflex import Reflex.Monad.Class import Control.Monad import Control.Monad.Identity import Co...
Saulzar/reflex-host
src/Reflex/Monad/Supply.hs
bsd-3-clause
2,924
0
19
726
1,227
632
595
-1
-1
module Expr ( Value(..), Expr(..), UnOp(..), BinOp(..), Statement(..) , ($=), (.<), (.>), (.*), (.+), (.-), (.|), (.&), (.=), not_, neg , priority ) where import Text.PrettyPrint data Value = I Integer | B Bool deriving Eq data BinOp = Plus | Mul | Minus | And | Or | Less | Greater | Equals deriving ...
SergeyKrivohatskiy/fp_haskell
hw11/Interpreter/Expr.hs
mit
2,373
0
14
673
1,061
574
487
79
1
----------------------------------------------------------------------------------------- {-| Module : Draw Copyright : (c) Daan Leijen 2003 License : wxWindows Maintainer : wxhaskell-devel@lists.sourceforge.net Stability : provisional Portability : portable Drawing. -} ---------------------------...
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Draw.hs
lgpl-2.1
34,713
0
21
10,131
7,689
3,840
3,849
648
20
module Language.StreamIt.Core ( Exp (..) , Var (..) , CoreE (..) , Elt (..) , NumE , Const (..) , Void , Array (..) , true , false , constant , ref , not_ , (&&.) , (||.) , and_ , or_ , (==.) , (/==.) , (<.) , (<=.) , (>.) , (>=.) , (.++) , (.--) , (+=) , (-=) , (...
adk9/haskell-streamit
Language/StreamIt/Core.hs
bsd-3-clause
10,249
0
15
2,985
4,349
2,202
2,147
-1
-1
------------------------------------------------------------------------------- --- $Id: BSort.hs#1 2009/03/06 10:53:15 REDMOND\\satnams $ ------------------------------------------------------------------------------- module Main where import System.Mem import System.Random import System.Time -----------...
ml9951/ThreadScope
papers/haskell_symposium_2009/bsort/BSort.hs
bsd-3-clause
6,086
0
15
1,072
1,799
998
801
102
2
module Views.BanList where import ClientState import Control.Lens import Graphics.Vty.Image import Irc.Format import Irc.Model banListImage :: Char -> Identifier -> ClientState -> [Image] banListImage mode chan st = case view (connChannels . ix chan . chanMaskLists . at mode) conn of Nothing -> [string (withFo...
bitemyapp/irc-core
driver/Views/BanList.hs
bsd-3-clause
861
0
11
152
286
144
142
20
3
{-# OPTIONS -XTypeOperators -XMultiParamTypeClasses #-} module TestInh where -- class (:<) r1 r2 where -- to :: r1 -> r2 -- override :: r1 -> (r2 -> r2) -> r1 newtype R1 = R1 {fun1 :: Int -> Int} data R2 = R2 {toR1 :: R1, fun2 :: Int -> Int} t1 this = R1 (\n -> if (n==0) then 1 else fun1 this (n-1)) t2 this ...
bixuanzju/fcore
lib/TestInh.hs
bsd-2-clause
500
0
11
125
234
127
107
9
2
-- Test purpose: -- RebindableSyntax does not play that well with MonadFail, so here we ensure -- that when both settings are enabled we get the proper warning. {-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-} {-# LANGUAGE RebindableSyntax #-} module MonadFailWarningsWithRebindableSyntax where import Prelude t...
gridaphobe/ghc
testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs
bsd-3-clause
356
0
8
63
35
20
15
7
1
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Network.Wai.Middleware.RequestLogger import Network.Wai.Middleware.Gzip import Web.Scotty main :: IO () main = scotty 3000 $ do -- Note that files are not gzip'd by the default settings. middleware $ gzip $ def { gzipFiles = GzipCompress } ...
edofic/scotty
examples/gzip.hs
bsd-3-clause
566
0
11
126
116
60
56
13
1
{-# LANGUAGE OverloadedStrings #-} import System.Random import System.Environment import Debug.Trace import Data.List import Control.DeepSeq import Data.Map (Map) import qualified Data.Map as Map -- ---------------------------------------------------------------------------- -- <<Talk newtype Talk = Talk Int deri...
AndrewRademacher/parconc-examples
timetable.hs
bsd-3-clause
3,686
22
14
1,088
1,306
669
637
78
2
{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} #if __GLASGOW_HASKELL__ >= 711 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif #ifndef MIN_VERSION_base #define MIN_VERSION_base(x,y,z) 1 #endif ---------...
danidiaz/lens
src/Generics/Deriving/Lens.hs
bsd-3-clause
3,733
0
19
732
774
424
350
53
1
module EnvMT (module IxEnvMT, F.MT(..), F.HasEnv, getEnv, inEnv, inModEnv) where import IxEnvMT hiding (HasEnv(..)) import qualified MT as F getEnv :: F.HasEnv m F.Z e => m e inEnv :: F.HasEnv m F.Z e => e -> m a -> m a inModEnv :: F.HasEnv m F.Z e => (e -> e) -> m a -> m a getEnv = F.getEnv F.this inEn...
forste/haReFork
tools/base/lib/Monads/EnvMT.hs
bsd-3-clause
380
0
8
98
186
101
85
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 HsImpExp: Abstract syntax: imports, exports, interfaces -} {-# LANGUAGE DeriveDataTypeable #-} module HsImpExp where import Module ( ModuleName ) import HsDoc ( HsDocString ) import OccName ...
acowley/ghc
compiler/hsSyn/HsImpExp.hs
bsd-3-clause
8,272
0
14
2,696
1,592
861
731
102
1
{-# OPTIONS_GHC -funbox-strict-fields #-} module T5252Take2a ( WriteMessage(..) , WriteDevice ) where import qualified Data.ByteString as ByteString data WriteMessage = WriteMessage !WriteDevice newtype WriteDevice = WriteDevice ByteString.ByteString
wxwxwwxxx/ghc
testsuite/tests/deSugar/should_compile/T5252Take2a.hs
bsd-3-clause
255
0
7
31
45
29
16
7
0
module B where import A b x = x
wxwxwwxxx/ghc
testsuite/tests/ghci.debugger/scripts/break023/B.hs
bsd-3-clause
34
0
5
11
15
9
6
3
1
module Haggcat.TestHelper where import Control.Monad import qualified Data.Aeson as Aeson import qualified Data.ByteString.Lazy as LBS import Haggcat.Client import Haggcat.Types getTestConfig :: FilePath -> IO Config getTestConfig = liftM read . readFile loadTestClient :: IO ...
carymrobbins/haggcat
src/Haggcat/TestHelper.hs
mit
798
0
11
173
202
103
99
21
2
module Hasql.Private.Encoders.Params where import Hasql.Private.Prelude import qualified Database.PostgreSQL.LibPQ as A import qualified PostgreSQL.Binary.Encoding as B import qualified Hasql.Private.Encoders.Value as C import qualified Hasql.Private.PTI as D import qualified Text.Builder as E -- | -- Encoder of som...
nikita-volkov/hasql
library/Hasql/Private/Encoders/Params.hs
mit
949
0
14
176
299
169
130
24
1
{-# LANGUAGE FlexibleInstances, ImplicitParams #-} import Numeric.LinearAlgebra.LAPACK import Numeric.LinearAlgebra.Algorithms import Data.Packed.Matrix import qualified Data.Matrix as M import Extensions.Units import Extensions.UnitsSolve import Extensions.UnitsEnvironment import Data.Ratio import Data.List import Sy...
ucam-cl-dtg/naps-camfort
dev/lapack-test.hs
mit
6,676
34
23
2,386
2,764
1,532
1,232
120
2
{-| Module : Text.Microparsec Description : A lightweight parser combinator library inspired by parsec Copyright : © 2015 Dathan Ault-McCoy License : GPL-3 Maintainer : kwarrtz@icloud.com Portability : POSIX Microparsec is a lightweight parser combinator library sharing many features with the parsec libra...
Kwarrtz/microparsec
src/Text/Microparsec.hs
mit
6,291
0
14
1,517
1,334
719
615
126
1
{-# LANGUAGE OverloadedStrings #-} module CFDI.PAC.FelSpec ( spec ) where import CFDI import CFDI.PAC ( StampError(PacError) , cancelCFDI , getPacStamp , stamp , stampLookup ) import CFDI.PAC.Fel import Control.Monad (when) import Data.Either (isLeft, isRight) import Data.Maybe ...
yusent/cfdis
test/unit/CFDI/PAC/FelSpec.hs
mit
5,200
0
23
1,654
1,411
729
682
154
1
module Logger where import Control.Concurrent --import Data.List import Parser (Cmd) type Log = (String, Cmd) newLogCache :: IO (MVar [Log]) newLogCache = newMVar [] log :: String -> Cmd -> MVar [Log] -> IO () log nick cmd cache = do modifyMVar_ cache (\cache -> do return $ cache ++ [(nick, cmd)])
osa1/dolap-chat
src/Logger.hs
mit
315
0
14
68
133
73
60
10
1
module Users.Controller ( module Users.Actions.Index , module Users.Actions.Show ) where import Users.Actions.Index import Users.Actions.Show
toddmohney/json-api
example/src/Users/Controller.hs
mit
150
0
5
22
34
23
11
5
0
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Main where import Control.Applicative ((<$>), (<*>)) import Control.Lens (IndexPreservingGetter, both, each, ix, over, to, use,...
pmiddend/physie
src/Physie/Main.hs
mit
23,261
0
18
7,680
7,424
3,938
3,486
405
4
{-# LANGUAGE FlexibleContexts #-} module ProjectEuler.Problem68 ( problem ) where import Control.Monad import Control.Monad.State import Data.Function import Data.List import Petbox import ProjectEuler.Types problem :: Problem problem = pureProblem 68 Solved result {- 5-gon encoding: - the outer ring is a...
Javran/Project-Euler
src/ProjectEuler/Problem68.hs
mit
1,817
0
14
646
585
311
274
52
1
module Notations where test :: Int -> Int -> Int test x y = let q | x == 2 && y == -1 = x | y == 0 = -1 | otherwise = quot x y in q * 2 {- -- The goal of this test is to add edits to -- transform the above into something like this: Require Import Coq.ZArith.BinInt. Open Scope bool_scope. Open ...
antalsz/hs-to-coq
examples/tests/Notations.hs
mit
893
0
14
294
92
45
47
7
1
module Main where import Control.Applicative import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as L -- import qualified Data.Attoparsec.ByteString.Char8 as P import qualified Data.ByteString.Builder as B import Data.Maybe import ...
mjansen/disk-info
compare-directories.hs
mit
2,092
0
14
526
586
317
269
49
1
{-# LANGUAGE Trustworthy #-} module MIO.Random ( Read(..) , Write(..) , module Control.Monad.Random , module Control.Monad.Trans.Class ) where import qualified System.Random as R import MIO.MIO import MIO.Privileges () import Control.Monad.Random import Control.Monad.Trans.Class class (Monad m) => Write m where get...
RTS2013/RTS
server/src/MIO/Random.hs
mit
659
0
11
110
245
140
105
21
0
{-# LANGUAGE CPP #-} {- | Module : Language.Scheme.FFI Copyright : Justin Ethier Licence : MIT (see LICENSE in the distribution) Maintainer : github.com/justinethier Stability : experimental Portability : non-portable (GHC API) This module contains the foreign function interface. -} module Language.Sch...
justinethier/husk-scheme
hs-src/Language/Scheme/FFI.hs
mit
4,932
0
20
1,091
600
307
293
41
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGFECompositeElement (pattern SVG_FECOMPOSITE_OPERATOR_UNKNOWN, pattern SVG_FECOMPOSITE_OPERATOR_OVER, pattern SVG_FECOMPOSITE_OPERATOR_IN, pattern SVG_FECOMPOSITE_OPERATOR_OUT, ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/SVGFECompositeElement.hs
mit
4,803
42
11
664
1,032
581
451
78
1
import qualified Data.Vector.Unboxed as V import Data.Int (Int8) import Data.Bits (xor) import Data.Char (digitToInt, intToDigit) initialState :: String initialState = "11100010111110100" diskLength1 :: Int diskLength1 = 272 diskLength2 :: Int diskLength2 = 35651584 -- given a string it returns an equivalent dragon...
bno1/adventofcode_2016
d16/main.hs
mit
2,420
2
16
690
689
351
338
40
2