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 BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCas...
lukexi/stack
src/Stack/Setup.hs
bsd-3-clause
64,425
0
31
21,458
14,412
7,125
7,287
1,210
13
import Test.DocTest main :: IO () main = doctest ["Data/Aeson/Lens.hs"]
ekmett/aeson-lens
doctest.hs
bsd-3-clause
73
0
6
11
27
14
13
3
1
{-# LANGUAGE OverloadedStrings, DoAndIfThenElse #-} module Git.Repository ( checkoutHead , readHead , resolveTree ) where import qualified Data.ByteString.Char8 as C import qualified Data.ByteString as B import Text.Printf (printf) import Git.Common ...
fcharlie/hgit
src/Git/Repository.hs
bsd-3-clause
4,336
0
19
1,514
867
433
434
69
3
module Language.Cee where -- -- $Id$ import Language.Type import Autolib.Util.Wort import Autolib.Util.Zufall import Control.Monad (guard) import Autolib.Set import System.Random cee :: Char -> Language -> Language cee c l = Language { abbreviation = "{ u " ++ [c] ++ " v | u v in " ++ abbreviation l ++ ...
Erdwolf/autotool-bonn
src/Language/Cee.hs
gpl-2.0
1,412
37
18
482
494
268
226
37
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListMFADevices.hs
mpl-2.0
6,003
0
14
1,271
795
470
325
82
1
-- (c) The University of Glasgow 2006 {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} module Unify ( tcMatchTy, tcMatchTys, tcMatchTyX, tcMatchTysX, tcUnifyTyWithTFs, ruleMatchTyX, -- * Rough matching roughMatchTcs, instanceCantMatch, t...
vTurbine/ghc
compiler/types/Unify.hs
bsd-3-clause
50,166
31
23
14,472
7,890
4,125
3,765
558
9
module WithLocalDeclIn1 where --The application of a function is replaced by the right-hand side of the definition, --with actual parameters replacing formals. --In this example, unfold the first 'sq' in 'sumSquares' --This example aims to test unfolding a function application with multiple matches. sumSquares x y...
kmate/HaRe
old/testing/foldDef/WithLocalDeclIn1.hs
bsd-3-clause
454
0
11
124
82
45
37
7
2
{-# LANGUAGE OverloadedStrings #-} module Main where main :: IO () main = undefined
erochest/cabal-new
templates/Main.sandbox.hs
apache-2.0
88
0
6
18
20
12
8
4
1
module Termination where import Prelude hiding (gcd, mod, map, repeat, take) import Language.Haskell.Liquid.Prelude fac :: Int -> Int tfac :: Int -> Int -> Int map :: (a -> b) -> List a -> List b merge :: (Ord a) => List a -> List a -> List a --------------------------------------------------------------------...
mightymoose/liquidhaskell
docs/slides/NEU14/02_Termination.hs
bsd-3-clause
3,574
0
9
830
632
350
282
32
1
module Typed.TH (benchmarks) where import Control.Applicative import Criterion import Data.Aeson hiding (Result) import Data.ByteString.Builder as B import Data.ByteString.Lazy as L import Twitter.TH import Typed.Common encodeDirect :: Result -> L.ByteString encodeDirect = encode encodeViaValue :: Result -> L.ByteSt...
23Skidoo/aeson
benchmarks/Typed/TH.hs
bsd-3-clause
801
0
12
161
222
121
101
22
1
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} -- | A representation where all bindings are annotated with aliasing -- information. module Futhark.Representation.Aliases ( -- * The Lore definition Aliases , ...
ihc/futhark
src/Futhark/Representation/Aliases.hs
isc
14,656
12
20
3,983
4,067
2,102
1,965
-1
-1
{-# LANGUAGE DoAndIfThenElse #-} module IfThenElseLayout where askCardsForExchange :: Hand -> IO [Card] askCardsForExchange h = do putStrLn "Wich card do you want to exchange? (Max. 3)" response <- getLine if length (readCards response) > 3 || ...
Pnom/haskell-ast-pretty
Test/examples/IfThenElseLayout.hs
mit
498
0
13
218
100
49
51
9
2
-- Consider all integer combinations of a^b for 2 ≤ a ≤ 5 and -- 2 ≤ b ≤ 5: -- 2^2=4, 2^3=8, 2^4=16, 2^5=32 -- 3^2=9, 3^3=27, 3^4=81, 3^5=243 -- 4^2=16, 4^3=64, 4^4=256, 4^5=1024 -- 5^2=25, 5^3=125, 5^4=625, 5^5=3125 -- If they are then placed in numerical order, with any repeats -- removed, we get the following sequ...
whittle/euler
src/Euler/Problem029.hs
mit
914
0
10
209
193
110
83
12
1
{-# LANGUAGE PatternGuards #-} module Plugin.Pl.PrettyPrinter ( prettyDecl, prettyExpr, prettyTopLevel, ) where import Plugin.Pl.Common import Data.Char import Data.List (intercalate) prettyDecl :: Decl -> String prettyDecl (Define f e) = f ++ " = " ++ prettyExpr e prettyDecls :: [Decl] -> String prettyDecls...
jystic/pointfree
Plugin/Pl/PrettyPrinter.hs
mit
5,634
0
16
1,435
2,431
1,240
1,191
159
6
{-# LANGUAGE ExistentialQuantification, Rank2Types #-} module Build.Types.Types (TextShow(..), HasName(..), HasLanguage(..), File(..), BuildStep(..), Target(..), Condition(..), Language(..), Provenance(..), FileType(..), AnyFile(..), Task(..), HeaderFile(..), SourceFile(..), ...
IreneKnapp/modern-data
Tools/Build/Haskell/Build/Types/Types.hs
mit
8,912
0
10
1,688
1,935
1,140
795
248
0
{-# LANGUAGE CPP #-} -- Copyright © 2008 Melissa E. O'Neill -- Used without permission -- | "Genuine Sieve of Eratosthenes" in pure lists. From -- the paper of the same title by Melissa E. O'Neill, -- <http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf>. -- This is the version with evens struck but without the -- ful...
BartMassey/genuine-sieve
oneill-sieve.hs
mit
1,180
0
12
285
328
172
156
22
2
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} -- Translate from the 'Stage1' IR to the 'Flat' IR. -- -- As the name of the latter suggests, this involves flattening the namepace. module Trans.Stage1ToFlat (cgrT...
zenhack/haskell-capnp
cmd/capnpc-haskell/Trans/Stage1ToFlat.hs
mit
10,737
0
23
3,704
2,786
1,464
1,322
227
5
{-# OPTIONS_GHC -fno-warn-type-defaults #-} module Main where import Numeric.MCMC.Slice rosenbrock :: [Double] -> Double rosenbrock [x0, x1] = negate (5 *(x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) main :: IO () main = withSystemRandom . asGenIO $ \gen -> do _ <- chain 50 1 [0, 0] rosenbrock gen mcmc 50 1 [0, 0] ...
jtobin/speedy-slice
test/Rosenbrock.hs
mit
336
0
14
74
153
83
70
9
1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE OverloadedStrings #-} -- | -- Module : Text.Template.Inserts.Internal -- Copyright : Joseph Abrahamson 2014 -- License : MIT -- -- Maintainer : me@jspha.com -- Stability : experimental -- Portability : unknown -- -- The internal workings of @inserts@....
tel/inserts
src/Text/Template/Inserts/Internal.hs
mit
5,317
0
20
1,221
1,316
696
620
90
2
module Main where import Data.Maybe import Control.Monad import EmpireZipper import CreateTerrain import Terrain import GalaxyStats import DataFunction import ZipperGalaxy import Galaxy import World import Civilization import ZipperGalaxyUtils import Math import Utils import qualified Data.Edison.Assoc.StandardMap as...
anttisalonen/starrover
src/Main.hs
mit
5,371
0
21
1,617
1,888
912
976
155
9
nNodos :: ArbolG a -> Int nNodos AVG = 0; nNodos (AG r s) = 1 + (naux s) naux :: [ArbolG a] -> Int naux [] = 0; naux (h:t)= (nNodos h) + (naux t)
josegury/HaskellFuntions
Arboles/Int-NNodos.hs
mit
147
0
7
37
105
54
51
6
1
module Control.Disruptor.EventPoller where import Control.Disruptor.DataProvider data PollState = Processing | Gating | Idle data EventPoller p sequencer sequence gatingSequence a = EventPoller { eventPollerDataProvider :: p , eventPollerSequencer :: sequencer , eventPollerSequence :: sequence ...
iand675/disruptor
src/Control/Disruptor/EventPoller.hs
mit
976
0
11
210
234
126
108
21
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-privatednsnamespace.html module Stratosphere.Resources.ServiceDiscoveryPrivateDnsNamespace whe...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/ServiceDiscoveryPrivateDnsNamespace.hs
mit
2,992
0
15
309
370
211
159
36
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Web.Common where import Common (loggerName) import Config (ServerType(..), BaseConfig(..)) import Control.Applicative ((<$>)) import Control.Monad.Catch (MonadThrow(..), MonadCatch(..)) import Control.Mo...
VictorDenisov/keystone
src/Web/Common.hs
gpl-2.0
2,963
0
17
707
1,015
538
477
77
3
module Language.Haskell.HsColour.Classify ( TokenType(..) , tokenise ) where import Data.Char (isSpace, isUpper, isLower, isDigit) import Data.List -- | Lex Haskell source code into an annotated token stream, without -- discarding any characters or layout. tokenise :: String -> [(TokenType,String)] tokenise s...
crackleware/hscolour
Language/Haskell/HsColour/Classify.hs
gpl-2.0
4,980
0
15
1,525
2,049
1,109
940
107
3
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE DeriveFoldable , DeriveFunctor , DeriveTraversable , FlexibleContexts , FlexibleInstances , OverloadedStrings , TypeSynonymInstances #-} module Model.Expression.Evaluation ( evaluate ...
jvilar/hrows
lib/Model/Expression/Evaluation.hs
gpl-2.0
2,826
0
18
947
1,067
560
507
66
13
--pattern matching f3 0 = 0 f3 x = if x < 0 then -1 else 1
rdnetto/H2V
H2V/tests/pattern_match.hs
gpl-2.0
74
0
6
32
32
17
15
4
2
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-} {- | Module : ./OWL2/CASL2OWL.hs Description : Comorphism from CASL to OWL2 Copyright : (c) C. Maeder, DFKI GmbH 2012 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisio...
gnn/Hets
OWL2/CASL2OWL.hs
gpl-2.0
10,667
0
25
2,788
3,745
1,891
1,854
244
5
{- | Module : $Header$ Description : Normalization w.r.t. associativity and commutativity Copyright : (c) Immanuel Normann, Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : inormann@jacobs-university.de Stability : provisional Portability : portable -} module Search.Common.A...
nevrenato/Hets_Fork
Search/Common/ACINormalization.hs
gpl-2.0
6,705
20
16
1,372
2,103
1,060
1,043
114
5
module Shrdlite.CombinatorParser ( module Shrdlite.CombinatorParser, module Control.Applicative ) where import Control.Applicative import qualified Data.Foldable as F newtype Parser t a = Parser ([t] -> [([t], a)]) parse :: Parser t a -> [t] -> [a] parse (Parser p) ts = [a | ([], a) <- p ts] instance Functor (P...
chip2n/tin172-project
haskell/src/Shrdlite/CombinatorParser.hs
gpl-3.0
1,191
0
14
329
636
341
295
27
2
#!/usr/bin/env stack {- stack runghc --verbosity info --package hledger-lib --package hledger --package cmdargs --package text -} {-# LANGUAGE OverloadedStrings, QuasiQuotes #-} import Control.Arrow (first) import Data.Maybe import Data.List import Data.String.Here import System.Console.CmdArgs import Hledger....
ony/hledger
bin/hledger-budget.hs
gpl-3.0
9,578
0
15
2,027
1,256
656
600
85
2
module Main where import System.Environment import Data.List import Data.Char --I DID NOT CREATE ANY OF THIS, I FOUND ALL OF IT ON REDDIT AND WANTED TO EXPERIMENT WITH HASKELL {- solve n xs = [sum $ zipWith (\a b -> if a == b then a else 0) xs (drop n $ cycle xs)] solve1 = solve 1 main :: IO () main = do content...
kevinlmadison/advent_of_code
3_year_2017/day01/haskell/sol_haskell.hs
gpl-3.0
842
0
13
231
179
92
87
13
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AccountPermissions/List.hs
mpl-2.0
4,946
0
18
1,155
726
421
305
107
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-kms/gen/Network/AWS/KMS/CreateGrant.hs
mpl-2.0
6,771
0
11
1,438
893
536
357
95
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-storage-transfer/gen/Network/Google/Resource/StorageTransfer/TransferOperations/List.hs
mpl-2.0
6,498
0
18
1,450
966
562
404
134
1
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } (***) x y = x
lspitzner/brittany
data/Test409.hs
agpl-3.0
128
0
5
16
14
8
6
1
1
module Foundation where import ClassyPrelude.Yesod import Yesod.Auth import Yesod.Auth.Hardcoded import Yesod.Auth.Message import Yesod.Core.Types import Yesod.Default.Util (addStaticContentExternal) import Database.Persist.Sql (runSqlPool, ConnectionPool) import Settings.StaticFiles import Settings import Model impor...
nek0/yacs
Foundation.hs
agpl-3.0
7,452
2
15
1,871
1,126
598
528
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Kubernetes.V1.LocalObjectReference where import GHC.Generics import Data.Text import qualified Data.Aeson -- | LocalObjectReference contains e...
minhdoboi/deprecated-openshift-haskell-api
kubernetes/lib/Kubernetes/V1/LocalObjectReference.hs
apache-2.0
717
0
9
89
83
50
33
14
0
name2reply :: String -> String name2reply name = "Please to meet you, " ++ name ++ ".\n" ++ "Youre name contains " ++ charcount ++ " characters" where charcount = show $ length name main :: IO () main = do putStrLn "Greetings once again. What is your name?" inpStr <- getLine let outStr = name...
EricYT/Haskell
src/real_haskell/chapter-7/callingpure.hs
apache-2.0
354
0
10
90
98
46
52
11
1
import Safe (readMay) import Control.Applicative ((<$>)) import Control.Applicative ((<*>)) displayAge maybeAge = case maybeAge of Nothing -> putStrLn "You provided Invalid year" Just age -> putStrLn $ "In 2020, you will be : " ++ show age calcAge birthYear futureYear = futureYear - birthYear main = d...
dongarerahul/edx-haskell
main-9.hs
apache-2.0
816
0
12
171
153
77
76
17
2
module Main where import Graphics.Blank import Life.Engine.QTree import Life.Display.Canvas import Life.Types import Life.Formations -- Runs Life indefinitely life :: Config -> Scene -> IO () life c b = blankCanvas 3000 $ \dc -> lifeCanvas dc (scene c b :: Board) -- Runs Life for the specified number of generations...
ku-fpg/better-life
examples/simulations/QTreeCanvas.hs
bsd-2-clause
489
0
9
92
186
101
85
11
1
-- Copyright (c) 2012-2019, Christopher Hall <hsw@ms2.hinet.net> -- Licence BSD2 see LICENSE file module SendControl where import qualified Graphics.X11 as X import qualified Graphics.X11.Xlib.Extras as XE import qualified Graphics.UI.Gtk as GTK import Control.Exception( bracket ) import Control.Concurrent( threadDe...
hxw/conlecterm
src/SendControl.hs
bsd-2-clause
9,670
0
17
1,526
2,993
1,579
1,414
160
1
module FizzBuzzKata.Day6 (fizzbuzz) where fizzbuzz :: [Int] -> [String] fizzbuzz [] = [] fizzbuzz nums = map toFizzBuzz nums where toFizzBuzz :: Int -> String toFizzBuzz num | isFizz num && isBuzz num = "fizz!buzz!" | isF...
Alex-Diez/haskell-tdd-kata
old-katas/src/FizzBuzzKata/Day6.hs
bsd-3-clause
850
0
11
365
256
133
123
19
1
{-# LANGUAGE DeriveGeneric #-} module Main(main) where import Prelude hiding (lookup) import Control.Arrow((>>>), (&&&)) import Control.Exception(try) import Data.Aeson(decode, encode, FromJSON) import Data.ByteString.Lazy.Char8(pack, unpack) import Data.Foldable(Foldable, toList) import Data.Function(on) import Dat...
TheBizzle/GallyScraper-Haskell
src/Scraper.hs
bsd-3-clause
3,532
5
17
730
1,139
607
532
88
1
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-} {-# OPTIONS_GHC -fcontext-stack44 #-} --------------------------------------------------------------------------- -- Generated by DB/Direct --------------------------------------------------------------------------- module DB1.Integer_tbl where import Database.Hask...
m4dc4p/haskelldb
examples/DB1/Integer_tbl.hs
bsd-3-clause
2,318
0
14
279
340
186
154
31
1
module Handler.Markdown where import Import import Text.Markdown import Text.Blaze.Html.Renderer.Text (renderHtml) import Data.Text.Lazy (fromStrict) putMarkdownR :: Handler Value putMarkdownR = do -- Look up the post parameter containing the input Markdown. minput <- lookupPostParam "markdown" case minpu...
fdilke/fpc-exp
src/Handler/Markdown.hs
bsd-3-clause
660
0
17
156
122
66
56
12
2
module Main where import FP import Examples main :: IO () main = examplesMain
davdar/quals
src/Main.hs
bsd-3-clause
80
0
6
16
25
15
10
5
1
-- | A streaming XML parser, using a method known as SAX. SAX isn't really a -- standard, but an implementation, so it's just an \"SAX-like\" parser. -- This module allows you parse an XML document without having to evaluate -- it as a whole. This is needed for protocols like jabber, which use xml -- streams fo...
FranklinChen/hugs98-plus-Sep2006
packages/HaXml/src/Text/XML/HaXml/SAX.hs
bsd-3-clause
3,272
16
15
690
670
371
299
65
2
module ChineseCheckers.ChineseCheckers where import ChineseCheckers.Table import Haste.Graphics.Canvas squareContent :: Table -> Coord -> Content squareContent [] _ = error "Table does not contain coordinate" squareContent (t:ts) (x,y) = case t of Square content _ coord | chec...
DATx02-16-14/Hastings
src/ChineseCheckers/ChineseCheckers.hs
bsd-3-clause
13,687
0
17
6,032
2,808
1,479
1,329
136
4
import System.Directory import System.IO import Data.List import Control.Monad path = "./images/photothèque" addPath :: String -> String addPath s = path ++ "/" ++ s isNotDots :: String -> Bool isNotDots s = s /= "." && s /= ".." isNotRef :: String -> Bool isNotRef s = s /= "referencePage" isDirectory :: String ->...
eniac314/mairieMurol
src/gatherPics.hs
bsd-3-clause
2,360
0
13
699
789
382
407
61
3
{-# LANGUAGE NoMonomorphismRestriction #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Curve.Rect -- Copyright : (c) 2011 Michael Sloan -- License : BSD-style (see the LICENSE file) -- -- Maintainer : Michael Sloan <mgsloan@gmail.com> -- Stabilit...
mgsloan/curve
Data/Curve/Rect.hs
bsd-3-clause
2,533
0
9
503
1,073
585
488
41
1
{-# LANGUAGE TupleSections #-} module Sgf.List ( BState (..) , ZipList' (..) , Index , indBase , foldrM , foldlM , elemByInd , elemsByInds , elemsByNotInds , indByElem , indsByElems1 , indsByElems , indsByNotElems , elemsOrder1 , elemsOrder , dropWhileEnd...
sgf-dma/hs-sgf-lib
src/Sgf/List.hs
bsd-3-clause
16,529
0
16
4,910
4,059
2,235
1,824
206
3
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE OverloadedStrings #-} -- | This module contains objects which represent data of Telegram Bot API responses module Web.Telegram.API.Bot.Data ( -- * Types User (..) , ChatMember (....
cblp/haskell-telegram-api
src/Web/Telegram/API/Bot/Data.hs
bsd-3-clause
50,133
1
10
11,649
6,198
3,622
2,576
642
2
module Gtk.SamplesSpec (main, spec) where import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction" $ do it "should work fine" $ do True `shouldBe` False
nishihs/gtk-samples
test/Gtk/SamplesSpec.hs
bsd-3-clause
208
0
13
49
76
40
36
9
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.GHC -- Copyright : Isaac Jones 2003-2007 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is a fairly large module. It...
typelead/epm
Cabal/Distribution/Simple/GHC.hs
bsd-3-clause
50,490
0
23
15,460
9,563
5,018
4,545
795
17
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} module Stanag.MessageAcknowledgement where import Ivory.Language import Stanag.Packing messageAcknowledgementInstance :: MemArea (Stored Uint32) messageAcknowledgementInstance = area "messageAckno...
GaloisInc/loi
Stanag/MessageAcknowledgement.hs
bsd-3-clause
406
0
9
40
63
37
26
10
1
{-# OPTIONS -fno-spec-constr #-} {-# LANGUAGE CPP, UndecidableInstances #-} #include "fusion-phases.h" -- | Unvectorised parallel arrays. -- -- * These operators may be used directly by unvectorised client programs. -- -- * They are also used by the "Data.Array.Parallel.Lifted.Combinators" -- module to define ...
mainland/dph
dph-lifted-vseg/Data/Array/Parallel/PArray.hs
bsd-3-clause
20,403
16
15
4,977
5,563
2,854
2,709
-1
-1
-- #!/usr/bin/env runghc -- (,st') in parse -- {-# LANGUAGE TupleSections #-} -- {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} -- {-# OPTIONS_GHC -cpp -DPiForallInstalled #-} -------------------------------------------------------------------- -- | -- Copyright : (c) A...
reuleaux/pire
tests/ParserTests/Nat.hs
bsd-3-clause
2,294
0
18
618
529
290
239
31
1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ScopedTypeVariables #-} module Main (main{-,module Plugins.API-}) where --import Shell --import Plugins.API {- import Paths_tpm import Control.Monad import Control.Monad.Trans import System.Environment import System.Directory import System.FilePath -} {-import qua...
armoredsoftware/protocol
tpm/mainline/project/Main.hs
bsd-3-clause
5,457
0
8
1,545
118
84
34
26
1
module Tests ( tests ) where import qualified Distribution.TestSuite as TS import Tests.TestUtils import Tests.KleenexParser import Tests.Coding import Tests.Regression import Tests.KFoldApproximation import Tests.OneApproximation tests :: IO [TS.Test] tes...
diku-kmc/repg
test/Tests.hs
mit
694
0
7
200
118
66
52
14
1
module Main where import Data.Int (Int16, Int32, Int64, Int8) import Data.Word (Word16, Word32, Word64, Word8) import Foreign.C.String (CString, withCString) import Foreign.C.Types (CInt (..), CSize (..)) import Forei...
iphydf/apidsl
test/event/event.exp.hs
gpl-3.0
1,733
0
6
411
115
83
32
6
0
{-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Main -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Main (main)...
olorin/amazonka
amazonka-redshift/test/Main.hs
mpl-2.0
537
0
8
103
76
47
29
9
1
{-# LANGUAGE CPP, NoImplicitPrelude #-} {-# OPTIONS -Wall #-} module Language.Paraiso.OM ( OM(..), makeOM ) where import qualified Data.Vector as V import Language.Paraiso.Name import Language.Paraiso.OM.Builder (Builder, buildKernel) import Language.Paraiso.OM.Graph import ...
nushio3/Paraiso
Language/Paraiso/OM.hs
bsd-3-clause
1,301
0
13
390
309
182
127
31
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following condit...
dimara/ganeti
test/hs/Test/Ganeti/HTools/Node.hs
bsd-2-clause
19,615
2
28
4,822
4,860
2,568
2,292
358
3
-------------------------------------------------------------------- -- | -- Module : MediaWiki.API.Action.Unblock -- Description : Representing Unblock requests. -- Copyright : (c) Sigbjorn Finne, 2008 -- License : BSD3 -- -- Maintainer: Sigbjorn Finne <sof@forkIO.com> -- Stability : provisional -- Portabil...
neobrain/neobot
mediawiki/MediaWiki/API/Action/Unblock.hs
bsd-3-clause
1,219
0
9
246
229
135
94
25
1
module SrcLocPretty where import SrcLoc1 import PrettyPrint instance Printable SrcLoc where ppi (SrcLoc f _ l c) = f<>":"<>l<>','<>c wrap = ppi shLineCol (SrcLoc _ _ l c) = show l++"_"++show c
forste/haReFork
tools/base/AST/SrcLocPretty.hs
bsd-3-clause
204
0
9
43
93
48
45
7
1
{-+ Knot-tying definitions for the base syntax to Stratego translation. -} module Base2Stratego where import BaseStruct2Stratego(transP,transD,transE,showId) import Syntax(HsPatI(..),HsDeclI(..),HsExpI(..)) -- recursive base syntax --transPat :: HsPat -> P transPat (Pat p) = transP showId transPat p transDecs ds = m...
forste/haReFork
tools/Phugs/Base2Stratego.hs
bsd-3-clause
574
0
7
89
157
87
70
8
1
import Sudoku import Control.Exception import System.Environment import Control.Parallel.Strategies import Control.DeepSeq import Data.Maybe -- <<main main :: IO () main = do [f] <- getArgs file <- readFile f let puzzles = lines file (as,bs) = splitAt (length puzzles `div` 2) puzzles -- <1> soluti...
seahug/parconc-examples
sudoku2.hs
bsd-3-clause
710
0
18
290
216
110
106
19
1
-- | Free regs map for x86_64 module RegAlloc.Linear.X86_64.FreeRegs where import X86.Regs import RegClass import Reg import Panic import Platform import Data.Word import Data.Bits newtype FreeRegs = FreeRegs Word64 deriving Show noFreeRegs :: FreeRegs noFreeRegs = FreeRegs 0 releaseReg :: RealReg -> FreeRegs...
ghc-android/ghc
compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs
bsd-3-clause
1,339
0
14
310
395
211
184
33
2
-- This used lots of memory, and took a long time to compile, with GHC 6.12: -- http://www.haskell.org/pipermail/glasgow-haskell-users/2010-May/018835.html {-# LANGUAGE FlexibleContexts, TypeFamilies #-} module IndTypesPerf where import IndTypesPerfMerge data Rec1 = Rec1 !Int mkRec1 v = mk $ merge v () where mk (...
ryantm/ghc
testsuite/tests/indexed-types/should_compile/IndTypesPerf.hs
bsd-3-clause
345
0
10
55
64
34
30
7
1
module ShouldSucceed where -- !!! tests the deduction of contexts. f :: (Eq a) => a -> [a] f x = g x where g y = if (y == x) then [] else [y]
wxwxwwxxx/ghc
testsuite/tests/typecheck/should_compile/tc040.hs
bsd-3-clause
157
0
9
50
67
38
29
4
2
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module SCInstances () where import Control.Applicative import Control.Monad import Data.Bits (shift, xor) import Data.Int (Int64) import qualified Data.Map as M import qualified Data.Sequence as Seq import qualified Data.Text as T import Data.Word (Word32) im...
jjwchoy/hotdb
tests/SCInstances.hs
mit
1,930
0
17
491
660
345
315
46
0
module LC where import Data.Char (ord) import Data.List (foldl') columnToNumber :: String -> Int columnToNumber s = foldl' (\acc (i, v) -> acc + 26 ^ i * v) 0 values where values = zip (reverse [0..(length s -1)]) ((\c -> ord c - 64) <$> s)
AriaFallah/leetcode
haskell/ExcelSheetColumn.hs
mit
245
0
13
51
131
72
59
6
1
{- | Module : DataAssociation.APriori Description : Implements /A-Priory/ Large Itemsets extraction. License : MIT Stability : development __A-Priory__ Large 'Itemset's extraction. See __2.1__ in <http://rakesh.agrawal-family.com/papers/vldb94apriori.pdf>. Defines the __APriori__ instance of 'LargeItemse...
fehu/min-dat--a-priori
core/src/DataAssociation/APriori.hs
mit
7,907
1
15
2,227
1,668
898
770
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module KMeans where import Data.Default import Data.List import qualified Data.Map as M class (Default v, Ord v) => Vector v where distance :: v -> v -> Double centroid :: [v] -> v class Vector v => Vectori...
evge-niy/learn_yesod
src/KMeans.hs
mit
1,510
0
20
529
537
290
247
29
1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGGradientElement (pattern SVG_SPREADMETHOD_UNKNOWN, pattern SVG_SPREADMETHOD_PAD, pattern SVG_SPREADMET...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGGradientElement.hs
mit
2,668
0
11
431
545
330
215
47
1
module Errors where import Control.Applicative data ExceptT e m a = ExceptT { runExceptT :: m (Either e a) } instance Functor m => Functor (ExceptT e m) where fmap f = ExceptT . fmap (fmap f) . runExceptT instance Applicative m => Applicative (ExceptT e m) where pure = ExceptT . pure . Right ...
lkania/Haskitter
src/Errors.hs
mit
1,484
0
13
491
524
263
261
37
2
import System.Random import Control.Monad.State randomSt :: (RandomGen g, Random a) => State g a randomSt = state random
RAFIRAF/HASKELL
For a Few Monads More/stateRandom.hs
mit
130
0
6
27
45
24
21
4
1
module SanitySpec ( spec ) where import Test.Hspec spec :: Spec spec = describe "sanity" $ it "should be sane" $ True `shouldBe` True
ianagbip1oti/ProC
test/SanitySpec.hs
mit
150
0
8
40
44
25
19
5
1
-- Joe Loser -- CS4450 HW4 -- 11/3/14 import PropLogic import Control.Applicative import Control.Monad import Data.List (nub) -- #1 - returns the set of all free variables in a proposition freeVars :: String -> Maybe [Var] freeVars str = case parse(str) of Nothing -> Nothing -- returns Nothing on any error Just ...
JoeLoser/CS4450-Principles-of-Programming
homeworks/hw4/hw4_jrlmwc.hs
mit
2,818
4
15
684
841
423
418
50
7
import Distribution.PackageDescription import Distribution.Simple import Distribution.Simple.LocalBuildInfo import Distribution.Simple.UserHooks import Distribution.Simple.Setup import System.Info import System.Directory import System.Environment import System.Process import System.FilePath import Data.Maybe main = ...
oden-lang/oden
Setup.hs
mit
2,521
3
14
499
628
319
309
59
3
{- arch-tag: Path tests main file Copyright (C) 2004-2011 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} module Pathtest(tests) where import Test.HUnit import System.Path import System.FilePath (pathSeparator) sep = map (\c -> if c == '/' th...
haskellbr/missingh
missingh-all/testsrc/Pathtest.hs
mit
2,835
0
15
1,053
799
412
387
61
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} module DataBuilder where import GHC.Generics import Data.Text import qualified Data.Text.Lazy.Builder as B import qualified Data.Text.Lazy.Builder.Int as B import qualified Data.Text.Lazy.Builder.RealFloat as B import Data.Monoid((<>), mconcat) dat...
hnfmr/beginning_haskell
chapter10/DataBuilder.hs
mit
2,491
0
14
553
912
478
434
44
3
{- ghci c:\Users\Thomas\Documents\GitHub\practice\pe\nonvisualstudio\haskell\Spec\Problem0010.Spec.hs c:\Users\Thomas\Documents\GitHub\practice\pe\nonvisualstudio\haskell\Implementation\Problem0010.hs c:\Users\Thomas\Documents\GitHub\practice\utilities\nonvisualstudio\haskell\Implementation\TestAbstract.hs -} -- :r :...
Sobieck00/practice
pe/nonvisualstudio/haskell/OldWork/Spec/Problem0010.Spec.hs
mit
684
0
8
90
70
39
31
10
1
module Darcs.Patch.Debug ( PatchDebug(..) )where import Darcs.Patch.Witnesses.Ordered ( FL, RL ) -- | PatchDebug is a hook class for temporarily adding debug information. -- To use it, add any methods that are required, implement those methods -- where needed, and then make it available in the relevant contexts. -- F...
DavidAlphaFox/darcs
src/Darcs/Patch/Debug.hs
gpl-2.0
884
0
8
161
116
66
50
7
0
{-| Implementation of the generic daemon functionality. -} {- Copyright (C) 2011, 2012 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 published by the Free Software Foundation; either version 2 of the License, or (at your opti...
badp/ganeti
src/Ganeti/Daemon.hs
gpl-2.0
15,931
0
16
3,631
3,416
1,770
1,646
324
4
{-# OPTIONS -w -O0 #-} {- | Module : ATC/ProofTree.der.hs Description : generated Typeable, ShATermConvertible instances Copyright : (c) DFKI Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable(overlapping ...
nevrenato/Hets_Fork
ATC/ProofTree.der.hs
gpl-2.0
816
0
4
126
29
20
9
5
0
module GRPAgentBinding ( reprogram , act , reinforcement ) where import GRPStats import GRPCommon --This file is currently DEAD CODE. Compilation is done by calling ghc and execution is done by calling the generated executables. --Documentation of that procedure is in GRPHeadless --The best bet to get t...
vektordev/GP
src/GRPAgentBinding.hs
gpl-2.0
1,298
0
7
257
130
81
49
12
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Sound.Tidal.Show (show, showAll, draw, drawLine, drawLineSz) where import Sound.Tidal.Pattern import Data.List (intercalate, sortOn) import Data.Ratio (numerator, denominator) import Data.Maybe (fro...
d0kt0r0/Tidal
src/Sound/Tidal/Show.hs
gpl-3.0
7,077
1
17
2,063
2,671
1,332
1,339
145
21
{-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE FlexibleContexts #-} -- | -- Copyright : (c) 2010-2012 Benedikt Schmidt & Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : GHC only -- -- The constraint reduction rul...
tamarin-prover/tamarin-prover
lib/theory/src/Theory/Constraint/Solver/Goals.hs
gpl-3.0
19,112
0
30
6,292
3,861
1,993
1,868
253
14
import Data.List data Tree = Empty | Node Tree Int Tree deriving (Show, Eq) --input: --first line length of each tree --middle 2*N elements of tree --after tree is the number of swaps --following the number of swaps is the depth at which to swap --understood 1 at start of tree (not mentioned anywhere) ...
woodsjc/hackerrank-challenges
swap-nodes.hs
gpl-3.0
4,423
102
25
1,550
1,594
838
756
79
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/ShippingSettings/Getsupportedcarriers.hs
mpl-2.0
3,568
0
12
747
316
192
124
57
1
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Model.Permission ( module Model.Permission.Types -- , permissionVIEW , permissionPRIVATE , readPermission , readRelease , dataPermission4 , canReadData2 , accessJSON -- * Checking permissioned objects , ...
databrary/databrary
src/Model/Permission.hs
agpl-3.0
5,151
0
12
897
708
388
320
79
3
-- Copyright 2020 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/hrepl
bazel/Bazel/QueryTest.hs
apache-2.0
6,194
0
17
1,801
1,584
787
797
-1
-1
module AlecSequences.A273191 (a273191) where import AlecSequences.A273190 (a273190) import Helpers.ListHelpers (runLengths) a273191 :: Int -> Int a273191 n = a273191_list !! (n - 1) a273191_list :: [Int] a273191_list = runLengths $ map a273190 [0..]
peterokagey/haskellOEIS
src/AlecSequences/A273191.hs
apache-2.0
252
0
7
35
84
48
36
7
1
module Helper.Name (snakeCase, camelCase) where import Prelude import Data.Char import Data.List.Split snakeCase :: FilePath -> String snakeCase fp = foldr1 (\x a -> x ++ "_" ++ a) pieces where pieces = splitOn "." fp camelCase :: FilePath -> String camelCase fp = foldr (\x a -> upper x ++ a) [] pieces ...
fabianbergmark/APIs
src/Helper/Name.hs
bsd-2-clause
406
0
9
98
168
90
78
14
2
module EqExercises where data TisAnInteger = TisAn Integer instance Eq TisAnInteger where (==) (TisAn v) (TisAn v') = v == v'
OCExercise/haskellbook-solutions
chapters/chapter06/exercises/scratch/eq_exercises.hs
bsd-2-clause
132
0
8
27
49
27
22
4
0
{-# LANGUAGE ConstraintKinds #-} module Opaleye.Internal.Column where import Data.String import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ -- | A column of a @Query@, of type @pgType@. For example 'Column' -- @PGInt4@ is an @int4@ column and a 'Column' @PGText@ is a @text@ -- column. -- -- Do not use th...
WraithM/haskell-opaleye
src/Opaleye/Internal/Column.hs
bsd-3-clause
3,461
0
11
657
959
511
448
-1
-1
-- CIS 194, Spring 2015 -- -- Test cases for HW 01 module HW01Tests where import HW01 import Testing -- Exercise 1 ----------------------------------------- ex1Tests :: [Test] ex1Tests = [ testF1 "lastDigit" lastDigit [(123, 3), (1234, 4), (5, 5), (10, 0), (0, 0)] , testF1 "dropLastDigit" dr...
ThomWright/CIS194
test/HW01Tests.hs
bsd-3-clause
1,641
0
10
477
496
315
181
30
1
#define IncludedshiftIndicesRight {-@ automatic-instances shiftIndicesRight @-} {-@ shiftIndicesRight :: lo:INat -> hi:Integer -> x:RString -> input:RString -> target:RString -> { map (shiftStringRight target x input) (makeIndices input target lo hi) == makeIndices (x <+> input) target (stringLen x +...
nikivazou/verified_string_matching
src/AutoProofs/shiftIndicesRight.hs
bsd-3-clause
3,591
15
37
775
1,324
674
650
53
1