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 Index where import Expense data MonthIndex = MonthIndex { month :: Int , expenses :: [Expense] } data YearIndex = YearIndex { year :: Int , months :: [MonthIndex] } data Index = Index { person...
fredmorcos/attic
projects/pet/archive/pet_haskell_20130811_early/Index.hs
isc
440
0
9
230
91
58
33
9
0
module Target.Pandoc where import Codec.Binary.UTF8.String ( encodeString ) import Data.Char ( toLower ) import Data.Configger ( Config ) import Data.Maybe ( fromMaybe ) import System.FilePath.Posix ( takeExtension ) import Text.Pandoc ( Pandoc(..) , Meta(..) , Inline(..) ...
Soares/Bookbuilder
src/Target/Pandoc.hs
mit
3,819
0
15
1,223
1,050
551
499
103
27
{-# LANGUAGE DeriveAnyClass #-} module TicTacToe.Player where data Player = X | O deriving (Bounded, CycleEnum, Enum, Eq) instance Show Player where show X = "Crosses" show O = "Naughts" switch :: Player -> Player switch = csucc
tomphp/haskell-tictactoe
src/TicTacToe/Player.hs
mit
261
0
6
70
74
41
33
10
1
module DogsRule (dogs) where dogs :: IO () dogs = do putStrLn "Who's a good puppy?!" putStrLn "YOU ARE!!!!!"
candu/haskellbook
ch13/hello/src/DogsRule.hs
mit
117
0
7
27
36
18
18
6
1
{-# LANGUAGE NoMonomorphismRestriction #-} module Plugins.Gallery.Gallery.Manual21 where import Diagrams.Prelude example = circle 0.2 # lc purple # fc yellow
andrey013/pluginstest
Plugins/Gallery/Gallery/Manual21.hs
mit
170
0
7
31
36
20
16
4
1
{-# htermination insert :: Ord a => (Maybe a) -> [(Maybe a)] -> [(Maybe a)] #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_insert_9.hs
mit
92
0
3
18
5
3
2
1
0
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-| Module: Internal.Rc Description: Reference counted boxes. This module provides a reference-counted cell type 'Rc', which contains a value and a finalizer. When the reference count reaches zero, the value is dropped and the finalizer is run. -} module ...
zenhack/haskell-capnp
lib/Internal/Rc.hs
mit
1,958
0
13
503
491
256
235
45
3
module Compiler.ExposeBasicBlocks (exposeBasicBlocks) where import Framework.LangFramework import qualified Framework.LangFramework as LF import Framework.Util import Framework.LIf import Control.Monad.State import Control.Applicative import Data.Foldable import Data.List hiding (tail) import Prelude hiding (pred,tai...
cgswords/Grift
Compiler/ExposeBasicBlocks.hs
mit
4,275
0
17
1,629
1,499
786
713
82
1
{-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} module TechRequestF where import FFIExample import DOM import Data.Text (fromString) import qualified Data.Text as T import Fay.Yesod --import Fay.Text (toJSON) import Prelude hiding (sort)...
swamp-agr/carbuyer-advisor
fay/TechRequestF.hs
mit
517
0
8
140
103
58
45
18
1
-- Alan Partridge I - Partridge Watch -- https://www.codewars.com/kata/5808c8eff0ed4210de000008 module Codewars.AlanPartridge.PartridgeWatch where part :: [String] -> String part l | count <= 0 = "Lynn, I've pierced my foot on a spike!!" | otherwise = "Mine's a Pint" ++ replicate count '!' where count =...
gafiatulin/codewars
src/7 kyu/PartridgeWatch.hs
mit
434
0
11
75
105
60
45
5
1
{-# LANGUAGE DoAndIfThenElse #-} module Helpers where import Control.Exception import Control.DeepSeq (force) import System.Directory import System.FilePath import System.Posix.User import Data.List (isInfixOf) import Category delimeter = "---------------------------------------------" greeting = "Hello, " defaultGr...
MysterionRise/octo-shell
src/Utils/Helpers.hs
mit
4,898
0
17
1,671
1,094
536
558
97
2
module Y2017.M03.D29.Exercise where -- below import available via 1HaskellADay git repository import Data.Probability {-- What, with March Madness, and all ... From Fifty Challenging Problems in Probability by Frederick Mosteller Problem 16: March Madness for ... TENNIS! Will Second-Best Be Runner Up? A tennis t...
geophf/1HaskellADay
exercises/HAD/Y2017/M03/D29/Exercise.hs
mit
1,514
0
5
434
43
29
14
6
1
import Control.Monad -- Monads --------------------------------------------------------- data Expr = Lit Int | Div Expr Expr eval :: Expr -> Int eval (Lit a) = a eval (Div a b) = eval a `div` eval b main1 = do print $ eval (Lit 42) -- 42 print $ eval (Div (Lit 44) (Lit 11)) -- 4 data Try a = Err String | ...
uroboros/haskell_design_patterns
chapter1/4_monads.hs
mit
1,625
0
12
520
774
379
395
49
3
module Model.Language where import Prelude (readsPrec) import ClassyPrelude.Yesod import Util.Multiline (multiline) import Settings.StaticFiles data Language = Assembly | Bash | C | Clojure | Coffeescript | Cpp | Csharp | ...
vinnymac/glot-www
Model/Language.hs
mit
13,768
0
9
2,579
2,739
1,470
1,269
-1
-1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.DOMTokenList (js_item, item, js_contains, contains, js_add, add, js_remove, remove, js_toggle, toggle, js_toString, toString, js_getLength, getLength, DOMTokenList, castToDOMTokenList, gType...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/DOMTokenList.hs
mit
4,432
54
13
794
1,110
617
493
83
1
-- MandelBrot implementation in Haskell import Data.Complex import System.Environment import Control.Parallel.Strategies import Criterion.Measurement --import Graphics.UI.SDL --initSDL :: IO Surface --initSDL = do -- SDL.init [SDL.InitEverything] -- SDL.setVideoMode (floor imageWidth) (floor imageHeight) 32 []...
RossMeikleham/Parallel-Mandelbrot
mandelbrot.hs
mit
1,878
0
16
552
545
287
258
32
4
{-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( getApplicationDev , appMain , develMain , makeFoundation -- * for DevelMain , getApplicationRepl , shutdownApp -- * for GHCI , handler , db ) where import Control.Monad.Logger (liftLoc, runLoggingT) i...
junjihashimoto/yesod-raml
yesod-raml-mock-server/Application.hs
mit
6,815
0
16
1,763
1,017
545
472
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appstream-stackfleetassociation.html module Stratosphere.Resources.AppStreamStackFleetAssociation where import...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/AppStreamStackFleetAssociation.hs
mit
2,344
0
15
257
279
160
119
31
1
{-# OPTIONS -fallow-overlapping-instances #-} {- arch-tag: Python file-like objects Copyright (C) 2005 John Goerzen <jgoerzen@complete.org> 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 ver...
jgoerzen/missingpy
Python/Objects/File.hs
gpl-2.0
7,688
0
24
3,002
1,229
612
617
107
1
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-} module Rewriting.TRS.Raw where import Autolib.Symbol import Autolib.TES.Term import Autolib.TES.Rule import Autolib.TES.Identifier import qualified Autolib.TES import Autolib.ToDoc import Autolib.Reader import Data.Typeable -- | this is the raw type, -- needs ...
Erdwolf/autotool-bonn
src/Rewriting/TRS/Raw.hs
gpl-2.0
682
0
12
142
151
92
59
15
0
{-# LANGUAGE TupleSections #-} {-| Auto-repair tool for Ganeti. -} {- Copyright (C) 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 published by the Free Software Foundation; either version 2 of the License, or (at your o...
kawamuray/ganeti
src/Ganeti/HTools/Program/Harep.hs
gpl-2.0
20,277
1
24
7,284
3,595
1,883
1,712
324
7
module FEN where import Data.Char import qualified Data.Attoparsec.Text as P import qualified Data.Text as T import Data.Array import Data.Word import Data.List import Debug.Trace (traceShow) import ChessData import Eval gameFromFEN :: P.Parser GameState gameFromFEN = do pos <- P.takeWhile notSpace -- Ge...
CameronDiver/hschess
src/fen.hs
gpl-3.0
3,380
0
15
899
1,010
532
478
81
13
{-# LANGUAGE FlexibleContexts #-} module Language.Dockerfile.Rules where import Data.List (intercalate, isInfixOf, isPrefixOf, isSuffixOf) import Data.List.Split (splitOn, splitOneOf) import Data.Maybe ...
beijaflor-io/haskell-language-dockerfile
src/Language/Dockerfile/Rules.hs
gpl-3.0
12,468
0
14
3,512
3,088
1,655
1,433
232
3
-- TODO: maybe add function that returns bytestring -- TODO: test against images saved by the official OpenEXR library import qualified Data.ByteString.Lazy as BL import qualified Data.Vector as V import System.Directory (removeFile) import Test.Hspec import qualified Graphics.OpenEXR...
pavolzetor/openexr-write
test/Spec.hs
gpl-3.0
1,525
0
17
556
320
158
162
25
1
{-# LANGUAGE TemplateHaskell, FlexibleInstances, IncoherentInstances#-} module Gif where import Test.QuickCheck import Data.Binary( Binary(..), encode, decode ) import Codec.Picture.Gif import Codec.Picture.Types import Codec.Picture.ColorQuant import Mutation import DeriveMutation import DeriveShow import Deriv...
fcostantini/QuickFuzz
src/Gif.hs
gpl-3.0
1,371
0
10
242
309
177
132
31
1
{-# LANGUAGE QuasiQuotes, NoMonomorphismRestriction #-} import Data.Packed.Static import Data.Packed.Static.Convert testQQ :: Matrix (D2,D3) Double testQQ = [$mat|1,2,3;4,5,6|] -- > [$mat| 1.0, 2.0, 3.0; -- 4.0, 5.0, 6.0 |] testQQU :: Matrix (Unknown, Unknown) Double testQQU = [$matU|1,2,3;4,5,6|] -- > [$ma...
reinerp/hmatrix-static
examples/MatrixFuncs.hs
gpl-3.0
6,013
62
10
1,363
2,154
1,186
968
84
1
-- Types module. -- By G.W. Schwartz -- {- | Collects all application specific types. Used here for Text.Lazy -} {-# LANGUAGE OverloadedStrings #-} module Data.Fasta.Text.Lazy.Types where -- Built-in import qualified Data.Text.Lazy as T import qualified Data.Map as M -- Algebraic data FastaSequence = FastaSequence ...
GregorySchwartz/fasta
src/Data/Fasta/Text/Lazy/Types.hs
gpl-3.0
1,159
0
9
453
195
123
72
19
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Campaigns/Get.hs
mpl-2.0
3,081
0
14
729
421
249
172
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-books/gen/Network/Google/Resource/Books/MyLibrary/ReadingPositions/Get.hs
mpl-2.0
4,020
0
15
896
467
277
190
75
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adexchange-seller/gen/Network/Google/Resource/AdExchangeSeller/Accounts/CustomChannels/List.hs
mpl-2.0
4,792
0
17
1,068
573
338
235
91
1
module HW11_AParser (Parser, runParser, satisfy, char, posInt) where import Control.Applicative import Data.Char newtype Parser a = Parser { runParser :: String -> Maybe (a, String) } satisfy :: (Char -> Bool) -> Parser Char satisfy p = Parser f where f [] = Nothing f (x:xs) | p...
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2014-06-upenn/cis194/src/HW11_AParser.hs
unlicense
1,205
0
13
343
551
288
263
34
2
{-# LANGUAGE ExistentialQuantification, FlexibleContexts, RankNTypes, ScopedTypeVariables, UndecidableInstances #-} module Math.Utils ( angleDiff, avg, bound, changeInPercent, changeMod, linearFunc, prevMod, succMod, showF3, ) where import Data.Ratio import Numeric (showFF...
jtapolczai/wumpus
Math/Utils.hs
apache-2.0
2,284
0
12
621
614
348
266
49
1
module Epoch where newtype Epoch = Epoch Int deriving (Eq, Ord) initial :: Epoch initial = Epoch 0 next :: Epoch -> Epoch next (Epoch a) = Epoch $ succ a
kdkeyser/halvin
src/halvin/Epoch.hs
apache-2.0
159
0
7
36
66
36
30
6
1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE LiberalTypeSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} module Main where import Test.QuickCheck import Test.QuickCheck...
ekmett/ermine
tests/properties.hs
bsd-2-clause
795
0
7
110
99
65
34
24
1
module Handler.Mirror where import Import import qualified Data.Text as T getMirrorR :: Handler RepHtml getMirrorR = do defaultLayout $ do $(widgetFile "mirror") postMirrorR :: Handler RepHtml postMirrorR = do postedText <- runInputPost $ ireq textField "content" defaultLayout $ do $(widg...
akegalj/yesod-example
Handler/Mirror.hs
bsd-2-clause
337
0
12
72
93
47
46
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} -- | Downloads page view. module HL.V.Downloads where import Data.Monoid import HL.Types import HL.V hiding (list) import HL.V.Template -- | Downloads view. downloadsV :: FromBlaze App downloadsV = template [] "Downloads" (\url -> ...
chrisdone/hl
src/HL/V/Downloads.hs
bsd-3-clause
3,781
0
29
1,208
602
275
327
81
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} module Web.Yelp.Base ( getObject , yreq , yhttp , asJson , asBS , YelpException(..) ) where import Control.Applicative import Control.Monad (mzero) import Control.Monad.Trans.Class (Mon...
mcschroeder/yelp
Web/Yelp/Base.hs
bsd-3-clause
4,560
0
17
1,220
1,162
626
536
101
3
{-# LANGUAGE BangPatterns #-} module Main where import Connection import Certificate import PubKey import Criterion.Main import Control.Concurrent.Chan import Network.TLS import Data.X509 import Data.X509.Validation import Data.Default.Class import qualified Data.ByteString as B import qualified Data.ByteString.Lazy ...
tolysz/hs-tls
core/Benchmarks/Benchmarks.hs
bsd-3-clause
2,434
0
17
823
607
318
289
48
2
module Sexy.Classes.UnconsMay (UnconsMay(..)) where import Sexy.Data (Maybe(..), seq) class UnconsMay l where unconsMay :: l a -> Maybe (a, l a) foldr :: (a -> b -> b) -> b -> l a -> b foldr myCons myNil = go where go xs = case unconsMay xs of Nothing -> myNil Just (y,ys) -> myCons...
DanBurton/sexy
src/Sexy/Classes/UnconsMay.hs
bsd-3-clause
1,306
0
15
428
649
330
319
35
0
import Control.Concurrent import Control.Concurrent.Chan import Control.Concurrent.STM import Control.Exception import Control.Monad import Control.Monad.State import Data.Maybe import Data.Map import Data.Time.Clock import Data.Time.Clock.POSIX import Network.Socket import System.IO import System.IO.Error import Text....
rmca/wtfstats
statsd.hs
bsd-3-clause
5,230
0
24
1,253
1,641
786
855
124
5
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {- Copyright (c) 2014, Markus Barenhoff <alios@alios.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a...
alios/geodetic
src/Data/Geodetic/Elipsoids.hs
bsd-3-clause
3,278
0
10
665
500
276
224
49
0
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MonadComprehensions #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANG...
ulricha/dsh-example-queries
Queries/TPCH/Standard/Q1.hs
bsd-3-clause
1,699
0
12
473
435
242
193
37
1
module Code30_TreeSpider where import Code28 (boxall1) boxall :: [[a]] -> [a] boxall = boxall1 type Nest = [Spider] data Spider = Node Int Nest ncode :: Nest -> [Int] ncode = boxall . map scode scode :: Spider -> [Int] scode (Node a xs) = a : ncode xs
sampou-org/pfad
Code/Code30_TreeSpider.hs
bsd-3-clause
309
0
7
106
114
65
49
10
1
module Data.MotionCapture.AMC( loadAMCFromFile, filterBones, filterSections, getAMCBone, exportAMC, setBone ) where -- MoCap Modules import Data.MotionCapture.AMC.Types import Data.MotionCapture.AMC.AMCParser import Data.MotionCapture.AMC.AMCExporter -- Parsec import Text.ParserCombinators.Parsec import...
netogallo/MoCap
Data/MotionCapture/AMC.hs
bsd-3-clause
1,856
0
11
314
523
280
243
37
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.ConditionalRender -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portabl...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/ConditionalRender.hs
bsd-3-clause
869
0
4
100
61
48
13
9
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. module Duckling.O...
rfranek/duckling
tests/Duckling/Ordinal/FR/Tests.hs
bsd-3-clause
600
0
9
96
80
51
29
11
1
{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} module Main where import qualified Data.ByteString.Lazy as BL import System.Console.CmdArgs.Implicit import System.IO import System.Environment import System.Exit import System.Process import Text.Parsec.Char hiding (upper) import Text.Parsec.Combinator import Text....
listx/syscfg
script/usbmnt.hs
bsd-3-clause
13,951
264
19
2,866
4,710
2,456
2,254
416
7
{-# LANGUAGE RankNTypes #-} -- | Running tests. To check a 'TestTree' in a REPL, use -- 'quickCheckTree'; to check a QuickCheck 'Testable', just use -- 'Test.QuickCheck.quickCheck' and the similar functions in -- "Test.QuickCheck". The other functions in this module will be more -- useful for checking from within a c...
massysett/quickpull
lib/Quickpull/Runners.hs
bsd-3-clause
5,144
0
20
1,094
992
524
468
78
4
{-# LANGUAGE OverloadedStrings #-} import Control.Monad import Control.Concurrent import System.IO import Text.XML.Pipe import Network import Network.PeyoTLS.ReadFile import Network.XmlPush.HttpPull.Tls.Server import TestPusher import qualified Data.ByteString.Char8 as BSC main :: IO () main = do soc <- listenOn $...
YoshikuniJujo/xml-push
examples/httpPullTlsSv.hs
bsd-3-clause
1,150
10
17
192
420
222
198
35
1
import System.Environment import Language.Pankti.Parser import Language.Pankti.AST main = do [path] <- getArgs putStrLn $ "Compiling " ++ path ast <- parsePktFile path putStrLn $ show ast
srujun/Pankti
src/Language/Main.hs
mit
198
0
8
36
64
32
32
8
1
import Control.Monad sumN n = (n * (n+1)) `div` 2 numberOfCombinations step num = foldl (+) 0 $ map (sumN . rep) [1..step] where rep x = (num - x) `div` step findStep str = foldl (\acc ch -> if ch == 'T' then (acc+2) else (acc+1)) 0 str ans str octaves = numberOfCombinations (findSte...
paramsingh/codechef-solutions
src/long/april15/piano.hs
mit
495
0
10
154
219
115
104
11
2
module Main where import qualified Saha.Server main :: IO () main = Saha.Server.main
kinoru/plate
executable/saha-server/Main.hs
agpl-3.0
88
0
6
16
28
17
11
4
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Data.LargeHashable.Tests.Helper where -- keep imports in alphabetic order (in Emacs, use "M-x sort-lines") import Control.Monad import Data.Bytes.Serial import Data.Hashable imp...
sternenseemann/large-hashable
test/Data/LargeHashable/Tests/Helper.hs
bsd-3-clause
7,127
0
17
2,048
2,131
1,126
1,005
188
0
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/ByteString/Builder/Prim/Binary.hs" #-} {-# LANGUAGE CPP, BangPatterns #-} {-# LANGUAGE Trustworthy #-} -- | Copyright : (c) 2010-2011 Simon Meier -- License : BSD3-style (see LICENSE) -- -- Maintainer : Simon M...
phischu/fragnix
tests/packages/scotty/Data.ByteString.Builder.Prim.Binary.hs
bsd-3-clause
7,781
0
13
1,766
1,111
656
455
135
1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ar-SA"> <title>Server-Sent Events Add-on</title> <maps> <homeID>sse.introduction</homeID> ...
thc202/zap-extensions
addOns/sse/src/main/javahelp/org/zaproxy/zap/extension/sse/resources/help_ar_SA/helpset_ar_SA.hs
apache-2.0
983
79
67
157
417
211
206
-1
-1
module FunIn1 where --In this example, the sub-expression '(y+1)' in function 'f' is generalised as parameter 'z' y=0 f z x =x + z g = f (y + 1) 1
kmate/HaRe
old/testing/generaliseDef/FunIn1_TokOut.hs
bsd-3-clause
151
0
7
35
41
23
18
4
1
module Field4 where data Vtree a = Vleaf {value2 :: a} | Vnode {value2 :: a, left, right :: Vtree a} fringe :: (Vtree a) -> [a] fringe t@(Vleaf _) = [value2 t] fringe t@(Vnode _ _ _) = (fringe (left t)) ++ (fringe (right t))
SAdams601/HaRe
old/testing/renaming/Field4_AstOut.hs
bsd-3-clause
242
0
9
63
132
74
58
8
1
-- | This is strictly for debugging only. Throws various kinds of exceptions. module Distribution.Server.Features.Crash (serverCrashFeature) where import Distribution.Server.Framework import Data.Maybe import Control.Exception import Control.Concurrent serverCrashFeature :: HackageFeature serverCrashFeature = (empty...
mpickering/hackage-server
Distribution/Server/Features/Crash.hs
bsd-3-clause
1,216
0
14
320
270
145
125
26
2
{-# LANGUAGE PatternSynonyms #-} module Export (A(..,MyB), B(MyA), C(MyC)) where data A = A data B = B pattern MyB = B pattern MyA = A data C a = C pattern MyC = B
olsner/ghc
testsuite/tests/patsyn/should_fail/export-type.hs
bsd-3-clause
171
2
6
42
76
46
30
13
0
{-| Module : Alexander Description : Library that helps with untangling of the rational tangles. -} module Alexander ( module Common , module Data.Tangle , untangle ) where import Data.Tangle import Data.KnotComplex import Control.Monad.VectorSpace import Common -- | Converts a tangle into its representation ...
adolenc/AlexanderTheGreat
src/Alexander.hs
mit
1,052
0
11
217
312
166
146
23
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveFunctor #-} {-# LA...
YLiLarry/db-model
src/DB/Model/Internal/Load.hs
mit
4,031
0
18
1,041
1,080
593
487
51
3
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.WorkerGlobalScope (js_close, close, js_importScripts, importScripts, js_getSelf, getSelf, js_getLocation, getLocation, error, offline, online, js_getNavigator, getNavigator, WorkerGlobalScop...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/WorkerGlobalScope.hs
mit
4,369
30
13
676
918
521
397
74
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.ChildNode (js_remove, remove, ChildNode, castToChildNode, gTypeChildNode) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Sh...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/ChildNode.hs
mit
1,239
6
8
139
356
228
128
21
1
data DataInt = D Int deriving (Eq, Ord, Show) newtype NewtypeInt = N Int deriving (Eq, Ord, Show) type Foo = Int
tamasgal/haskell_exercises
Real_World_Haskell/ch06/Newtype.hs
mit
123
0
6
32
54
30
24
5
0
-- Powers of 2 -- https://www.codewars.com/kata/57a083a57cb1f31db7000028 module PowersOfTwo where powersOfTwo :: Int -> [Int] powersOfTwo n = map (2 ^) [0..n]
gafiatulin/codewars
src/8 kyu/PowersOfTwo.hs
mit
161
0
6
23
40
24
16
3
1
import Test.QuickCheck import Data.Cube import Text.Printf instance Arbitrary Face where arbitrary = elements allFaces instance Arbitrary Color where arbitrary = elements allColors instance Arbitrary Sticker where arbitrary = do f <- arbitrary c <- arbitrary return $ Sticker f c instance Arbitrary...
jneen/cube
Tests.hs
mit
736
0
9
176
254
127
127
27
1
{-| Module : clause Copyright : (c) Stéphane Vialette, 2015 License : MIT Maintainer : vialette@gmail.com Stability : experimental -} module PPOL.Sat.Clause ( -- Clause data type Clause(..) -- Clause contructor , newClause , empty -- modifying a clause , deleteLiteral -- information , literals ...
vialette/PPOL
src/PPOL/Sat/Clause.hs
mit
3,258
1
12
628
808
431
377
55
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# OPTIONS_HADDOCK not-home #-} -- | -- Module : Control.Auto.Blip.Internal -- Description : Exposing internal unsafe functions for working with -- 'Blip'. -- Copyright : (c) Justin Le 2015 -- Licens...
mstksg/auto
src/Control/Auto/Blip/Internal.hs
mit
7,044
0
10
1,678
722
434
288
64
1
module Euler.E43 where import Data.List (permutations) import Euler.Lib (listToInt) euler43 :: Int euler43 = sum $ map listToInt $ filter isGud panNums isGud :: [Int] -> Bool isGud n = and [ d n [2,3,4] 2 , d n [3,4,5] 3 , d n [4,5,6] 5 , d n [5,6,7] 7 , d n [6,7,8] 11 , d n [7,8,9] 13 , d n [8,9,10] 17...
D4r1/project-euler
Euler/E43.hs
mit
578
4
11
146
368
206
162
22
1
import BasePrelude import MTLPrelude import Data.Text (Text) import Data.Vector (Vector) import Data.Time import qualified Hasql as H import qualified Hasql.Postgres as H import qualified ListT import qualified Test.QuickCheck.Gen as Q import qualified Test.QuickCheck.Arbitrary as Q import qualified Test.QuickCheck.Ins...
begriffs/hasql-postgres
profiling/Main.hs
mit
1,180
0
19
327
349
195
154
-1
-1
{-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-} -- | Reexports "Data.Functor.Const.Compat" -- from a globally unique namespace. module Data.Functor.Const.Compat.Repl ( module Data.Functor.Const.Compat ) where import "this" Data.Functor.Const.Compat
haskell-compat/base-compat
base-compat/src/Data/Functor/Const/Compat/Repl.hs
mit
304
0
5
31
31
24
7
5
0
import Test.Hspec import Test.QuickCheck import Control.Exception (evaluate) main :: IO () main = hspec $ do describe "Ledger.Amount" $ do it "returns the first element of a list" $ do head [23 ..] `shouldBe` (23 :: Int) it "returns the first element of an *arbitrary* list" $ property $ \x xs ->...
ledger/commodities
test/testAmount.hs
mit
460
0
18
109
153
78
75
12
1
import Math import Data.List import Data.Ord -- PROBLEM NO 12 -- it returns the n-th triangle number triangle :: Int -> Int triangle n = quot (n * (n + 1)) 2 -- it returns the number of factors the n-th triangle number has triFactors :: Int -> Int triFactors n = length $ factors $ triangle n solution12Helper :: Int...
zeniuseducation/poly-euler
haskell/prob11-20.hs
epl-1.0
1,811
0
12
422
689
356
333
40
2
module Main where import IO import System (getArgs) --import List (isPrefixOf) import Text.XML.HaXml.Haskell2Xml -- Test stuff data MyType a = ConsA Int a | ConsB String {-! derive : Haskell2Xml !-} instance Eq a => Eq (MyType a) where (ConsA a b) == (ConsA c d) = a==c && b==d (ConsB e) ...
jgoerzen/dtmconv
HaXml-1.12/examples/SimpleTestD.hs
gpl-2.0
3,579
25
20
987
1,011
541
470
58
8
predecessor = predecessor -- ^comment 0 -- comment 1 successor :: a successor = successor
evolutics/haskell-formatter
testsuite/resources/source/comments/depends_on_displacement/single_annotation/line_pair/after_none/Output.hs
gpl-3.0
91
0
4
16
18
11
7
3
1
{-# LANGUAGE TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : Hoodle.ModelAction.Select.Transform -- Copyright : (c) 2011-2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- ...
wavewave/hoodle-core
src/Hoodle/ModelAction/Select/Transform.hs
gpl-3.0
5,040
0
20
1,214
1,822
981
841
85
2
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} module TrainConfig ( LegacyConfig(..) , TrainingConfig(..) , getModelTrainingConfig , getStepInfoConfig , setTrainingConfigAllowNewer , setTrainingConfigDatasets , setTrainingConfigPlatform , set...
merijn/GPU-benchmarks
benchmark-analysis/src/TrainConfig.hs
gpl-3.0
5,692
0
14
1,360
1,206
655
551
115
3
{- - Copyright (C) 2014 Alexander Berntsen <alexander@plaimi.net> - - This file is part of Virtual Tennis. - - Virtual Tennis 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...
alexander-b/master-fun
src/virtualtennis/Menu.hs
gpl-3.0
9,000
0
14
3,330
1,576
920
656
161
2
module Accumulate (accumulate) where accumulate :: (a -> b) -> [a] -> [b] accumulate = undefined
daewon/til
exercism/haskell/accumulate/src/Accumulate.hs
mpl-2.0
98
0
7
17
40
24
16
3
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/DeletePipeline.hs
mpl-2.0
3,130
0
9
685
354
217
137
48
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-games-management/gen/Network/Google/Resource/GamesManagement/Events/ResetAll.hs
mpl-2.0
4,389
0
17
1,013
638
374
264
92
1
module Propellor.Property.SiteSpecific.Branchable where import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import qualified Propellor.Property.User as User import qualified Propellor.Property.Ssh as Ssh import qualified Propellor.Property.Postfix as Po...
np/propellor
src/Propellor/Property/SiteSpecific/Branchable.hs
bsd-2-clause
3,640
20
33
339
616
341
275
55
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Tests for lock waiting structure. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. R...
ganeti-github-testing/ganeti-test-1
test/hs/Test/Ganeti/Locking/Waiting.hs
bsd-2-clause
16,377
0
24
3,733
3,550
1,906
1,644
232
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Test.Anemone.Foreign.VInt where import Anemone.Foreign.VInt import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Builder as Builder im...
ambiata/anemone
test/Test/Anemone/Foreign/VInt.hs
bsd-3-clause
1,769
0
13
351
439
249
190
47
2
module Pear.Lexer where import Prelude hiding (lex) import Pear.Operator import Pear.Types import Text.Parsec import Text.Parsec.String parseEverything :: Parser Ast parseEverything = pearAlgebra lex = parse (parseEverything) ""
Charlesetc/haskell-parsing
src/Pear/Lexer.hs
bsd-3-clause
234
0
6
32
62
37
25
9
1
{-# LANGUAGE OverloadedStrings, TypeFamilies, ScopedTypeVariables, FlexibleContexts, PackageImports #-} module HttpPullTlsCl ( HttpPullTlsCl, HttpPullTlsClArgs(..), One(..), testPusher, ) where import Prelude hiding (filter) import Control.Applicative import Control.Monad import "monads-tf" Control.Monad.Trans im...
YoshikuniJujo/forest
subprojects/xml-push/HttpPullTlsCl.hs
bsd-3-clause
5,316
52
17
1,021
2,216
1,115
1,101
145
3
{------------------------------------------------------------------------------ Control.Monad.Operational Example: A reformulation of Koen Claessen's Parallel Parsing Processes http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.9217 For a detailed explanation, see also http://apfel...
HeinrichApfelmus/operational
doc/examples/BreadthFirstParsing.hs
bsd-3-clause
2,548
0
13
570
542
282
260
31
3
{-# LANGUAGE CPP #-} module Fibon.Run.Config.Local( configs ) where import Fibon.Run.Config -- This includes the conifg module imports and defines the localConfigs list #include "LocalConfigs.txt" configs :: [RunConfig] configs = localConfigs
dmpots/fibon
tools/fibon-run/Fibon/Run/Config/Local.hs
bsd-3-clause
249
0
5
37
35
24
11
6
1
{-# LANGUAGE OverloadedStrings #-} import Control.Monad import Data.Aeson import qualified Data.ByteString as BS import Data.Maybe import HypeStat (maybeExec) import Test.HUnit test1 :: IO () test1 = do bsPipeline <- BS.readFile "test/sample_pipeline.json" ...
KenetJervet/hypestat
test/Spec.hs
bsd-3-clause
828
0
12
187
230
121
109
20
2
import Common.Utils (if') input = [ [ 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8] , [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0] , [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65] , [52, 70, 9...
foreverbell/project-euler-solutions
src/11.hs
bsd-3-clause
2,239
0
12
734
1,595
1,034
561
27
1
module Util.Parse ( module Text.ParserCombinators.Parsec , module Text.ParserCombinators.Parsec.Expr , module Util.Parse.Parse ) where import Util.Parse.Parse import Text.ParserCombinators.Parsec hiding (parse) import Text.ParserCombinators.Parsec.Expr
etu-fkti5301-bgu/alt-exam_automated_theorem_proving
src/Util/Parse.hs
bsd-3-clause
267
0
5
35
55
38
17
7
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoRebindableSy...
facebookincubator/duckling
Duckling/Ordinal/KA/Rules.hs
bsd-3-clause
5,285
0
17
735
1,021
614
407
113
2
slice [] _ _ = [] slice (x:_) 1 1 = [x] slice (x:xs) 1 k = x:slice xs 1 (k - 1) slice (x:xs) i k = slice xs (i - 1) (k - 1)
bradb/99problems
src/p18.hs
bsd-3-clause
124
0
8
36
116
60
56
4
1
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, FlexibleInstances, OverloadedStrings, GADTs, ExistentialQuantification, ForeignFunctionInterface #-} module QueryArrow.FFI.C.GenQuery where import QueryArrow.Syntax.Utils import Prelude hiding (lookup) import qualified Data.Text as Text import Data.Map.Strict (lo...
xu-hao/QueryArrow
QueryArrow-ffi-c-genquery/src/QueryArrow/FFI/C/GenQuery.hs
bsd-3-clause
2,996
0
34
737
877
440
437
57
7
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Volume/Rules.hs
bsd-3-clause
975
0
16
189
179
110
69
23
2
----------------------------------------------------------------------------- -- -- Module : Main -- Copyright : (c) Phil Freeman, Jeff Polakow 2013 -- License : BSD3 -- -- Maintainer : -- Stability : experimental -- Portability : -- -- | -- ------------------------------------------------------------...
paf31/Adventure
src/Main.hs
bsd-3-clause
2,521
0
18
528
711
357
354
49
2
{-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TypeFa...
kylcarte/derivation
src/Data/Derivation/Natural.hs
bsd-3-clause
6,598
0
12
2,059
965
530
435
70
5
-- Copyright © 2013 Cameron White -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of condition...
cameronbwhite/ComputationalStructures
Haskell/PDA.hs
bsd-3-clause
1,767
1
11
359
113
82
31
-1
-1
{-# LANGUAGE BangPatterns #-} -- ------------------------------------------------------------ module PackageRank ( DAGList , DAG , Ranking , Score -- , dagFromList -- , dagToList -- , ranking , rankingStd , fromList , transClosure , Rel(..) , dagListToList ) where imp...
erantapaa/parse-cabal
src/PackageRank.hs
bsd-3-clause
13,820
0
15
4,552
2,723
1,479
1,244
159
2
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section{Tidying up Core} -} {-# LANGUAGE CPP #-} module TidyPgm ( mkBootModDetailsTc, tidyProgram, globaliseAndTidyId ) where #include "HsVersions.h" import TcRnTypes import DynFlags import CoreSyn import CoreUnfold import CoreFVs import CoreT...
fmthoma/ghc
compiler/main/TidyPgm.hs
bsd-3-clause
63,067
0
18
19,184
7,500
4,049
3,451
560
5