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 : XMonad.Prompt.Window -- Copyright : Devin Mullins <me@twifkak.com> -- Andrea Rossato <andrea.rossato@unibz.it> -- License : BSD-style (see LICENSE) -- -- Maintainer : Devin Mullins <me@twifkak....
eb-gh-cr/XMonadContrib1
XMonad/Prompt/MyWindow.hs
bsd-3-clause
3,593
0
13
782
552
309
243
49
3
-- Copyright © 2012 Frank S. Thomas <frank@timepit.eu> -- All rights reserved. -- -- Use of this source code is governed by a BSD-style license that -- can be found in the LICENSE file. -- | Ohloh API Reference: <http://meta.ohloh.net/referencecontributor_fact/> module Web.Ohloh.ContributorFact ( ContributorFact(..)...
fthomas/ohloh-hs
Web/Ohloh/ContributorFact.hs
bsd-3-clause
2,299
0
11
519
468
266
202
46
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} module Util where import qualified Numeric import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BSL import Control.Monad.RWS.Class import Data.List.Split (chunksOf) import qualified Data.Binary ...
isomorphism/labelled-hexdump-parser
Util.hs
bsd-3-clause
5,165
0
14
1,297
2,124
1,106
1,018
132
2
module Language.CFamily.C.Analysis.TypeConversions ( arithmeticConversion, floatConversion, intConversion ) where import Language.CFamily.C.Analysis.SemRep -- | For an arithmetic operator, if the arguments are of the given -- types, return the type of the full expression. arithmeticConversion :: TypeNam...
micknelso/language-c
src/Language/CFamily/C/Analysis/TypeConversions.hs
bsd-3-clause
1,609
0
8
249
469
241
228
28
1
-- | -- Module : Data.Pack.Endianness -- License : BSD-style -- Maintainer : capsjac <capsjac at gmail dot com> -- Stability : Experimental -- Portability : Portable -- {-# LANGUAGE CPP #-} module Data.Pack.Endianness ( swap16 , swap32 , swap64 , le16Host , le32Host , le64Host , be16Host ,...
capsjac/pack
Data/Pack/Endianness.hs
bsd-3-clause
2,301
0
14
554
517
317
200
41
1
{-#LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, TypeApplications #-} {-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} module DirectoryServer where import Network hiding (a...
Garygunn94/DFS
.stack-work/intero/intero8753hOX.hs
bsd-3-clause
15,452
456
15
4,001
4,189
2,160
2,029
276
7
{-# LANGUAGE CPP #-} {-# LANGUAGE DoAndIfThenElse #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Mismi.Control ( A.AWS , A.Error , A.AccessKey , A.SecretKey , A.SessionToken , A.Region (..) , runAWS , runAWST ...
ambiata/mismi
mismi-core/src/Mismi/Control.hs
bsd-3-clause
8,864
3
26
2,697
2,577
1,325
1,252
232
10
module Rules.Program (buildProgram) where import Hadrian.Haskell.Cabal import Hadrian.Haskell.Cabal.PackageData as PD import Base import Context import Expression hiding (stage, way) import GHC import Oracles.ModuleFiles import Oracles.Flag (crossCompiling) import Settings import Settings.Packages.Rts import Target i...
bgamari/shaking-up-ghc
src/Rules/Program.hs
bsd-3-clause
3,525
0
29
1,226
821
413
408
-1
-1
-- -- Circuit compiler for the Faerieplay hardware-assisted secure -- computation project at Dartmouth College. -- -- Copyright (C) 2003-2007, Alexander Iliev <sasho@cs.dartmouth.edu> and -- Sean W. Smith <sws@cs.dartmouth.edu> -- -- All rights reserved. -- -- This code is released under a BSD license. -- Please see LI...
ailiev/faerieplay-compiler
Faerieplay/Tree.hs
bsd-3-clause
3,329
2
13
1,222
1,125
598
527
-1
-1
module CS.JsonDotNet.Internal.Types where import Data.Aeson import Data.Text data FieldType = FInteger | FNumber | FString | FBool | FDay | FUTCTime | FEnum Text [Value] | FObject Text [(Text, FieldType)] ...
cutsea110/servant-csharp
src/CS/JsonDotNet/Internal/Types.hs
bsd-3-clause
1,446
0
8
486
428
232
196
51
1
module REPL where import Parser import Syntax import PrettyPrinter import Compiler import Evaluator import System.Console.Haskeline import Control.Monad.Trans import System.IO processProgram :: String -> IO () processProgram input = do case parseTopLevelProgram_P input of Left err -> print ...
MarkX95/TinyHask
REPL.hs
bsd-3-clause
1,109
0
14
266
345
158
187
38
2
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RebindableSyntax #-} module KnockoutOption where import RebindableEDSL -- knock-out barrier option -- knockout :: Exp R -> Exp R -> Exp R -> Int -> Contr knockout barrier strike notional maturity = if rObs (FX EUR DKK) 0 <= barrier `within` maturity then zero el...
douglas-larocca/contracts
Coq/Extraction/Examples/KnockoutOption.hs
mit
465
0
12
123
139
74
65
12
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeNetworkInterfaceAttribute.hs
mpl-2.0
6,771
0
16
1,304
848
503
345
92
1
{-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -Wall #-} {- | Module : Core Description : Abstract syntax and pretty printer for Core. Copyright : (c) 2014—2015 The F2J Project Developers (given in AUTHORS.txt) License : BSD3 Maintainer : Zhiyuan Shi <zhiyuan.shi@gmail.com>, Haoyuan Zhang ...
wxzh/fcore
lib/Core.hs
bsd-2-clause
13,701
1
21
4,052
6,203
3,158
3,045
259
5
{-# LANGUAGE RecordWildCards #-} module Main (main) where import Data.Traversable import Control.Monad.Except import Options.Applicative import qualified Kalium data Options = Options { filenameIn :: String , filenameOut :: String , logSwitch :: Bool , patSigSwitch :: Bool } pOptions :: Parser...
rscprof/kalium
kalium-cli/Main.hs
bsd-3-clause
1,193
0
20
302
344
171
173
32
2
{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} #ifndef MIN_VERSION_profunctors #define MIN_VERSION_profunctors(x,y,z) 1 #endif #if __GLASGOW_HASKELL__ < 708 || !(MIN_VERSION_profunctors(4,4,0)) {-# LANGUAGE Trustworthy #-} #endif #if __GLAS...
rpglover64/lens
src/Control/Lens/Getter.hs
bsd-3-clause
18,862
0
14
4,184
2,078
1,274
804
103
1
{- | This is the main module of FunGEN (Functional Game Engine), which re-exports the rest. -} {- FunGEN - Functional Game Engine http://joyful.com/fungen Copyright (C) 2002 Andre Furtado <awbf@cin.ufpe.br> 2008, 2011-2013 Simon Michael <simon@joyful.com> This code is distributed in the hope that it will...
fffej/fungen
Graphics/UI/Fungen.hs
bsd-3-clause
1,848
0
5
380
198
151
47
23
0
f = a b (\x -> c x d)
mpickering/hlint-refactor
tests/examples/Lambda25.hs
bsd-3-clause
22
0
8
9
24
12
12
1
1
{-# LANGUAGE PatternGuards #-} module Idris.Elab.Clause where import Idris.AbsSyntax import Idris.ASTUtils import Idris.DSL import Idris.Error import Idris.Delaborate import Idris.Imports import Idris.Elab.Term import Idris.Coverage import Idris.DataOpts import Idris.Providers import Idris.Primitives import Idris.Inli...
uwap/Idris-dev
src/Idris/Elab/Clause.hs
bsd-3-clause
47,429
10
28
19,125
13,652
6,761
6,891
757
42
module HAD.Y2114.M03.D21.Solution where import Control.Applicative import Control.Arrow import Data.Maybe -- $setup -- >>> import Test.QuickCheck -- >>> import Data.Maybe (fromJust) -- | minmax -- get apair of the min and max element of a list (in one pass) -- returns Nothing on empty list -- -- Point-free: checked ...
1HaskellADay/1HAD
exercises/HAD/Y2014/M03/D21/Solution.hs
mit
1,049
0
14
206
237
141
96
15
1
{-# LANGUAGE BangPatterns,CPP #-} import System.Directory import System.FilePath import Control.Concurrent.Async import System.Environment import Data.List hiding (find) import Control.Exception (finally) import Data.Maybe (isJust) import Control.Concurrent.MVar import Control.Concurrent.STM import Data.IORef import GH...
prt2121/haskell-practice
parconc/findpar3.hs
apache-2.0
2,096
1
15
632
843
427
416
63
4
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples, DefaultSignatures, TypeOperators, FlexibleContexts #-} module Parallel (NFData, parMap, rdeepseq) where import Control.Monad import GHC.Exts import Control.DeepSeq infixl 0 `using` type Strategy a = a -> Eval a newtype Eval a = Eval (State# RealWorld -> (# ...
ezyang/ghc
testsuite/tests/concurrent/T13615/Parallel.hs
bsd-3-clause
1,432
0
14
435
592
304
288
39
1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGPoint (matrixTransform, matrixTransform_, setX, getX, setY, getY, SVGPoint(..), gTypeSVGPoint) ...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGPoint.hs
mit
2,558
0
12
349
671
394
277
38
1
-- -- (C)opyright 2007 Ricardo Martins <ricardo at scarybox dot net> -- Licensed under the MIT/X11 License. -- See LICENSE file for license details. -- module Main where import System (getArgs) import Text.Regex.Posix import StrictIO import Test.QuickCheck -- strip the email message from those stupid signatures m...
meqif/tools
hashishin/hashishin.hs
mit
1,249
0
12
301
456
248
208
30
2
module DevelMain where import Prelude import Application (getApplicationRepl, shutdownApp) import Control.Exception (finally) import Control.Monad ((>=>)) import Control.Concurrent import Data.IORef import Foreign.Store import Network.Wai.Handler.Warp import GHC.Word update :: IO () update = do mtidStore <- look...
pbrisbin/tee-io
app/DevelMain.hs
mit
1,883
0
15
526
519
255
264
46
2
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DataKinds #-} module Data.HighJson ( -- * A json specification for any type HighS...
agrafix/highjson
highjson/src/Data/HighJson.hs
mit
7,271
0
12
1,580
2,153
1,199
954
-1
-1
------------------------------------------------------------------------------------------------------------------------------ -- ROSE TREES, FUNCTORS, MONOIDS, FOLDABLES ------------------------------------------------------------------------------------------------------------------------------ data Rose a = a :> [R...
mitochon/hexercise
src/mooc/fp101/Lab6RoseTemplate.hs
mit
3,871
17
24
775
1,894
954
940
50
2
-- Generated by protobuf-simple. DO NOT EDIT! module Types.StringMsg where import Control.Applicative ((<$>)) import Prelude () import qualified Data.ProtoBufInt as PB newtype StringMsg = StringMsg { value :: PB.Text } deriving (PB.Show, PB.Eq, PB.Ord) instance PB.Default StringMsg where defaultVal = StringMsg...
sru-systems/protobuf-simple
test/Types/StringMsg.hs
mit
848
0
13
157
296
159
137
20
0
import Control.Monad.Reader data GameState = NotOver | FirstPlayerWin | SecondPlayerWin | Tie data Game position = Game { getNext :: position -> [position], getState :: position -> GameState } getNext' :: position -> Reader (Game position) [position] getNext' position = do g...
Muzietto/geiesmonads
es6/Megamax.hs
mit
990
32
10
318
278
146
132
-1
-1
module TicTacToe.ResultSpec where import Test.Hspec import qualified TicTacToe.Fixtures as Fixtures import qualified TicTacToe.Result as Result spec :: Spec spec = describe "TicTacToe.Result" $ do context "for in play board" $ do let board = Fixtures.inPlayBoard let result = Result.fromBoard boar...
tomphp/haskell-tictactoe
test/TicTacToe/ResultSpec.hs
mit
2,912
51
6
1,065
353
201
152
43
1
{-# LANGUAGE GeneralizedNewtypeDeriving, OverloadedStrings #-} module Reddit.Types where import Control.Applicative import Control.Monad import Data.Aeson (FromJSON (..), ToJSON, (.:)) import Data.Text (Text) newtype DisplayName = DisplayName { unDisplayName :: Text } deriving (Show,Read,FromJS...
sifisifi/subscribe-jpsubreddits
src/Reddit/Types.hs
mit
1,201
0
13
301
320
186
134
30
0
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- http://stackoverflow.com/questions/27591266/telling-cabal-where-the-main-module-is module Betfair.StreamingAPI.API.StreamingState ( Streami...
joe9/streaming-betfair-api
src/Betfair/StreamingAPI/API/StreamingState.hs
mit
1,457
0
10
448
218
134
84
30
1
import System.Random import System.IO.Unsafe import Data.List import Data.Char --Problem 1: Retrieve the last element from a list myLast :: [a] -> a myLast [x] = x myLast (_:xs) = myLast xs -- --Problem 2: Retrieve the second to last element from a list myButLast :: [a] -> a myButLast xs = myLast (init xs) -- --Pr...
ostrowr/99-Haskell-Problems
99problems.hs
mit
13,000
0
14
2,991
4,356
2,336
2,020
232
2
module Main where import Prelude hiding (lookup) import Control.Applicative ((<$>)) import Control.Monad (join) import Control.Concurrent.Object import Control.Concurrent.STM import qualified Control.Exception as E import qualified Data.Map as Map import Con...
ruicc/structured-concurrent-object
tests/group.hs
mit
4,108
0
23
1,232
1,336
681
655
-1
-1
module Y2015.D20Spec (spec) where import Y2015 import Test.Hspec spec :: Spec spec = parallel $ describe "Day 20" $ describe "withMinPresents" $ it "finds 70 presents at house four" $ withMinPresents 70 `shouldBe` 4
tylerjl/adventofcode
test/Y2015/D20Spec.hs
mit
258
0
10
76
63
34
29
9
1
module Cube where import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import Data.Tuple.HT cube w = do renderPrimitive Quads $ do vertex $ Vertex3 w w w vertex $ Vertex3 w w (-w) vertex $ Vertex3 w (-w) (-w) vertex $ Vertex3 w (-w) w vertex $ Vertex3 w w w vertex $ Vertex3 w w (-w) ...
fatuhoku/haskell-yampa-bouncing-ball
src/Cube.hs
mit
896
0
13
262
556
275
281
30
1
module HtmlDocSpec where import Prelude hiding (div) import Test.Hspec import HtmlDoc import Dom import Debug.Trace div :: String -> [HtmlNode] -> HtmlNode div id children = htmlNodeWithId "div" id children spec :: Spec spec = do it "sets font size from CSS" $ do let css = [ (parseSelector "#big", [FontSize (P...
pbevin/toycss
test/HtmlDocSpec.hs
gpl-2.0
660
0
18
146
272
139
133
18
1
module Text.Pandoc.CrossRef.Util.CodeBlockCaptions ( mkCodeBlockCaptions ) where import Text.Pandoc.Definition import Text.Pandoc.Shared (normalizeSpaces) import Data.List (isPrefixOf, stripPrefix) import Data.Maybe (fromMaybe) import Text.Pandoc.CrossRef.References.Types import Text.Pandoc.CrossRef.Util.O...
infotroph/pandoc-crossref
lib/Text/Pandoc/CrossRef/Util/CodeBlockCaptions.hs
gpl-2.0
1,318
0
12
202
518
275
243
32
1
--project euler problem 15 {-- Starting in the top left corner of a 2×2 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 20×20 grid? --} {-- mathematically this is a trivial problem... pascal's triangle to the rescue! --} factorial n = product [1..n] m ...
goalieca/haskelling
015.hs
gpl-3.0
425
0
11
79
89
49
40
3
1
instance Functor (Reader r) where fmap f g = f . g
hmemcpy/milewski-ctfp-pdf
src/content/1.8/code/haskell/snippet22.hs
gpl-3.0
54
0
7
15
29
14
15
2
0
{-# language OverloadedStrings, NamedFieldPuns #-} module Redsift.SignUrl (signUrl, URI) where import Network.HTTP import Network.AWS.Authentication import Network.AWS.AWSConnection import Network.URI import System.FilePath type Bucket = String type Object = String -- $ Signs a url. Outputs the uri with the bucke...
zalora/redsift
Redsift/SignUrl.hs
gpl-3.0
1,849
0
17
521
376
216
160
40
3
{-# LANGUAGE TypeFamilies, FlexibleInstances, FlexibleContexts, ViewPatterns, RecordWildCards, NamedFieldPuns, ScopedTypeVariables, TypeSynonymInstances, NoMonomorphismRestriction, TupleSections, StandaloneDeriving, GeneralizedNewtypeDeriving, DeriveDataTypeable, MultiParamTypeClasses #-} module R3Immersions where imp...
DanielSchuessler/hstri
R3Immersions.hs
gpl-3.0
3,363
0
17
1,441
815
435
380
67
2
{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.List.Split import Data.String import Network.HTTP import Text.JSON.Generic import Control.Concurrent.Async -- This is a quick helper to allow me to add the object first over the value. (!&!) :: (JSON a) => JSObject JSValue -> String -> Result a (!...
Tombert/StockScrape
src/Main.hs
gpl-3.0
5,759
0
12
1,416
880
484
396
78
1
{- | Module : $Header$ Description : hsay. Copyright : (c) Alexander Berntsen 2014 License : GPL-3 Maintainer : alexander@plaimi.net -} module Main where import Control.Arrow ( second, ) import Data.List ( intersperse, ) import Data.Monoid ( Sum (Sum), mappend, mempty, ) import ...
alexander-b/hsay
src-exec/hsay.hs
gpl-3.0
3,166
0
17
913
1,310
699
611
98
3
{-# LANGUAGE RecordWildCards #-} module Main where import Data.Monoid ((<>)) import Options.Applicative import Game.Regret (defaultMain) import Game.Select (SelectGame(SelectGame)) import Game.Dudo (Dudo(..)) main :: IO () main = defaultMain $ (\dieSides -> SelectGame Dudo{..}) <$> option auto ( long ...
davidspies/regret-solver
dudo/app/Main.hs
gpl-3.0
444
0
12
104
135
76
59
16
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-drive/gen/Network/Google/Resource/Drive/Replies/List.hs
mpl-2.0
4,311
0
18
1,112
638
375
263
95
1
{-# LANGUAGE InstanceSigs, ExplicitForAll, DeriveDataTypeable #-} module Length (Length(..), to_miles, add) where import Data.Generics (everywhere, mkT, Data, Typeable) data Foo = Foo String Int deriving (Eq, Show, Typeable, Data) newtype Length = Length Foo deriving (Eq, Show, Typeable, Data) -- data Mi...
dboulytchev/generic-transformers
papers/EPTCS/sybdemo/app/Length.hs
lgpl-2.1
670
0
10
150
297
158
139
14
1
-- | Frp handlers specific to this program. Will likely not be split -- into a separate package. module Jaek.UI.FrpHandlersCustom ( Focus ,genBZip ,genBDraw ,genDFocus ) where import Jaek.Base import Jaek.Render import Jaek.Peaks import Jaek.StreamExpr import Jaek.Tree import Jaek.UI.Focus import Jaek.UI.FrpHan...
JohnLato/jaek
src/Jaek/UI/FrpHandlersCustom.hs
lgpl-3.0
2,989
0
21
806
823
452
371
69
1
-- -- xmonad example config file for xmonad-0.9 -- -- A template showing all available configuration hooks, -- and how to override the defaults in your own xmonad.hs conf file. -- -- Normally, you'd only override those defaults you care about. -- -- NOTE: Those updating from earlier xmonad versions, who use -- EwmhDesk...
msk-/dotfiles
xmonad.hs
unlicense
26,526
0
16
5,989
2,806
1,770
1,036
164
1
{- Created : 2015 Feb 05 (Thu) 14:56:08 by Harold Carr. Last Modified : 2016 Feb 04 (Thu) 20:04:24 by Harold Carr. -} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module ThreepennyExternalNewEventDemo where import Control.Concurrent (forkIO) import Graphics.UI.Threepenny import ...
haroldcarr/rdf-triple-browser
experiments/haskell-threepenny-gui-experiments/src/ThreepennyExternalNewEventDemo.hs
apache-2.0
1,095
0
15
321
318
154
164
26
1
{-# LANGUAGE DeriveFunctor #-} module Ast where import RecursionSchemes data Literal = IntLit Int | StringLit String | UnitLit deriving Show data ExpF a = Var String | App a a | Lam String a | Lit Literal | Let String a a | IfThenElse a a a deri...
holoed/Junior
src/Ast.hs
apache-2.0
741
0
7
237
313
166
147
25
1
{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.Typeable import Data.Data import Text.JSON (decode, Result(Ok, Error)) import Text.JSON.Generic (fromJSON) import System.IO (hFlush, stdout) data InMsg = InMsg { problem :: String, state :: String } de...
disco-framework/disco
priv/squares/components/barkeeper/Main.hs
apache-2.0
845
0
15
214
296
155
141
30
2
-- program fails if year entered from command-line is not a number main = do putStrLn "Please Enter Your Birthyear: " year <- getLine putStrLn $ "In 2020, you will be : " ++ show (2020 - read year)
dongarerahul/edx-haskell
main.hs
apache-2.0
205
0
11
46
44
20
24
4
1
module Main where import qualified SimpleService_Client as Client import Simple_Types import Thrift import Thrift.Protocol.Binary import Thrift.Server import Thrift.Transport import Thrift.Transport.Handle import Control.Exception import Data.Either import Data.Int import Data.List import Data.Maybe import Data.Time...
maxeler/maxskins
examples/Simple/client/hs/Dynamic/SimpleClient.hs
bsd-2-clause
8,580
0
15
1,898
2,904
1,433
1,471
155
16
{-# LANGUAGE OverloadedStrings, TemplateHaskell, DeriveGeneric, ScopedTypeVariables #-} module Dashboardh.Status( getJenkins , getJobs , getViewJobs , getJob , getAvgBuildTime ) where import Dashboardh.Prelude import Dashboardh.Job import Dashboardh.BuildTime import Dashboardh.Core import Data.Text ...
nhibberd/dashboardh
src/Dashboardh/Status.hs
bsd-3-clause
2,259
0
19
462
786
398
388
-1
-1
-- | Parsing items. module Data.Cfg.Item ( AugItem, Item, -- * Creation mkInitialItem, nextItem, -- * Query production, mark, atEnd, beforeMark, afterMark, nextV ) where import Data.Cfg.Augment import Data.Cfg.Cfg -- | A parsing \"item\": a partially processed produ...
nedervold/context-free-grammar
src/Data/Cfg/Item.hs
bsd-3-clause
1,686
0
10
427
410
223
187
34
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Layers.Flatten where import Network import Static import Util import Data.Singletons.TypeLits import Data.Singletons.Prelude.Num import Data.Serialize data Flatten = Flatt...
jonascarpay/convoluted
src/Layers/Flatten.hs
bsd-3-clause
946
0
12
211
330
176
154
-1
-1
module Primitives (primitives) where import Value ( Value(Nil, Integer, Char, Con, Fun, IOAction, Err), Env, initialize) primitives :: Env primitives = initialize [ ("+", Fun $ mkBinIntFun (+)), ("-", Fun $ mkBinIntFun (-)), ("*", Fun $ mkBinIntFun (*)), ("div", Fun $ mkBinIntFun div), ("^", Fun $ mkBinIntF...
YoshikuniJujo/toyhaskell_haskell
src/Primitives.hs
bsd-3-clause
1,517
68
9
311
708
375
333
38
2
-- | Example 2: Parsing a list of tokens instead of a 'String' and computing -- the desired result directly. -- In this example it is assumed that there exists a lexer -- that goes from @'String' -> 'CToken'@, so that an input -- 'String' can be fed into the lexer an...
ollef/Grempa
examples/Ex2Calculator.hs
bsd-3-clause
3,072
0
15
691
313
190
123
31
1
{-# LANGUAGE FlexibleContexts,FlexibleInstances #-} {- Some functions that are used across the program -} module HOCHC.Utils((%),errorPart,fromRight,xor,(>><),check,(?),throwError) where import Control.Monad.Except import qualified Control.Monad.Fail instance Control.Monad.Fail.MonadFail (Either String) where ...
penteract/HigherOrderHornRefinement
HOCHC/Utils.hs
bsd-3-clause
1,185
1
11
232
530
293
237
24
2
{-# LANGUAGE ConstraintKinds, DeriveDataTypeable, FlexibleContexts, OverloadedStrings, PatternGuards #-} -- | refunds on payins and transfers module Web.MangoPay.Refunds where import Web.MangoPay.Monad import Web.MangoPay.Payins import Web.MangoPay.Types import Web.MangoPay.Users import Web.MangoPay.Walle...
prowdsponsor/mangopay
mangopay/src/Web/MangoPay/Refunds.hs
bsd-3-clause
4,998
0
43
1,508
913
507
406
92
1
{-# LANGUAGE OverloadedStrings #-} -- This modules keeps track of the probabilities of a word following two other -- words. This can be used to generate a third item from a sequence of two -- items, and by extension, a string of many items. module Text.Ribot.Mimic ( mimic , FreqMap , getWeightedChoice ...
erochest/ribot
src/Text/Ribot/Mimic.hs
bsd-3-clause
8,354
0
17
2,302
1,690
914
776
-1
-1
{-# LANGUAGE TemplateHaskell #-} module Ariadne.Macros where import Language.Haskell.TH import Data.Generics.Zipper import Control.Monad justE e = [| Just $e |] cmatch :: Q Exp -> Q Exp cmatch exp = do ConE conNm <- exp varNm <- newName "e" lamCaseE [ match (asP varNm $ recP conNm []) (nor...
apsk/ariadne
src/Ariadne/Macros.hs
bsd-3-clause
494
0
13
138
174
91
83
14
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} module Sequent.Env ( EnvT, evalEnvT , Env, evalEnv , next ) where import Control.Monad.State.Lazy (MonadState, State...
matthieubulte/sequent
src/Sequent/Env.hs
bsd-3-clause
1,062
0
7
352
259
147
112
30
1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE PatternSynonyms #-} module Language.Indescript.Parser.Lexer ( Token(..) , LinkedPos , PosedToken , lexIndescript ) where import Data.Char (ord) import Text.Regex.Applicative import Language.Indescript...
notcome/indescript
src/Language/Indescript/Parser/Lexer.hs
bsd-3-clause
9,280
0
17
2,705
3,365
1,792
1,573
204
5
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell -- Note: `partialmeasureOld.hs` works fine [lq| cons :: x:a -> _ -> {v:[a] | hd v = x} |] cons x xs = x : xs [lq| test :: {v:_ | hd v = 0} |] test :: [Int] test = cons 0 [1,2,3,4] [lq| measure hd |] hd :: [a] -> a hd (x:_) = x -- Instead of rejecting, ...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/partialmeasure.hs
bsd-3-clause
508
0
7
138
103
64
39
10
1
-- A significant part of this code has been borrowed from other -- hakyll users, mostly Jasper through his site and hakyll's, -- but also skybluetrades.net and chromaticleaves.com {-# LANGUAGE OverloadedStrings #-} import Control.Applicative ((<$>)) import Data.Char import Data.Maybe (catMaybes) import Data.Monoid (m...
JoeyEremondi/eremondi.com-hakyll
site.hs
bsd-3-clause
8,484
15
24
2,648
1,669
835
834
167
2
module Import ( module Import ) where import Prelude as Import hiding (head, init, last, readFile, tail, writeFile) import Yesod as Import hiding (Route (..)) import Control.Applicative as Import (pure,...
jabaraster/MetShop
Import.hs
bsd-3-clause
1,154
0
6
565
152
112
40
19
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ...
dalaing/type-systems
src/Ast.hs
bsd-3-clause
2,511
0
15
603
1,226
678
548
55
0
-- | -- Module : Language.SequentCore.OccurAnal -- Description : Occurrence analysis for Sequent Core -- Maintainer : maurerl@cs.uoregon.edu -- Stability : experimental -- -- Normally occurrence analysis is performed by the simplifier, but if needed, this -- module can update a module or a single term on deman...
lukemaurer/sequent-core
src/Language/SequentCore/OccurAnal.hs
bsd-3-clause
81,219
0
18
22,403
9,345
5,097
4,248
632
7
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE KindSi...
dalaing/type-systems
src/Fragment/TyArr/Ast/Error.hs
bsd-3-clause
1,687
0
10
280
444
246
198
36
2
{-# LANGUAGE OverloadedStrings #-} module LiteralWithEnvVar ( script ) where import Prelude import Shell -- This test ensures that we escape string literals properly if they -- have an embedded variable expansion. script :: ShellM () script = do run $ command "echo" ["${SHELL}"] return ()
travitch/shellDSL
tests/inputs/LiteralWithEnvVar.hs
bsd-3-clause
296
0
9
52
56
31
25
8
1
{- <TEST> {- MISSING HASH #-} -- {-# MISSING HASH #-} <COMMENT> {- INLINE X -} {- INLINE Y -} -- {-# INLINE Y #-} {- INLINE[~k] f -} -- {-# INLINE[~k] f #-} {- NOINLINE Y -} -- {-# NOINLINE Y #-} {- UNKNOWN Y -} <COMMENT> INLINE X </TEST> -} module Hint.Comment(commentHint) where import Hint.Type import Data.Char i...
fpco/hlint
src/Hint/Comment.hs
bsd-3-clause
1,075
0
13
231
306
161
145
17
2
----------------------------------------------------------------------------- -- | -- Module : Data.SBV.Provers.SExpr -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Parsing of S-expressions (mainly used for parsing SMT-Lib get-valu...
dylanmc/cryptol
sbv/Data/SBV/Provers/SExpr.hs
bsd-3-clause
7,288
0
15
3,120
2,379
1,226
1,153
101
49
{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} module Fragnix.Core.Slice where import Data.Aeson (FromJSON, ToJSON) import Data.Hashable (Hashable) import Data.Text (Text) import GHC.Generics (Generic) -- Slices type SliceID = Text data Slice = Slice { sliceID :: SliceID -- ^ The hash by which this slice ...
phischu/fragnix
src/Fragnix/Core/Slice.hs
bsd-3-clause
3,541
0
10
603
796
432
364
101
0
import Control.Arrow ( second ) import Control.Concurrent ( forkIO, threadDelay ) import Control.Exception ( mask_ ) import Control.Monad ( when ) import qualified Data.ByteString as B ( ByteString ) import qualified Data.ByteString.Char8 as C ( ByteStrin...
danchoi/imapget
src/Main.hs
bsd-3-clause
5,715
0
30
1,904
1,397
748
649
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Strict #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | @futhark dataset@ module Futhark.CLI.Dataset (main) where import Control.Monad import Control.Monad.ST import qualified Data.Binary as Bin import qualified Data.ByteString.Lazy.Char8 as BS import qualified Data.Text ...
diku-dk/futhark
src/Futhark/CLI/Dataset.hs
isc
10,492
0
25
2,807
3,018
1,584
1,434
271
12
{-# LANGUAGE OverloadedStrings #-} module Config.Internal where import qualified Data.Yaml as Y import Data.Yaml ((.:)) import Control.Applicative ((<$>),(<*>),empty) loadConfigFromFile :: String -> IO (Either Y.ParseException VanguardConfig) loadConfigFromFile file = Y.decodeFileEither file ...
rlupton20/vanguard-dataplane
app/Config/Internal.hs
gpl-3.0
1,079
0
9
276
314
174
140
21
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="id-ID"> <title>Server-Sent Events | ZAP Extension</title> <maps> <homeID>top</homeID> ...
veggiespam/zap-extensions
addOns/sse/src/main/javahelp/org/zaproxy/zap/extension/sse/resources/help_id_ID/helpset_id_ID.hs
apache-2.0
979
80
67
160
419
212
207
-1
-1
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE...
advancedtelematic/quickcheck-state-machine-model
src/Test/StateMachine/Types.hs
bsd-3-clause
5,165
0
14
1,141
1,461
808
653
131
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Ros.Sensor_msgs.Range where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Internal.RosBin...
acowley/roshask
msgs/Sensor_msgs/Ros/Sensor_msgs/Range.hs
bsd-3-clause
1,705
1
13
357
487
280
207
43
1
{-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude, AutoDeriveTypeable, RoleAnnotations #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.IOArray -- Copyright : (c) The University of...
alexander-at-github/eta
libraries/base/GHC/IOArray.hs
bsd-3-clause
2,530
0
10
459
518
282
236
33
1
import System.Environment import System.IO import Text.ParserCombinators.Parsec import Control.Monad import Data.ByteString.Lazy.Char8 as BS hiding (length,take,drop,filter,head,concat) import Control.Applicative hiding ((<|>), many) import Data.List as DL import Data.Char import Text.Printf {-- han(Open usp Tukubai) ...
ShellShoccar-jpn/Open-usp-Tukubai
COMMANDS.HS/han.hs
mit
8,489
11
12
2,356
3,124
1,777
1,347
140
3
{-# OPTIONS_GHC -cpp #-} {-+ Instance declarations in the source code are assigned names and added to the instance database, which gets used during context reduction. -} module TiInstanceDB( IDB,Instance,InstEntry(..),emptyIdb,extendIdb,classInstances,findInst,findInst', addInstKind,instType) where import TiTypes...
kmate/HaRe
old/tools/base/TI/TiInstanceDB.hs
bsd-3-clause
3,912
13
15
869
1,125
619
506
59
3
module LiftToToplevel.WhereIn7 where --A definition can be lifted from a where or let to the top level binding group. --Lifting a definition widens the scope of the definition. --In this example, lift 'addthree' defined in 'fun'. --This example aims to test adding parenthese. fun x y z =inc addthree where in...
kmate/HaRe
test/testdata/LiftToToplevel/WhereIn7.hs
bsd-3-clause
358
0
8
79
52
29
23
4
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wincomplete-patterns #-} module T15385 where import Data.Type.Equality data T a where TInt :: T Int TBool :: T Bool f1, f2 :: a :~: Int -> T a -> () f1 eq t | Refl <- eq = case t of TInt -> () f2 eq t ...
sdiehl/ghc
testsuite/tests/pmcheck/should_compile/T15385.hs
bsd-3-clause
382
0
10
114
126
68
58
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF l...
johnbelamaric/themis
vendor/github.com/apache/thrift/lib/hs/src/Thrift/Protocol.hs
apache-2.0
4,484
0
14
870
1,059
587
472
91
12
-- This one should succeed; M.x is unambiguous module ShouldCompile (module M) where import Rn043_A as M -- x, M.x import Rn043_B -- x, Rn043_A.x
olsner/ghc
testsuite/tests/rename/should_compile/rn043.hs
bsd-3-clause
161
0
4
40
21
16
5
3
0
-- Check overlap in n+k patterns {-# LANGUAGE NPlusKPatterns #-} module Foo where g :: Int -> Int g (x+1) = x g y = y g _ = 0 -- Overlapped h :: Int -> Int h (x+1) = x h _ = 0 -- Not overlapped
olsner/ghc
testsuite/tests/deSugar/should_compile/ds056.hs
bsd-3-clause
218
0
9
72
84
45
39
9
1
{-# LANGUAGE ConstrainedClassMethods #-} module Main where class C a where op :: (Show a, Show b) => a -> b -> String -- This class op adds a constraint on 'a' -- In GHC 7.0 this is fine, and it's a royal -- pain to reject it when in H98 mode, so -- I'm just allowing it instance C Int where op x y = show x...
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail149.hs
bsd-3-clause
368
0
9
94
100
54
46
7
1
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, TypeFamilies, FlexibleInstances #-} module T4135a where import Control.Monad import Language.Haskell.TH class Foo a where type FooType a createInstance' :: Q Type -> Q Dec createInstance' t = liftM head [d| instance Foo $t where type Fo...
urbanslug/ghc
testsuite/tests/th/T4135a.hs
bsd-3-clause
341
0
6
75
61
35
26
11
1
module Print1 where main :: IO () main = putStrLn "Hello world!"
nkbt/haskell-book
3.3.hsproj/Print1.hs
mit
68
0
6
15
22
12
10
3
1
type Church a = (a -> a) -> a -> a zero :: Church a zero = \s z -> z one :: Church a one = \s z -> s z two :: Church a two = \s z -> (s . s) z -- lambda eta reduction, gets rid of z three :: Church a three = \s -> (s . s . s) church2string :: Church String -> String church2string x = ...
anwb/fp-one-on-one
church-numerals.hs
mit
810
0
8
260
279
148
131
17
1
{- | module: $Header$ description: OpenTheory packages license: MIT maintainer: Joe Leslie-Hurd <joe@gilith.com> stability: provisional portability: portable -} module HOL.OpenTheory.Package where import Control.Concurrent (forkIO) import Control.Concurrent.MVar (newEmptyMVar,putMVar,readMVar) import Control.Monad (...
gilith/hol
src/HOL/OpenTheory/Package.hs
mit
15,844
4
17
3,453
5,144
2,625
2,519
350
5
module TicTacToe.PlayerSpec where import Test.Hspec import TicTacToe.Player (Player(..)) import qualified TicTacToe.Player as Player spec :: Spec spec = describe "TicTacToe.Player" $ do describe "show" $ it "shows the player" $ do show O `shouldBe` "Naughts" show X `shouldBe` "Crosses" ...
tomphp/haskell-tictactoe
test/TicTacToe/PlayerSpec.hs
mit
440
0
13
105
136
71
65
14
1
module QualifiedDot where twoDots = (Prelude..)
Pnom/haskell-ast-pretty
Test/examples/QualifiedDot.hs
mit
48
0
5
6
13
9
4
2
1
{-# LANGUAGE DeriveDataTypeable #-} module Main where import System.Console.ANSI import System.IO (hFlush, stdout) import System.Directory import System.FilePath.Posix (takeDirectory, (</>)) import Data.List (intercalate) import Data.List.Split (splitOneOf) import Data.Char (toLower, toUpper, isNumber, isLetter) impor...
duikboot/holyhaskell
src/Main.hs
mit
4,063
0
13
945
1,110
542
568
106
2
module Simple where import Prelude (Bool(..), otherwise, Maybe(..), Show) data Weekday = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday deriving Show isWeekend :: Weekday -> Bool isWeekend Saturday = True isWeekend Sunday = True isWeekend _ = False lazyAppl...
antalsz/hs-to-coq
examples/simple/Simple.hs
mit
594
0
8
180
251
136
115
18
1
module Parse.Post.Internal ( PostBodyHtml (PostBodyHtml) , PostHeaderHtml (PostHeaderHtml) , PostHtml ( .. ) ) where import Data.ByteString.Char8 (ByteString) import Text.HTML.TagSoup (Tag) data PostHeaderHtml = PostHeaderHtml [Tag ByteString] deriving (Show) data PostBodyHtml = PostBodyHtml [Tag ByteStri...
JacobLeach/xen-parsing
app/Parse/Post/Internal.hs
mit
433
0
8
66
124
76
48
14
0
module Lexer where import Text.Parsec.String (Parser) import Text.Parsec.Language (emptyDef) import qualified Text.Parsec.Token as Tok lexer :: Tok.TokenParser () lexer = Tok.makeTokenParser styles where ops = ["+", "*", "-", "/"] names = ["def", "extern"] styles = emptyDef { ...
tgkokk/kaleidoscope
src/Lexer.hs
mit
949
0
8
241
301
164
137
28
1