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
module Rebase.Data.Text.Internal ( module Data.Text.Internal ) where import Data.Text.Internal
nikita-volkov/rebase
library/Rebase/Data/Text/Internal.hs
mit
98
0
5
12
23
16
7
4
0
-- vim: ts=2:sw=2:sts=2 {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, TypeSynonymInstances #-} module XMonad.Config.Amer.Layout ( MyTransformers(..) ) where import XMonad (Typeable, Window) import XMonad.Layout (Full(..)) import XMonad.Layout.NoBord...
amerlyq/airy
xmonad/cfg/Layout.hs
mit
961
0
10
207
228
135
93
16
0
{- HAAP: Haskell Automated Assessment Platform This module provides functions for processing Literate Haskell source code files. -} {-# LANGUAGE BangPatterns, FlexibleContexts #-} module HAAP.Code.Literate.Haskell ( lhs2hs, lhs2lhs, compileLHS ) where import HAAP.Core import HAAP.IO import HAAP.Shelly ...
hpacheco/HAAP
src/HAAP/Code/Literate/Haskell.hs
mit
3,350
0
16
738
1,127
582
545
73
3
module Lessons.Lesson6 where import Geometry quadrilateral [a,b,c,d] | across c (a,b) d = (d,b,c,a) | across a (b,c) d = (a,b,d,c) | otherwise = (a,b,c,d)
alphalambda/k12math
prog/lib/geo/Lessons/Lesson6.hs
mit
206
0
9
76
115
66
49
5
1
-- Algorithms/Sorting/Insertion Sort - Part 1 module Main where import qualified HackerRank.Algorithms.InsertionSortPart1 as M main :: IO () main = M.main
4e6/sandbox
haskell/hackerrank/InsertionSortPart1.hs
mit
158
0
6
24
31
20
11
4
1
{-# htermination minFM :: Ord a => FiniteMap [a] b -> Maybe [a] #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_minFM_4.hs
mit
85
0
3
16
5
3
2
1
0
-- |Netrium is Copyright Anthony Waite, Dave Hewett, Shaun Laurens & Contributors 2009-2018, and files herein are licensed -- |under the MIT license, the text of which can be found in license.txt -- -- The definition of the basic contract language {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Contract ( -- *...
netrium/Netrium
src/Contract.hs
mit
11,527
0
16
3,053
3,218
1,742
1,476
197
1
{-# LANGUAGE OverloadedStrings #-} module Main ( main ) where import Text.Regex.Base.RegexLike import Text.Regex.PCRE.ByteString import Data.Traversable import qualified Data.ByteString as BS main :: IO () main = do let rawSample = "[VER:v=12.45|stuff1|stuff2|stuff3[X], extra1, extra2, extra 3]" Right re <- ...
Javran/misc
regex-playground/src/Main.hs
mit
547
0
13
87
150
78
72
15
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ViewPatterns #-} module Hpack.Syntax.BuildTools ( BuildTools(..) , ParseBuildTool(..) , SystemBuildTools(..) ) where import Data.Text (Text) import qualified Data.Text as T import Data.Semigroup (Semigroup...
haskell-tinc/hpack
src/Hpack/Syntax/BuildTools.hs
mit
3,490
0
14
722
787
449
338
64
0
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} ------------------------------------------- -- | -- Module : Web.Stripe.Charge -- Copyright : (c) David Johnson, 2014 -- Maintainer : djohnson.m@gmail.com -...
dmjio/stripe
stripe-core/src/Web/Stripe/Charge.hs
mit
6,989
0
9
2,224
1,059
654
405
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Document.Tests.TrainStation ( test_case ) where -- Modules import Document.Tests.Suite -- (verify,find_errors,proof_obligation) import Logic.Expr import qualified Logic.Expr.Const as Expr import Logic.Expr.Parser import Logic.Proof import Logic.QuasiQuote import Lo...
literate-unitb/literate-unitb
src/Document/Tests/TrainStation.hs
mit
283,395
1
22
118,973
18,913
12,285
6,628
-1
-1
module Levenshtein where levenshtein :: String -> String -> Int levenshtein "" b = 0 levenshtein a "" = 0 levenshtein a b = compare a b + levenshtein (tail a) (tail b) where compare a b = if head a == head b then 0 else 1
ostera/asdf
haskell/Levenshtein.hs
mit
225
0
9
51
103
52
51
6
2
-- | This module is an extension of the "RectBinPacker.Bin" module and provides an interface that -- allows you to insert a rotatable object into a 'Bin'. The orientation of the object will be -- automatically determined to be the best fit. -------------------------------------------------------------------------------...
jochu/image-bin-packing
src/RectBinPacker/BinRotatable.hs
mit
2,037
0
9
259
262
146
116
23
1
{----------------------------------------------------------------------------------------- Module name: WebSockets Made by: Tomas Möre 2015 Usage: This is a WebSockets module inteded to run over an instance of the standard Server IMPORTANT: If you start a websockets session DO NOT attempt to send any kind of ...
black0range/Smutt
src/Smutt/WebSocket/Server/WebSocket.hs
mit
25,956
267
15
8,664
4,108
2,245
1,863
-1
-1
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module PrintC where -- pretty-printer generated by the BNF converter import AbsC import Data.Char -- the top-level printing method printTree :: Print a => a -> String printTree = render . prt 0 type Doc = [ShowS] -> [ShowS] doc :: ShowS -> Doc doc = (:) render ::...
aufheben/Y86
Compiler/lab/C/PrintC.hs
mit
23,864
0
16
4,995
11,459
5,571
5,888
376
12
module Mortgage.Money ( Money ) where import Test.QuickCheck import Text.Printf import Data.Ratio data Money = Money {-# UNPACK #-} !Double instance Show Money where show (Money amt) = printf "%.2f" amt -- round to 0.01 instance Eq Money where (Money x) == (Money y) = round (100*x) == round (100*y) insta...
wangbj/MortageCalc
src/Mortgage/Money.hs
mit
1,247
0
10
346
592
302
290
33
0
{-**************************************************************************** * Hamster Balls * * Purpose: Common data types shared by other modules * * Author: David, Harley, Alex, Matt * * ...
harley/hamball
src/Common.hs
mit
7,661
0
13
1,981
1,735
978
757
258
2
f x = if x > 2 then do print "x" else do print "y"
itchyny/vim-haskell-indent
test/if/ifthendo.in.hs
mit
51
1
8
15
36
15
21
-1
-1
module Test where import TambaraYamagami as TY import Stringnet as S import Data.Tree as T import Data.Matrix as M import Data.Maybe import Finite import Algebra obj = (toObject M) `TY.tensorO` (toObject M) `TY.tensorO` (toObject M) m = toObject M o = toObject one notOne = toObject $ AE $ AElement 1 -- a snake equ...
PaulGustafson/stringnet
Test.hs
mit
1,938
0
12
422
541
303
238
32
2
-- |Module for representing and manipulating complex numbers. module Cplx where -- |Basic data type for storing complex numbers. data Cplx = Cplx {re :: Double, im :: Double } deriving (Eq) -- re Cplx a b = a -- im Cplx a b = b -- |Function 'conj' returns a complex conjugate of a complex number. conj :: Cplx -> Cplx ...
jmiszczak/hoqus
alternative/Cplx.hs
mit
1,306
0
11
295
414
214
200
17
1
{-# LANGUAGE PatternSignatures #-} {-# LANGUAGE PatternSignatures #-} {-# LANGUAGE DoAndIfThenElse #-} module Operate.Tutor where import Operate.Types import Types.Signed import Types.Config import Operate.Bank import Gateway.CGI import qualified Operate.Param as P import qualified Control.Aufgabe as A import qua...
marcellussiegburg/autotool
db/src/Operate/Tutor.hs
gpl-2.0
6,412
81
26
2,492
1,544
828
716
144
8
module HandlerUtils where import Control.Monad.Reader import qualified Data.ByteString.Char8 as B import Data.List import RoomsAndClients import CoreTypes import Actions thisClient :: Reader (ClientIndex, IRnC) ClientInfo thisClient = do (ci, rnc) <- ask return $ rnc `client` ci thisRoom :: Reader (ClientIn...
jeffchao/hedgewars-accessible
gameServer/HandlerUtils.hs
gpl-2.0
1,956
0
14
381
765
402
363
49
1
module Regular where import Text.Regex.PCRE import qualified Data.IntMap.Strict as IntMap import qualified Data.String.Utils as SU import Data.List toBeEscaped = "\\/[]().{}?*+|" escape :: String -> String escape s = foldl (\b a -> SU.replace [a] ("\\" ++ [a]) b) s toBeEscaped data RE = LineStart | Word |...
afroisalreadyinu/LogAnalyzer
daemon/Regular.hs
gpl-2.0
2,785
0
13
569
902
486
416
68
3
--------------------------------------------------------------------------- -- This file is part of grammata. -- -- grammata 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, ...
SRechenberger/grammata
src/Grammata/Machine/Storage.hs
gpl-3.0
1,964
0
7
317
164
111
53
17
0
-- | Creates paths based on file\'s hashes. module Util.HashDir (hashDir, hashDir') where import Prelude import Data.List import qualified Data.Text as T import System.FilePath -- | Splits the hash of the file in four parts and constucts a four levels -- directory path. hashDir :: T.Text -> FilePath hashDir = foldl'...
RaphaelJ/getwebb.org
Util/HashDir.hs
gpl-3.0
594
0
10
129
174
99
75
13
1
{-GPLV3.0 or later copyright Timothy Hobbs <timothyhobbs@seznam.cz> Copyright 2012. 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 (at your option) any later ver...
timthelion/gtk-jsinput
Graphics/UI/Gtk/Custom/JSInput.hs
gpl-3.0
4,633
0
34
1,301
1,045
497
548
104
12
module Main ( main ) where import Control.Concurrent import Network.FastCGI action :: CGI CGIResult action = do setHeader "Content-type" "text/plain" tid <- liftIO myThreadId output $ unlines [ "I am a FastCGI process!" , "Hear me roar!" , "" , show tid ] main :: I...
PuZZleDucK/PuZZleDucK.ORG
test-html/haskell/FastCGI.hs
gpl-3.0
371
0
10
108
97
50
47
14
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-analytics/gen/Network/Google/Resource/Analytics/Management/AccountUserLinks/List.hs
mpl-2.0
4,424
0
16
1,003
513
300
213
82
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Networks/UpdatePeering.hs
mpl-2.0
5,221
0
18
1,160
567
341
226
88
1
-- "Dao/Examples/FastNumbers.hs" a program for converting numbers expressed in -- english to numerical values. -- -- Copyright (C) 2008-2015 Ramin Honary. -- -- Dao 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 -- Fou...
RaminHAL9001/Dao-examples
src/Dao/Examples/Numbers.hs
agpl-3.0
46,760
0
22
8,824
3,251
2,066
1,185
-1
-1
module Ape.Transform.CommonSubExpr (commonSubExpr, emptyExprMap) where import Ape.Expr import Ape.Env import qualified Data.Map.Strict as M import Ape.Transform.NormalizeExpr import Data.List type ExprMap = M.Map (CExpr Info) String emptyExprMap :: ExprMap emptyExprMap = M.empty class CommonSubExpr a where comm...
madmann91/Ape
src/Ape/Transform/CommonSubExpr.hs
lgpl-3.0
3,097
0
17
889
1,063
552
511
50
3
module EnumFromTo where enumFromTo' :: (Enum a, Eq a) => a -> a -> [a] enumFromTo' from to = go from to [] where go from to li | from == to = li ++ [to] | otherwise = go (succ from) to (li ++ [from])
thewoolleyman/haskellbook
09/05/maor/enumfromto.hs
unlicense
226
0
11
72
117
60
57
6
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : Object.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:34 Warning : this file is machine generated - do not mo...
uduki/hsQt
Qtc/Classes/Object.hs
bsd-2-clause
2,870
76
11
564
890
466
424
70
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Mars.Command.Ls (Ls (..), LsResult (..), ansiColor) where import Data.Aeson import qualified Data.HashMap.Strict as Map import Data.Ix import Data.Maybe import Data.String imp...
lorcanmcdonald/mars
src/Mars/Command/Ls.hs
bsd-3-clause
3,676
0
18
782
1,290
685
605
104
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module River.X64.Color ( colorByRegister , RegisterError(..) ) where import Control.Monad.Trans.State.Strict (StateT, runStateT, get, put) import Data.Functio...
jystic/river
src/River/X64/Color.hs
bsd-3-clause
6,266
0
20
1,988
2,421
1,204
1,217
192
11
{-| Module : Idris.Output Description : Utilities to display Idris' internals and other informtation to the user. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Output where import Idris.Core.TT import Idris.Core.Evaluate (isDCo...
enolan/Idris-dev
src/Idris/Output.hs
bsd-3-clause
15,694
0
22
4,857
4,586
2,256
2,330
312
48
{-# OPTIONS_GHC -Wall #-} module Cis194.Hw.LogAnalysis where -- in ghci, you may need to specify an additional include path: -- Prelude> :set -isrc import Cis194.Hw.Log -- $setup -- >>> let foo = LogMessage Warning 10 "foo" -- >>> let baz = LogMessage Warning 5 "baz" -- >>> let bif = LogMessage Warning 15 "bif" -- >>...
halarnold2000/cis194
src/Cis194/Hw/LogAnalysis.hs
bsd-3-clause
4,449
0
15
1,203
914
487
427
66
5
module Problem13 ( numbers100 , sum100numbers , columnarAddition ) where import Data.List as L import Lib (digits, number) numbers100 :: [Integer] numbers100 = [ 37107287533902102798797998220837590246510135740250 , 46376937677490009712648124896970078050417018260538 , 7432498619952...
candidtim/euler
src/Problem13.hs
bsd-3-clause
7,418
0
13
1,678
551
342
209
120
1
{-# LANGUAGE RebindableSyntax #-} -- Copyright : (C) 2009 Corey O'Connor -- License : BSD-style (see the file LICENSE) {-# LANGUAGE MagicHash #-} module Bind.Marshal.Verify.Dynamic where import Bind.Marshal.Prelude import Bind.Marshal.Action.Base import Bind.Marshal.Action.Dynamic import Bind.Marshal.Action....
coreyoconnor/bind-marshal
src/Bind/Marshal/Verify/Dynamic.hs
bsd-3-clause
2,661
0
17
592
663
338
325
-1
-1
-- | Simulates the @isUnicodeIdentifierPart@ Java method. <http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html#isUnicodeIdentifierPart%28int%29> module Language.Java.Character.IsUnicodeIdentifierPart ( IsUnicodeIdentifierPart(..) ) where import Data.Char import Data.Word import Data.Set.Diet(Diet) impo...
tonymorris/java-character
src/Language/Java/Character/IsUnicodeIdentifierPart.hs
bsd-3-clause
12,247
0
10
5,425
3,632
2,264
1,368
474
1
{-# LANGUAGE TemplateHaskell #-} module NintetyNine.Problem16 where import Test.Hspec import Test.QuickCheck import Test.QuickCheck.All import Data.List -- dropEvery "abcdefghik" 3 "abdeghk" dropEvery :: [a] -> Int -> [a] dropEvery xs n | length xs < n = xs | otherwise = take (n - 1) xs ++ dropEvery (dr...
chemouna/99Haskell
src/Problem16.hs
bsd-3-clause
1,547
0
14
367
311
166
145
-1
-1
#!/usr/bin/runhaskell module Main where import Distribution.Simple main :: IO () main = defaultMain
colinhect/hsnoise
Setup.hs
bsd-3-clause
104
0
6
17
25
15
10
4
1
------------------------------------------------------------ -- | -- Module : Data.NeuralNetwork.Backend.BLASHS -- Description : A backend for neural network on top of 'blas-hs' -- Copyright : (c) 2016 Jiasen Wu -- License : BSD-style (see the file LICENSE) -- Maintainer : Jiasen Wu <jiasenwu@hotmail.c...
pierric/neural-network
Backend-blashs/Data/NeuralNetwork/Backend/BLASHS.hs
bsd-3-clause
5,167
0
14
1,079
1,526
814
712
-1
-1
-- -- Benchmark code: sample request using http-condiuit -- -- Copyright © 2012-2013 Operational Dynamics Consulting, Pty Ltd and Others -- -- The code in this file, and the program it is a part of, is made -- available to you by its authors as open source software: you can -- redistribute it and/or modify it under a B...
afcowie/pipes-http
tests/ConduitSample.hs
bsd-3-clause
2,161
0
17
545
540
293
247
48
1
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings #-} module Tests.Test.HUnitPlus.Execution where import Control.Exception(Exception, throwIO) import Data.List import Data.HashMap.Strict(HashMap) import Data.Maybe import Data.Typeable import Distribution.TestSuite import Test.HUnitPlus.Base import Test.HUnitPlus.Exec...
emc2/HUnit-Plus
test/Tests/Test/HUnitPlus/Execution.hs
bsd-3-clause
31,830
31
25
13,502
7,642
4,285
3,357
556
15
-- | -- Module : -- License : BSD-Style -- Maintainer : Nicolas DI PRIMA <nicolas@di-prina.fr> -- Stability : experimental -- Portability : unknown -- {-# LANGUAGE OverloadedStrings #-} module Main (main) where import Control.Monad (when) import Data.List (intercalate) import Network.SMTP import System....
NicolasDP/hs-smtp
cli/Main.hs
bsd-3-clause
1,713
0
18
478
474
238
236
40
4
{-# LANGUAGE MultiParamTypeClasses #-} module Lambda.Convertor.Expr where import DeepControl.Applicative import DeepControl.Monad hiding (forM, mapM) import Lambda.DataType (Lambda) import Lambda.DataType.Expr import Lambda.Action import Lambda.Convertor.PatternMatch import Util.Pseudo import Prelude hiding (forM, ...
ocean0yohsuke/Simply-Typed-Lambda
src/Lambda/Convertor/Expr.hs
bsd-3-clause
2,635
0
10
839
1,279
630
649
55
0
module Parser.ParseModule (parseModule) where import Parser.Parse import Parser.Syntax import Parser.ParseSpace import Parser.ParseDec import Parser.ParseIdent parseImportSome :: Parse Char ImportTermination parseImportSome = fmap ImportSome $ ksingleOrParenthesized parseLocalIdent parseImportAll :: Parse Char Impo...
Kiwi-Labs/kwirc
kwick/parser/ParseModule.hs
mit
1,205
2
12
193
330
152
178
42
1
{-# LANGUAGE DeriveGeneric #-} module Course where import qualified Data.Text as T import Data.Aeson import GHC.Generics data Course = Course !T.Text deriving (Show, Generic) instance FromJSON Course
ksaveljev/udemy-downloader
Course.hs
mit
204
0
8
31
53
31
22
9
0
{-# language TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-} module Binpack.Interface where import Binpack.Instance import Binpack.Example import qualified Binpack.Param as P import Binpack.Quiz import Binpack.Approximation import Binpack.InstanceTH () import Autolib.FiniteMap import Autolib.Set ...
florianpilz/autotool
src/Binpack/Interface.hs
gpl-2.0
3,351
0
21
1,248
931
459
472
79
1
{- | Module : ./CASL/ToSExpr.hs Description : translate CASL to S-Expressions Copyright : (c) C. Maeder, DFKI 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable translation of CASL to S-Expressions -} module CASL.T...
spechub/Hets
CASL/ToSExpr.hs
gpl-2.0
6,159
0
21
1,720
2,211
1,156
1,055
135
9
{- | Module : ./TPTP/Prover/EProver/ProofParser.hs Description : Parses an EProver proof. Copyright : (c) Eugen Kuksa University of Magdeburg 2017 License : GPLv2 or higher, see LICENSE.txt Maintainer : Eugen Kuksa <kuksa@iks.cs.ovgu.de> Stability : provisional Portability : non-portable (imports ...
spechub/Hets
TPTP/Prover/EProver/ProofParser.hs
gpl-2.0
980
0
18
266
209
121
88
15
4
module NGramCrackers.Ops.String ( bigrams , trigrams , getNGramsFromString , getNGramsFromList , getAlphasOnlyToString , getWordFrequency ) where import Data.Char (isAlphaNum, toLower) import NGramCrackers.NGramCrackers import NGramCrackers.Utilities.List {-| Extract bigrams from a string -} bigrams :: String -> [St...
R-Morgan/NGramCrackers
testsuite/NGramCrackers/Ops/String.hs
agpl-3.0
1,788
0
10
342
295
159
136
26
1
-- | -- Module : Example.Time.Compat -- License : BSD-style -- Maintainer : Nicolas DI PRIMA <nicolas@di-prima.fr> -- -- This file is an example on how to use the Data.Hourglass.Compat -- module to transpose a ZonedTime (from time) into a LocalTime of DateTime -- (from hourglass). -- module Example.Time.Compa...
ppelleti/hs-hourglass
Example/Time/Compat.hs
bsd-3-clause
935
0
11
214
190
107
83
17
1
{- ------------------------------------------------------------------------ (c) The GHC Team, 1992-2012 DeriveConstants is a program that extracts information from the C declarations in the header files (primarily struct field offsets) and generates various files, such as a header file that can be #included into non...
lukexi/ghc-7.8-arm64
utils/deriveConstants/DeriveConstants.hs
bsd-3-clause
40,857
0
18
13,280
9,491
4,884
4,607
698
26
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Main -- Copyright : (c) David Himmelstrup 2005 -- License : BSD-like -- -- Maintainer : lemmih@gmail.com -- Stability : provisional -- Portability : portable -- -- Entry point to the ...
mmakowski/cabal
cabal-install/Main.hs
bsd-3-clause
55,596
0
24
15,404
9,943
5,227
4,716
898
13
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-cloudsearch/gen/Network/AWS/CloudSearch/DefineExpression.hs
mpl-2.0
4,010
0
9
859
481
294
187
61
1
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.Spacing -- Copyright : (c) Brent Yorgey -- License : BSD-style (see LICENSE) -- -- Maintainer : <byorgey@gmail.com> -- Stability : un...
markus1189/xmonad-contrib-710
XMonad/Layout/Spacing.hs
bsd-3-clause
2,275
0
10
534
475
264
211
23
1
module C1 (Tree, leaf1, branch1, branch2, isLeaf, isBranch, mkLeaf, mkBranch, myFringe, SameOrNot(..)) where data Tree a = Leaf {leaf1 :: a} | Branch {branch1 :: Tree a, branch2 :: Tree a} mkLeaf :: a -> Tree a mkLeaf = Leaf mkBranch :: (Tree a) -> (Tree a) -> Tree a mkBranch ...
SAdams601/HaRe
old/testing/fromConcreteToAbstract/C1_AstOut.hs
bsd-3-clause
958
2
10
303
438
227
211
30
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.GHC.IPI641 -- Copyright : (c) The University of Glasgow 2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- module Distribution.Simple.GHC.IPI64...
randen/cabal
Cabal/Distribution/Simple/GHC/IPI641.hs
bsd-3-clause
4,324
0
11
1,178
827
495
332
80
1
module Foo1 where -- Variant: ill-kinded. class XClass a where xFun :: a -> XData data XData = XCon XClass
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail147.hs
bsd-3-clause
119
0
7
32
32
18
14
4
0
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE DataKinds #-} pattern PATTERN = () wrongLift :: PATTERN wrongLift = undefined
hferreiro/replay
testsuite/tests/patsyn/should_fail/T9161-1.hs
bsd-3-clause
126
0
6
20
23
13
10
5
1
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Database ( module Generated , js_changeVersion , changeVersion' , changeVersion , js_transaction , transaction' , transaction , js_readTransaction , readTransaction' , readTransaction ) where import Data.Maybe (fromJu...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Database.hs
mit
3,935
28
14
547
971
520
451
-1
-1
module Main where import Control.Applicative import Control.Concurrent.Suspend import Control.Exception import Control.Monad import Data.Int (Int64) import Data.List (intersperse) import Options import Text.Printf import Sound.ALUT import System.Console.ANSI import System.Console.Readline import System.Exit (exitFailu...
AZaviruha/pomodoro-cli
src/Main.hs
mit
5,818
0
18
1,854
1,259
628
631
130
5
import Data.List.Split import qualified Data.Map as Map data Direction = N | E | S | W deriving (Show, Ord, Eq) turnMap = Map.fromList $ [ ((dirs !! i, 'L'), dirs !! ((i - 1) `mod` 4)) | i <- [0 .. 3] ] ++ [ ((dirs !! i, 'R'), dirs !! ((i + 1) `mod` 4)) | i <- [0 .. 3] ] where dirs = [N, E, ...
lzlarryli/advent_of_code_2016
day1/part1.hs
mit
875
0
13
237
481
260
221
29
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Persistence.DBConnection ( loadConnection ) where import Control.Applicative import Control.Monad import Data.Aeson import qualified Data.ByteString.Lazy.Char8 as BSL import Database.Post...
ostapneko/stld2
src/main/Persistence/DBConnection.hs
mit
761
0
15
262
151
83
68
19
1
module Group where import Data.List import Data.Maybe import GroupUtils {- Types -} type BinOp a = (a -> a -> a) type MTable a = ([a], [[a]]) data Group a = Group { set :: [a], op :: (BinOp a) } data GAction a b = GAction (Group a) [b] (a -> b -> b) instance (Show a, Eq a) => Show (Group a) where show (Group ...
elfeck/grouphs
src/Group.hs
mit
9,129
0
15
2,664
4,839
2,391
2,448
186
2
module ByteString.BuildersBenchmark.Inputs where import Prelude import qualified ByteString.BuildersBenchmark.Subjects as A import qualified ByteString.BuildersBenchmark.Actions as B sized :: Int -> [ByteString] sized factor = replicate factor "abcdefg"
nikita-volkov/bytestring-builders-benchmark
library/ByteString/BuildersBenchmark/Inputs.hs
mit
259
0
6
31
53
34
19
7
1
-- 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, RecordWildCards #-} module Language.Bond.Codegen.Cpp.Apply_h (apply_h) where import System.FilePath import Prelude import...
upsoft/bond
compiler/src/Language/Bond/Codegen/Cpp/Apply_h.hs
mit
1,611
0
11
217
219
144
75
20
1
-- | -- Module : CmdLineParser -- Description : Parser for command line options. -- Copyright : (c) Maximilian Nitsch, 2015 -- -- License : MIT -- Maintainer : maximilian.nitsch@gausus.de -- Stability : experimental -- Portability : portable -- -- This module enables to parse command line option and put t...
Ma-Ni/haspell
lib/Spellchecker/CmdLineParser.hs
mit
2,455
0
17
1,033
359
193
166
39
1
module Text.XmlTv ( Channel(..) , Program(..) , xmlToChannel , xmlToProgram , parseChannels , parsePrograms , filterChans , updateChannel , findChan , sortChans , previous , current , later ) where import Control.Monad import Data.Maybe import Text.XML.Light import D...
dagle/hs-xmltv
src/Text/XmlTv.hs
mit
3,370
0
16
846
1,105
563
542
83
2
{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.Map.MultiKey import Data.Typeable import Prelude hiding (lookup, null) data Record = Record { rIntKey :: Int , rStringKey :: String , rData :: String } deriving (Show, Typeable) instance MultiKeyable Record where empty = MultiKey [key rInt...
jhickner/data-map-multikey
example.hs
mit
514
0
8
107
153
87
66
19
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.PositionCallback (newPositionCallback, newPositionCallbackSync, newPositionCallbackAsync, PositionCallback) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), M...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/PositionCallback.hs
mit
2,205
0
12
372
521
310
211
39
1
module Main where import Control.Lens import Control.Monad ( unless, when ) import Data.IORef import System.Exit ( exitFailure, exitSuccess ) import System.IO ( hPutStrLn, stderr ) import qualified Graphics.UI.GLFW as W import Graphics.Rendering.OpenGL import Graphics.Event import Graphics.RenderableItem import Grap...
nyorem/cghs
viewer/Main.hs
mit
2,592
0
18
683
765
362
403
69
3
module List3 where -- 21 insertAt :: a -> [a] -> Int -> [a] insertAt _ _ 0 = error "0 is not a valid position" insertAt elem list pos = fst split ++ [elem] ++ snd split where split = splitAt (pos - 1) list range :: Int -> Int -> [Int] range from to = [from..to]
matteosister/haskell-exercises
List3.hs
mit
272
0
9
68
122
65
57
7
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-trigger.html module Stratosphere.Resources.GlueTrigger where import Stratosphere.ResourceImports import S...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/GlueTrigger.hs
mit
3,424
0
15
462
639
366
273
53
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| JSON utility functions. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
vladimir-ipatov/ganeti
src/Ganeti/JSON.hs
gpl-2.0
10,107
0
15
2,364
2,432
1,274
1,158
172
3
{-# LANGUAGE OverloadedStrings #-} module Tombot.Errors where import Data.Monoid left <\> right = left <> "\n" <> right noFileInPath file = "No file '" <> file <> "' found in path." noConfig = noFileInPath "Config.json" <\> "Parhaps you forgot to configure Tombot?"
Shou/Tombot
Tombot/Errors.hs
gpl-2.0
283
0
6
59
59
31
28
7
1
-- Tema_11.hs -- Tema 11: Aplicaciones de programación funcional. -- José A. Alonso Jiménez https://jaalonso.github.com -- ===================================================================== module Tema_11 where import Data.List ((\\)) -- --------------------------------------------------------------------- -- § E...
jaalonso/I1M-Cod-Temas
src/Tema_11.hs
gpl-2.0
13,834
0
12
3,614
2,559
1,432
1,127
126
2
module Datum where data Jahreszeit = Fruehling | Sommer | Herbst | Winter deriving (Eq, Ord, Enum, Show, Read) data Monat = Januar | Februar | Maerz | April | Mai | Juni | Juli | August | September | Oktober | November | Dezember deriving (Eq, Ord, Enum, Show, Read) type Jahr = Int type ...
collective/ECSpooler
backends/haskell/haskell_libs/Datum.hs
gpl-2.0
329
0
6
90
118
71
47
8
0
module UI.App where import Control.Concurrent.STM.TMChan (TMChan) import Brick import Brick.BChan import Brick.Widgets.Border import Brick.Widgets.Border.Style import Graphics.Vty import Data.Maybe (isJust, fromJust) import Data.List (find) import qualified Data.TCP as TCP import Data.Entity (Entity) import qualified ...
osense/stalkerlike-client-cli
app/UI/App.hs
gpl-3.0
3,429
0
17
593
1,007
538
469
64
1
module Main where import qualified Lib as L import Text.Printf (printf) main :: IO () --main = printf "2 + 3 = %d\n" (ourAdd 2 3) main = L.main
stephane-rolland/aastraal
aastraal-client-brick/app/Main.hs
gpl-3.0
147
0
6
32
38
24
14
5
1
-- the Reader Functor -- instance Functor ((->) r) where fmap = (.) f :: r -> a -- Challenge 2: Prove functor laws for the reader functor. Hint: it’s really simple. -- -- ... 1. preserves identity -- fmap id f -- = id . f -- = f -- = (id f) -- fmap f id -- = f . id -- = f -- = (id f) ...
sujeet4github/MyLangUtils
CategoryTheory_BartoszMilewsky/PI_07_Functors/ex2_Reader.hs
gpl-3.0
943
0
8
321
61
46
15
3
0
newtype BiComp bf fu gu a b = BiComp (bf (fu a) (gu b))
hmemcpy/milewski-ctfp-pdf
src/content/1.8/code/haskell/snippet09.hs
gpl-3.0
55
0
9
13
34
20
14
1
0
module Database.Design.Ampersand.Output.PredLogic ( PredLogicShow(..), showLatex, showRtf, mkVar ) where import Data.List import Database.Design.Ampersand.Basics import Database.Design.Ampersand.ADL1 import Database.Design.Ampersand.Classes import Database.Design.Ampersand.Misc import Database.Design...
4ZP6Capstone2015/ampersand
src/Database/Design/Ampersand/Output/PredLogic.hs
gpl-3.0
29,802
1
19
11,686
9,253
4,892
4,361
420
62
{-# OPTIONS_GHC -fno-bang-patterns #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Array.Base -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org ...
kaoskorobase/mescaline
resources/hugs/packages/base/Data/Array/Base.hs
gpl-3.0
46,951
26
17
13,510
10,730
5,647
5,083
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} module Detector.Type ( module Detector.Type.Common , module Detector.Type.Identification , module Detector.Type.PTEtaData , module Detector.Type...
wavewave/detector-yaml
lib/Detector/Type.hs
gpl-3.0
3,004
0
11
821
693
406
287
57
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListSSHPublicKeys.hs
mpl-2.0
7,562
0
17
1,513
935
564
371
104
1
-- ---------------------------------------------------------------------- -- Copyright 2010-2011 National University of Ireland. -- ---------------------------------------------------------------------- -- This file is part of DysVunctional Language. -- -- DysVunctional Language is free software; you can redistribute ...
axch/dysvunctional-language
haskell-fol/FOL/Language/AlphaRn.hs
agpl-3.0
4,505
0
13
1,028
1,327
669
658
77
1
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } func :: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd ) )
lspitzner/brittany
data/Test370.hs
agpl-3.0
236
0
7
41
17
10
7
3
0
module Main where import Lib main :: IO () main = go
aztecrex/haskell-deleteme
app/Main.hs
unlicense
55
0
6
14
22
13
9
4
1
{- MainTestSuite.hs Copyright 2014 Sebastien Soudan 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 t...
ssoudan/hsStruct
test/MainTestSuite.hs
apache-2.0
4,122
0
12
1,049
657
360
297
59
1
{-# LANGUAGE OverloadedStrings #-} module Salesforce.HTTP ( showRequest , showResponse ) where import Control.Monad (when, unless) import Control.Monad.Writer (MonadWriter(..), execWriter) import Data.ByteString.Lazy (ByteString) import Data.CaseInsensitive (original) import qualified Data.ByteString.Char8 as B...
VictorDenisov/salesforce
src/Salesforce/HTTP.hs
apache-2.0
2,496
0
13
488
820
443
377
56
9
module Commands (commandMap) where import Control.Applicative import qualified Data.Map as Map import qualified Data.Set as Set import System.Exit import System.Directory import Types import CSVmail import Tools -- Map that list the commands key and the corresponding function. It is the -- public interface commandM...
montefra/email_compare
src/Commands.hs
bsd-2-clause
5,924
0
14
2,476
1,221
639
582
86
2
-- http://www.codewars.com/kata/52f787eb172a8b4ae1000a34 module Zeros where zeros :: Int -> Int zeros 0 = 0 zeros n = sum . tail . takeWhile (>0) . iterate (`div`5) $ n
Bodigrim/katas
src/haskell/5-Number-of-trailing-zeros-of-N.hs
bsd-2-clause
169
0
9
28
62
35
27
4
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} module Database.Narc.AST.Pretty where import Database.Narc.AST import Database.Narc.Pretty import Database.Narc.Util (mapstrcat) -- Pretty-printing ------------------------------------------------===== instance Pretty (Term' a) where pretty (Unit) = "()" ...
ezrakilty/narc
Database/Narc/AST/Pretty.hs
bsd-2-clause
1,241
0
12
310
551
276
275
28
0
module Evaluator.Deeds where import Data.List import StaticFlags import Utilities import Data.Ord (comparing) -- | Number of unclaimed deeds. Invariant: always greater than or equal to 0 type Unclaimed = Int -- | A deed supply shared amongst all expressions type Deeds = Int -- NB: it is OK if the number of deeds ...
osa1/chsc
Evaluator/Deeds.hs
bsd-3-clause
2,553
0
15
565
474
267
207
26
2
{-# LANGUAGE MultiParamTypeClasses #-} import Control.Monad.Chrono import Control.Monad.IO.Class newtype Pos = Pos (Int, Int, Int) deriving Show data DeltaPos = MoveX Int | MoveY Int | MoveZ Int instance Keystone Pos DeltaPos where redo (MoveX n) (Pos (x, y, z)) = Pos (x + n, y, z) redo (MoveY n) (Pos (x, y...
kvanberendonck/monad-chrono
examples/Example.hs
bsd-3-clause
997
0
10
298
514
263
251
34
1
-- |Load and unload MSF plugins. module MSF.Plugin ( module Types.Plugin , plugin_load , plugin_unload , plugin_loaded ) where import MSF.Monad import Types.Plugin import qualified RPC.Plugin as RPC -- | Silent operation. plugin_load :: (SilentCxt s) => PluginName -> PluginOptions -> MSF s Result plugin_loa...
GaloisInc/msf-haskell
src/MSF/Plugin.hs
bsd-3-clause
804
0
10
147
206
112
94
17
1
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude, OverloadedStrings, RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, TemplateHaskell #-} {-# LANGUAGE TypeFamilie...
jeremyjh/free-agent
core/src/FreeAgent/Core/Protocol/Schedule.hs
bsd-3-clause
9,410
0
22
2,775
1,954
1,019
935
227
2