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 OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticbeanstalk-application-applicationresourcelifecycleconfig.html module Stratosphere.ResourceProperties.E...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ElasticBeanstalkApplicationApplicationResourceLifecycleConfig.hs
mit
3,349
0
12
207
261
152
109
28
1
-- The solution of exercise 1.30 -- The sum procedure above generates a linear recursion. The procedure -- can be rewritten so that the sum is performed iteratively. Show how -- to do this process. -- -- -------- (above from SICP) -- -- Compute cube of a number cube :: Num a => a -> a cube x = x ^ 3 -- New abstrack s...
perryleo/sicp
ch1/sicpc1e30.hs
mit
1,282
1
15
371
464
246
218
20
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Fun.Direct.Config ( module Fun.Direct.Config, module Fun.Matrix, mktafel2, mkmatrix ) where import Fun.Type import Fun.Matrix import Fun.Table import Autolib.Reader import Autolib.ToDoc import Autolib.Reporter import ...
marcellussiegburg/autotool
collection/src/Fun/Direct/Config.hs
gpl-2.0
862
2
9
166
226
134
92
28
1
-- Copyright 2016 Peter Beard -- Distributed under the GNU GPL v2. For full terms, see the LICENSE file. -- -- Problem #3 -- -- The prime factors of 13195 are 5, 7, 13 and 29. -- -- What is the largest prime factor of the number 600851475143 ? -- Get the square root of an Int (rounded up) isqrt :: Int -> Int isqrt = ...
PeterBeard/project-euler
haskell/src/problem-003.hs
gpl-2.0
878
3
10
192
198
103
95
11
2
-- Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: -- Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ... -- Pentagonal Pn=n(3n−1)/2 1, 5, 12, 22, 35, ... -- Hexagonal Hn=n(2n−1) 1, 6, 15, 28, 45, ... -- -- It can be verified that T285 = P165 = H143 = 40755. -- -- Fi...
ciderpunx/project_euler_in_haskell
euler045.hs
gpl-2.0
1,592
1
13
357
300
174
126
24
1
module TodoTree.Print ( printTree , writeTree ) where import Data.Tree import TodoTree.Types import Data.List (intersperse) printTree :: BraceStyle -> Tree Todo -> IO () printTree sty tre = putStrLn $ showTree sty tre writeTree :: FilePath -> BraceStyle -> Tree Todo -> IO () writeTree fp sty tre = writeFile ...
jefdaj/todotree
src/TodoTree/Print.hs
gpl-3.0
1,617
0
10
376
476
243
233
40
2
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} import Codec.Compression.GZip import Control.Applicative import Control.Lens import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Maybe import qualified Data.ByteString....
wavewave/lhc-analysis-collection
heavyhiggs/xsecgraph.hs
gpl-3.0
4,359
1
15
1,024
1,119
627
492
98
1
module Main(main) where import Lambda.Eval import Lambda.Parser import System.IO import Lambda.Args as A import Options.Applicative type Content = Either (String -> IO Handle) String getHandle :: Arguments -> IO Content getHandle (Arguments _ (Just _filePath)) | _filePath == "-" = return $ Left $ \_ -> return stdi...
KuroAku/lambda
src/Lambda.hs
gpl-3.0
1,157
0
10
210
431
215
216
33
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NamedFieldPuns #-} {-# OPTIONS_GHC -F -pgmF htfpp #-} module Pudding.Test.Observables.SimpleObservable (htf_thisModulesTests) where import Data.Complex (Complex(..)) import Data.Either (isLeft, isRight) import qualified Data.Vector.Unboxed ...
jfulseca/Pudding
src/Pudding/Test/Observables/SimpleObservable.hs
gpl-3.0
4,327
0
15
864
1,478
775
703
94
1
{- | Module : Tct.Method.Uncurry Copyright : (c) Martin Avanzini <martin.avanzini@uibk.ac.at>, Georg Moser <georg.moser@uibk.ac.at>, Andreas Schnabl <andreas.schnabl@uibk.ac.at> License : LGPL (see COPYING) Maintainer : Martin Avanzini <martin.avanzini@uibk.ac.at> Stabi...
mzini/TcT
source/Tct/Method/Uncurry.hs
gpl-3.0
12,733
0
22
5,483
3,209
1,695
1,514
189
12
---------------------------------------------------------------------------- -- | -- Module : $Header$ -- Copyright : (c) Proyecto Theona, 2012-2013 -- (c) Alejandro Gadea, Emmanuel Gunther, Miguel Pagano -- License : <license> -- -- Maintainer : miguel.pagano+theona@gmail.com -- Stabil...
alexgadea/fun
Fun/Theories.hs
gpl-3.0
826
0
5
144
91
65
26
11
1
module Files.MMap where import Files import HTorrentPrelude import Data.ByteString import Data.ByteString.Unsafe import Data.Conduit.Binary import qualified Data.Conduit.List as CL import Data.IntMap import Data.Interval import Data.Isometry import Foreign.C.Types import Foreign.Marshal.Utils import Foreign.Ptr impor...
ian-mi/hTorrent
Files/MMap.hs
gpl-3.0
2,025
0
14
393
674
350
324
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} module Handler.Home where import Import -- | Show a dashboard containing an overview of wishlists & the library. getHomeR :: Handler Html getHomeR = do ( wishlists, wanted, inProgress, recentlyFinished, newlyAdded, libraryWidget, libraryEnctype) <- getStanda...
prikhi/MyBookList
Handler/Home.hs
gpl-3.0
2,065
0
17
549
441
229
212
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Projects/DisableXpnResource.hs
mpl-2.0
4,721
0
15
988
480
290
190
76
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Orderreports/Listtransactions.hs
mpl-2.0
7,782
0
24
1,881
1,149
660
489
166
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/TwoStepVerification/TurnOff.hs
mpl-2.0
5,142
0
20
1,196
719
418
301
108
1
-- | This exists to get the full library into the coverage report. -- -- By including Main, the test exe inherits the full dependency graph, -- pulling in a few dozen more top-level definitions. Naturally, none of the -- missing modules are exercised by tests, so until this point, coverage numbers -- were inflated. Hap...
databrary/databrary
test/DatabraryMainTest.hs
agpl-3.0
588
0
8
97
43
27
16
6
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Model.VolumeMetricTest where import Test.Tasty.HUnit -- import Model.Id.Types -- import Model.Volume -- import Model.Category -- import Model.Metric -- import Model.VolumeMetric -- import TestHarness -- unit_assetBacked :: Assertion -- unit_assetBacked =...
databrary/databrary
test/Model/VolumeMetricTest.hs
agpl-3.0
585
0
4
105
29
25
4
3
0
module Main (Test(Test, a, b)) where
lspitzner/brittany
data/Test137.hs
agpl-3.0
37
0
5
6
17
13
4
3
0
module Erlang.Distribution.Term where import Erlang.Distribution.Internal import Control.Monad import Data.ByteString (ByteString) import Data.List (genericLength) import Data.Serialize import Data.Word data Term = TAtomCacheRef Word8 | TS...
mitchellwrosen/haskell-erlang-bridge
src/Erlang/Distribution/Term.hs
lgpl-3.0
9,559
0
17
3,577
2,490
1,154
1,336
-1
-1
drop' :: Int -> [a] -> [a] drop' n xs = if n <= 0 || null xs then xs else drop' (n-1) (tail xs) take' :: Int -> [a] -> [a] take' _ [] = [] take' n (x:xs) | n <= 0 = [] | otherwise = x:take' (n-1) xs
EricYT/Haskell
src/chapter-14-2.hs
apache-2.0
236
1
8
89
152
79
73
9
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.NamedClusterRole where import GHC.Generics import Data.Text import Openshift.V1.ClusterRole import qualified Data.Aeson -- | dat...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/NamedClusterRole.hs
apache-2.0
583
0
8
88
93
58
35
16
0
module Main where import Debug.Trace import System.Environment import System.FilePath import Language.Haskell.Exts import Codec.Archive.Zip import Data.List.Utils import Data.Char import Data.ByteString.Lazy as B hiding (map, length, getContents, putStrLn) import qualified Data.Map.Strict as M import Control.Monad im...
caasi/trans
app/Main.hs
bsd-3-clause
3,737
0
28
1,056
1,144
567
577
93
9
module MyRest.Api where {-- curl http://127.0.0.1:3000/rest/1.0.0/message \ -d '1' \ -X POST \ -H 'Content-Type: application/json' --} import Prelude import Control.Monad.Reader import Data.IORef import Rest import Rest.Api import Rest.Driver.Wai import qualified Rest.Resource as R silkApiExample st = apiToAp...
tolysz/Diag
MyRest/Api.hs
bsd-3-clause
1,120
0
11
209
377
201
176
31
1
module Main where main = putStrLn "hello" hoge = {})) parseError {}
YoshikuniJujo/toyhaskell_haskell
examples/parseError.hs
bsd-3-clause
74
5
6
18
29
17
12
-1
-1
-- #hide module Text.XHtml.Strict.Elements where import Text.XHtml.Internals -- * Elements in XHTML Strict abbr :: Html -> Html acronym :: Html -> Html address :: Html -> Html anchor :: Html -> Html area :: Html bdo :: Html -...
FranklinChen/hugs98-plus-Sep2006
packages/xhtml/Text/XHtml/Strict/Elements.hs
bsd-3-clause
5,494
0
5
2,974
1,293
689
604
156
1
module Data.ROS.Service.Internal where import Data.ROS.Formattable import Data.ROS.Message import Data.ROS.Message.Internal import Data.ROS.Service.Definition import Data.List ( intercalate ) import Text.Printf msgFmtLen :: Message -> Int msgFmtLen = filedsTpLen . fields srvFmtLen :: Service -> Int srvFmtLen sr...
ROSVendor/msg_dbg
lib/Data/ROS/Service/Internal.hs
bsd-3-clause
685
0
12
152
204
111
93
21
1
{-# LANGUAGE OverloadedStrings #-} module HQStatus where import Control.Applicative import Control.Monad import Network import Network.HTTP import Data.Aeson import System.Time import qualified Data.Text as T import qualified Data.ByteString.Lazy.Char8 as BC data HQStatus = HQStatus { open :: !Bool ...
astro/l-bot
src/HQStatus.hs
bsd-3-clause
1,330
0
16
358
398
213
185
44
2
{-# LANGUAGE PackageImports #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {...
kcsongor/generic-lens
generic-optics/src/Data/Generics/Product/Fields.hs
bsd-3-clause
5,284
0
11
1,220
762
474
288
56
1
{-# LANGUAGE OverloadedStrings #-} module Insomnia.Typecheck.Equiv.TypeAlias (equivTypeAlias) where import Control.Monad (unless) import Data.Monoid ((<>)) import qualified Unbound.Generics.LocallyNameless as U import Insomnia.Identifier (Field) import Insomnia.TypeDefn (TypeAlias(..), PrettyField(..)) import Insomn...
lambdageek/insomnia
src/Insomnia/Typecheck/Equiv/TypeAlias.hs
bsd-3-clause
2,624
0
24
711
725
378
347
54
2
{- Test for Expr-} module TestExpr where import qualified Dictionary import Expr import Test.QuickCheck test = do quickCheck n1 quickCheck n2 quickCheck n3 quickCheck n4 quickCheck n5 quickCheck n6 quickCheck $ expectFailure $ seq (n21) True quickCheck $...
DavidRutqvist/ParserOperators-D7012E-Lab2
test/TestExpr.hs
bsd-3-clause
803
0
9
210
270
137
133
25
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 The @TyCon@ datatype -} {-# LANGUAGE CPP, FlexibleInstances #-} module TyCon( -- * Main TyCon data types TyCon, AlgTyConRhs(..), HowAbstract(..), visibleDataCons, AlgTyConFlav(..), isNoParent, ...
mettekou/ghc
compiler/types/TyCon.hs
bsd-3-clause
95,838
7
16
27,462
11,518
6,518
5,000
1,031
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. ------------------...
rfranek/duckling
Duckling/Ranking/Classifiers/HE.hs
bsd-3-clause
58,288
0
15
28,301
11,009
6,843
4,166
978
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} module ElmFormat.AST.PatternMatching where import ElmFormat.AST.Shared import AST.V0_16 import AST.Structure import Reporting.Annotation (Located(At)) import Data.Indexed as I {-| Takes a list of patterns and matches them agains a type, extracting the types of each o...
avh4/elm-format
elm-format-lib/src/ElmFormat/AST/PatternMatching.hs
bsd-3-clause
1,240
0
16
302
349
187
162
23
2
{-# LANGUAGE DataKinds #-} module SpatialReference.Epsg where import SpatialReference type Epsg3857 = Epsg 3857 type Epsg4326 = Epsg 4326
meteogrid/spatial-reference
src/SpatialReference/Epsg.hs
bsd-3-clause
140
0
5
21
28
17
11
5
0
{-# LANGUAGE PatternGuards #-} module Idris.Elab.Provider(elabProvider) where import Idris.AbsSyntax import Idris.ASTUtils import Idris.DSL import Idris.Error import Idris.Delaborate import Idris.Imports import Idris.Coverage import Idris.DataOpts import Idris.Providers import Idris.Primitives import Idris.Inliner imp...
bkoropoff/Idris-dev
src/Idris/Elab/Provider.hs
bsd-3-clause
4,520
0
19
1,377
1,151
603
548
92
5
{-# OPTIONS -fglasgow-exts #-} module GArbitrary where import Prelude hiding (sum) import qualified Prelude import Control.Monad import Control.Applicative import System.Random import Test.QuickCheck import Debug.Trace import Generics.Regular import GFixpoints -- Applicative and alternative instances for the random...
dreixel/regular
examples/framework/GArbitrary.hs
bsd-3-clause
1,903
0
13
444
664
349
315
-1
-1
{-# LANGUAGE OverloadedLists #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} module Alerta.Hedgehog where import Alerta.Gen import Control.Arrow ((&&&)) import Data.Aeson (FromJSON, FromJSONKey, ToJSON, ToJSONKey, ...
mjhopkins/alerta-client
test/Alerta/Hedgehog.hs
bsd-3-clause
3,434
0
13
804
929
486
443
-1
-1
-- | Interface to the Futhark parser. module Language.Futhark.Parser ( parseFuthark , parseExp , parseType , parseLambda , parseValue , parseValues , parseExpIncr , parseExpIncrIO , ParseError (..) ) where import Control.Applicative import Control.Monad import Control.Monad.Trans.State import ...
CulpaBS/wbBach
src/Language/Futhark/Parser.hs
bsd-3-clause
6,825
0
14
1,564
1,609
856
753
127
2
{-# LANGUAGE OverloadedStrings #-} module Routes.DeckRoutes where import Database.PostgreSQL.Simple import Network.HTTP.Types.Status import Web.Scotty import qualified Web.Scotty as S import DB.Deck.Model import DB.Deck.Queries import DB.CardSimple.Model import DB.CardSimple.Queries import Routes.Utils ...
ppseafield/backend-flashcard
src/Routes/DeckRoutes.hs
bsd-3-clause
1,513
0
16
377
439
208
231
45
4
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE LambdaCase #-} -- | Generate presentations for types. module Present (-- * Presenting functions presentIt ,presen...
chrisdone/present
src/Present.hs
bsd-3-clause
57,066
5
27
20,078
12,937
6,961
5,976
1,171
27
module OptionsSpec (main, spec) where import Test.Hspec import Options (Mode(..)) import qualified Options main :: IO () main = hspec spec spec :: Spec spec = do describe "get" $ do it "recognizes --query" $ do opts <- Options.get ["--query", "foobar"] Options.mode opts `should...
beni55/pwsafe
test/OptionsSpec.hs
mit
1,033
0
15
252
313
157
156
25
1
module Config (readNick, readConfig) where import Network.IRC (UserName) import Control.Applicative import Data.Maybe import Data.Char import System.Environment (lookupEnv) import Text.Read (readMaybe) import Network.Socket (HostName, PortNumber) im...
wimdu/alonzo
src/Config.hs
mit
1,303
0
12
309
404
211
193
38
1
module Main where import qualified System.Directory as Dir import qualified System.Environment as Env import System.Exit (exitWith) import System.IO (hPutStrLn, stderr, stdin, stdout) import qualified System.Process as Proc import GHC.IO.Encoding (setLocaleEncoding, utf8) import qualified Elm.Compiler.Version as Comp...
mgold/Elm
src/CommandLineRouter.hs
bsd-3-clause
2,687
0
21
752
451
241
210
48
4
{- Teak synthesiser for the Balsa language Copyright (C) 2007-2010 The University of Manchester This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or...
Mahdi89/eTeak
src/Optim.hs
bsd-3-clause
28,826
0
30
10,179
7,357
3,694
3,663
459
8
module FunIn6 where --Default parameters can be added to definition of functions and simple constants. --In this example: add parameter 'y' to 'foo' main :: IO Integer main = do let foo = return [1..4] x <- foo return (sum x)
kmate/HaRe
test/testdata/AddOneParameter/FunIn6.hs
bsd-3-clause
235
0
11
50
55
28
27
6
1
{-# LANGUAGE ScopedTypeVariables, DeriveGeneric #-} import qualified Data.ByteString.Lazy as BL import Data.Csv import qualified Data.Vector as V import GHC.Generics data Person = Person String Int deriving Generic instance FromRecord Person instance ToRecord Person persons :: [Person] persons = [Person "John" 5000...
edtsech/cassava
examples/IndexBasedGeneric.hs
bsd-3-clause
666
1
15
140
219
108
111
18
2
module Board.Adventure.Adventure where data Adversary = Monster Int | Spirit Int deriving (Show, Eq) data Adventure = Combat Adversary deriving (Show, Eq)
charleso/intellij-haskforce
tests/gold/codeInsight/TotalProject/Board/Adventure/Adventure.hs
apache-2.0
158
0
6
25
52
30
22
3
0
----------------------------------------------------------------------------- -- | -- Module : Main (doctests) -- Copyright : (C) 2012-14 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : provisional -- Portability : portable --...
ekmett/intervals
tests/doctests.hs
bsd-2-clause
663
0
7
121
54
30
24
7
1
module Main where import Control.Monad (unless) import Paths_test (getDataFileName) import System.Directory (doesFileExist) import System.Exit (exitFailure) import System.IO (putStrLn) main :: IO () main = do fname <- getDataFileName "data-file" exists <- doesFileExist fname if exists then return () e...
dcreager/cabal
tests/systemTests/dataDir/Exe.hs
bsd-3-clause
397
0
10
89
118
61
57
15
2
----------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.Shaders.Attribs -- Copyright : (c) Sven Panne 2006-2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable --...
hesiod/OpenGL
src/Graphics/Rendering/OpenGL/GL/Shaders/Attribs.hs
bsd-3-clause
2,288
0
9
290
342
198
144
32
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UnboxedTuples #-} -- | Handy functions that should really be merged into Control.Concurrent -- itself. module Control.Concurrent.Extended ( forkIOLabeledWithUnmaskBs , forkOn...
sopvop/snap-server
src/Control/Concurrent/Extended.hs
bsd-3-clause
3,571
0
13
855
494
278
216
30
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, TypeOperators, UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Either -- Copyright : ...
tolysz/prepare-ghcjs
spec-lts8/base/Data/Either.hs
bsd-3-clause
8,019
1
9
1,703
847
509
338
50
1
module SimplePatternIn1 where -- try to fold against 'a' in Left a -- gives an error as you cannot fold against a -- pattern binding (changes definition). (Left a) = head f f :: (Num a, Num b) =>[Either a b] f = [Left 1, Right 2]
SAdams601/HaRe
old/testing/foldPatterns/SimplePatternIn1_TokOut.hs
bsd-3-clause
234
0
7
51
67
37
30
4
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module CondFmtTests ( tests ) where import Test.Tasty (testGroup, TestTree) import Test.Tasty.SmallCheck (testProperty) import Codec.Xlsx import Codec.Xlsx.Parser.Internal import Codec.Xlsx.Writer.Internal import Common import Test.SmallChe...
qrilka/xlsx
test/CondFmtTests.hs
mit
581
0
15
93
132
79
53
17
1
----------------------------------------------------------------------------- -- | -- Module : Hadrian.Haskell.Package -- Copyright : (c) Andrey Mokhov 2014-2017 -- License : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability : experimental -- -- Haskell packages and operations on ...
izgzhen/hadrian
src/Hadrian/Haskell/Package.hs
mit
2,873
0
9
512
512
278
234
40
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} -- | -- Module : Network.OAuth.Signing -- Copyright : (c) Joseph Abrahamson 2013 -- License : MIT -- -- Maintainer : me@jspha.com -- Stability : experimental -- Portability : non-portable -- -- Signin...
ibotty/oauthenticated
src/Network/OAuth/Signing.hs
mit
7,788
0
16
1,989
1,770
958
812
-1
-1
import Control.Monad -- Arrow import Prelude hiding ((.), id) import Control.Category import Control.Arrow import System.IO -- ------------------------------------------------------ main1 = liftM (length . words) (readFile "jabberwocky.txt" ) >>= print -- 66 -- regular functions: length, words...
uroboros/haskell_design_patterns
chapter3/5_arrows.hs
mit
3,642
0
18
1,013
899
466
433
57
1
-- https://www.reddit.com/r/dailyprogrammer/comments/2ao99p/7142014_challenge_171_easy_hex_to_8x8_bitmap/ module Main where import Data.Bits import Data.Word import Data.Text as T import Data.Text.Read as TR import qualified Data.Text.IO as TIO readHexPair :: Text -> Maybe (Word8, Word8) readHexPair txt = do...
gallais/dailyprogrammer
easy/171/Main.hs
mit
860
0
16
189
354
183
171
25
2
{-# OPTIONS_GHC -Wall #-} module LogAnalysis where import Log parse :: String -> [LogMessage] parse logs = map (parseMessage) (lines logs) parseMessage :: String -> LogMessage parseMessage msg = case tokens of ("I":_) -> LogMessage Info n1 (restAfter 2 tokens) ("W":_) -> LogMessage Warning n1 (restAfter 2 to...
strburst/haskell-stuff
cis194/hw2/LogAnalysis.hs
mit
1,554
0
11
391
625
323
302
36
4
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main where import Protolude import qualified Data.Set as S type Key = Int type Position = (Int, Int) open :: Key -> Position -> Bool open k = even . popCount . (+ k) . f where f (x, y) = x * x + 3 * x + 2 * x * y + y + y * y neighbors :...
genos/online_problems
advent_of_code_2016/day13/src/Main.hs
mit
1,546
0
15
458
704
378
326
39
1
{-# LANGUAGE BlockArguments #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} module ZoomHub.Web.Page.VerifyContent ( VerifyContent, mkVerifyContent, VerificationResult (..), ) where import Data.Monoid ((<>)) import Data.Text (Text) import qualified Data....
zoomhub/zoomhub
src/ZoomHub/Web/Page/VerifyContent.hs
mit
3,247
0
24
1,195
600
326
274
-1
-1
module Data.KeywordArgs.Parse (configParser) where import Data.Maybe (catMaybes) import Text.Parsec ((<|>), many, try, lookAhead, manyTill, char, anyChar, many1) import Text.Parsec.String (Parser) import Text.ParserCombinators.Parsec.Prim (GenParser) import Text.ParserCombinators.Parsec.Char (space, newline, one...
stackbuilders/keyword-args
src/Data/KeywordArgs/Parse.hs
mit
1,936
0
12
309
681
360
321
49
1
module Network.BitFunctor.Transaction.Tests where import Network.BitFunctor.Account import Network.BitFunctor.Transaction import Network.BitFunctor.Transaction.Arbitrary() import Data.Maybe (fromJust) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (testCase) import Test.Tasty.QuickCheck (testPropert...
BitFunctor/bitfunctor
test/src/Network/BitFunctor/Transaction/Tests.hs
mit
749
0
12
141
186
110
76
16
1
module Lab2 where import Data.Char -- Data.Char is imported for isAlphaNum check in IBAN assignment -- Triangle Assignment -- Time taken : 40 minutes data Shape = NoTriangle | Equilateral | Isosceles | Rectangular | Other deriving (Eq,Show) isTriangle :: Integer -> Integer -> ...
Gurrt/software-testing
week-2/Lab2.hs
mit
4,938
0
21
1,532
1,995
991
1,004
88
2
----------------------------------------------------------------------------- -- -- Module : GtkHelpers -- Copyright : -- License : MIT -- -- Maintainer : Tobias Fuchs -- Stability : experimental -- Portability : Win32, POSIX -- -- | -- ----------------------------------------------------------------...
fuchsto/drool
src/Drool/UI/GtkHelpers.hs
mit
5,410
0
15
790
1,460
710
750
94
1
{-# LANGUAGE FlexibleContexts, PolyKinds, DataKinds, TypeSynonymInstances #-} import Control.Monad.Reader type Config = FilePath load :: Config -> String -> IO String load config x = readFile (config ++ x) loadRevision :: Config -> Int -> IO String loadRevision config x = load config ("history" ++ show x ++ ".txt")...
Muzietto/geiesmonads
haskell/MonadReader/monadReader.hs
mit
1,267
0
10
284
468
237
231
-1
-1
----------------------------------------------------------------------------- -- -- Module : Main -- Copyright : (c) Phil Freeman 2013 -- License : MIT -- -- Maintainer : Phil Freeman <paf31@cantab.net> -- Stability : experimental -- Portability : -- -- | -- ------------------------------------------...
bergmark/purescript
psc/Main.hs
mit
5,399
0
22
1,089
1,536
813
723
106
5
import Control.Monad import Test.QuickCheck import Text.Printf import Tagger.Tag import Tagger.Data main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests prop_trigramHas3 pairs | null pairs = True | otherwise = all (\t -> length t == 3) $ trigramize pairs tests = [("trigram/has3", quickCheck prop_trigramHas3)]...
svoisen/hs_tagger
Tests.hs
mit
461
0
11
80
169
88
81
14
1
{- | Module : $Header$ Description : type checking terms and program equations Copyright : (c) Christian Maeder and Uni Bremen 2003 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable type inference based on <http://www...
nevrenato/Hets_Fork
HasCASL/TypeCheck.hs
gpl-2.0
22,221
358
23
9,499
6,750
3,613
3,137
458
32
{-# OPTIONS -w -O0 #-} {- | Module : CASL_DL/ATC_CASL_DL.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(overla...
nevrenato/Hets_Fork
CASL_DL/ATC_CASL_DL.der.hs
gpl-2.0
2,081
0
5
249
120
82
38
17
0
{-# LANGUAGE ScopedTypeVariables #-} module Handler.CategoryList where import Import import Database.Persist.Sql (toSqlKey) import Prelude (read) getCategoryListR :: Handler Value getCategoryListR = do filters <- createFilterList $ zip filterParams filterHandlers cats <- runDB $ selectList filters [As...
Southern-Exposure-Seed-Exchange/Order-Manager-Prototypes
yesod/Handler/CategoryList.hs
gpl-3.0
1,922
0
15
611
560
280
280
42
3
module Render.Backend.NoBackend where import Control.Wire import Prelude hiding ((.),id) import Render.Render import Utils.Wire.TestWire noBackend :: (Real t, Monoid e, Show e, Show a) => t -> Backend (Timed t ()) e IO () a noBackend dt = Backend runStdOutBackend where runStdOutBackend _ wr = tes...
mstksg/netwire-experiments
src/Render/Backend/NoBackend.hs
gpl-3.0
373
0
12
77
149
81
68
11
1
{-# LANGUAGE RecursiveDo, OverloadedStrings #-} module Estuary.Widgets.SpecificPattern where import Reflex import Reflex.Dom hiding (Delete,Insert,End) import Data.Map import Control.Monad import Data.List(intersperse, findIndex) import GHCJS.DOM.EventM import Data.Maybe(isJust) import Text.Read(readMaybe) import Data...
d0kt0r0/estuary
client/src/Estuary/Widgets/SpecificPattern.hs
gpl-3.0
4,540
0
16
619
2,469
1,340
1,129
50
1
{-| Module : LexerMonad License : GPL Maintainer : helium@cs.uu.nl Stability : experimental Portability : portable -} module Database.Design.Ampersand.Input.ADL1.LexerMonad ( LexerMonad , addPos , lexerError, lexerWarning , runLexerMonad ) where import Database.D...
DanielSchiavini/ampersand
src/Database/Design/Ampersand/Input/ADL1/LexerMonad.hs
gpl-3.0
2,324
0
16
581
744
409
335
49
3
module Main where import Control.Monad import Data.List getInt = readLn :: IO Int getInts :: IO [Int] getInts = map read . words <$> getLine main :: IO () main = do t <- getInt replicateM_ t $ do _ <- getInt ps <- getInts let ps' = tail ps diff = [abs(abs(x-y) - 1) | (x, y) <- zip ps ps'] ...
opethe1st/CompetitiveProgramming
CodeChef/2020/07/chef_and_strings.hs
gpl-3.0
341
0
19
100
167
84
83
15
1
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, GADTs #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} module QLogic.GeneralBoxes where import Control.Arrow import Data.List impo...
ttylec/QLogic
src/QLogic/GeneralBoxes.hs
gpl-3.0
15,756
0
13
3,750
4,171
2,243
1,928
-1
-1
-- Module : Network.AWS.ElasticFileSystem -- Copyright : (c) 2013-2015 Brendan Hay -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obtain it at ht...
fmapfmapfmap/amazonka
amazonka-efs/gen/Network/AWS/ElasticFileSystem.hs
mpl-2.0
1,837
0
4
556
142
112
30
15
0
-- brittany {lconfig_indentPolicy: IndentPolicyMultiple } data GrantsForCompanyResp = GrantsForCompanyResp Types.Company [EnterpriseGrantResponse]
lspitzner/brittany
data/Test72.hs
agpl-3.0
196
0
7
60
18
10
8
2
0
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QStackedWidget_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:21 Warning : this file is machine generated -...
uduki/hsQt
Qtc/Gui/QStackedWidget_h.hs
bsd-2-clause
59,034
0
18
12,269
18,819
9,078
9,741
-1
-1
module TestOrbat where import Orbat import Type import Color import Size import Posture import Unit testOrbatBlue :: Orbat testOrbatBlue = Orbat Blue [ Unit (1, 1) Blue "1-5 IB" Mech Battalion 30 30 Stationary 45 [] 101 , Unit (5, 7) Blue "2-5 IB" Armor Battalion 45 45 Stationary 45 [] 102 , Unit (10, 10) Bl...
nbrk/ld
library/TestOrbat.hs
bsd-2-clause
658
0
8
145
264
143
121
21
1
module Database.Narc.TypeInfer where import Data.Maybe (fromMaybe) import Control.Monad.State (lift) import Test.HUnit import Gensym import Database.Narc.AST import Database.Narc.Type import Database.Narc.Fallible import Database.Narc.Debug (debug) import Database.Narc.Pretty import Database.Narc.AST.Pretty() -- -...
ezrakilty/narc
Database/Narc/TypeInfer.hs
bsd-2-clause
9,191
0
27
3,006
3,529
1,826
1,703
203
4
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[TcType]{Types used in the typechecker} This module provides the Type interface for front-end parts of the compiler. These parts * treat "source types" as opaque: newtypes, and predicates ...
vTurbine/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
100,175
0
16
28,185
17,304
9,037
8,267
-1
-1
module Reddit.Pipes ( commentStream , postStream , redditStream , allUserComments ) where import Control.Applicative import Control.Concurrent (threadDelay) import Control.Monad.IO.Class import Data.Function import Pipes (Producer) import Prelude import Reddit import Reddit.Types.Comment import Reddit.Types.Li...
intolerable/pipes-reddit
src/Reddit/Pipes.hs
bsd-3-clause
1,761
0
18
317
672
343
329
42
2
{-# LANGUAGE TemplateHaskell #-} -- | MalgoをKoriel.Coreに変換(脱糖衣)する module Malgo.Desugar.Pass (desugar) where import Control.Lens (At (at), makePrisms, preuse, preview, traverseOf, traversed, use, view, (<>=), (?=), (^.), _2, _Just) import qualified Data.Char as Char import qualified Data.HashMap.Strict as HashMap impo...
takoeight0821/malgo
src/Malgo/Desugar/Pass.hs
bsd-3-clause
13,379
0
27
2,893
5,266
2,575
2,691
-1
-1
{-# LANGUAGE ScopedTypeVariables, ImplicitParams #-} module Data.TrieMap.TrieKey.Subset.Tests where import Data.TrieMap.TrieKey import qualified Data.Map as M import Data.TrieMap.TrieKey.Tests.Utils import Test.QuickCheck tests :: forall k . (TrieKey k, Arbitrary k, Show k) => String -> k -> Property tests test _ =...
lowasser/TrieMap
Data/TrieMap/TrieKey/Subset/Tests.hs
bsd-3-clause
518
0
11
88
181
102
79
11
1
module Tct.Jbc (module M) where import Tct.Jbc.Config as M (runJbc, JbcConfig, jbcConfig) import Tct.Jbc.Data.Problem as M (Jbc, JbcDeclaration, JbcStrategy) import Tct.Jbc.Strategies as M
ComputationWithBoundedResources/tct-jbc
src/Tct/Jbc.hs
bsd-3-clause
199
0
5
33
59
41
18
4
0
-- #hide ----------------------------------------------------------------------------- -- | -- Module : Language.Haskell.Exts.Lexer -- Original : Language.Haskell.Lexer -- Copyright : (c) The GHC Team, 1997-2000 -- (c) Niklas Broberg, 2004 -- License : BSD-style (see the file LICENSE.txt) -- -...
abuiles/turbinado-blog
tmp/dependencies/haskell-src-exts-0.3.9/Language/Haskell/Exts/Lexer.hs
bsd-3-clause
26,620
0
22
11,727
6,721
3,298
3,423
622
51
{-# OPTIONS_GHC -Wall #-} module HW01 where -- Exercise 1 ----------------------------------------- -- Get the last digit from a number lastDigit :: Integer -> Integer lastDigit num = mod num 10 -- Drop the last digit from a number dropLastDigit :: Integer -> Integer dropLastDigit num = div num 10 -- Exercise 2 ---...
shimazing/haskell-study-fall2016
HW01/HW01.hs
bsd-3-clause
1,504
0
12
255
432
231
201
24
1
module Data.MRF.FactorGraph ( FactorGraph (..) , mkFactorGraph , Labeled (..) , mkLabeled , Dom ) where -- TODO: In Data.MRF.FactorGraph.Unboxed implement unboxed version -- (when values can be stored in unboxed vectors). import Prelude hiding (length, reverse, map) import Data.ListLike (length, r...
kawu/mrf
Data/MRF/FactorGraph.hs
bsd-3-clause
2,813
0
12
845
749
410
339
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Tests.Database.Cassandra.CQL.Protocol (tests) where import Control.Applicative ((<$>), (<*>)) import Control.Exception.Lifted (finally) import Control.Monad.IO.Class (liftIO, MonadIO) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Maybe import Control.Monad...
romanb/cassandra-cql-protocol
test/Tests/Database/Cassandra/CQL/Protocol.hs
bsd-3-clause
11,331
0
21
3,110
2,908
1,521
1,387
242
4
{-# LANGUAGE OverloadedStrings #-} module Text.Digestive.Heist.Extras.Plain ( dfPlainText , dfPlainChoice , dfPlainChoiceGroup , dfPlainBool , dfPlainFile ) where import Data.Map.Syntax ((##)) import qualified Data.Text as T import Data.Text (Text) import Text.Digestive.View import Heist.Interpreted import Tex...
cimmanon/digestive-functors-heist-extras
src/Text/Digestive/Heist/Extras/Plain.hs
bsd-3-clause
1,935
4
14
307
585
300
285
47
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE Undecida...
sleexyz/haskell-fun
NCategories5.hs
bsd-3-clause
2,011
0
12
422
581
334
247
-1
-1
{- % (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 TcGenDeriv: Generating derived instance declarations This module is nominally ``subordinate'' to @TcDeriv@, which is the ``official'' interface to deriving-related things. This is where we do all the grimy bindings...
ml9951/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
103,719
0
19
32,873
18,398
9,688
8,710
1,293
8
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE CPP #-} -- | Types used throughout the Cloud Haskell framework -- -- We collect all types used internally in a single module ...
tweag/distributed-process
src/Control/Distributed/Process/Internal/Types.hs
bsd-3-clause
30,343
0
15
6,420
6,835
3,701
3,134
707
2
module Proxy (newApp) where import Control.Lens import Network.HTTP.Client (newManager, defaultManagerSettings) import Network.HTTP.ReverseProxy import Network.Wai import Text.Email.Validate import qualified Claim import qualified Config import qualified Session import qualified Validate proxyDest :: Config.T -> Pr...
ktvoelker/auth-proxy
src/Proxy.hs
bsd-3-clause
1,171
0
15
237
343
178
165
31
4
module Tests.Test where import Distribution.TestSuite import qualified Tests.Test.HUnitPlus as HUnitPlus tests :: Test tests = testGroup "Test" [HUnitPlus.tests]
emc2/HUnit-Plus
test/Tests/Test.hs
bsd-3-clause
164
0
7
20
40
25
15
5
1
{-# LANGUAGE OverloadedStrings #-} module Text_Color where import Graphics.Blank import Wiki -- (578,200) main :: IO () main = blankCanvas 3000 $ \ context -> do send context $ do font "40pt Calibri" fillStyle "#0000ff" fillText("Hello World!", 150, 100) wiki $ snapShot context "imag...
ku-fpg/blank-canvas
wiki-suite/Text_Color.hs
bsd-3-clause
364
0
13
88
100
49
51
12
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeOperators #-} module UseHaskellAPIClient where import Data.Proxy import Servant.API import ...
davidheg/Cs4032-use-haskell-api
src/UseHaskellAPIClient.hs
bsd-3-clause
1,240
0
12
235
189
102
87
23
1
{-# LANGUAGE FlexibleContexts, CPP #-} module AWS.RDS.OptionGroup ( describeOptionGroups , createOptionGroup , deleteOptionGroup ) where import Control.Applicative ((<$>), (<*>)) #if MIN_VERSION_conduit(1,1,0) import Control.Monad.Trans.Resource (MonadThrow, MonadResource, MonadBaseControl) #endif imp...
IanConnolly/aws-sdk-fork
AWS/RDS/OptionGroup.hs
bsd-3-clause
2,647
0
12
580
584
316
268
74
1