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 Main where myContains a b | a == [] = False | head a == b = True | otherwise = myContains (tail a) b myFilter a b | b == [] = [] | a (head b) == False = myFilter a (tail b) | otherwise = head b : myFilter a (tail b) myAppend a b | a == [] && b == [] = [] | a == [] = b | b == [] = a | length b ==...
pavlosmcg/haskell-musings
listfunctions.hs
mit
380
6
11
121
267
123
144
15
1
module BusinessProcess.TypeChecker (typeChecker) where import BusinessProcess.Types import Data.List -- import BusinessProcessModel -- Checks wether a BusinessProcess is consistent, -- according to the following rules -- -- a) there must be just one trasition starting from the start state (why?) -- b)...
hephaestus-pl/hephaestus
willian/hephaestus-integrated/asset-base/bpmn/src/BusinessProcess/TypeChecker.hs
mit
2,006
0
12
405
492
269
223
21
2
module Latte.FrontEnd.FunctionNameDuplicationSpec (main, spec) where import qualified Data.Set as Set import Test.Hspec import Latte.Lang import Latte.FrontEnd mockFunction :: String -> TopDef mockFunction name = FnDef Int (Ident name) [] (Block []) main :: IO () main = hspec spec spec :: Spec spec = do describe ...
mpsk2/LatteCompiler
testsuite/tests/Latte/FrontEnd/FunctionNameDuplicationSpec.hs
mit
1,395
2
19
213
585
309
276
25
1
module Handler.Home where import Import getHomeR :: Handler Html getHomeR = defaultLayout $ $(widgetFile "home")
collaborare/antikythera
src/Handler/Home.hs
mit
121
0
8
23
33
18
15
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html module Stratosphere.Resources.EC2VPNConnection where import Stratosphere.ResourceImpor...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/EC2VPNConnection.hs
mit
4,264
0
15
472
643
368
275
54
1
{-| A small module for performing some analysis of hydra models. In the ipc compiler we use this to provide some sanity checking of the compiled model. -} module Language.Hydra.Analysis ( sanityChecks ) where {- Imported Standard Libraries -} {- Imported Local Libraries -} import Language.Pepa.Qualified...
allanderek/ipclib
Language/Hydra/Analysis.hs
gpl-2.0
1,194
0
12
335
203
112
91
22
1
-- Automatically execute source code in multiple languages, with docker. -- Copyright (C) 2014 Pedro Tacla Yamada -- -- 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 Li...
yamadapc/autorun
src/Main.hs
gpl-2.0
881
0
6
151
54
37
17
5
1
-- If we allow a kTest as an initialiser, we can easily get a -- paradox. module T where import Prelude hiding ( id ) import Tests.KBPBasis import ADHOC.Knowledge.Clock -- Agent "1" knows a bit iff the bit is false. c = proc () -> do rec x <- (| nondetLatchAC (\x -> agent "1" (kTest $ "1" `know...
peteg/ADHOC
Tests/10_Knowledge/050_kbpTest_init.hs
gpl-2.0
646
3
23
146
201
107
94
-1
-1
module GGen.Slice ( planeSlice ) where import Data.VectorSpace import Data.AffineSpace import Data.List (deleteFirstsBy, partition) import GGen.Types import GGen.Geometry.Types import GGen.Geometry.Polygon (lineSegPaths, lineSegsToPolygons, polygonToLineSegPath, fixPolygon2Chirality) import GGen.Geo...
bgamari/GGen
GGen/Slice.hs
gpl-3.0
3,481
0
17
1,236
865
465
400
55
2
module Vdv.XML where import ClassyPrelude hiding (Element) import Text.XML elementToBareDocument :: Element -> Document elementToBareDocument e = Document { documentPrologue = Prologue { prologueBefore = [], prologueDoctype = Nothing, prologueAfter = []} , documentRoot = e , documentEpilogue = [] }
pmiddend/vdvanalyze
src/Vdv/XML.hs
gpl-3.0
320
0
9
61
83
51
32
9
1
--project euler problem 390 {-- Consider the triangle with sides sqrt(5), sqrt(65) and sqrt(68). It can be shown that this triangle has area 9. S(n) is the sum of the areas of all triangles with sides sqrt(1+b2), sqrt(1+c2) and sqrt(b2+c2) (for positive integers b and c ) that have an integral area not exceeding n. T...
goalieca/haskelling
390.hs
gpl-3.0
617
0
14
135
136
68
68
6
1
{-# LANGUAGE OverloadedStrings, QuasiQuotes, StandaloneDeriving #-} module Main (main) where import Prolog (Program, consult, parseQuery ,resolve, VariableName(..), Term(..),var,withTrace) import Quote (ts) import System.Environment (getArgs) import Control.DeepSeq (deepseq, NFData(rnf)) instance NFData Term where ...
nishiuramakoto/logiku
prolog/bench/Main.hs
gpl-3.0
1,053
0
15
245
368
189
179
26
2
{-# LANGUAGE OverloadedStrings #-} module Reffit.Handlers.HandleIndex( handleIndex ) where import Reffit.Types import Reffit.Document import Reffit.OverviewComment import Reffit.Sort import Reffit.PaperRoll import Reffit.User import Reffit.Scores import Reffit.AcidTypes import Reffit.FieldTag import Reffit.Handl...
imalsogreg/reffit
src/Reffit/Handlers/HandleIndex.hs
gpl-3.0
3,169
0
18
627
943
486
457
-1
-1
module HipSpec.Lint where import Text.PrettyPrint import HipSpec.Lang.LintRich as R import HipSpec.Lang.Simple as S import HipSpec.GHC.Utils import CoreSyn import CoreLint import SrcLoc import HipSpec.Id coreExprLint :: CoreExpr -> Maybe String coreExprLint = fmap portableShowSDoc . lintUnfolding noSrcLoc [] lin...
danr/hipspec
src/HipSpec/Lint.hs
gpl-3.0
742
0
11
136
286
151
135
19
2
{-# LANGUAGE ScopedTypeVariables #-} module Ampersand.Basics.Exit ( exitWith , AmpersandExit(..) ) where import Ampersand.Basics.Prelude import Ampersand.Basics.UTF8 import Data.List import qualified System.Exit as SE import System.IO.Unsafe(unsafePer...
AmpersandTarski/ampersand
src/Ampersand/Basics/Exit.hs
gpl-3.0
2,363
0
12
658
506
282
224
51
10
-------------------------------------------------------------------------------- -- This file is part of diplomarbeit ("Diplomarbeit Johannes Weiß"). -- -- -- -- diplomarbeit is free software: you can redistribute it and/or modify ...
weissi/diplomarbeit
lib/Data/Helpers.hs
gpl-3.0
4,165
0
14
1,362
684
388
296
59
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-bigquerydatatransfer/gen/Network/Google/Resource/BigQueryDataTransfer/Projects/Locations/DataSources/List.hs
mpl-2.0
6,740
0
18
1,474
893
520
373
133
1
module Transpiler where import Data.Char import Data.List import Control.Monad import Control.Applicative alpha :: String alpha = ['a'..'z'] ++ ['A'..'Z'] nums :: String nums = ['0' .. '9'] ----------------------------------------------------- --------------- my parser combinator ---------------- ------------------...
ice1000/OI-codes
codewars/authoring/haskell/Transpiler.hs
agpl-3.0
3,570
0
14
1,008
1,578
795
783
119
4
{- Copyright (C) 2004-2007 John Goerzen <jgoerzen@complete.org> Please see the COPYRIGHT file -} module Main where import Test.HUnit import Tests import TestUtils import System.IO import Text.Printf -- main = do runTestTT tests main = do hSetBuffering stdout LineBuffering hSetBuffering stderr LineBufferi...
jgoerzen/hsh
testsrc/runtests.hs
lgpl-2.1
1,176
0
10
321
326
161
165
30
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( getApplicationDev , appMain , develMain ...
PKAuth/pkcloud-accounts
src/Application.hs
apache-2.0
7,165
0
13
1,809
1,059
570
489
113
3
import XMonad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ICCCMFocus import XMonad.Hooks.SetWMName import XMonad.Layout.NoBorders import XMonad.Layout.ThreeColumns import XMonad.Util.Run(spawnPipe) import XMonad.Util.EZConfig(additionalKeys) import...
beloglazov/dotfiles
tag-xmonad/xmonad/xmonad.hs
apache-2.0
4,527
22
15
1,482
1,230
721
509
77
1
-- |Adds constraints for the browser DOM to the environment. module Ovid.DOM ( topLevelIds , topLevelPreprocessing ) where --{{{ Imports import CFA import CFA.Labels import Prelude hiding (lookup) import Ovid.Prelude import Text.ParserCombinators.Parsec.Pos (initialPos) import qualified Data.Map as M import WebB...
brownplt/ovid
src/Ovid/DOM.hs
bsd-2-clause
6,278
0
16
1,128
1,873
943
930
130
2
module FractalFlame.Types.Plottable where import FractalFlame.Point.Types.CartesianPoint import FractalFlame.Types.Base data Plottable = Plottable { point :: CartesianPoint , colorIx :: Coord } deriving (Show)
anthezium/fractal_flame_renderer_haskell
FractalFlame/Types/Plottable.hs
bsd-2-clause
221
0
8
33
48
31
17
7
0
{-# LANGUAGE OverloadedStrings #-} {- | Module : Glider.NLP.TokenizerSpec Copyright : Copyright (C) 2013-2014 Krzysztof Langner License : BSD3 Maintainer : Krzysztof Langner <klangner@gmail.com> Stability : alpha Portability : portable -} module Glider.NLP.TokenizerSpec (spec) where import Glider.NLP.Tokenizer impor...
klangner/glider-nlp
test-src/Glider/NLP/TokenizerSpec.hs
bsd-2-clause
866
0
10
399
106
58
48
12
1
{-# LANGUAGE DeriveDataTypeable , NoImplicitPrelude , UnicodeSyntax #-} {- Lot's of code in this module was 'borrowed' from criterion. -} module Test.Complexity.Config where -------------------------------------------------------------------------------- -- Imports -------------------------...
roelvandijk/complexity
Test/Complexity/Config.hs
bsd-3-clause
2,633
0
9
929
526
310
216
49
1
{- Module Regressions gives the tools to perform gradient decent including adding new features, scaling data and fitting polynomial to data. You can't scale after adding free term. -} module Regressions ( scale , addFreeTerm , getXYContainer , getX , getY , getHeaders , getAmountOfBasi...
kanes115/Regressions
src/Regressions.hs
bsd-3-clause
15,184
0
19
4,964
3,592
2,001
1,591
180
3
{-# Language BangPatterns #-} module Network.Openflow.Ethernet.Generator where import Network.Openflow.Ethernet.Frame import Network.Openflow.Misc import Network.Openflow.StrictPut import Data.Word import Data.Monoid import qualified Data.ByteString as BS import Blaze.ByteString.Builder --import Data.ByteString.Lazy.B...
ARCCN/hcprobe
src/Network/Openflow/Ethernet/Generator.hs
bsd-3-clause
1,883
0
12
365
414
213
201
43
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module API.IB.Data where import Control.Applicative import Control.Lens (makeLenses) import Control.Monad import Currency import Data.Attoparsec.ByteString.Char8 import ...
RobinKrom/interactive-brokers
library/API/IB/Data.hs
bsd-3-clause
54,274
0
21
15,240
9,299
5,277
4,022
1,247
20
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Deps.Get ( all , AllPackages , Mode(..) , versions , info , docs ) where import Prelude hiding (all) import Control.Monad.Except (catchError, liftIO) import qualified Data.ByteString as BS import qualified Data.List as List import qual...
evancz/builder
src/Deps/Get.hs
bsd-3-clause
4,812
0
17
1,202
1,415
755
660
122
3
{-# LANGUAGE ScopedTypeVariables,GADTs,DeriveDataTypeable,FlexibleInstances, ExistentialQuantification, StandaloneDeriving, TypeSynonymInstances, FlexibleContexts, DeriveFunctor,RankNTypes,MultiParamTypeClasses #-} {-| Provides the expression data type as well as the type-checking algorithm. -} module Language.GTL...
hguenther/gtl
lib/Language/GTL/Expression.hs
bsd-3-clause
48,877
1
34
15,963
18,003
8,951
9,052
1,034
72
module Platform.Test where import Data.Int import Data.List import qualified Data.Map.Strict as S import Control.Monad.State import Control.Monad.Trans.Maybe import System.Directory import System.Exit import System.FilePath.Posix import Platform.Minimal64 import Spec.Decode import Spec.Execute import Platform.Run (rea...
mit-plv/riscv-semantics
src/Platform/Test.hs
bsd-3-clause
3,710
0
19
855
1,158
606
552
80
2
import System.Environment (getArgs) pali :: Integer -> Bool pali x = x == reve x reve :: Integer -> Integer reve x = read . reverse $ show x revadd :: Integer -> Integer -> String revadd x y | pali y = show x ++ " " ++ show y | x > 100 = "not found" | otherwise = revadd (x + 1) (y + r...
nikai3d/ce-challenges
moderate/reverse_add.hs
bsd-3-clause
466
0
12
143
219
105
114
14
1
module Data.TrieMap.ProdMap.Tests where import Data.TrieMap.ProdMap () import Data.TrieMap.WordMap () import Data.Word import qualified Data.TrieMap.TrieKey.Tests as TrieKeyTests import Test.QuickCheck tests :: Property tests = TrieKeyTests.tests "Data.TrieMap.ProdMap" (0 :: Word, 0 :: Word)
lowasser/TrieMap
Data/TrieMap/ProdMap/Tests.hs
bsd-3-clause
296
0
6
34
75
49
26
8
1
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} -- | -- Module: Database.PostgreSQL.Simple.Time.Internal.Parser -- Copyright: (c) 2012-2015 Leon P Smith -- (c) 2015 Bryan O'Sullivan -- License: BSD3 -- Maintainer: Leon P Smith <leon@melding-monads.com> -- Stability: experimental -- -- Par...
timmytofu/postgresql-simple
src/Database/PostgreSQL/Simple/Time/Internal/Parser.hs
bsd-3-clause
6,189
0
21
1,863
1,877
962
915
140
4
module BowlingKata.Day5 (score) where score :: [Int] -> Int score ([]) = 0 score (lastRoll:[]) = lastRoll score (roll1:roll2:[]) = roll1 + roll2 score (roll1:roll2:roll3:[]) = roll1 + roll2 + roll3 score (roll1:roll2:roll3:rolls) = do if isStrike roll1 then 10 + roll2 + roll...
Alex-Diez/haskell-tdd-kata
old-katas/src/BowlingKata/Day5.hs
bsd-3-clause
642
0
12
200
275
144
131
16
3
module PackageManagement ( Transplantable(..) , parseVersion , parsePkgInfo ) where import Distribution.Package (PackageIdentifier(..), PackageName(..)) import Distribution.Version (Version(..)) import Control.Monad (unless) import Types impor...
Paczesiowa/virthualenv
src/PackageManagement.hs
bsd-3-clause
4,703
0
21
1,201
1,048
514
534
81
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 HsTypes: Abstract syntax: user-defined types -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeSynonymInstance...
bitemyapp/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
32,374
0
15
8,703
6,288
3,331
2,957
399
6
{-# language CPP #-} -- No documentation found for Chapter "SemaphoreCreateFlags" module Vulkan.Core10.Enums.SemaphoreCreateFlags (SemaphoreCreateFlags(..)) where import Vulkan.Internal.Utils (enumReadPrec) import Vulkan.Internal.Utils (enumShowsPrec) import GHC.Show (showString) import Numeric (showHex) import Vulka...
expipiplus1/vulkan
src/Vulkan/Core10/Enums/SemaphoreCreateFlags.hs
bsd-3-clause
1,902
0
10
360
305
184
121
-1
-1
-- -- Copyright © 2013-2014 Anchor Systems, Pty Ltd and Others -- -- The code in this file, and the program it is a part of, is -- made available to you by its authors as open source software: -- you can redistribute it and/or modify it under the terms of -- the 3-clause BSD licence. -- {-# LANGUAGE DeriveDataTypeable...
anchor/rados-timestore
lib/TimeStore/Core.hs
bsd-3-clause
9,491
0
14
2,326
2,072
1,143
929
-1
-1
module MtAnnotate ( mtAnnotateStatement ) where import qualified Data.Map as M import qualified Database.HsSqlPpp.Parse as Pa import MtTypes mtAnnotateStatement :: MtSchemaSpec -> Pa.Statement -> Pa.Statement mtAnnotateStatement spec (Pa.QueryStatement a q) = Pa.QueryStatement a (annotateQuery spec q []) mtAnnot...
lucasbraun/mt-rewrite
src/MtAnnotate.hs
bsd-3-clause
7,601
0
19
1,302
2,371
1,187
1,184
85
4
import Text.Parsec.Char import Text.Parsec.Combinator import Text.Parsec import qualified Text.Parsec.Token as P import Text.Parsec.Language (emptyDef) import Control.Applicative ((<$>)) import Control.Monad (void, fail, unless) import Data.Map import Data.Maybe type Program = [Function] data Function = Fu...
mmartin/mivm
ir/Main.hs
bsd-3-clause
4,218
0
18
1,970
961
506
455
97
1
{-# LANGUAGE DeriveGeneric, OverloadedStrings, GeneralizedNewtypeDeriving #-} module Data.RDF.Types ( -- * RDF triples, nodes and literals LValue(PlainL,PlainLL,TypedL), Node(UNode,BNode,BNodeGen,LNode), Subject, Predicate, Object, Triple(Triple), Triples, View(view), -- * Constructor functions plainL,pl...
jutaro/rdf4h
src/Data/RDF/Types.hs
bsd-3-clause
28,112
0
23
7,288
5,109
2,786
2,323
-1
-1
module GHCJS.Require where import Control.Concurrent import Control.Monad import Data.JSString import Data.String import GHCJS.Foreign import GHCJS.Foreign.Callback import GHCJS.Marshal import GHCJS.Types import JavaScript.Arra...
beijaflor-io/ghcjs-commonjs
old-examples/ghcjs-loader-test/GHCJS/Require.hs
mit
2,375
18
16
583
647
322
325
58
3
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE QuasiQuotes, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Copyright : (c) Microsoft License : MIT Maintainer : adamsap@microsoft...
alfpark/bond
compiler/src/Language/Bond/Codegen/Util.hs
mit
3,036
0
8
529
382
235
147
28
1
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE RecordWildCards #-} -- | Propagation of runtime configuration. module Pos.Chain.Update.Configuration ( UpdateConfiguration(..) , HasUpdateConfiguration , updateConfiguration , withUpdateConfiguration , ourAppName , ourSystemTag ...
input-output-hk/pos-haskell-prototype
chain/src/Pos/Chain/Update/Configuration.hs
mit
4,038
0
13
828
628
370
258
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Safe #-} {-# LANGUAGE UndecidableInstances #-} module Network.Tox.Timed where import Control.Monad.RWS (RWST) import Control.Monad.Random (RandT) import Control.Monad.Reader (R...
iphydf/hs-toxcore
src/Network/Tox/Timed.hs
gpl-3.0
954
0
7
240
287
156
131
24
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.ImportExport.Types.Produc...
fmapfmapfmap/amazonka
amazonka-importexport/gen/Network/AWS/ImportExport/Types/Product.hs
mpl-2.0
3,278
0
11
742
635
378
257
70
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Program : dem_01.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:47 Warning : this file is machine generated - do not mo...
keera-studios/hsQt
demos/dem_01.hs
bsd-2-clause
32,391
0
39
12,093
11,675
5,715
5,960
835
23
{-# LANGUAGE GeneralizedNewtypeDeriving, PatternGuards, NoMonoPatBinds #-} module Evaluator.FreeVars ( inFreeVars, heapBindingFreeVars, pureHeapBoundVars, stackBoundVars, stackFrameBoundVars, stackFrameFreeVars, pureHeapVars, stateFreeVars, stateAllFreeVars, stateLetBounders, stateLambdaBounders, stateI...
batterseapower/chsc
Evaluator/FreeVars.hs
bsd-3-clause
4,385
0
15
755
1,228
686
542
58
5
markup = <div> <% getViewDataValue_u "show-me" :: View String %> </div>
alsonkemp/turbinado-website
App/Views/TestSession/CreateCounter.hs
bsd-3-clause
92
7
5
31
29
16
13
-1
-1
{-# LANGUAGE OverloadedStrings #-} module System.Taffybar.Widget.Generic.AutoSizeImage where import qualified Control.Concurrent.MVar as MV import Control.Monad import Control.Monad.IO.Class import Data.Int import Data.Maybe import qualified Data.Text as T import qualified GI.Gd...
teleshoes/taffybar
src/System/Taffybar/Widget/Generic/AutoSizeImage.hs
bsd-3-clause
6,873
0
22
1,562
1,631
800
831
143
5
{-# LANGUAGE GeneralizedNewtypeDeriving, CPP, OverloadedStrings #-} module Haste.Random (Random (..), Seed, next, mkSeed, newSeed) where import Haste.Prim.JSType import Data.Int import Data.Word import Data.List (unfoldr) import Control.Monad.IO.Class import System.IO.Unsafe #ifdef __HASTE__ import Haste.Foreign #else ...
santolucito/haste-compiler
libraries/haste-lib/src/Haste/Random.hs
bsd-3-clause
2,479
0
14
525
712
392
320
52
1
{-# LANGUAGE TemplateHaskell, TypeOperators, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, UndecidableInstances, GADTs, OverlappingInstances, ConstraintKinds #-} -------------------------------------------------------------------------------- -- | -- Module : Examples.Multi.Eval -- Copyright :...
spacekitteh/compdata
examples/Examples/Multi/Eval.hs
bsd-3-clause
1,809
0
10
336
473
251
222
25
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} module Distribution.Client.GlobalFlags ( GlobalFlags(..) , defaultGlobalFlags , RepoContext(..) , withRepoCo...
headprogrammingczar/cabal
cabal-install/Distribution/Client/GlobalFlags.hs
bsd-3-clause
10,253
0
17
2,895
1,882
1,045
837
192
4
{-# LANGUAGE Trustworthy #-} {-# OPTIONS_GHC -#include "HsBase.h" #-} {-# OPTIONS_GHC -w #-} --tmp ----------------------------------------------------------------------------- -- | -- Module : Data.Array.IO.Safe -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file librar...
jtojnar/haste-compiler
libraries/ghc-7.8/array/Data/Array/IO/Safe.hs
bsd-3-clause
1,202
0
5
255
71
58
13
11
0
{-# OPTIONS_GHC -O -fmax-simplifier-iterations=0 #-} -- Not running the simplifier leads to type-lets persisting longer module T13708 where indexOr :: a -> Int -> [a] -> a indexOr fallback idx xs = if (idx < length xs) then xs !! idx else fallback
ezyang/ghc
testsuite/tests/simplCore/should_compile/T13708.hs
bsd-3-clause
257
0
8
52
60
34
26
7
2
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE UndecidableInstances, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} module T3108 where -- Direct recursion terminates (typechecking-wise) class C0 x where m0 :: x -> () m0 = const undefined instance {-# OVERLAPP...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/T3108.hs
bsd-3-clause
882
0
8
174
257
140
117
-1
-1
{-# LANGUAGE DuplicateRecordFields, TypeFamilies #-} module OverloadedRecFldsFail10_C (F(..)) where import OverloadedRecFldsFail10_A data instance F Char = MkFChar { foo :: Char }
mettekou/ghc
testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_C.hs
bsd-3-clause
182
0
8
24
37
23
14
4
0
{-# LANGUAGE TypeFamilies #-} module ShouldCompile where import Ind2_help(C(..)) zipT :: (C a, C b) => T a -> T b -> T (a,b) zipT x y = mkT (unT x, unT y)
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/ind2.hs
bsd-3-clause
159
0
9
37
85
46
39
5
1
-- | -- Module : Palette -- Description : Colours for Cairo -- Copyright : (c) Jonatan H Sundqvist, 2015 -- License : MIT -- Maintainer : Jonatan H Sundqvist -- Stability : experimental -- Portability : POSIX (not sure) -- -- Jonatan H Sundqvist -- June 11 2015 -- module Palette where -------------...
SwiftsNamesake/Copernicus
Palette.hs
mit
1,536
0
7
178
214
144
70
10
1
module Haskit.Parser ( Definition(..) , Expr(..) , UnOp(..) , BinOp(..) , Constant(..) , definition , global ) where import Data.Void import Text.Megaparsec import Text.Megaparsec.Char import qualified Text.Megaparsec.Char.Lexer as L import Text.Megaparsec.Expr d...
jac3km4/haskit
src/Haskit/Parser.hs
mit
3,278
0
15
765
1,233
646
587
123
2
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE Strict #-} module Main (main) where import System.Random import Data.Foldable (toList, foldl') import qualified Data.Vector as V data ...
argent0/haskell-ml-benchmark
src/MainVector.hs
mit
3,810
0
15
851
1,319
701
618
91
2
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module HW08 where import Prelude (Show(..), ...
mrordinaire/upenn-haskell
src/HW08.hs
mit
7,052
4
16
2,215
1,868
989
879
-1
-1
-- Extended from aeson-serialize by Kevin Holt {-| - This module defines a newtype wrapper for instances of FromJSON and ToJSON which - is an instance of Serialize. The serialized form is a UTF-8 encoded bytestring - of the JSON representation of the datatype. |-} module Data.Serialize.Aeson where import ...
plow-technologies/cereal-aeson
src/Data/Serialize/Aeson.hs
mit
976
0
8
184
180
101
79
11
1
-- Playfield module Playfield ( Well , Cell(..) , emptyWell , numberRows , numberCells , coordCells , renderPiece , pieceCollides , clearAndCountFilledRows , cellColor ) where import Piece import Data.List import Graphics.Gloss -- A cell is a rectangle in the playfield - it c...
mgeorgoulopoulos/TetrisHaskellWeekend
Playfield.hs
mit
4,221
0
14
1,222
1,023
551
472
63
1
-- | -- Module: BigE.Model.IndexAllocator -- Copyright: (c) 2017 Patrik Sandahl -- Licence: MIT -- Maintainer: Patrik Sandahl <patrik.sandahl@gmail.com> -- Stability: experimental -- Portability: portable module BigE.Model.IndexAllocator ( IndexAllocator , AllocReply (..) , init , alloc ) where imp...
psandahl/big-engine
src/BigE/Model/IndexAllocator.hs
mit
1,631
0
15
548
295
170
125
44
2
{-# LANGUAGE TypeOperators #-} module Terrain where import Numeric.Noise.Perlin import System.Random (randomRs,mkStdGen) import qualified Data.Array.Repa as R import qualified Data.Vector.Unboxed as R (Unbox) type Seed = Int rangeMap :: (Ord a) => b -> [(a,b)] -> a -> b rangeMap def rs x = case dropWhile (\(a,_) ->...
RTS2013/RTS
server/src/Terrain.hs
mit
1,334
0
13
374
616
342
274
34
2
-- file ch03/ex07.hs -- Define a function that joins a list of lists together using a separator value -- intersperse :: (Show t) => Char -> [t] -> Char intersperse :: Char -> [[Char]] -> [Char] intersperse _ [] = "" intersperse _ (x:[]) = x intersperse delimiter (x:xs) = x ++ [delimiter] ++ intersperse delimiter xs
imrehg/rwhaskell
ch03/ex07.hs
mit
317
0
8
57
90
49
41
4
1
-- | Helpers for dealing with HTTP requests. module Strive.Internal.HTTP ( delete , get , post , put , buildRequest , performRequest , handleResponse , decodeValue ) where import Data.Aeson (FromJSON, eitherDecode) import Data.ByteString.Char8 (unpack) import Data.ByteString.Lazy (ByteString) import ...
bitemyapp/strive
library/Strive/Internal/HTTP.hs
mit
2,760
0
12
533
809
430
379
53
2
module Physics.Hurl.Geometry ( -- * Shape Shape (..), validShape, area, transformShape, translateShape, rectangle, -- * Position Position(..), positionIso, moveShape, module Physics.Hurl.Geometry.Isometry, -- * Linear Re-exports V2 (..), ) where import Control...
cdxr/haskell-hurl
Physics/Hurl/Geometry.hs
mit
3,595
0
12
907
887
472
415
67
3
module Main where import Language.Egison.Core import Language.Egison.Types import Control.Monad.Error import System.Environment main :: IO () main = do args <- getArgs env <- primitiveBindings ret1 <- runIOThrows $ liftM concat $ mapM (evalTopExpr env) topExprs case ret1 of Just errMsg -> putStrLn errMsg ...
aretoky/egison2
etc/template.hs
mit
465
0
16
106
161
78
83
17
3
{-# LANGUAGE OverloadedStrings #-} module Main where import Test.Framework import Test.Framework.Providers.HUnit import Test.HUnit import Test.HUnit.Base (Test(TestLabel)) import qualified Data.HashMap as Hash import Data.Maybe (fromMaybe) import Utils.File import Utils.Text import Madl.Network as Madl import Madl....
julienschmaltz/madl
test/src/Madl/TestNetwork.hs
mit
8,646
0
17
1,435
1,822
1,117
705
174
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANG...
psibi/yesod
yesod-core/Yesod/Core/Widget.hs
mit
10,891
0
18
2,313
3,071
1,608
1,463
206
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveGeneric #-} module Types.Poll where import Data.Text import Data.Aeson import Data.UUID import Control.Applicative import GHC.Generics import Data.Time.Clock import Database.PostgreSQL.Simple.FromField import Database.P...
sigrlami/pollock
app-snap/src/Types/Poll.hs
mit
1,006
0
9
197
208
119
89
29
0
solution = (sum [1..100]) ^ 2 - sum ( map (^ 2) [1..100])
DylanSp/Project-Euler-in-Haskell
prob6/solution.hs
mit
57
0
9
12
45
24
21
1
1
-- AnalyzerCondition.hs --- -- -- Filename: AnalyzerCondition.hs -- Description: -- Author: Manuel Schneckenreither -- Maintainer: -- Created: Mon Oct 6 23:22:48 2014 (+0200) -- Version: -- Package-Requires: () -- Last-Updated: Tue Apr 11 14:34:09 2017 (+0200) -- By: Manuel Schneckenreither -- Update #: ...
ComputationWithBoundedResources/ara-inference
src/Data/Rewriting/ARA/ByInferenceRules/AnalyzerCondition.hs
mit
903
0
5
156
84
73
11
5
0
module Rosalind.Bases where -- We represent the bases of DNA A, C, G, T as Haskell values. And stuff. -- There is a bit at the end of this module that deals with generating random -- gene sequences then looking at the reverse complement of those sequences. import Control.Comonad import Control.Monad.State import Data...
geophf/1HaskellADay
exercises/HAD/Rosalind/Bases.hs
mit
5,215
0
17
784
809
449
360
49
1
module Text.Regex.VerbalExpressions ( verEx , add , startOfLine , startOfLine' , endOfLine , endOfLine' , find , possibly , anything , anythingBut , something , somethingBut , replace , lineBreak , br , tab , word , anyOf , range , withAnyCase , withAnyCase' , searchOneLine ...
whackashoe/HaskellVerbalExpressions
Text/Regex/VerbalExpressions/verbalexpressions.hs
mit
6,439
0
16
2,100
2,273
1,199
1,074
160
3
module IRC.Log ( logMessage, commandHasLogger, ) where import Data.List import qualified Data.Map as Map import IRC.Parsers import IRC.Types import Network import System.IO import Text.Printf commandHasLogger :: CommandName -> Bool commandHasLogger command = Map.member command commandFormatters commandFormatters = M...
Macha/Mbot
IRC/Log.hs
mit
2,210
0
9
349
495
271
224
46
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} module IHaskell.Convert.IpynbToLhs (ipynbToLhs) where import IHaskellPrelude import qualified Data.Text.Lazy as LT import qualified Data.ByteString.Lazy as LBS import Data.Aeson (decode...
gibiansky/IHaskell
src/IHaskell/Convert/IpynbToLhs.hs
mit
2,775
0
15
627
822
419
403
55
2
-- List reversion. Tail recursion with "foldl". module Reverse where import Prelude hiding (reverse) import Data.List (foldl) reverse :: [t] -> [t] reverse = foldl (\remainingItems item -> item : remainingItems) [] {- GHCi> reverse "" reverse "1" reverse "12" -} -- "" -- "1" -- "21"
pascal-knodel/haskell-craft
Examples/· Folds/reverse/foldl/Reverse.hs
mit
301
0
8
64
69
43
26
5
1
{- | Module : $Header$ Description : translating a HasCASL subset to Isabelle Copyright : (c) C. Maeder, DFKI 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable utility function for translation from HasCASL to Isabe...
nevrenato/Hets_Fork
Comorphisms/PPolyTyConsHOL2IsaUtils.hs
gpl-2.0
40,408
6
27
12,356
14,671
7,274
7,397
932
27
module TypeCheck(typeCheck, Context, VariableName(..), Type(..), TypeVariable(..)) where import Data.Char import Data.Either import Data.List import Data.Maybe import qualified Data.Map as M import qualified Data.Set as S import Control.Applicative import Control.Monad import Control.Monad.State import Control.Monad...
anttisalonen/lvm
src/stau/TypeCheck.hs
gpl-3.0
13,436
0
22
3,258
4,958
2,411
2,547
319
10
module GameState ( newGame, getChild, getChildren, getPlayableCorners, getLegalPlacements, getPlayer, ) where import Data.Bits import Data.List import Types import Player import Board import Territory import Placement instance Show GameState where show (State _ board _ _) = show board ...
djudd/blokus
GameState.hs
gpl-3.0
2,097
0
11
498
606
305
301
-1
-1
-- | Extensions to the interface of 'Data.Map'. module Extension.Data.Map ( module Data.Map , adjustWithDefault , queryMap , invertMap ) where import Data.Maybe (fromMaybe) import qualified Data.Set as S import Data.Map -- | Adjusts a value at a specific key. When the key is not a member of the map, -- the ...
meiersi/scyther-proof
src/Extension/Data/Map.hs
gpl-3.0
880
0
11
196
267
143
124
14
1
module ParseTests(parseTestResults) where import Regexp import ParseRegexp(parse) import Tokenise parseTestResults :: [([Token], Maybe Regexp, Maybe Regexp)] parseTestResults = runParseTests parseTests parseTests :: [([Token], Maybe Regexp)] parseTests = [([Text "abc"], Just $ Literal "abc"), ([Text "xyz", Dot...
srank/regexp
ParseTests.hs
gpl-3.0
1,617
0
14
324
683
375
308
35
1
{-# LANGUAGE Arrows #-} module Main where import System.IO import Debug.Trace import Control.Monad.Random import FRP.Yampa import SIR type SIRAgentProc = SF [SIRState] SIRState contactRate :: Double contactRate = 5.0 infectionProb :: Double infectionProb = 0.05 illnessDuration :: Double illnessDuration = 15.0 a...
thalerjonathan/phd
coding/papers/FrABS/Haskell/prototyping/SIRYampa/src/Main.hs
gpl-3.0
3,950
5
16
865
1,382
722
660
91
2
readLine = putStrLn "123" >> getLine
cwlmyjm/haskell
AFP/L0223.hs
mpl-2.0
36
0
6
5
13
6
7
1
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module CouchAuthProxy.UserToken where import Control.Lens (makeLensesWith, camelCaseFields) import Data.Aeson (ToJSON(toJSON), object, (...
asvyazin/my-books.purs
server/my-books/CouchAuthProxy/UserToken.hs
mpl-2.0
1,115
0
14
254
305
173
132
31
0
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } func :: ( Trither lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd ) lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> asd
lspitzner/brittany
data/Test379.hs
agpl-3.0
298
1
8
55
26
12
14
6
0
period a = (head plist) : (takeWhile (/= head plist) (tail plist)) where plist = filter (/=2) $ r a r a = map (\n -> (as1^n + ap1^n) `mod` a2) [0..] where as1 = a - 1 ap1 = a + 1 a2 = a^2 prob120 = sum (map (maxlist.period) [3..1000]) where maxlist = foldl1 max main...
jdavidberger/project-euler
prob120.hs
lgpl-3.0
348
4
12
117
197
98
99
9
1
{-# LANGUAGE TupleSections #-} module Renderer ( renderGame ) where import Control.Lens import Control.Monad.Reader import Control.Monad.State import Data.IORef import Data.List import qualified Data.Vector.Storable as VS import Foreign.C.Types import Linear (V2(V2), V4(V4)) import Linear.Affine (Point(P)) im...
nitrix/lspace
legacy/Renderer.hs
unlicense
8,022
0
30
2,629
2,212
1,103
1,109
-1
-1
module Main where main :: IO () main = print "HELLO"
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/type-level/2017-08-justin-le-fixed-length-vector-types/app/Main.hs
unlicense
55
0
6
13
22
12
10
3
1
import Test.HUnit import P9x.Util(expectEqual_, testList) import P9x.P91.KnightsTour p91 = testList "P91" [ expectEqual_ [] (findKnightTours 0), expectEqual_ [[(0, 0)]] (findKnightTours 1), expectEqual_ [] (findKnightTours 2), expectEqual_ [] (findKnightTours 3), expectEqual_ [] (findKnightTou...
dkandalov/katas
haskell/p99/src/p9x/p91/KnightsTour_Test.hs
unlicense
684
2
10
144
398
239
159
18
1
{-#LANGUAGE OverloadedStrings#-} module Data.P440.XML.Instances.ZSV where import qualified Data.P440.Domain.ZSV as ZSV import Data.P440.Domain.SimpleTypes import Data.P440.Domain.ComplexTypes import Data.P440.XML.XML import qualified Data.P440.XML.Instances.SimpleTypes import qualified Data.P440.XML.Instances.Complex...
Macil-dev/440P-old
src/Data/P440/XML/Instances/ZSV.hs
unlicense
3,206
0
10
857
1,530
781
749
62
0
-- | Hashing functions and HMAC DRBG definition module Network.Haskoin.Crypto.Hash ( Hash512(getHash512) , Hash256(getHash256) , Hash160(getHash160) , CheckSum32(getCheckSum32) , bsToHash512 , bsToHash256 , bsToHash160 , hash512 , hash256 , hash160 , sha1 , doubleHash256 , bsToCheckSum32 , checkSum32 , hmac512 , hmac25...
tphyahoo/haskoin
haskoin-core/Network/Haskoin/Crypto/Hash.hs
unlicense
9,339
0
13
2,380
2,862
1,515
1,347
227
1
-- Copyright 2020-2021 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed t...
google/hs-attenuation
attenuation/src/Data/Type/Attenuation.hs
apache-2.0
6,036
0
10
1,122
934
559
375
-1
-1
{- | Module : Codec.Goat.ValueFrame Description : Top-level header for value compression Copyright : (c) Daniel Lovasko, 2016-2017 License : BSD3 Maintainer : Daniel Lovasko <daniel.lovasko@gmail.com> Stability : stable Portability : portable -} module Codec.Goat.ValueFrame ( ValueFrame(..) , valueDecod...
lovasko/goat
src/Codec/Goat/ValueFrame.hs
bsd-2-clause
452
0
5
66
44
31
13
7
0
module Helpers.Profile ( profileForm , saveProfile ) where import Import data ProfileForm = ProfileForm { pfFullname :: Maybe Text , pfUsername :: Maybe Text , pfEmail :: Maybe Text } profileForm :: User -> Form ProfileForm profileForm u = renderBootstrap $ ProfileForm <$> aopt tex...
pbrisbin/renters-reality
Helpers/Profile.hs
bsd-2-clause
818
0
11
229
227
115
112
22
1
{-# LANGUAGE RecordWildCards #-} module NW.Random where import Control.Monad.Primitive import qualified Crypto.Hash.SHA1 as SHA1 import Data.Bits import qualified Data.ByteString.Lazy as B import Data.List (foldl', nub, transpose) import Data.Time.Calendar import Data.Time.Clock import qualified Data.Vector as V impo...
listx/netherworld
src/NW/Random.hs
bsd-2-clause
3,970
46
15
841
1,483
768
715
104
4