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 ElasticSearch.Search.Types where
SaneApp/elastic-search-api
src/ElasticSearch/Search/Types.hs
mit
40
0
3
3
7
5
2
1
0
module Handler.OutputSpec ( main , spec ) where import SpecHelper main :: IO () main = hspec spec spec :: Spec spec = withApp $ do describe "POST /commands/token/output" $ it "creates command output" $ do now <- liftIO getCurrentTime token <- newToken void ...
mrb/tee-io
test/Handler/OutputSpec.hs
mit
2,048
0
17
926
428
221
207
45
1
{-# LANGUAGE ExistentialQuantification, KindSignatures , TypeFamilies, UndecidableInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE U...
tomsmalley/quickform
src/QuickForm/TypeLevel.hs
mit
4,865
1
13
1,083
1,916
1,061
855
-1
-1
module Terminal.Types where import Data.Array.Diff import Data.Char import Data.Maybe (fromJust, fromMaybe) import Data.Tuple (swap) type ScreenIndex = (Int, Int) data TerminalChar = TerminalChar { character :: Char, foregroundColor :: TerminalColor, backgroundColor :: TerminalColor, isBright :: Bool,...
lordi/haskell-terminal
src/Terminal/Types.hs
gpl-2.0
3,109
0
11
945
832
509
323
110
1
-- -- riot/Config.hs -- -- Copyright (c) Tuomo Valkonen 2004-2005. -- -- 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 versio...
opqdonut/riot
Config.hs
gpl-2.0
888
0
7
197
69
49
20
9
1
--due to a bug in haskell-src, this line is parsed incorrectly as (a2*x + b)*x + c without brackets f x a b c = (a2 * x) + (b * x) + c where a2 = a * a
rdnetto/H2V
H2V/tests/f0.hs
gpl-2.0
156
0
8
44
49
26
23
2
1
module T where import Tests.KesterelBasis -- The identity on booleans. e = signalE $ \s -> proc x -> (| loopE (do x <- (| ifE (returnA -< x) (emitE s -< ()) (nothingE -< ()) |) pauseE -< () sigE s -< ()) |) c = runE e prop_correct = property (\xs -> let xs' = map unSimBoo...
peteg/ADHOC
Tests/08_Kesterel/028_if_id.hs
gpl-2.0
440
5
18
126
196
99
97
-1
-1
module Tests.Old (tests) where import Test.Framework (testGroup, Test ) import Test.Framework.Providers.HUnit import Test.HUnit ( assertBool ) import System.Environment ( getArgs ) import System.IO ( openTempFile, stderr ) import System.Process ( runProcess, waitForProcess ) import System.FilePath ( (</>), (<.>) ) imp...
nickbart1980/pandoc
tests/Tests/Old.hs
gpl-2.0
10,046
0
16
2,981
2,670
1,445
1,225
196
4
module Examples.VHDL.Tutorial where import Prelude import QHaskell import Examples.VHDL.FrontEnd import Examples.VHDL.Glue ---------------------------------------- -- Chapter 2 halfAdd = [|| \ (a,b) -> let sum = xor2 a b carry = and2 a b in (sum,carry) ||] -- Alternat...
shayan-najd/QHaskell
Examples/VHDL/Tutorial.hs
gpl-3.0
10,103
85
19
2,621
3,644
1,990
1,654
-1
-1
module Asm(generateAssembly) where import Data.List import qualified Data.Map as M import Control.Applicative import Control.Monad import Control.Monad.State import Control.Monad.Except() import Stau import StauTypes type FunctionMap = M.Map String FunctionInfo data FunctionInfo = FunctionInfo { funNumber ...
anttisalonen/lvm
src/stau/Asm.hs
gpl-3.0
17,109
36
43
4,866
6,129
3,080
3,049
419
15
{-# LANGUAGE OverloadedStrings #-} import SequenceFormats.RareAlleleHistogram (RareAlleleHistogram(..), showHistogram, readHistogram) import Control.Monad (foldM, when) import Control.Error (scriptIO, runScript, Script, tryRight, throwE, errLn) import qualified Data.Text.IO as T import Data.Version (showVersion) import...
stschiff/rarecoal-tools
src-combineHistograms/combineHistograms.hs
gpl-3.0
2,390
0
14
448
606
307
299
41
1
import Data.List import System import Char (toUpper, toLower) data Command = Fields deriving (Eq, Show, Read) -- Æåñòêî çàêîäèðîâàííûå èíäåêñû ïîëåé. neededFields = [6, 7, 8, 11, 13, 35, 111, 121] isR200 :: [String] -> Bool isR200 [] = False isR200 s = (head s) == "R200" replaceChar :: Char -> Char -...
graninas/Haskell-Algorithms
Materials/Haskell в реальном мире - Статья/parser 0.12.hs
gpl-3.0
3,241
7
19
707
1,078
559
519
60
3
module Math.LambdaUtil.Parser (parseExpr) where import Data.Functor import Text.ParserCombinators.Parsec import Math.LambdaUtil.LambdaExpr parseExpr :: String -> Expr parseExpr s = case res of Left e -> error (show e) Right res' -> res' where res = parse parseLambdaExpr "" s parseAllExpr = do ...
zakharvoit/lambda-util
src/Math/LambdaUtil/Parser.hs
gpl-3.0
984
0
10
216
372
183
189
38
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-useraccounts/gen/Network/Google/Resource/CloudUserAccounts/Groups/RemoveMember.hs
mpl-2.0
3,876
0
17
921
472
281
191
77
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module OddsAndEvens where -- | The natural numbers. data Nat = Z | S Nat -- | The axioms of even numbers. data Even (a :: Nat) :: * where -- | Zero is even. ZeroEven :: Even Z -- | If n is even...
ice1000/OI-codes
codewars/301-400/odd-plus-even-equals-odd.hs
agpl-3.0
2,818
0
11
656
946
490
456
48
1
main = putStrLn "hello, world" -- > :t putStrLn -- putStrLn :: String -> IO () -- > :t putStrLn "hello, world" -- putStrLn "hello, world" :: IO () -- putStrLn takes a string and returns an I/O action that has a result -- type of () (empty tuple, known as unit) -- I/O action is something that when performed will carr...
Ketouem/learn-you-a-haskell
src/chapter-8-input-and-output/helloworld.hs
unlicense
641
0
5
129
21
16
5
1
1
{-# LANGUAGE OverloadedStrings #-} -- | This bot replies "Got it" to every incoming update. module Main where import Data.Text (Text) import qualified Telegram.Bot.API as Telegram import Telegram.Bot.Simple import Telegram.Bot.Simple.Debug -- | Bot conversation s...
haroldcarr/learn-haskell-coq-ml-etc
conference/2018-05-lambdaconf/telegram-bot-in-haskell/app/Main2.hs
unlicense
1,389
0
9
297
299
164
135
31
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QSystemTrayIcon_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:18 Warning : this file is machine generated ...
uduki/hsQt
Qtc/Gui/QSystemTrayIcon_h.hs
bsd-2-clause
13,388
0
18
2,864
4,190
1,999
2,191
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns -fno-warn-orphans #-} module Overkill where -- Dara.Functor.Classes in transformers 0.4.0 are totally differ...
treeowl/bound
examples/Overkill.hs
bsd-3-clause
11,727
0
15
3,385
5,501
2,749
2,752
-1
-1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.APPLE -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- A convenience module, com...
haskell-opengl/OpenGLRaw
src/Graphics/GL/APPLE.hs
bsd-3-clause
1,780
0
5
170
262
195
67
33
0
{-# LANGUAGE CPP #-} module Bead.Persistence.SQL.Registration where import Database.Persist.Sql import qualified Bead.Domain.Entities as Domain import qualified Bead.Domain.Relationships as Domain import Bead.Persistence.SQL.Class import Bead.Persistence.SQL.Entities #ifdef TEST import ...
andorp/bead
src/Bead/Persistence/SQL/Registration.hs
bsd-3-clause
1,286
0
12
263
253
139
114
18
1
{-# LANGUAGE TypeOperators #-} module Data.Rope.Annotation ( MonoidalAnn(..) , PackableAnn(..) , BreakableAnn(..) ) where import Data.Rope (Rope) class MonoidalAnn f where -- | build an empty 'Annotation' emptyAnn :: f a -- | append two annotations, based on their corresponding ropes ...
ekmett/rope
Data/Rope/Annotation.hs
bsd-3-clause
1,347
0
11
363
295
153
142
19
0
module Lets.Go where {- The list is the fundamental 'data structure' in functional programming. -} -- Let's define some lists: intL = [1, 2, 3] -- what is the type of intL? >>> intL :: [Integer] charL = ['a','b','c'] -- what is the type? ... list2 :: [Char] -- what is the type of intL? >>> charL :: [Char] ...
peterson/lets-haskell
src/Lets/Go.hs
bsd-3-clause
2,509
0
9
595
295
182
113
21
1
import CodeJamLib (countFlips) main :: IO () main = do t <- fmap read getLine mapM_ readCase [1..t] readCase :: Int -> IO () readCase i = do s <- getLine putStrLn . outputString $ countFlips s where outputString v = "Case #" ++ (show i) ++ ": " ++ (show v)
alemedeiros/alemedeiros-code-jam
src-exe/RevengeOfThePancakes.hs
bsd-3-clause
287
0
11
82
126
61
65
10
1
{- | Module : $Header$ Description : Supports bulk renaming of directories and files into a standard, normalized format. Copyright : (c) Calvin Smith License : BSD3, see LICENSE.txt Maintainer : Calvin Smith <cs-haskell@protempore.net> Stability : Experimental Portability : portable...
eukaryote/denominate
src/Denominate.hs
bsd-3-clause
1,827
0
5
387
54
38
16
10
0
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} -- {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE AllowAmbiguousT...
AaronFriel/eff-experiments
dep/eff/src/Lib.hs
bsd-3-clause
451
0
4
66
36
29
7
13
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Language.Rsc.Errors where import Language.Fixpoint.Misc import Language.Fixpoint.Types.Errors import Language.Rsc.Locations import Language.Rs...
UCSD-PL/RefScript
src/Language/Rsc/Errors.hs
bsd-3-clause
23,865
0
19
7,690
6,460
3,033
3,427
216
1
module Lava.Netlist ( netgraph ) where import Control.Applicative import Data.Traversable import Lava.Ref import Lava.Signal import Lava.MyST ---------------------------------------------------------------- -- netlist netlistST :: Traversable f => ST s v -> (v -> S v -> ST s ()) -> f Symbol -> ST s...
shayan-najd/MiniLava
Lava/Netlist.hs
bsd-3-clause
2,252
0
18
1,026
762
368
394
54
2
{-# LANGUAGE TypeSynonymInstances #-} module Language.SPL.Data.Position ( module Text.Parsec.Pos , Position , p ) where import Text.Parsec.Pos import Text.PrettyPrint.ANSI.Leijen (Pretty, pretty, text) type Position = SourcePos p = initialPos "filename.spl" instance Pretty Position where pretty = text ....
timjs/spl-compiler
src/Language/SPL/Data/Position.hs
bsd-3-clause
327
0
6
56
79
50
29
11
1
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE NoImplicitPrelude #-} module SimpleStore.Types where import Control.Applicative import Control.Concurrent.ReadWriteVar import Control.Monad.IO.Class import ...
bitemyapp/simple-store
src/SimpleStore/Types.hs
bsd-3-clause
1,907
0
12
362
534
307
227
43
0
-------------------------------------------------------------------------------- -- Copyright 1994 by Peter Thiemann -- $Log: Fonts.hs,v $ -- Revision 1.1.1.1 1998/12/09 13:34:08 pjt -- Imported sources -- -- Revision 1.1 1993/08/31 12:31:32 thiemann -- Initial revision -- -- Revision 1.1 1993/08/31 12:31:32 th...
FranklinChen/Ebnf2ps
src/Fonts.hs
bsd-3-clause
3,273
39
23
547
1,064
593
471
59
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- A conveni...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB.hs
bsd-3-clause
16,449
0
5
872
2,551
2,016
535
267
0
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, PatternGuards #-} -- Copyright (c) 6 DonStewart - http://www.cse.unsw.edu.au/~dons -- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html) -- | Test a property with QuickCheck module Plugin.Check where import File (findFile) import Plugin import Lambda...
jwiegley/lambdabot
Plugin/Check.hs
mit
3,983
0
25
1,276
1,140
603
537
72
3
-- Copyright (c) 2010, Diego Souza -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditio...
dgvncsz0f/iyql
src/main/haskell/Yql/Data/Version.hs
gpl-3.0
1,728
0
6
317
72
54
18
6
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Setup -- Copyright : Isaac Jones 2003-2004 -- Duncan Coutts 2007 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is a big module, but not very com...
jwiegley/ghc-release
libraries/Cabal/cabal/Distribution/Simple/Setup.hs
gpl-3.0
75,997
0
18
20,208
15,147
8,558
6,589
1,410
12
{-| Re-export the modules of the hledger-web program. -} module Hledger.Web ( module Hledger.Web.WebOptions, module Hledger.Web.Main, tests_Hledger_Web ) where import Test.HUnit import Hledger.Web.WebOptions import Hledger.Web.Main tests_Hl...
mstksg/hledger
hledger-web/Hledger/Web.hs
gpl-3.0
435
0
6
122
60
39
21
10
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/GetInvalidation.hs
mpl-2.0
4,213
0
13
867
600
359
241
79
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} -- | Main stack tool entry point. module Main where import Control.Exception import ...
rekka/stack
src/main/Main.hs
bsd-3-clause
38,771
0
30
14,343
7,796
3,956
3,840
-1
-1
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, NoImplicitPrelude, OverloadedStrings #-} {-# OPTIONS -Wall #-} module Main(main) where import qualified Data.Text.IO as T import Data.Typeable import qualified Language.Paraiso.Annotation as Anot import qualified Language.Paraiso.Annotation.Allocation a...
nushio3/Paraiso
attic/Optimization/DiffusionMain.hs
bsd-3-clause
5,048
0
14
1,195
1,501
820
681
103
1
------------------------------------------------------------------------------- -- This module provides functions which perform all of the commands -- listed in section 22 of the document: TPM Main: Part 3 - Commands ------------------------------------------------------------------------------- module TPM.Eviction whe...
armoredsoftware/protocol
tpm/mainline/src/TPM/Eviction.hs
bsd-3-clause
898
0
10
112
140
78
62
12
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FunctionalDependencies #-} ...
bergey/plots
src/Plots/Types/Surface.hs
bsd-3-clause
3,116
0
3
858
84
82
2
13
0
module Circular where main :: Fay () main = let y = x + 1::Double x = y + 1 in print y
beni55/fay
tests/circular.hs
bsd-3-clause
106
0
9
42
49
26
23
5
1
{-| Unittests for the MonD data parse function -} {- Copyright (C) 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ve...
vladimir-ipatov/ganeti
test/hs/Test/Ganeti/HTools/ExtLoader.hs
gpl-2.0
4,153
0
17
841
929
492
437
71
3
<?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="es-ES"> <title>Selenium add-on</title> <maps> <homeID>top</homeID> <mapref location="ma...
kingthorin/zap-extensions
addOns/selenium/src/main/javahelp/org/zaproxy/zap/extension/selenium/resources/help_es_ES/helpset_es_ES.hs
apache-2.0
960
77
67
156
411
208
203
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sk-SK"> <title>SAML Support</title> <maps> <homeID>saml</homeID> <mapref location="map....
kingthorin/zap-extensions
addOns/saml/src/main/javahelp/help_sk_SK/helpset_sk_SK.hs
apache-2.0
958
77
66
156
407
206
201
-1
-1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="hu-HU"> <title>Selenium add-on</title> <maps> <homeID>top</homeID> <mapref location="m...
rnehra01/zap-extensions
src/org/zaproxy/zap/extension/selenium/resources/help_hu_HU/helpset_hu_HU.hs
apache-2.0
963
79
67
157
416
210
206
-1
-1
-- | This module provides types and functions for managing an attribute -- map which maps attribute names ('AttrName') to attributes ('Attr'). -- This module is designed to be used with the 'OverloadedStrings' -- language extension to permit easy construction of 'AttrName' values -- and you should also use 'mappend' ('...
sisirkoppaka/brick
src/Brick/AttrMap.hs
bsd-3-clause
6,249
0
14
1,191
927
541
386
64
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Modul...
olsner/ghc
libraries/base/Foreign/Ptr.hs
bsd-3-clause
4,124
0
11
753
397
238
159
-1
-1
module Main (main) where import GenUtils import DataTypes import Parser import Interp import PrintTEX import System.Environment -- 1.3 (partain) import Data.Char -- 1.3 --fakeArgs = "game001.txt" --fakeArgs = "pca2.pgn" --fakeArgs = "silly.pgn" --fakeArgs = "small.pgn" --fakeArgs = "sicil.pgn" --fakeA...
manyoo/ghcjs
test/ghc/programs/andy_cherry/Main.hs
mit
6,981
0
15
2,357
1,967
1,044
923
136
11
{-# LANGUAGE PartialTypeSignatures #-} module PartialClassMethodSignature2 where class Foo a where foo :: (Eq a, _) => a -> a
urbanslug/ghc
testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.hs
bsd-3-clause
129
0
8
23
36
20
16
4
0
module Language.HigherRank.Interpret (runInterpret) where import qualified Data.Map as M import Control.Monad.Except (MonadError, Except, runExcept, throwError) import Control.Monad.Reader (MonadReader, ReaderT, ask, local, runReaderT) import Language.HigherRank.Print (printReducedExpr) import Language.HigherRank.Ty...
lexi-lambda/higher-rank
library/Language/HigherRank/Interpret.hs
isc
1,491
0
15
247
549
281
268
-1
-1
module Scripting.Fuligite.REPL where import Scripting.Fuligite.ObjectParser import Control.Monad import Text.ParserCombinators.Parsec import Scripting.Fuligite.Eval (evaluate) import Scripting.Fuligite.Expr (Expr(..), EvalState) import qualified Scripting.Fuligite.DefaultState as DS type Result = Either String (Expr,...
tomjefferys/fuligite
src/Scripting/Fuligite/REPL.hs
mit
890
4
13
305
257
134
123
29
3
-- Data Types à la Carte -- https://www.codewars.com/kata/592a1c156d6c5a56c800001f {-# LANGUAGE TypeOperators, DeriveFunctor, MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances, FlexibleContexts #-} module ALaCarte where -- Definitions newtype Expr f = In (f (Expr f)) -- We define a separate data type for each...
gafiatulin/codewars
src/3 kyu/ALaCarte 2.hs
mit
4,141
2
15
930
1,327
690
637
68
1
-- | 'Proxied' monad. @'Proxied' x@ is a monad transformer that has a global -- configuration parameter of type @x@ associated with it. -- -- It is used to implement things like @ZoomT@\/@runZoom@ and -- @CustromWriterT@\/@evalWriterWith@. -- -- Most of the time you don't need to use this directly. It is exported for t...
feuerbach/monad-classes
Control/Monad/Classes/Proxied.hs
mit
2,401
0
13
507
891
465
426
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main(main) where import Test.Hspec import Test.QuickCheck import Test.QuickCheck.Function import Control.Monad.Variables import Control.Monad.Variables.File import Control.Monad.Variables.Lens import Control.Concurrent.STM import Control.Monad.ST hiding (unsafeSTToIO) impor...
prophile/variables
Tests.hs
mit
1,765
0
17
398
565
283
282
54
1
----------------------------------------------------------------------------- -- | -- Module : Language.Krill.Parser.Named -- Description : Types that have a name attached to them -- Maintainer : coskuacay@gmail.com -- Stability : experimental --------------------------------------------------------------------...
cacay/language-sill
Language/Krill/Parser/Named.hs
mit
513
0
7
74
44
30
14
3
0
avg lst = (sm lst) / (ln lst) where sm [] = 0 sm (a:as )= a + (sm as) ln [] = 0 ln (a:as) = 1 + (ln as) intersperse _ [] = [] intersperse sep (x:xs) | xs == [] = x | otherwise = x ++ [sep] ++ intersperse sep xs
gefei/learning_haskell
real_world_haskell/ch03.hs
mit
251
4
9
95
165
82
83
9
3
module StringCalculator ( calculate ) where import Data.List.Split import Data.String.Utils(startswith) calculate :: String -> Int calculate "" = 0 calculate s = sum . map readInteger . splitWhen (\c -> c == separatorFrom s || c == '\n') $ trim s where separatorFrom :: String ->...
theUniC/string-calculator.hs
src/StringCalculator.hs
mit
813
0
13
316
252
125
127
23
1
{-# LANGUAGE OverloadedStrings #-} module Haste.Bootstrap where import Haste import Haste.Foreign -------------------------------------------------------------------------------- -- | The state of a Bootstrap button. -- See http://getbootstrap.com/javascript/#buttons data ButtonState = Loading | Reset derivi...
adinapoli/haste-bootstrap
src/Haste/Bootstrap.hs
mit
958
0
10
164
192
99
93
21
1
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiP...
capitanbatata/functional-systems-in-haskell
fsh-exercises/src/GenericProgramming.hs
mit
11,574
0
19
2,977
2,555
1,405
1,150
170
2
tell :: (Show a) => [a] -> String tell [] = "The list is empty" tell (x:[]) = "The list has one element: " ++ show x tell (x:y:[]) = "The list has two elements: " ++ show x ++ " and " + show y tell (x:y:_) = "This list is long. The first two elements are: " ++ show x ++ " and " ++ show y
v0lkan/learning-haskell
session-003/007-tell.hs
mit
290
0
9
70
132
66
66
5
1
module Data.Stack where data Stack a = Stack [a] deriving (Eq, Show) push :: a -> Stack a -> Stack a push a (Stack xs) = Stack (a:xs) pop :: Stack a -> Stack a pop (Stack (x:xs)) = Stack xs pop (Stack []) = Stack [] peek :: Stack a -> Maybe a peek (Stack (x:xs)) = Just x peek (Stack []) = Nothing isEmpty :: Stac...
Kiandr/CrackingCodingInterview
Haskell/src/chapter-3/Data/Stack.hs
mit
434
0
9
102
258
130
128
16
1
module JSEvaluator ( eval , nullEnv , nullScope , bindVars , readNamesInScope , readNamesInEnv , initEnv , initScope , isBound , isBoundInScope , appendScope , getVar , getVarInScope , setVar , setVarInScope , defineVarInScope , asJSBool , asJSNumber , asJSString ) where import Data.IORef import Da...
li-zhirui/JSAnalyzer
JSEvaluator.hs
mit
37,943
0
14
9,521
7,290
3,867
3,423
431
8
import Test.Tasty import Test.Tasty.Golden import Test.Tasty.Golden.Manage as Gold (defaultMain) import Control.Applicative import Control.Monad import Data.List import Data.Maybe import Data.Monoid import System.FilePath import System.Directory import System.Process import Text.XML.HXT.Core newtype InputPath = In...
chreekat/vim-haskell-syntax
test/runner/Main.hs
mit
2,826
0
16
676
801
422
379
80
3
{-# LANGUAGE OverloadedStrings, FlexibleInstances #-} module Redmine.Reporter where import Redmine.Types import qualified Text.PrettyPrint as PP import Data.Maybe (isJust, fromJust) import qualified Data.Text as T (Text, drop, length, lines, pack, replace, take, unpack) import Data.Time.Clock import Redmine.Reporter...
ywata/redmine-report
src/Redmine/Reporter.hs
mit
4,247
0
16
1,042
1,535
819
716
70
4
module Q03 where elementAt :: [a] -> Int -> a elementAt x k = case elementAtTest x k of Left x -> x Right y -> error y elementAtTest :: [a] -> Int -> Either a String elementAtTest x k | k > 0 = elementAtTestWithPositiveIndex x k | otherwise = Right "k <= 0 is not sup...
cshung/MiscLab
Haskell99/q03.hs
mit
592
0
8
146
203
100
103
12
2
{- Quadratic primes Problem 27 Euler discovered the remarkable quadratic formula: n² + n + 41 It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 41² + 41 + 41 is clearly divi...
bertdouglas/euler-haskell
001-050/27a.hs
mit
1,450
0
9
319
283
159
124
18
2
{-# LANGUAGE OverloadedStrings #-} module Main where import Happstack.Lite (serve, dir) import Control.Monad (msum) import Routes (routes) import Static (static) main :: IO () main = serve Nothing $ msum [ dir "/static" static , routes ]
akru/happsite
Main.hs
mit
253
0
8
52
80
46
34
10
1
{-# LANGUAGE OverloadedStrings, TupleSections #-} module ParkAddressesImport where import Control.Applicative ((<$>),(<*>)) import Control.Monad.Reader (runReaderT, void) import Data.Csv (FromNamedRecord, parseNamedRecord,(.:)) import Snap.Snaplet.PostgresqlSimple (Postgres) import Db.ParkAddress import Internal in...
bfpg/brisparks.info
import/ParkAddressesImport.hs
mit
788
0
21
137
213
116
97
23
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-geolocation.html module Stratosphere.ResourceProperties.Route53RecordSetGroupGeoLocation wh...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/Route53RecordSetGroupGeoLocation.hs
mit
2,821
0
12
253
355
202
153
32
1
module Tema_24a_Fibonacci_Spec (main, spec) where import Tema_24.Fibonacci import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "Fibonacci" $ do it "e1" $ fib 8 `shouldBe` 21
jaalonso/I1M-Cod-Temas
test/Tema_24a_Fibonacci_Spec.hs
gpl-2.0
219
0
12
49
79
42
37
10
1
{-# LANGUAGE RecordWildCards, TupleSections #-} import Data.List import System.FilePath import qualified Data.Map as M import Config import Options.Applicative import TypedBibData import BibDB import BibAttach import qualified SuffixTreeCluster as SC import MaybeIO import Diff import Data.Function (on) -------------...
jyp/imbib
Batch.hs
gpl-2.0
6,681
0
19
1,593
2,081
1,089
992
118
3
-- GenI surface realiser -- Copyright (C) 2005 Carlos Areces and Eric Kow -- -- 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 ...
kowey/GenI
src/NLP/GenI.hs
gpl-2.0
36,579
0
17
10,821
7,928
4,219
3,709
611
4
{-# OPTIONS_GHC -Wall -fwarn-tabs -Werror #-} ------------------------------------------------------------------------------- -- | -- Module : Graphics.Primitives.Closed -- Copyright : Copyright (c) 2014 Michael R. Shannon -- License : GPLv2 or Later -- Maintainer : mrshannon.aerospace@gmail.com -- Sta...
mrshannon/trees
src/Graphics/Primitives/Closed.hs
gpl-2.0
6,001
0
17
2,283
1,865
948
917
100
1
{- | Module : $Header$ Description : abstract QVT-Relational syntax Copyright : (c) Daniel Calegari Universidad de la Republica, Uruguay 2013 License : GPLv2 or higher, see LICENSE.txt Maintainer : dcalegar@fing.edu.uy Stability : provisional Portability : portable -} module QVTR.As where import...
nevrenato/HetsAlloy
QVTR/As.hs
gpl-2.0
4,090
0
10
1,412
1,026
591
435
107
0
data Tree a= Empty | Node a (Tree a) (Tree a) createTree = Node "A" (Node "B" (Node "C" Empty Empty) (Node "D" Empty Empty) ) (Node "E" (Node "F" Empty Empty) (Node "G" Empty (Node "H" (Node "I" Empty Empty) ...
yalpul/CENG242
leaves.hs
gpl-3.0
482
0
13
220
181
91
90
13
1
{-# LANGUAGE OverloadedStrings #-} {- Formatter.hs Pretty-prints the components of reaction systems to string. Copyright 2014 by Sergiu Ivanov <sergiu.ivanov@u-pec.fr> This file is part of brsim. brsim is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
scolobb/brsim
Formatter.hs
gpl-3.0
6,671
0
20
1,428
1,417
763
654
90
2
{-# LANGUAGE NoMonomorphismRestriction, PackageImports, ScopedTypeVariables #-} module HEP.Physics.TTBar.Analysis where import HEP.Parser.LHCOAnalysis.PhysObj hiding (FourMomentum,fourmomfrometaphipt,trd3) printEvent :: PhyEventClassified -> IO () printEvent p = do putStrLn $ show p
wavewave/ttbar
lib/HEP/Physics/TTBar/Analysis.hs
gpl-3.0
305
0
8
48
60
35
25
6
1
{-# LANGUAGE FlexibleInstances, OverlappingInstances, Rank2Types #-} module Heqet.Tools where import Heqet.Types import Heqet.List import Heqet.LyInstances import Control.Lens import Data.List import Control.Applicative import Data.Maybe import Data.Monoid import Data.Ord import Safe import Data.Typeable mapOverNot...
Super-Fluid/heqet
Heqet/Tools.hs
gpl-3.0
9,812
6
20
2,481
3,200
1,700
1,500
-1
-1
{-# LANGUAGE OverloadedStrings #-} module WebParsing.ArtSciParser (parseArtSci, getDeptList, fasCalendarURL) where import Network.HTTP import Text.HTML.TagSoup import Text.HTML.TagSoup.Match import Database.Persist.Sqlite import Database.CourseInsertion import Data.List import qualified Data.Text as T import Datab...
arkon/courseography
hs/WebParsing/ArtSciParser.hs
gpl-3.0
3,619
0
16
911
831
427
404
74
4
----------------------------------------------------------------------------- -- | -- Module : Data.Array.MArray -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : experimental -- Port...
kaoskorobase/mescaline
resources/hugs/packages/base/Data/Array/MArray.hs
gpl-3.0
2,144
0
5
593
112
87
25
20
0
module Main (main) where import Codec.Binary.Embroidery.PCS import System( getArgs ) main :: IO () main = do args <- getArgs pattern <- importFile (head args) case pattern of Right pcs -> do exportFile "test.pcs" pcs {-displayRendering pcs -...
ludflu/embroidery
ExamplePCS.hs
gpl-3.0
376
0
14
145
109
55
54
9
2
module DL3018 (tests) where import Data.Text as Text import Helpers import Test.Hspec tests :: SpecWith () tests = do let ?rulesConfig = mempty describe "DL3018 - Pin versions in `apk add`." $ do it "apk add version pinning single" $ do ruleCatches "DL3018" "RUN apk add flex" onBuildRuleCatches "...
lukasmartinelli/hadolint
test/DL3018.hs
gpl-3.0
3,530
0
17
1,152
574
263
311
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Accounts/Get.hs
mpl-2.0
3,051
0
14
729
421
249
172
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
496,469
0
84
122,055
90,132
50,946
39,186
-1
-1
{-# LANGUAGE OverloadedStrings, TypeFamilies, DataKinds, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}module Model.Tag.Types ( TagName(..) , validateTag , Tag(..) , TagUse(..) , TagUseRow(..) , TagCoverage(..) , TagWeight(..) ) where import qualified Data.ByteString as BS import qualified Data.B...
databrary/databrary
src/Model/Tag/Types.hs
agpl-3.0
2,624
0
10
451
742
437
305
-1
-1
module Data.GI.CodeGen.CodeGen ( genConstant , genFunction , genModule ) where #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) import Data.Traversable (traverse) #endif import Control.Monad (forM, forM_, when, unless, filterM) import Data.List (nub) import Data.Maybe (fromJust, fromMayb...
ford-prefect/haskell-gi
lib/Data/GI/CodeGen/CodeGen.hs
lgpl-2.1
16,927
0
25
5,024
4,436
2,220
2,216
333
5
{- Модуль, отвечающий за формирование базового контекста статей. https://github.com/denisshevchenko/ruhaskell Все права принадлежат русскоязычному сообществу Haskell-разработчиков, 2015 г. -} {-# LANGUAGE OverloadedStrings #-} module Context ( postContext ) where import Data.Monoid (mconcat) imp...
akamch/ruhaskell-old
src/Context.hs
unlicense
3,184
0
10
1,031
465
278
187
39
1
import Codez main = putStrLn (show (parse nullAlphabet "Hello"))
pdbartlett/misc-stuff
haskell/codez/Main.hs
apache-2.0
65
0
9
9
26
13
13
2
1
module Render ( renderGame , initRender ) where import Prelude hiding ((.), id) import Control.Category import Control.Monad import Debug.Trace import Graphics.DrawingCombinators as Draw import Graphics.Rendering.OpenGL as GL import qualified Gra...
Xandaros/Pacman
src/Render.hs
bsd-2-clause
2,310
0
19
668
908
479
429
63
4
------------------------------------------------------------ -- Copyright : Erik de Castro Lopo <erikd@mega-nerd.com> -- License : BSD3 ------------------------------------------------------------ module Test.ServerDef ( PortsDef (..) , portsDef ) where import Data.List (sort) import System.IO.Unsafe (uns...
olorin/http-proxy
Test/ServerDef.hs
bsd-2-clause
1,234
0
13
313
282
157
125
30
3
import Data.ByteString.Base16 as B16 import Data.ByteString.Base64 as B64 import Data.ByteString as BS convertBase64toBase16 :: ByteString -> ByteString convertBase64toBase16 s = B16.encode p where (p,_) = B16.decode s main :: IO () main = do s <- BS.getLi...
svdberg/yesod-milk
test.hs
bsd-2-clause
427
0
10
168
109
58
51
10
1
{-# LANGUAGE QuasiQuotes #-} module Repo.Rrdp where import Control.Concurrent import Control.Concurrent.STM as S import Control.Monad import Data.Foldable import Data.Maybe import Data.Time.Clock import Network.URI import qualified Data....
lolepezy/rpki-pub-server
src/Repo/Rrdp.hs
bsd-2-clause
9,192
46
22
2,636
2,534
1,317
1,217
163
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | A vector representation of a transition map. Memory efficient, but the -- insert operation is /O(n)/ with respect to the number of transitions. -- In particular, complexity of the insert operation can make the construction -- of a large-alphabet dictionary intractable...
kawu/dawg-ord
src/Data/DAWG/Gen/Trans/Vector.hs
bsd-2-clause
1,772
6
19
443
450
256
194
40
0
module Common.World ( World(..), advanceBodies, advanceWorld ) where import Common.Type import Common.Util import Common.Body import Data.Array.Accelerate as A data World = World { worldBodies :: !(Vector Body) -- ^ Bodies in the simulation , worldSteps :: {-...
vollmerm/shallow-fission
tests/n-body/src-acc/Common/World.hs
bsd-3-clause
1,934
0
15
704
393
212
181
39
1
-- | -- Helper methods for working with XML -- module Network.TableStorage.XML ( qualify, cDataText, namespaceAttr ) where import Text.XML.Light.Types ( Content(Text), CDataKind(CDataText), CData(CData, cdData, cdLine, cdVerbatim), QName(..), Attr(..) ) -- | -- Qualify a name for a spec...
paf31/tablestorage
src/Network/TableStorage/XML.hs
bsd-3-clause
954
0
9
214
231
145
86
19
1
module MathSpec (main, spec) where import Math import Control.Exception import System.Timeout import Test.Hspec import Test.QuickCheck -- `main` is here so that this module can be run from GHCi on its own. It is -- not needed for automatic spec discovery. main :: IO () main = hspec spec spec :: Spec spec = paral...
ott8bre/first-haskell
test-suite/MathSpec.hs
bsd-3-clause
1,006
0
20
248
361
189
172
25
1
{- Select.hs (adapted from select.c which is (c) Silicon Graphics, Inc.) Copyright (c) Sven Panne 2002-2005 <sven.panne@aedion.de> This file is part of HOpenGL and distributed under a BSD-style license See the file libraries/GLUT/LICENSE This is an illustration of the selection mode and name stack, whic...
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/examples/RedBook/Select.hs
bsd-3-clause
5,414
0
19
1,364
1,635
792
843
107
1
{-# LANGUAGE MultiParamTypeClasses #-} -- | The monadic interface to the Search algorithm module Chess.Search.Search ( Search , runSearch , report , abortable , isPondering ) where import Control.Concurrent.STM (readTVarIO) import Control.Monad.State import Control.Lens (use) import Chess.Search.SearchSt...
phaul/chess
Chess/Search/Search.hs
bsd-3-clause
2,012
0
9
405
381
214
167
36
2
{-# LANGUAGE DataKinds #-} module Graphomania.Interactive ( readShumov , readShumovBE , readShumovLE , writeShumov , writeShumovBE , writeShumovLE , module X ) where import Data.MonoTraversable as X import Graphomania.Shumov
schernichkin/BSPM
graphomania/src/Graphomania/Interactive.hs
bsd-3-clause
280
0
4
84
43
29
14
11
0