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 DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE...
input-output-hk/pos-haskell-prototype
core/src/Pos/Core/JsonLog/LogEvents.hs
mit
7,366
0
12
2,067
1,495
817
678
218
2
{-# LANGUAGE FlexibleContexts #-} module IRC.Commands where import Control.Applicative import Control.Monad import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Encoding as T import Data.ByteString (ByteString) import IRC.Types import ...
EXio4/netza
src/IRC/Commands.hs
mit
6,729
0
19
2,177
2,542
1,320
1,222
-1
-1
{-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-| Module : Mealstrom.FSMApi Description : API for FSMs Copyrig...
linearray/mealstrom
src/Mealstrom/FSMApi.hs
mit
5,551
0
17
1,888
1,307
687
620
-1
-1
{-------------------------------------------------------------------------------- Copyright (c) Daan Leijen 2003 wxWindows License. Demonstrates: - many different kind of controls - message logging. --------------------------------------------------------------------------------} {-# LANGUAGE FlexibleContexts ...
jacekszymanski/wxHaskell
samples/wx/Controls.hs
lgpl-2.1
5,198
0
22
2,169
1,407
685
722
85
3
{-# LANGUAGE CPP, DeriveDataTypeable #-} {-# OPTIONS -Wall #-} -- | An 'Annotation' that describes the dependency of the nodes -- and labels certain group of Manifest nodes -- that can safely be accessed simultaneously module Language.Paraiso.Annotation.Dependency ( Direct(..), Calc(..), Indirect(..), KernelWr...
nushio3/Paraiso
Language/Paraiso/Annotation/Dependency.hs
bsd-3-clause
1,646
0
8
319
237
151
86
27
0
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-...
reflex-frp/reflex
src/Reflex/Adjustable/Class.hs
bsd-3-clause
5,753
0
15
1,053
1,409
735
674
-1
-1
-- | Intel specific ELF additions -- . -- ZCA tables -- ========== -- . -- ICC (Intel C Compiler) can generate an optimization report with the -- opt-report-* family of flags. To make the correspondance between the -- information in the generated file and the produced binary, a debug section -- called ".debug_opt_repor...
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Format/Elf/Intel.hs
bsd-3-clause
5,837
0
14
1,504
1,107
625
482
95
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} -- | Constants used throughout the project. module Stack.Constants (builtConfigFileFromDir ,builtFileFromDir ,configuredFileFromDir ,defaultShakeThreads ,distDirFromDir ,distRelativeDir ,haskellModuleExts ,imageStaging...
duplode/stack
src/Stack/Constants.hs
bsd-3-clause
9,433
0
12
2,252
1,946
1,046
900
197
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeInType #-} module T14253 where import GHC.Exts import Data.Kind data TypeRep (a :: k) where Con :: TypeRep (a :: k) TrFun :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) ...
ezyang/ghc
testsuite/tests/pmcheck/complete_sigs/T14253.hs
bsd-3-clause
1,082
0
13
340
321
183
138
-1
-1
-- Copyright (c) 2000 Galois Connections, Inc. -- All rights reserved. This software is distributed as -- free software under the license in the file "LICENSE", -- which is included in the distribution. -- Modified to use stdout (for testing) module Illumination ( Object , Light (..) , light, pointlight,...
gridaphobe/hpc
tests/raytrace/Illumination.hs
bsd-3-clause
8,981
11
21
2,834
3,623
1,964
1,659
171
5
<?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="tr-TR"> <title>SAML Support</title> <maps> <homeID>saml</homeID> <mapref location="map....
thc202/zap-extensions
addOns/saml/src/main/javahelp/help_tr_TR/helpset_tr_TR.hs
apache-2.0
958
77
66
156
407
206
201
-1
-1
module MultiMatchesIn1 where square x y = let sq 0 = 0 sq x = x ^ pow pow = 2 in sq x + sq y where pow' = 56 g = let blah = 42 + blah2 blah2 = 9 in blah where blah = 56
SAdams601/HaRe
old/testing/letToWhere/MultiMatchesIn1_TokOut.hs
bsd-3-clause
304
0
9
183
94
48
46
10
2
module SPARC.CodeGen.Base ( InstrBlock, CondCode(..), ChildCode64(..), Amode(..), Register(..), setSizeOfRegister, getRegisterReg, mangleIndexTree ) where import SPARC.Instr import SPARC.Cond import SPARC.AddrMode import SPARC.Regs import Size import R...
forked-upstream-packages-for-ghcjs/ghc
compiler/nativeGen/SPARC/CodeGen/Base.hs
bsd-3-clause
3,178
0
11
840
473
267
206
58
2
module Main where import BuggyOpt() -- bug inducer! import Prelude hiding (lookup) import Good import M mkLin :: Array Int -> Map (Array Int) Int mkLin mseqs = (isJust (lookup mseqs empty)) `seq` (insert mseqs 1 empty) main :: IO () main = print $ isGood $ mkLin (array (1,1) [ (1,array (3,3) [(3, 42)]) ]!!!1)
urbanslug/ghc
testsuite/tests/stranal/should_run/T8425/Main.hs
bsd-3-clause
318
0
14
63
160
90
70
10
1
-- Tests grouping WITH a by clause {-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-} module Main where import GHC.Exts(the, groupWith) main = putStrLn (show output) where output = [ (the dept, sum salary, name) | (dept, salary, name) <- [("A", 1, "Bob"), ("B", 2, "Fred"), ("A", 5, "J...
urbanslug/ghc
testsuite/tests/deSugar/should_run/mc08.hs
bsd-3-clause
394
0
11
93
132
81
51
7
1
{-% # Text.ProseDoc `Text.ProseDoc` is a tool that reads markdown formatted comments from a Haskell source file and composes the comments and the associated source into a HTML document where the prose and source flow side by side in sync. The concept is blatantly borrowed from the CoffeeScript tool [docco](http://jas...
shangaslammi/prose-doc
src/Text/ProseDoc.hs
mit
3,087
0
16
552
513
267
246
42
3
import System.Log.Logger import System.IO import Network.Wreq import Control.Lens (view) import qualified Data.ByteString.Lazy as BS import Control.Concurrent.Async downloadUrl :: String -> IO () downloadUrl url = do updateGlobalLogger "DownloaderApp" (setLevel INFO) infoM "DownloaderApp" ("Downloading: " ++ url) ...
codygman/haskell-concurrent-downloader-example
src/Main.hs
mit
725
0
11
184
173
90
83
18
1
module System.FSQuery.Util where import Data.Char (isSpace) import qualified Data.Char as DChar trimWhile :: (Char -> Bool) -> String -> String trimWhile p = f . f where f = reverse . dropWhile p toLowerString :: String -> String toLowerString "" = "" toLowerString (x:xs) = DChar.toLower x : toLowerString xs di...
qwfy/fsquery
src/System/FSQuery/Util.hs
mit
471
0
8
88
184
101
83
14
1
module Text.Parsec.Utils ( parseWhiteSpaces , parseUnquotedString ) where import Control.Applicative ((<|>)) import qualified Text.Parsec as Parsec parseWhiteSpaces :: Parsec.Parsec String () String parseWhiteSpaces = Parsec.try (Parsec.many1 Parsec.space) <|> Parsec.many1 Parsec.ta...
r-peck/Rome
src/Text/Parsec/Utils.hs
mit
469
0
9
86
137
78
59
9
1
{-# LANGUAGE GADTs #-} module Kafkaesque.Request.KafkaRequest ( Request(..) , Response(..) , TimeoutMs(..) , TopicData , PartitionData , ProduceResponseTopic , FetchResponseTopic , FetchResponsePartition , FetchRequestPartition , FetchRequestTopic , OffsetListResponsePartition , OffsetListRespo...
cjlarose/kafkaesque
src/Kafkaesque/Request/KafkaRequest.hs
mit
3,704
0
10
655
903
550
353
90
0
import Control.Monad import System.IO import Text.Printf fac = product . flip take [1..] solve x = 1 + sum (map (\t -> x ** fromIntegral t / fac t) [1..9]) main :: IO () main = do n_temp <- getLine let n = read n_temp :: Int forM_ [1..n] $ \a0 -> do x_temp <- getLine let x = read x_temp ...
ahavrylyuk/hackerrank
haskell/eval-ex.hs
mit
367
0
14
110
176
87
89
13
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} newtype Velocity = Velocity { unVelocity :: Double } deriving (Eq, Ord) v :: Velocity v = Velocity 2.718 x :: Double x = 6.636 err = v + x
riwsky/wiwinwlh
src/newtype.hs
mit
189
1
6
40
70
36
34
8
1
module Rotations where import Data.Ord (compare) import Data.List (minimumBy) rotateWord :: String -> (Int, String) rotateWord word = minimumBy compareWithIndex allRotations where doubleWord = word ++ word len = length word allRotations = map (\n -> (n, take len (drop n doubleWord))) [0..(len-1)] co...
tyehle/programming-studio
2017-W20/tobin/src/Rotations.hs
mit
363
0
13
72
147
82
65
9
1
module PinkKellet (kellet) where kellet :: [Double] -> [Double] -- ^ pinked noise kellet w = kellet' w 0 0 0 0 0 0 0 where kellet' [] _ _ _ _ _ _ _ = [] kellet' (white:ws) b0 b1 b2 b3 b4 b5 b6 = pink : kellet' ws b0' b1' b2' b3' b4' b5' b6' where b0' = 0.99886 * b0 + white * 0.0...
danplubell/color-noise
library/PinkKellet.hs
mit
735
0
16
304
287
154
133
13
2
module Chip8.Display (init) where import Foreign.C.Types import Linear import qualified SDL initDisplay :: IO () initDisplay = undefined
narrative/chip8
src/Chip8/Display.hs
mit
139
0
6
20
39
24
15
6
1
---------------------------------------------- -- CIS 194, Homework 1 -- Author: Glenn R. Fisher -- Date: March 29, 2016 ---------------------------------------------- ---------------------------------------------- -- Part 1: Validating Credit Card Numbers ---------------------------------------------- -- | Convert p...
glennrfisher/cis194-haskell
01 Intro/01-intro.hs
mit
4,079
0
16
780
585
341
244
30
1
-- -- Copyright (c) 2013-2019 Nicola Bonelli <nicola@pfq.io> -- -- 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 option) any later version. -- -...
awgn/cgrep
src/Main.hs
gpl-2.0
12,676
0
35
3,960
3,361
1,794
1,567
207
9
{- | Module : $Header$ Description : parser for CASL architectural specifications Copyright : (c) Maciek Makowski, Warsaw University 2003-2004, C. Maeder License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable (via imports)...
nevrenato/Hets_Fork
Syntax/Parse_AS_Architecture.hs
gpl-2.0
9,288
0
16
2,014
2,341
1,149
1,192
169
2
module Main where import Pythagoras (Triple(..), pythagoreanTripleSequence, perimeter) import Primes (divides) main :: IO () main = let target = 1000 sieve trip = (perimeter trip) `divides` target match = head $ filter sieve pythagoreanTripleSequence factor = target `div` (peri...
liefswanson/projectEuler
app/p1/q9/Main.hs
gpl-2.0
865
0
15
330
304
166
138
22
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} module NLP.TextClustering (Algorithm(..), Distance(..), clusterDocuments, clusterDocumentsVerbose) where import Math.IDF(buildFeatureVectors) import NLP.TextClustering.DistanceUtils import Math.HKMeans.KMeans (kmeans) import Numeric.LinearA...
remusao/DocumentClustering
NLP/TextClustering.hs
gpl-2.0
4,468
0
14
1,109
1,179
694
485
71
2
-- | This module provides the functionallity to use -- pandocs reader for reStructuredText (RST) in Yesod. -- The code bases heavily on yesod-markdown from -- Patrick Brisbin, which does the same thing for Markdown. module Yesod.RST ( RST(..) -- * Wrappers , rstToHtml , rstToHtmlTrusted , rstFromFile ...
pSub/yesod-rst
Yesod/RST.hs
gpl-2.0
3,670
0
14
814
866
480
386
-1
-1
-- Need this for ghc >= 7 {-# LANGUAGE NoMonoLocalBinds #-} ---------------------------------------------------- -- -- -- HyLoRes.ClauseSet.InUse: -- -- A set of FullClauses classified by the -- -- family of the distinguished formula ...
nevrenato/HyLoRes_Source
src/HyLoRes/ClauseSet/InUse.hs
gpl-2.0
14,234
4
15
5,544
3,718
1,970
1,748
227
9
module Util.ParallelTest where import Control.Concurrent.MVar import Control.Concurrent(forkIO, threadDelay) import Control.Monad import Util.TestWrapper import Test.HUnit delayTest millis = wrapTest $ \test -> threadDelay (millis * 1000) >> test parallelTests label tests = TestLabel label $ TestCase $ do forks ...
raimohanska/rump
src/Util/ParallelTest.hs
gpl-3.0
1,185
0
13
322
398
195
203
23
1
ka >>= kab = Cont (\hb -> ...)
hmemcpy/milewski-ctfp-pdf
src/content/3.5/code/haskell/snippet26.hs
gpl-3.0
30
1
7
7
22
11
11
-1
-1
module AST where -- The syntax is taken from C99 (ISO/IEC 9899:1999), section 6 -- 6.4.2 data Identifier = Identifier String deriving (Eq,Show) -- 6.4.4 data Constant = Integer Integer | Float Double | Char Char | Enumeration Identifier derivin...
joelwilliamson/jcc
AST.hs
gpl-3.0
12,482
0
9
4,242
1,937
1,114
823
209
0
module Lecture5NRC (solveAndShowNRC, genProblemNRC, blocksNRC) where import Data.List import System.Random -- | Mainly a direct copy from Lecture 5, however renamed the functions with a NRC -- suffix. Furthermore introduced a now set of blocks, the blocksNRC. The most -- challenging bit was figuring out that I had to...
vdweegen/UvA-Software_Testing
Lab5/Willem/Lecture5NRC.hs
gpl-3.0
11,492
0
16
3,393
6,043
3,406
2,637
296
5
{-# Language OverloadedStrings #-} module Equ.PreExpr.Symbols where import Equ.Syntax import Equ.Types import Equ.Theories.AbsName -- | Constante cero. natZero :: Constant natZero = Constant { conRepr = "0" , conName = Zero , conTy = TyAtom ATyNat } -- | Ope...
miguelpagano/equ
Equ/PreExpr/Symbols.hs
gpl-3.0
5,931
0
9
2,870
1,125
679
446
127
1
{-# LANGUAGE GADTs #-} module Parselang where import Math.Qeatem import Language import Data.Char import Data.Maybe import Control.Monad import Control.Applicative ((<$>)) import Text.Parsec import qualified Data.HashMap.Strict as HM import qualified Data.HashSet as H import qualified Data.Map as M type MetaParser a ...
kuribas/metatyper
src/Parselang.hs
gpl-3.0
10,801
0
23
2,793
3,958
1,925
2,033
299
5
module Main where -- | -- Module : Acme.CuteGirl -- Copyright : (c) Mateusz Kowalczyk 2014 -- License : GPL-3 -- -- Maintainer : fuuzetsu@fuuzetsu.co.uk -- Stability : stable -- -- Executable module handling "Acme.CuteGirl" import Acme.CuteGirl import System.Environment (getArgs) main :: IO () mai...
Fuuzetsu/acme-cutegirl
src/Main.hs
gpl-3.0
825
0
11
268
129
79
50
16
3
module Database.Design.Ampersand.Graphic.ClassDiag2Dot ( classdiagram2dot ) where import Data.List import Database.Design.Ampersand.Basics import Database.Design.Ampersand.Classes import Database.Design.Ampersand.ADL1 hiding (Association,Box) import Database.Design.Ampersand.Misc import Data.String import Data.Gr...
guoy34/ampersand
src/Database/Design/Ampersand/Graphic/ClassDiag2Dot.hs
gpl-3.0
9,989
2
26
5,138
1,799
963
836
125
8
module Language.Intentionally.Types where import Data.Set (Set(..)) import qualified Data.Set as Set -- User or device newtype Agent = Agent (Set AState) deriving (Show, Eq, Ord) data AState = AP Physics | AB Body | AI Instinct | AS Social deriving (Show, Eq, Ord) -- abstraction...
mpahrens/Intentionally
Language/Intentionally/Types.hs
gpl-3.0
1,248
0
7
320
404
225
179
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-iam/gen/Network/Google/Resource/IAM/Projects/ServiceAccounts/Keys/List.hs
mpl-2.0
6,101
0
17
1,372
801
469
332
124
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-sts/gen/Network/AWS/STS/DecodeAuthorizationMessage.hs
mpl-2.0
5,502
0
9
987
451
283
168
55
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-youtube/gen/Network/Google/Resource/YouTube/LiveChatBans/Insert.hs
mpl-2.0
5,332
0
19
1,299
809
472
337
119
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Books.Types.Sum -- Copyright : (c) 2015-2016 Brendan H...
rueshyna/gogol
gogol-books/gen/Network/Google/Books/Types/Sum.hs
mpl-2.0
26,484
0
11
5,589
4,082
2,163
1,919
470
0
{-# LINE 1 "CCAR/Tests/TestRegex.hsc" #-} {-# LANGUAGE CPP, ForeignFunctionInterface #-} {-# LINE 2 "CCAR/Tests/TestRegex.hsc" #-} module CCAR.Tests.TestRegex where import Foreign import Foreign.C.Types {-# LINE 9 "CCAR/Tests/TestRegex.hsc" #-} newtype PCREOption = PCREOption {unPCREOption :: CInt} deriving (S...
asm-products/ccar-websockets
CCAR/Tests/TestRegex.hs
agpl-3.0
600
2
8
95
123
74
49
14
1
-- | Utility functions for C code generation {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} module Data.GI.CodeGen.JNI.Utils.C where import Data.List (intercalate) import Data.Maybe (catMaybes, isNothing, maybeToList) import Data.String (fromString) import qualified Data.Text as T (Text, unpac...
ford-prefect/gir2jni
src/Data/GI/CodeGen/JNI/Utils/C.hs
lgpl-2.1
11,028
0
21
3,482
2,805
1,473
1,332
233
16
import System.IO import System.IO.Streams import Control.Monad import Data.List initial_state :: [[Int]] initial_state = [] find' :: Int -> [[Int]] -> Maybe [Int] find' x [] = Nothing find' x (st:sts) | elem x st = Just st | otherwise = find' x sts drop' :: Int -> Int -> [[Int]] -> [[Int]] drop' _ _ [[]] = [...
a143753/AOJ
DSL_1_A.hs
apache-2.0
2,270
0
13
796
1,014
524
490
62
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Cis194.Week12.Risk where import Control.Monad import Control.Monad.Random import Data.List ------------------------------------------------------------ -- Die values newtype DieValue = DV { unDV :: Int } deriving (Eq, Ord, Show, Num) first :: (a -> b) -> (a, c) ...
gsnewmark/cis194
src/Cis194/Week12/Risk.hs
apache-2.0
1,691
0
12
424
737
391
346
38
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck as QC import Data.Attoparsec.ByteString as Atto import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B import ...
shyam334/hadoop-tools
tests/test.hs
apache-2.0
3,312
0
12
866
1,254
654
600
74
1
-- -*- coding: utf-8 -*- -- Copyright (c) 2010-2014, MIT Probabilistic Computing Project -- -- 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/license...
probcomp/haxcat
BenchInfer.hs
apache-2.0
1,537
0
8
292
171
98
73
19
1
import Data.List import System.IO -- List primeNumbers = [3, 5, 7, 11] morePrimes = primeNumbers ++ [13, 17, 19, 23, 29] favNums = 2 : 7 : 21 : 66 : [] multlist = [[3, 5, 7], [11, 13, 17]] morePrimes2 = 2 : morePrimes lenPrime = length morePrimes2 revPrime = reverse morePrimes2 isListEmpty = null morePrimes2 secondP...
Kermit95/Playground
lang/haskell/haskell_tut2.hs
apache-2.0
1,767
0
9
354
764
448
316
46
1
module Main where import qualified PassThroughService_Client as Client import PassThrough_Types import Thrift import Thrift.Protocol.Binary import Thrift.Server import Thrift.Transport import Thrift.Transport.Handle import Control.Exception import Data.Either import Data.Int import Data.List import Data.Maybe import...
maxeler/maxskins
examples/PassThrough/client/hs/AdvancedStatic/PassThroughClient.hs
bsd-2-clause
7,987
0
17
1,730
2,640
1,309
1,331
144
12
module Test.Day4 where import Day4 as D4 import Test.Tasty import Test.Tasty.HUnit day4 :: TestTree day4 = testGroup "The Ideal Stocking Stuffer" [part1, part2] part1 :: TestTree part1 = testGroup "Part 1" [p1Tests, p1Puzzle] p1Tests :: TestTree p1Tests = testGroup "Test Cases" $ [ testCase "Example 1" $ zer...
taylor1791/adventofcode
2015/test/Test/Day4.hs
bsd-2-clause
797
0
9
155
232
123
109
24
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module OpenRTB.Types.Enum.VideoPlaybackMethodSpec where import Control.Applicative import Data.Aeson import Data.Aeson.TH import Test.Hspec import Test.QuickCheck import Test.Instances import OpenRTB.Types.Enum.VideoPlaybackMethod data Mock = Mock {...
ankhers/openRTB-hs
spec/OpenRTB/Types/Enum/VideoPlaybackMethodSpec.hs
bsd-3-clause
689
0
18
111
195
106
89
21
1
{-# LANGUAGE NoMonomorphismRestriction, PackageImports, TemplateHaskell, FlexibleContexts #-} module Language.Granule.ReplParser where import Prelude --import Data.List --import Data.Char import qualified Data.Text as T import Text.Parsec import qualified Text.Parsec.Token as Token import Text.Parsec.Language ...
dorchard/gram_lang
repl/app/Language/Granule/ReplParser.hs
bsd-3-clause
3,867
0
15
969
1,119
550
569
118
2
{-# OPTIONS_GHC -cpp #-} ----------------------------------------------------------------------------- -- | -- Module : Network -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/network/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : pr...
FranklinChen/hugs98-plus-Sep2006
packages/network/Network.hs
bsd-3-clause
9,517
83
17
1,913
1,511
793
718
141
2
-- | -- Module : FRP.Animas.MergeableRecord -- Copyright : (c) Antony Courtney and Henrik Nilsson, Yale University, 2003 -- License : BSD-style (see the LICENSE file in the distribution) -- -- Maintainer : nilsson@cs.yale.edu -- Stability : provisional -- Portability : portable -- -- Framework for r...
eamsden/Animas
src/FRP/Animas/MergeableRecord.hs
bsd-3-clause
2,250
2
8
498
305
187
118
18
1
{- Testing definitions in no-role-annots package. Copyright 2014 Richard Eisenberg https://github.com/goldfirere/no-role-annots/ -} {-# LANGUAGE TemplateHaskell, CPP, GeneralizedNewtypeDeriving, StandaloneDeriving #-} module Test.Test where #if __GLASGOW_HASKELL__ < 707 import Language.Haskell.Ro...
goldfirere/no-role-annots
Test/Test.hs
bsd-3-clause
1,953
0
14
394
388
205
183
38
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ImpredicativeTypes #-} module Parser.PropertyParser where import Control.Applicative.Interleaved import Data.Char import qualified Data.Map as Map import Data.Maybe import Text.ParserCombinators.UU ...
carliros/Simple-San-Simon-Functional-Web-Browser
src/Parser/PropertyParser.hs
bsd-3-clause
10,124
0
18
2,558
2,277
1,222
1,055
234
1
module Algebra.Lattice.Levitated ( Levitated(..) ) where import Algebra.Lattice -- -- Levitated -- -- | Graft a distinct top and bottom onto an otherwise unbounded lattice. -- The top is the absorbing element for the join, and the bottom is the absorbing -- element for the meet. data Levitated a = Top ...
batterseapower/lattices
Algebra/Lattice/Levitated.hs
bsd-3-clause
1,240
0
8
367
345
184
161
24
0
module Graphics.Vty.Widgets.Builder.Reader.XML.Namespaces ( coreNS , widgetNS , dataNS ) where coreNS, widgetNS, dataNS :: String coreNS = "http://codevine.org/vty-ui-builder/xmlns/core/1.0" widgetNS = "http://codevine.org/vty-ui-builder/xmlns/widget/1.0" dataNS = "http://codevine.org/vty-ui-builder/xm...
jtdaugherty/vty-ui-builder-xml
src/Graphics/Vty/Widgets/Builder/Reader/XML/Namespaces.hs
bsd-3-clause
333
0
4
40
46
32
14
8
1
{-# OPTIONS_GHC -fno-warn-tabs #-} {- $Id: TestsAccum.hs,v 1.2 2003/11/10 21:28:58 antony Exp $ ****************************************************************************** * Y A M P A * * ...
ivanperez-keera/Yampa
yampa/tests/TestsAccum.hs
bsd-3-clause
11,381
28
15
4,051
3,783
2,141
1,642
252
2
{-# LANGUAGE BangPatterns #-} module Pygmalion.Metadata ( FileMetadataMap , FileSet , FileMetadata (..) , readMetadata , checkMetadata , rehashVersion , hasBuildCommand , newSourceEntry , newInclusionEntry , getCommandInfoForFile ) where import Control.Applicative import Control.Monad import Control.Monad.Writer impo...
sethfowler/pygmalion
src/Pygmalion/Metadata.hs
bsd-3-clause
7,308
0
18
1,838
1,355
699
656
121
5
{-# OPTIONS_GHC -fno-warn-tabs #-} {- $Id: TestsLoop.hs,v 1.6 2003/11/10 21:28:58 antony Exp $ ****************************************************************************** * Y A M P A * * ...
ivanperez-keera/Yampa
yampa/tests/TestsLoop.hs
bsd-3-clause
6,914
10
19
1,931
2,339
1,382
957
145
2
{-# LANGUAGE OverloadedStrings #-} -- | Tree interface using the @qtree@ package. -- An example of usage is provided in the /examples/ directory of -- the source distribution. module Text.LaTeX.Packages.Trees.Qtree ( -- * Tree re-export module Text.LaTeX.Packages.Trees -- * Qtree package , qtree ...
dmcclean/HaTeX
Text/LaTeX/Packages/Trees/Qtree.hs
bsd-3-clause
1,374
0
11
332
345
192
153
26
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module CSVParsers ( Language , Dic , CSVFlashcard (..) , CSVChapter (..) , toCSVChapters , DicOf , CSVCourseIntro (..) , CSVCourseIntroFlashcard (..) , toCSVCourseIntro , CSVLanguage (..) , CSVCourseMeta (..) ) where import qualified Data...
homam/babelbay-ma-parseit
src/CSVParsers.hs
bsd-3-clause
4,967
0
23
1,035
1,506
860
646
114
1
{-# LANGUAGE TemplateHaskell #-} -- | Code snippets used by the JS backends. module Futhark.CodeGen.RTS.JavaScript ( serverJs, valuesJs, wrapperclassesJs, ) where import Data.FileEmbed import qualified Data.Text as T -- | @rts/javascript/server.js@ serverJs :: T.Text serverJs = $(embedStringFile "rts/jav...
HIPERFIT/futhark
src/Futhark/CodeGen/RTS/JavaScript.hs
isc
590
0
7
75
95
58
37
13
1
{-# LANGUAGE NPlusKPatterns #-} module Chapter2.Section2.Tut9 where import Prelude import Data.List(genericLength) import Data.Char(isDigit) import Unsafe.Coerce() import Test.QuickCheck() --import Test.QuickCheck(arbitrary) --import Test.QuickCheck.Property ((==>)) --import MonadUtils ((<*>), (<$>))...
ltfschoen/HelloHaskell
src/Chapter2/Section2/Tut9.hs
mit
17,359
1
11
5,223
562
336
226
35
1
module Sproxy.Application.State ( decode , encode ) where import Data.ByteString (ByteString) import qualified Data.ByteString.Base64 as Base64 import Data.ByteString.Lazy (fromStrict, toStrict) import Data.Digest.Pure.SHA (bytestringDigest, hmacSha1) import qualified Data.Serialize as DS -- FIXME: Compress / d...
ip1981/sproxy2
src/Sproxy/Application/State.hs
mit
819
0
10
131
244
135
109
19
2
{-# LANGUAGE ScopedTypeVariables #-} import Prelude hiding (filter) import System.Environment (getArgs) import Vision.Detector.Edge (canny) import Vision.Image import Vision.Image.Storage.DevIL (Autodetect (..), load, save) -- Detects the edge of the image with the Canny's edge detector. -- -- usage: ./canny input.pn...
RaphaelJ/friday-examples
src/Canny.hs
lgpl-3.0
1,354
0
17
481
249
131
118
25
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-} #endif -- | This module defines the 'WeakBag' type, which represents a mutable -- collection of items that does not cause the items to be retained in me...
ryantrinkle/reflex
src/Data/WeakBag.hs
bsd-3-clause
4,839
0
24
1,109
884
473
411
78
1
{-# LANGUAGE OverloadedStrings #-} module Traduisons.Util where import Control.Monad.Except import Data.List import Data.Maybe import Data.Time.Clock.POSIX import Network.HTTP.Client as N import Network.HTTP.Types import Control.Exception import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.La...
johntyree/traduisons-hs
src/Traduisons/Util.hs
bsd-3-clause
2,257
0
17
549
772
399
373
51
5
{-# LANGUAGE TemplateHaskell #-} {-# Language OverloadedStrings #-} module BitcoinCore.BloomFilter ( Filter(..) , Tweak(..) , NFlags(..) , probability , maxFilterBytes , numberHashFunctions , filterSize , pDefault , blankFilter , updateFilter , hardcodedTweak , unroll , roll , serializeFilte...
clample/lamdabtc
backend/src/BitcoinCore/BloomFilter.hs
bsd-3-clause
4,977
0
14
984
1,301
724
577
122
2
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import System.Exit (ExitCode(..), exitWith) import Sieve (primesUpTo) exitProperly :: IO Counts -> IO () exitProperly m = do counts <- m exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess testCase :: St...
pminten/xhaskell
sieve/sieve_test.hs
mit
1,728
0
12
409
841
513
328
35
2
module Text.Peggy ( module Text.Peggy.Prim, module Text.Peggy.SrcLoc, module Text.Peggy.Syntax, module Text.Peggy.Quote, ) where import Text.Peggy.Prim import Text.Peggy.SrcLoc import Text.Peggy.Syntax import Text.Peggy.Quote
tanakh/Peggy
Text/Peggy.hs
bsd-3-clause
237
0
5
32
61
42
19
9
0
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} module Lazyfoo.Lesson17 (main) where import Prelude hiding (foldl1) import Control.Applicative import Control.Monad import Data.Foldable import Data.Monoid import Data.Maybe import Foreign.C.Type...
bj4rtmar/sdl2
examples/lazyfoo/Lesson17.hs
bsd-3-clause
4,774
0
24
1,331
1,481
730
751
117
4
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE CPP #-} -- The intent is that this Prelude provide the API of -- the base 4.11 Prelude in a way that is portable for -- all base versions. module Prelude ( module Prelude.Compat , Semigroup(..) ) where import Prelude.Compat import Data...
jgm/pandoc-citeproc
prelude/Prelude.hs
bsd-3-clause
365
0
6
62
45
32
13
9
0
#!/usr/bin/env stack -- stack --install-ghc runghc --package turtle -- Generate a subset of sinex files to commit into the source tree as test -- data {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} import qualified Data.Text as T import qualified Data.Text.IO as TIO import Data.Text.Read as T ...
lbodor/geodesy-domain-model
src/test/resources/solutions/final/weekly/sinex-subset.hs
bsd-3-clause
1,029
0
15
261
300
161
139
20
2
import Distribution.Simple import System.Process main = defaultMainWithHooks simpleUserHooks { preConf = \args confFlags -> do system "./build-parser.sh" preConf simpleUserHooks args confFlags }
thomasjm/IHaskell
ghc-parser/Setup.hs
mit
247
0
11
74
50
25
25
6
1
{-# LANGUAGE CPP, BangPatterns #-} module Main where import Control.Monad import Data.Int import Network.Socket ( AddrInfo, AddrInfoFlag (AI_PASSIVE), HostName, ServiceName, Socket , SocketType (Stream), SocketOption (ReuseAddr) , accept, addrAddress, addrFlags, addrFamily, bindSocket, defaultProtocol , defa...
aycanirican/network-transport-tcp
benchmarks/JustPingThroughMVar.hs
bsd-3-clause
4,012
0
15
819
1,225
638
587
94
2
import Numeric.Natural import Control.Exception (evaluate) newtype Mod a = Mod a deriving (Show) instance Integral a => Num (Mod a) where Mod a * Mod b = Mod (a * b `mod` 10000000019) fromInteger n = Mod (fromInteger n `mod` 10000000019) main :: IO () main = do -- Should not allocate more compared to ...
sdiehl/ghc
libraries/base/tests/T17499.hs
bsd-3-clause
471
0
11
109
171
88
83
10
1
---------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.BluetileCommands -- Copyright : (c) Jan Vornberger 2009 -- License : BSD3-style (see LICENSE) -- -- Maintainer : jan.vornberger@informatik.uni-oldenburg.de -- Stability : unstable -- Portabili...
markus1189/xmonad-contrib-710
XMonad/Actions/BluetileCommands.hs
bsd-3-clause
3,505
0
15
1,055
610
336
274
38
1
{-@ LIQUID "--no-termination" @-} {-@ LIQUID "--short-names" @-} {-@ LIQUID "--fullcheck" @-} {-@ LIQUID "--maxparams=3" @-} module AlphaConvert (subst) where import qualified Data.Set as S import Language.Haskell.Liquid.Prelude freshS :: S.Set Bndr -> Bndr alpha :: S.Set Bndr -> Expr -> Expr subs...
mightymoose/liquidhaskell
tests/pos/alphaconvert-Set.hs
bsd-3-clause
3,870
0
10
959
528
283
245
33
1
{-# LANGUAGE GADTs, ExistentialQuantification, KindSignatures, RankNTypes #-} -- Fails (needs the (Ord a) in TypeSet -- c.f. gadt22.hs module Expr where import Data.Set (Set) data Type a where TypeInt :: Type Int TypeSet :: {- Ord a => -} Type a -> Type (Set a) TypeFun :: Type a -> Type b -...
urbanslug/ghc
testsuite/tests/gadt/gadt21.hs
bsd-3-clause
668
0
12
159
257
135
122
14
1
{-# OPTIONS_GHC -fpackage-trust #-} module Check05 ( main' ) where main' = do let n = 1 print $ n
urbanslug/ghc
testsuite/tests/safeHaskell/check/Check05.hs
bsd-3-clause
108
0
9
30
31
17
14
5
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} module Main (main) where import Control.Monad.IO.Class (liftIO) import Control.Monad.State import Control.Monad.Reader import Data.FileEmbed import Data.List import Data.Monoid import qualified Data.Map as M import System.File...
ihc/futhark
src/futhark-doc.hs
isc
4,092
0
18
1,231
1,139
608
531
90
4
import Text.Printf main = do line <- getLine let money = (read line :: Double) * 95.0 putStrLn $ printf "%.2f" $ if money < 300 then money else money * 0.85
Voleking/ICPC
references/aoapc-book/BeginningAlgorithmContests/haskell/ch1/ex1-7.hs
mit
164
1
12
39
73
35
38
5
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module System.NotifySend ( defaultNotification, notifySend, summary, body, expireTime, urgency, icon, Command, commandOptions ) where import Control.Lens hiding (elements) import C...
bobjflong/notify-send
src/System/NotifySend.hs
mit
1,959
0
13
499
556
306
250
51
2
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} module PDF.ContentStream ( parseStream , parseColorSpace ) where import Data.Char (chr, ord) import Data.String (fromString) import Data.List (isPrefixOf, dropWhileEnd) import Numeric (readOct, readHex) import Data.Maybe (fromMaybe) import qua...
k16shikano/hpdft
src/PDF/ContentStream.hs
mit
20,250
0
21
6,810
7,639
3,846
3,793
585
8
module Contextifier ( contextify ) where import qualified Data.Map as Map import Syntax (Context, Name (..), Term (..)) -- TODO invent a good name here. newtype TermContexts = TermContexts (Map.Map String Context) contextify :: Term -> Term contextify = contextify' emptyContext contextify' :: TermCont...
ysukhoverkhov/taplic4
src/06_UntypedLambda_Naive/Contextifier.hs
mit
1,266
0
14
225
379
195
184
25
3
module Main where import qualified GHCJS.CommonJS as CommonJS willThrowWithPairNumbers :: Int -> IO () willThrowWithPairNumbers n = if even n then error "What are you doing!?" else putStrLn "[haskell] All good" main :: IO () main = CommonJS.exportMain [ CommonJS.pack ("willThrowWithPairNumbers"...
beijaflor-io/ghcjs-commonjs
examples/failure/Main.hs
mit
354
0
8
72
85
46
39
10
2
{-# LANGUAGE OverloadedStrings #-} module Data.API.LinkedIn.Facet ( QueryFacet , Facets(..) , parseFacets , Facet(..) ) where import Control.Applicative ((<$>), (<*>)) import Data.Conduit (MonadThrow, Sink) import Data.Text (Text, unpack) import Data.XML.Types (Event) import Text.XML...
whittle/linkedin-api
Data/API/LinkedIn/Facet.hs
mit
2,207
0
13
674
621
337
284
52
1
module A4com where run file func = rdnam file >>= return.func -- example: run "task1_out.nam" task1_tcp rdnam::String->IO [[String]] rdnam fname = readFile fname >>= return.map words.lines smplpred cmplist wds = and $ map (\(i,w)->wds !! i==w) cmplist smplfilt cmplist = filter (smplpred cmplist) sumtr term_...
ducis/computer-network-labs
a4/A4com.hs
mit
596
0
11
93
294
166
128
10
1
{-# LANGUAGE DeriveFunctor #-} module Compiler.PreAST.Type.Expression where import Compiler.Serializable import Compiler.PreAST.Type.Symbol -------------------------------------------------------------------------------- -- Expression (with >/>=/=....) data Expression a = UnaryExpression (SimpleExpression a) ...
banacorn/mini-pascal
src/Compiler/PreAST/Type/Expression.hs
mit
3,002
0
10
726
804
421
383
53
0
import Control.Monad import Control.Applicative import Data.Char import System.IO ---- Testing functions -------------------------------- -- tests whether current token is a recognized operator isOperator :: String -> Bool isOperator string = elem (head string) "+-*/" -- tests whether current token is a recognized...
tonyfischetti/HRPNC
RPN.hs
mit
2,361
3
11
607
659
328
331
42
2
module Physics.Draw where import Linear.Affine import Linear.V2 import qualified SDL.Video.Renderer as R import qualified Physics.Contact as C import Physics.Transform import Physics.Linear import Physics.Geometry toRenderable :: (Functor f, RealFrac a, Integral b) => f a -> f b toRenderable = fmap floor centeredRec...
ublubu/shapes-demo
src/Physics/Draw.hs
mit
3,752
0
11
1,005
1,634
818
816
81
2
{-# LANGUAGE OverloadedStrings #-} module Network.API.Shopify.Request where import Data.Default (def) import Data.Text (append, pack, Text) import Data.Text.Encoding (encodeUtf8) import Network.API.Shopify.Types (MetafieldId(MetafieldId), APICredential(OAuthCred, BasicCred), ProductId(ProductId), StoreName(StoreName)...
aaronlevin/haskell-shopify
src/Network/API/Shopify/Request.hs
mit
7,587
0
10
3,608
1,329
760
569
96
1
module Text.Fractions where import Control.Applicative import Data.Ratio ((%)) import Text.Trifecta badFraction = "1/0" alsoBad = "10" shouldWork = "1/2" shouldAlsoWork = "2/1" parseFraction :: Parser Rational parseFraction = do numerator <- decimal char '/' denominator <- decimal return (numerator % denomin...
mudphone/HaskellBook
src/Fractions.hs
mit
1,713
0
12
295
450
221
229
44
2
{-# LANGUAGE Arrows #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} module Db.Transaction ( Transaction'(Transaction) , NewTransaction , Transaction...
benkolera/talk-stacking-your-monads
code/src/Db/Transaction.hs
mit
3,123
1
11
620
712
395
317
90
1