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
-------------------------------------- --- Ex 16.10 ---- -------------------------------------- module Deq ( emptyDeq, -- Produces an empty Deq :: Deq a isEmptyDeq, -- Tests if a Deq is empty :: Deq a -> Bool pushDeq, -- Add element to tail :: a ->...
CarmineM74/haskell_craft3e
Chapter16/Deq.hs
mit
1,803
0
7
479
248
149
99
28
1
module Y2020.M09.D01.Solution where {-- OKAY! SCROOGE! So, we ingested and word-counted "A Christmas Carol," removing the weirdness and removing the stopwords. GREAT! ... oh, I forgot: I'm Scrooge. BAH! HUMBUG! So, now, let's ingest and word-count the top-100 books from project gutenberg. That's going to be the ...
geophf/1HaskellADay
exercises/HAD/Y2020/M09/D01/Solution.hs
mit
3,156
0
11
474
278
164
114
20
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE DeriveDataTypeable #-} -- | LLVM Data types module LlvmData where import Control.Lens.Plated ( Plated , plate ) import Data.Data ( Data , Typeable ) import Data.Data.Lens ( uniplate ) -- | A list of top-level entities such as target declarations or function ...
garious/hopt
LlvmData.hs
mit
2,009
0
8
981
319
190
129
40
0
module Meetup ( Weekday(..) , Schedule(..) , meetupDay ) where import Data.Maybe (mapMaybe) import Data.Time.Calendar (Day, fromGregorianValid, toGregorian) import Data.Time.Calendar.WeekDate (toWeekDate) data Weekday = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday deriv...
enolive/exercism
haskell/meetup/src/Meetup.hs
mit
1,204
0
11
296
426
237
189
45
6
{-# OPTIONS -fno-warn-missing-methods #-} module Vec3 ( Vec3(..) , magnitudeV3 , normaliseV3 , mulsV3 , dotV3 , clampV3 , clipV3) where data Vec3 = Vec3 !Float !Float !Float deriving (Eq, Show) instance Num Vec3 where (+) (Vec3 x1 x2 x3) (Vec...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/raster/Ray/Vec3.hs
mit
1,880
0
11
590
667
354
313
61
1
{-# Language DeriveGeneric #-} {-# Language FlexibleInstances #-} {-# Language OverloadedStrings #-} module Game.Area where import GHC.Generics import qualified Data.HashMap.Strict as HMS import Game.Cell import Data.Bits import Data.Text (Text) import qualified Data.Text as T import Data.Aeson import Data.Maybe impor...
tlaitinen/game
Game/Area.hs
mit
1,240
0
12
349
425
239
186
36
1
module Language.Lua.Lint.Lint where import Text.Parsec.Pos (SourcePos, sourceLine) import Control.Monad.ST (runST, ST) import Control.Monad (when, unless, sequence_) import Control.Applicative import Data.STRef import Data.Function (on) import Debug.Trace import qualified Data.Map as M import qualified Data.Graph.Induc...
ykst/llint
Language/Lua/Lint/Lint.hs
mit
18,511
0
25
5,820
6,716
3,423
3,293
406
13
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Compiler.Settings where import Gen2.Base import qualified Gen2.Object as Object import qualified Control.Exception as E import Control.Concurrent.MVar import Control.Monad import Data.Aeson import ...
ghcjs/ghcjs
src/Compiler/Settings.hs
mit
8,733
0
15
3,043
1,751
966
785
167
1
module Bob (responseFor) where import Data.Char (toUpper, isAlpha, isUpper, isSpace) import Data.List (dropWhileEnd) responseFor :: String -> String responseFor xs | null stripped = "Fine. Be that way!" | any isAlpha stripped && alphaOnly == map toUpper alphaOnly =...
munyari/programming-problems
exercism.io/haskell/bob/src/Bob.hs
gpl-2.0
622
0
10
244
146
74
72
12
1
import XMonad import XMonad.Actions.CycleWS (nextWS, prevWS, shiftToNext, shiftToPrev) import XMonad.Actions.GroupNavigation (nextMatch, historyHook, Direction(History)) import XMonad.Config.Desktop (desktopConfig) import XMonad.Hooks.DynamicLog import XMonad.Hooks.FadeInactive import XMonad.Hooks.Mana...
markhepburn/dotxmonad
xmonad.hs
gpl-2.0
8,547
0
16
2,207
1,544
893
651
130
1
{-# language DeriveDataTypeable #-} {-# language TemplateHaskell #-} {-# language DatatypeContexts #-} {-# language MultiParamTypeClasses #-} {-# language FlexibleInstances #-} module Rewriting.Abstract.Fixed where import Rewriting.Abstract.Syntax import Rewriting.Abstract.Semantics import Rewriting.Abstract.Braced i...
marcellussiegburg/autotool
collection/src/Rewriting/Abstract/Fixed.hs
gpl-2.0
3,325
8
18
1,085
869
474
395
72
1
module Input where import VM import Tokens {- Input to the whitespace VM. For convenience, three input characters A => space, B => tab, C => either of CR/LF Numbers are binary (A=0, B=1, C=terminator) Strings are sequences of binary characters, terminated by C. We have: * Stack instructions (Preceded by...
brainbush/Tomato-Programming-Language
Input.hs
gpl-2.0
3,648
35
13
924
1,609
852
757
68
3
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module Algebraic.Quiz where import Algebraic.Central import Algebraic.Class import qualified Algebraic.Config as C import qualified Algebraic.Instance as I import Inter.Types import Inter.Quiz import Condition import Debug import qualified Autolib.TES.Binu a...
Erdwolf/autotool-bonn
src/Algebraic/Quiz.hs
gpl-2.0
2,656
42
17
755
629
372
257
72
2
-- | Functions of alignments of words. module Linguistics.WordAlignment ( module Linguistics.WordAlignment , buildAlignmentBuilder ) where import Control.Arrow (second) import Control.DeepSeq import Control.Lens hiding (each) import Control.Monad.State.Strict import ...
choener/WordAlignment
Linguistics/WordAlignment.hs
gpl-3.0
2,972
0
14
719
797
429
368
-1
-1
module Main where import Control.Applicative import Control.Monad import Data.Maybe import Data.List import Data.Monoid ( Monoid(..) ) -- cabal import Distribution.Simple.Setup ( Flag(..), fromFlag , trueArg , flagToList , optionVerbosity ) import Distribution.ReadE ( s...
Heather/hackport
Main.hs
gpl-3.0
21,173
0
18
4,635
4,526
2,443
2,083
386
8
{- Copyright (C) 2009 Tamas Eppel <Tamas.Eppel@gmail.com> This file is part of Renamer. Renamer is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later ver...
peletomi/icanhasren
RenCli.hs
gpl-3.0
6,974
0
16
2,808
1,544
793
751
109
6
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} -- {-# LANGUAGE FunctionalDependencies #-} -- {-# LANGUAGE Constra...
shinjiro-itagaki/shinjirecs
shinjirecs-api/src/Model.hs
gpl-3.0
13,835
37
20
3,240
5,025
2,582
2,443
259
16
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-cloudidentity/gen/Network/Google/Resource/CloudIdentity/Groups/Memberships/List.hs
mpl-2.0
6,621
0
19
1,525
973
565
408
136
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-bigquery/gen/Network/Google/Resource/BigQuery/Routines/List.hs
mpl-2.0
5,309
0
19
1,269
740
434
306
105
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/Hl7V2Stores/Messages/Patch.hs
mpl-2.0
7,665
0
17
1,517
870
512
358
136
1
module Database.LMDB.BinaryUtil where import Control.Applicative import Data.Binary import Data.Binary.Get import Data.Binary.Put import qualified Data.ByteString as S import qualified Data.ByteString.Lazy as L import Data.Maybe -- | Given a reference key value, search sequence of encoded key/length/value -- triples ...
jimcrayne/lmdb-bindings
Database/LMDB/BinaryUtil.hs
agpl-3.0
4,293
0
16
1,275
860
445
415
73
4
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, OverloadedStrings, Rank2Types #-} module Cortex.Miranda.CommitRaw where -- This module exports everything for testing purposes. Outside of tests -- `Cortex.Miranda.Commit` module should be used instead. ----- import Control.Monad.Trans (MonadIO) import Control.Mo...
maarons/Cortex
Miranda/CommitRaw.hs
agpl-3.0
6,567
0
12
1,640
2,111
1,154
957
147
2
module BoTox.Bots where import BoTox.Types import Control.Auto.Serialize import BoTox.Bots.GroupBot import BoTox.Bots.TitleBot import BoTox.Bots.RollBot import BoTox.Bots.EchoBot bots :: MonadTB m => [ToxBot m] bots = [ serializing' "groups.db" groupBot , perGroup titleBot , perGroup echoBot , p...
gordon-quad/botox
src/BoTox/Bots.hs
agpl-3.0
338
0
7
62
90
52
38
12
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE OverloadedStrings #-} {-| Module : Haskoin.Test.Util Copyright : No rights reserved License : MIT Maintainer : jprupp@protonmail.ch Stability : experimental Portability : POSIX -} module Haskoin.Util.Arbitrary.Util ( arbitraryBS , arbitraryBS...
haskoin/haskoin
src/Haskoin/Util/Arbitrary/Util.hs
unlicense
6,629
0
13
1,695
2,046
1,093
953
-1
-1
import Data.List takeIf _ [] = [] takeIf f (a:ax) = if f a then a:takeIf f ax else takeIf f ax inc 1 v (t:ts) = (t+v):ts inc i v (t:ts) = t:(inc (i-1) v ts) inc' _ _ [] t = t inc' a i (b:bs) t = if b == a then inc' a (i+1) bs t' else inc' a (i+1) bs t where t' = inc i 1 t play :: [Int] -> (Int,[In...
a143753/AOJ
0609.hs
apache-2.0
798
0
14
290
509
259
250
35
2
-- | "Toplevel" definitions. -- module Insomnia.Toplevel where import Insomnia.Identifier import Insomnia.ModuleType import Insomnia.Module import Insomnia.Query -- | A toplevel contains a list of toplevel items. -- -- TODO: worth representing this stuff using Unbound binders? newtype Toplevel = Toplevel [ToplevelIte...
lambdageek/insomnia
src/Insomnia/Toplevel.hs
bsd-3-clause
1,306
0
6
278
95
65
30
13
0
module Main where import Go.Move import Go.Board import SGF.Parser import Control.Monad import System.Environment import System.IO main :: IO () main = do args <- getArgs let fileName = last args (Right game) <- parseSGFFile fileName let gamePlay = leftPathConcat . gameStates . getMoves $ game hSetBuffe...
kebertx/GoFu
app/PlayGo.hs
bsd-3-clause
470
0
12
117
155
74
81
19
1
{-# LANGUAGE TupleSections, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-} module Catalogue ( Catalogue (..) -- <== TODO: don't expose the graph structure!!! , emptyCat , Item (..) , ItemType (..) , itemType' , ItemId (..) , Link (..) -- <== tmp , ItemEditor , loadCatalogue , r...
jsnajder/fer3-catalogue
src/Catalogue.hs
bsd-3-clause
21,055
0
18
4,487
6,954
3,686
3,268
422
3
module Models where import Control.Exception (catch, displayException, SomeException) import Database.PostgreSQL.Simple (Connection, execute_) import GHC.Int import qualified Models.Media as M import qualified Models.Projects as P data ModelType = Authors | Series | Posts ...
pellagic-puffbomb/simpleservantblog
src/Models.hs
bsd-3-clause
878
0
11
203
228
119
109
22
1
module TIM ( module TIM.Evaluator, module TIM.Types, module TIM.Compiler ) where import TIM.Evaluator(compile, eval) import TIM.Types import TIM.Compiler(compileProgram)
thomkoehler/FunLang
src/TIM.hs
bsd-3-clause
181
0
5
29
52
33
19
8
0
{-# LANGUAGE OverloadedStrings #-} module Line_Width where import Graphics.Blank import Wiki -- (578,200) main :: IO () main = blankCanvas 3000 $ \ context -> do send context $ do moveTo(100,150) lineTo(450,50) lineWidth 15 stroke() wiki $ snapShot context "images/Line_Width....
ku-fpg/blank-canvas
wiki-suite/Line_Width.hs
bsd-3-clause
350
0
13
92
111
54
57
13
1
{-# OPTIONS -Wall -Werror #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# ...
GaloisInc/saw-script
src/SAWScript/Crucible/LLVM/Boilerplate.hs
bsd-3-clause
6,205
0
14
1,290
1,671
899
772
-1
-1
module FreeNamesBaseStruct where import FreeNames import DefinedNames(DefinedNames) import BaseSyntax import Lists((\\\)) import List(nub) import TypedIds --import AccList(accList) import HsName -- modules (computes names that need to be imported) instance FreeNames i ds => FreeNames i (HsModuleI m i ds) where ...
forste/haReFork
tools/base/defs/FreeNamesBaseStruct.hs
bsd-3-clause
5,007
13
16
1,578
1,822
913
909
-1
-1
module Main where import Criterion.Main import Debug.Trace import Control.DeepSeq --import Criterion.Types --import Criterion.Config import System.Random import qualified Data.Set as S import Control.Concurrent.Actors import Control.Concurrent.Chan.Split import TreeExample -- THIS IS A WORK-IN-PROGRESS. PLEASE ...
jberryman/simple-actors
Benchmark.hs
bsd-3-clause
3,354
48
9
821
672
372
300
48
3
----------------------------------------------------------------------------- -- TIProg: Type Inference for Whole Programs -- -- Part of `Typing Haskell in Haskell', version of November 23, 2000 -- Copyright (c) Mark P Jones and the Oregon Graduate Institute -- of Science and Technology, 1999-2000 -- -- This p...
elben/typing-haskell-in-haskell
TIProg.hs
bsd-3-clause
1,676
0
12
511
358
188
170
25
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Db ( User(..) , UserId , Todo(..) , Db , createTables , runDb , newTodo , saveTodo , listTodos) where import Control.Monad import Control.Monad.Reader import Data.Aeson (ToJSON, toJSON, (.=), object) impor...
nurpax/snap-reactjs-todo
src/Db.hs
bsd-3-clause
4,030
0
13
1,034
1,046
550
496
93
2
{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-} module Action.Test(actionTest) where import Query import Action.CmdLine import Action.Search import Action.Server import General.Util import Input.Type import Data.List import System.IO.Extra import General.Store actio...
ndmitchell/hogle-dead
src/Action/Test.hs
bsd-3-clause
1,886
17
16
335
447
222
225
42
2
{-# LANGUAGE DeriveDataTypeable , EmptyDataDecls #-} module Text.RE2.Types.Internal ( RE2(..) , UTF8, Latin1 ) where import Text.RE2.C ( CRE2 ) import Foreign.ForeignPtr ( ForeignPtr ) import Data.Data ( Typeable ) -- | Abstract type representing a compiled regex. -- -- Parametrized by a character ...
kmcallister/haskell-re2
Text/RE2/Types/Internal.hs
bsd-3-clause
638
0
7
126
103
67
36
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} {- | Module : Alt.Prelude Description : Small Prelude to use with other modules. Copyright : (c) Nicolas Godbout, 2015 License : BSD-3 Maintainer : nicolas.godbout@gmail.com Small Prelude for use with other modules. Remark: Please use this ...
DrNico/alt-base
Alt/Prelude.hs
bsd-3-clause
1,405
0
7
386
159
105
54
16
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE Mul...
martinvlk/ghcjs-servant-client
src/Servant/Common/Req.hs
bsd-3-clause
14,094
51
24
3,600
3,047
1,629
1,418
-1
-1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Util.DebugWindow -- Description : Dump window information for diagnostic\/debugging purposes. -- Copyright : (c) Brandon S Allbery KF8NH, 2014 -- License : BSD3-style (see LICENSE) -- -- Maintainer : a...
xmonad/xmonad-contrib
XMonad/Util/DebugWindow.hs
bsd-3-clause
6,730
159
16
2,614
1,823
972
851
130
12
import Disorder.Core.Main import qualified Test.Jetski main :: IO () main = disorderMain [ Test.Jetski.tests ]
ambiata/jetski
test/test.hs
bsd-3-clause
135
1
7
39
40
21
19
6
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE UnicodeSyntax #-} {-| [@ISO639-1@] - [@ISO639-2@] - [@ISO639-3@] one [@Native name@] Onʌyotaʔa:ka [@English name@] Oneida -} module Text.Numeral.Language.ONE.TestDat...
telser/numerals
src-test/Text/Numeral/Language/ONE/TestData.hs
bsd-3-clause
5,933
0
8
1,462
1,210
809
401
136
1
{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} -- template-haskell #endif #ifndef MIN_VERSION_template_haskell #define MIN_VE...
hvr/lens
src/Control/Lens/Plated.hs
bsd-3-clause
23,120
0
13
4,517
3,068
1,770
1,298
172
1
----------------------------------------------------------------------------- -- | -- Module : ForSyDe.DFT -- Copyright : (c) ForSyDe Group, KTH 2007-2008 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : forsyde-dev@ict.kth.se -- Stability : experimental -- Portability : portable -- -- ...
forsyde/forsyde-shallow
src/ForSyDe/Shallow/Utility/DFT.hs
bsd-3-clause
2,566
0
12
617
855
431
424
38
1
{-# LANGUAGE FlexibleContexts, BangPatterns, MagicHash, UnboxedTuples #-} module Data.Picture.Drawing.Points ( writePoint, rawWritePoint, unsafeRawWritePoint, writePoints, reflect ) where import Control.Monad import Data.Primitive.ByteArray import Control.Monad.Primitive import Data.Color import Data.Pa...
jbaum98/graphics
src/Data/Picture/Drawing/Points.hs
bsd-3-clause
1,905
0
13
388
591
284
307
41
1
module Main where import ABS (a:b:tmp:n:n1:res:the_end:_)=[1..] main_ :: Method main_ [] this wb k = Assign n (Val (I 4)) $ Assign a (Val (I 1)) $ Assign b (Val (I 3)) $ Assign tmp (Val (I 2)) $ Assign res (Sync hanoi [a,b,tmp,n]) k hanoi :: Method hanoi [a,b,tmp,n] this wb k = Assign res (Val (I 0)) $ ...
abstools/abs-haskell-formal
benchmarks/6_hanoi/progs/4.hs
bsd-3-clause
652
0
19
185
416
216
200
22
1
{-# LANGUAGE PackageImports #-} import "server" Application (develMain) import Prelude (IO) main :: IO () main = develMain
Dridus/alexandria
server/app/devel.hs
mit
124
0
6
19
34
20
14
5
1
module QuickCheck.GenT.Prelude ( module Exports, traceM, ) where -- base import Prelude as Exports hiding (concat, foldr, mapM_, sequence_, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, mapM, sequence, FilePath, id, (.)) import Control.Monad as Expo...
nikita-volkov/QuickCheck-GenT
src/QuickCheck/GenT/Prelude.hs
mit
2,311
0
8
319
691
471
220
47
1
-- | Example for choosing the world's master module HAHP.Sample.Config2 where import Data.Map import HAHP.Data import HAHP.Data.Core import Numeric.LinearAlgebra.HMatrix sampleAHPConfig2 :: AHPTree sampleAHPConfig2 = AHPTree "Become the world's master, P...
jpierre03/hahp
src/HAHP/Sample/Config2.hs
gpl-3.0
3,052
0
11
1,579
510
269
241
64
1
{-# LANGUAGE DeriveDataTypeable #-} module Foreign.CUDA.Cusparse.Error where import Foreign.CUDA.Cusparse.Types (Status (..)) -- System import Data.Typeable import Control.Exception -- Describe each error code -- describe :: Status -> String describe Success = "success" describe NotInitialized = "lib...
kathawala/symdiff
cublas/Foreign/CUDA/Cusparse-bak/Error.hs
gpl-3.0
1,608
0
10
286
302
164
138
30
2
module Response ( -- | @/about@ module Response.About, -- | @/calendar@ module Response.Calendar, -- | @/draw@ module Response.Draw, -- | @/graph@ module Response.Graph, -- | @/grid@ module Response.Grid, -- | @/image@ m...
tamaralipowski/courseography
hs/Response.hs
gpl-3.0
809
0
5
249
126
84
42
22
0
module Comprehension2 where main :: [[Char]] main = [ [x,y,z] | x@'a' <- "abc", let { z :: Char; z = x }, y <- "xy" ]
roberth/uu-helium
test/correct/Comprehension2.hs
gpl-3.0
119
0
9
28
69
42
27
3
1
module Nitpick.Pattern where import qualified Data.List as List import qualified Data.Set as Set import qualified AST.Literal as L import qualified AST.Pattern as P import qualified AST.Variable as Var import qualified Reporting.Annotation as A data Pattern = Data Var.Canonical [Pattern] | Record [String] ...
mgold/Elm
src/Nitpick/Pattern.hs
bsd-3-clause
2,625
0
17
842
811
411
400
82
12
{-# LANGUAGE DeriveDataTypeable #-} import Haste.HPlay.View import Haste.HPlay.Cell import Haste.Perch import Haste import Haste.LocalStorage import Control.Applicative import Prelude hiding (div,span,id,all) import Data.Typeable import Control.Monad(when) import Control.Monad.IO.Class import qualified Data.IntMap as ...
agocorona/MFlow
Demos/todo/todo.hs
bsd-3-clause
6,510
0
34
2,069
2,300
1,124
1,176
173
9
{-# LANGUAGE RankNTypes, NamedFieldPuns, RecordWildCards #-} module Distribution.Server.Features.PackageCandidates ( PackageCandidatesFeature(..), PackageCandidatesResource(..), initPackageCandidatesFeature, CandidateRender(..), CandPkgInfo(..), ) where import Distribution.Server.Framework impo...
haskell-infra/hackage-server
Distribution/Server/Features/PackageCandidates.hs
bsd-3-clause
20,851
0
20
5,270
3,995
2,115
1,880
315
12
{-# LANGUAGE RecordWildCards #-} import Control.Applicative import Control.Exception import Control.Monad import Control.Monad.Trans.Resource (runResourceT) import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Lazy.Char8 as L8 import Data.List import Data.Maybe import Distribution.PackageDescr...
rubik/stack
etc/scripts/release.hs
bsd-3-clause
28,278
105
50
7,900
6,285
3,188
3,097
599
7
module B1.Data.Price.MockTest (getTestGroup) where import Test.QuickCheck import Test.Framework import Test.Framework.Providers.QuickCheck2 import B1.Data.Price.Mock getTestGroup :: Test getTestGroup = testGroup "B1.Data.Price.MockTest" [ testProperty "prop_getMockPrices_numPrices" prop_getMockPrices_numPrices ]...
madjestic/b1
tests/B1/Data/Price/MockTest.hs
bsd-3-clause
502
0
9
59
106
60
46
-1
-1
{-# LANGUAGE OverloadedStrings #-} import Control.Lens import Pipes import qualified Pipes.Prelude as P import Utils.Spoty -- | Stream all albums in constant space and print the names. main = runEffect $ getArtistAlbums artist >-> P.map (view name) >-> P.print where artist = "0LcJLq...
davnils/spoty
Examples/Albums.hs
bsd-3-clause
339
0
9
80
65
36
29
7
1
-- | The DOM has two ways of describing keyboard events: by Keycode, or by -- Charcode. The Keycode represents the physical key which was involved, -- whereas the Charcode represents the resulting character. Therefore, a -- typical keyboard interaction might yeild the following events: -- -- > KeyDown Keycode.shift --...
MoixaEnergy/blaze-react
src/Text/Blaze/Event/Charcode.hs
mit
854
0
11
171
97
59
38
9
2
{-# LANGUAGE MagicHash #-} module MagicHash00001 where -- Ripped from Data.List, verify I# constructor is valid. findIndices :: (a -> Bool) -> [a] -> [Int] #ifdef USE_REPORT_PRELUDE findIndices p xs = [ i | (x,i) <- zip xs [0..], p x] #else -- Efficient definition findIndices p ls = loop 0# ls w...
charleso/intellij-haskforce
tests/gold/parser/MagicHash00001.hs
apache-2.0
530
0
9
188
77
45
32
7
2
module A4 where data Data a = C1 a Char | C2 Int | C3 Float f :: (Data a) -> Int f (C1 a c) = 99 f (C2 a) = a f (C3 a) = 42 g (C1 (C1 x z) c) = 89
SAdams601/HaRe
old/testing/removeField/A4AST.hs
bsd-3-clause
154
0
9
53
109
58
51
7
1
module D1 where sumSquares ((x : xs)) = sq + (sumSquares xs) sumSquares [] = 0 sq x = x ^ pow pow = 2 main = sumSquares [1 .. 4]
SAdams601/HaRe
old/testing/demote/D1AST.hs
bsd-3-clause
136
0
8
38
73
40
33
6
1
{-# OPTIONS -fglasgow-exts #-} {-# LANGUAGE RankNTypes #-} module ShouldCompile where data Eq t => TrafoE t = forall env2 . TrafoE Int t newSRef () = TrafoE
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/T2478.hs
mit
165
0
6
36
40
23
17
-1
-1
module WithRenamingIn2 where --The application of a function is replaced by the right-hand side of the definition, --with actual parameters replacing formals. --In this example, unfold the first 'sq' in 'sumSquares' --This example aims to test renaming in order to avoid name clash or capture. sumSquares pow y =(let...
kmate/HaRe
old/testing/unfoldDef/WithRenamingIn2_TokOut.hs
bsd-3-clause
383
0
10
73
62
34
28
4
1
-- some incomplete sequences concatenated bad = "Àà€ð€€ø€€€"
urbanslug/ghc
testsuite/tests/parser/unicode/utf8_023.hs
bsd-3-clause
61
0
4
8
7
4
3
1
1
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} module Enum where import GHC.Generics ----------------------------------------------------------------------------- -- Ut...
urbanslug/ghc
testsuite/tests/generics/GEnum/Enum.hs
bsd-3-clause
2,343
0
14
524
854
465
389
49
2
{-# LANGUAGE OverloadedStrings #-} -- | Multicore imperative code. module Futhark.CodeGen.ImpCode.Multicore ( Program, Multicore (..), MCCode, Scheduling (..), SchedulerInfo (..), AtomicOp (..), ParallelTask (..), module Futhark.CodeGen.ImpCode, ) where import Futhark.CodeGen.ImpCode i...
diku-dk/futhark
src/Futhark/CodeGen/ImpCode/Multicore.hs
isc
4,786
0
13
1,104
1,336
689
647
94
0
module Y2017.M01.D10.Solution where import Control.Arrow ((&&&)) import Data.Binary import Data.ByteString.Lazy.Char8 (ByteString) import qualified Data.ByteString.Lazy.Char8 as BL import Data.Function (on) import Data.List (sort, group, sortBy) import Data.Set (Set) import qualified Data.Set as Set import Data.Text (...
geophf/1HaskellADay
exercises/HAD/Y2017/M01/D10/Solution.hs
mit
3,312
0
11
515
400
241
159
32
1
{-# LANGUAGE FlexibleInstances #-} module Exercises2 where -- Ex. 1 data Quant a b = Finance | Desk a | Bloor b instance Functor (Quant a) where fmap _ Finance = Finance fmap _ (Desk a) = Desk a fmap f (Bloor b) = Bloor (f b) -- Ex. 2 data K a b = K a instance Functor (K a) where fmap _ ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter16.hsproj/Exercises2.hs
mit
2,043
0
10
548
978
513
465
55
0
{-# LANGUAGE TemplateHaskell #-} module Oczor.Compiler.State where import ClassyPrelude import Oczor.Infer.InferContext import Control.Monad.State import Control.Monad.Except import Oczor.Syntax.Syntax import Oczor.Utl type Lang = String type LangSrc = String type OcSrc = String type OcWithFfi = (Maybe String, OcSrc...
ptol/oczor
src/Oczor/Compiler/State.hs
mit
934
0
9
161
244
154
90
34
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE CPP #-} module Data.ByteString.Rea...
philopon/bytestring-read
src/Data/ByteString/Read/Fractional.hs
mit
5,486
0
16
1,406
1,633
867
766
85
3
module Grid where import Data.List import Data.Foldable (Foldable(..)) import Control.Applicative transposeString :: String -> String transposeString str = concat . mergeFirsts . splitOn (=='\n') $ str splitOn :: (Char -> Bool) -> String -> [String] splitOn p s = case dropWhile p s of "" -> [] s' -> w : sp...
Lacaranian/gridhs
grid.hs
mit
8,475
0
15
2,497
4,073
2,101
1,972
142
2
{-# LANGUAGE ViewPatterns #-} module Eval where import Syntax import TypeCheck import Environment import Unbound.Generics.LocallyNameless import Control.Monad.Except import Data.Maybe (fromJust) type Eval a = ExceptT String FreshM a isNumerical :: Term -> Bool isNumerical TmZero = True isNumerical (TmSucc t) = isN...
kellino/TypeSystems
fullSimple/Eval.hs
mit
2,106
0
15
600
917
442
475
71
4
-- Author: G4BB3R import Data.List (find) import Data.Maybe (fromJust) smallest :: Int smallest = fromJust $ find (\x -> all (\y -> rem x y == 0) [11..20]) [1..] main = print smallest
Ladeia/ProjectEuler
Problem005/Haskell/solution_1.hs
mit
186
0
13
35
87
48
39
5
1
-- Problem 1 -- Find the last element of a list myLast :: [a] -> a myLast (x:xs) | length xs == 0 = x | otherwise = myLast xs -- Problem 2 -- Find the last but one element of a list. myButLast :: [a] -> a myButLast (x:xs) | length xs == 1 = x | otherwise = myButLast xs -- Problem 3 -- Fi...
pedropazello/Haskell_99_problems
lists.hs
mit
5,945
0
11
1,479
1,609
855
754
79
2
(.) :: (b -> c) -> (a -> b) -> a -> c (. (a -> b)) :: (b -> c) -> (a -> c) type b = (e -> f) (. (a -> (e -> f))) :: ((e -> f) -> c) -> (a -> c) (. (a -> e -> f)) :: ((e -> f) -> c) -> a -> c -- Doesn't look much useful. ((b -> c) .) :: (a -> b) -> (a -> c) type c = (e -> f) ((b -> (e -> f)) .) :: (a -> b) -> (a -> (...
Shakadak/tinker
curry.hs
mit
4,062
75
17
1,268
1,301
743
558
-1
-1
module Physics where -- this gives us all we need to rule supreme. Let's build things with it! import Numeric.Units.Dimensional.Prelude as D import Numeric.Units.Dimensional.NonSI import qualified Prelude import Graphics.Rendering.OpenGL as GL --quick extensions to make Dimensional more useable toQuantity :: (Num a)...
Stratege/NBody-Simulation
physics.hs
mit
5,141
0
12
860
812
437
375
34
1
-- | -- Module : Cartesian.Types -- Description : -- Copyright : (c) Jonatan H Sundqvist, 2015 -- License : MIT -- Maintainer : Jonatan H Sundqvist -- Stability : experimental|stable -- Portability : POSIX (not sure) -- -- Created _ _ 2015 -- TODO | - -- - -- SPEC | - -- - ------------...
SwiftsNamesake/Cartesian
src/Cartesian/Types.hs
mit
1,648
0
6
194
151
110
41
12
0
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Types.MetadataSpec where import Control.Monad (forM_) import Data.Aeson (decode, encode, Value(..)) import Data.Aeson.QQ import qualified Data.HashMap.Lazy as HM import Test.Hspec import Web.Mackerel.Types.Metadata spec :: Spec spec = do let metadata' = Metad...
itchyny/mackerel-client-hs
test/Types/MetadataSpec.hs
mit
963
0
23
217
282
151
131
24
1
import Data.List data Node = Node { value :: Int, adj :: [Node] } deriving Eq instance Show Node where show node = show $ value node -- source node의 집합 type Graph = [Node] topological_sort :: Graph -> [Node] topological_sort graph = reverse . concat $ [topological_sort_node x [] | x <-graph] where topologic...
jwvg0425/DSAndAlgo3
src/topological_sort/topological_sort.hs
mit
458
0
13
83
173
94
79
8
1
-- -- -- ------------------ -- Exercise 12.44. ------------------ -- -- -- module E'12'44 where
pascal-knodel/haskell-craft
_/links/E'12'44.hs
mit
106
0
2
24
13
12
1
1
0
{-# LANGUAGE DeriveDataTypeable, MultiParamTypeClasses #-} module Sortier.Merge.Check where -- $Id$ import Sortier.Merge.Param import Sortier.Netz.Type import Sortier.Netz.Check ( umrech, is_increasing ) import Sortier.Netz.Rechnung import Sortier.Netz.Example import Sortier.Netz.Bild import Autolib.Util.Bild im...
Erdwolf/autotool-bonn
src/Sortier/Merge/Check.hs
gpl-2.0
3,407
77
14
942
598
422
176
88
4
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, CPP #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} {- Copyright (C) 2011-2015 John MacFarlane <jgm@berkeley.edu> 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 ...
Twinside/pandoc
src/Text/Pandoc/ImageSize.hs
gpl-2.0
4,103
0
19
1,147
903
484
419
67
5
------------------------------------------------------------------------------- -- PARSING FUNCTIONS ------------------------------------------------------------------------------- module Parsing where import Instances import Text.ParserCombinators.ReadP import Data.List import Data.Word import Data.Char import Dat...
arnizamani/aiw
Parsing.hs
gpl-2.0
19,327
15
41
6,581
6,468
3,237
3,231
-1
-1
{-# Language OverloadedStrings #-} -- | Expresiones de ejemplos usados en matching y en parser. module TestSuite.Tests.Samples where import Equ.Types import Equ.Parser import Equ.Syntax import Equ.PreExpr import Equ.Theories.FOL hiding (true, false) import Equ.Theories.List import Equ.Theories.Arith hiding (zero) impo...
miguelpagano/equ
TestSuite/Tests/Samples.hs
gpl-3.0
4,626
0
9
1,159
1,279
707
572
114
1
{- | Module : $Header$ Description : Bools. dealwithit.jpeg. Copyright : (c) plaimi 2014 License : GPL-3 Maintainer : plailude@plaimi.net -} module Plailude.Control.Bool where if' :: Bool -> a -> a -> a -- | If 'True' then the first value, else the second. if' True = const if' False = const id fi :...
plaimi/plailude
src/Plailude/Control/Bool.hs
gpl-3.0
417
0
7
100
75
41
34
6
1
module Logic.EState where import Prelude hiding (FilePath) import Types.Base import Types.ETree import Types.EState import Types.AppConfig(Config(..)) import qualified Logic.ETree as ETree import qualified Data.Tree.Zipper as Z -- | Carries the flags from the old state to the new one/ setPreviousFlags :: EState -> ...
diegospd/pol
src/Logic/EState.hs
gpl-3.0
1,196
0
11
256
307
167
140
23
2
h x = let y = f x in g y
hmemcpy/milewski-ctfp-pdf
src/content/2.1/code/haskell/snippet02.hs
gpl-3.0
30
0
9
16
26
11
15
2
1
-- Copyright (C) 2012 Michael Zuser mikezuser@gmail.com -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -...
bacchanalia/KitchenSink
KitchenSink/Combinators.hs
gpl-3.0
2,132
0
10
460
479
295
184
38
2
{-# LANGUAGE FlexibleContexts #-} module LambdaLine.GitComm ( gitCurrentBranch , gitPushSymbol , gitRepositorySymbol , gitStagedSymbol , gitStatusSymbols , gitUnstagedSymbol , inGitRepository ) where -- internal imports import LambdaLine.Util -- import LambdaLine.Segment (Segment, mkSegment) -- external lib imports im...
josiah14/lambdaline
LambdaLine/GitComm.hs
gpl-3.0
4,365
0
14
1,280
952
492
460
70
5
import System.Environment import System.IO import Data.List import Control.Applicative import Control.Monad main :: IO () main= do files <- getArgs let headFile = head files links = tail files headHandle <- openFile (headFile) ReadMode tailHandles <- zipWithM openFile links ...
yyttr3/Mips_Preprocessor
link.hs
gpl-3.0
1,570
0
12
382
567
294
273
39
1
module Phascal.Parser (parse) where import Phascal.Ast import Phascal.Types import Text.ParserCombinators.Parsec hiding (token, parse) import Control.Applicative((<*),(*>),empty) import Control.Monad(void, liftM) keywords = [ "and" , "begin" , "div" , "do" , "else" ...
zenhack/phascal
src/Phascal/Parser.hs
gpl-3.0
4,058
0
13
1,352
1,387
716
671
138
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/CreateInstance.hs
mpl-2.0
11,754
0
10
2,551
1,474
883
591
144
1
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts, TypeFamilies, TypeOperators , StandaloneDeriving, GeneralizedNewtypeDeriving , TypeSynonymInstances, UndecidableInstances #-} {-# OPTIONS_GHC -Wall -fno-warn-orphans #-} ---------------------------------------------------------------------- -- ...
ekmett/reactive
src/FRP/Reactive/Behavior.hs
agpl-3.0
10,418
0
11
2,239
1,632
947
685
83
2
-- GSoC 2015 - Haskell bindings for OpenCog. {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} -- | This Module defines the main functions to interact with the AtomSpace -- creating/removing/modifying ...
cosmoharrigan/atomspace
opencog/haskell/OpenCog/AtomSpace/Api.hs
agpl-3.0
11,813
0
33
4,449
2,993
1,490
1,503
-1
-1
module ErrorHandling( Error(Succeeded, Failed), errorTuple, extractValue) where data Error a = Succeeded a | Failed String deriving (Show) instance Monad Error where return a = Succeeded a (Succeeded a) >>= f = f a (Failed errMsg) >>= f = (Failed errMsg) instance Eq a => Eq...
dillonhuff/CLP
src/ErrorHandling.hs
lgpl-3.0
721
0
8
172
311
163
148
22
1
import XMonad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Util.Run(spawnPipe) import XMonad.Util.EZConfig(additionalKeys) import System.IO myManageHook = composeAll [ className =? "Gimp" --> doFloat] myWorkspaces = ["1","2","3","4","5","6","7","8","9"] ++ (map snd myExtraWork...
mikelward/conf
xmonad/xmonad.hs
apache-2.0
1,118
0
16
281
297
174
123
26
1
module Language.Drasil.Plain.Helpers where import Data.String.Utils (replace) toPlainName :: String -> String toPlainName s = let illegalChars = [ ",","~","`","-","=","!","@","#","$","%","^","&","*","(",")","+", "[","]","\\",";","'",".","/","|",":","\"","<",">","?"," "] in foldl varNam...
JacquesCarette/literate-scientific-software
code/drasil-printers/Language/Drasil/Plain/Helpers.hs
bsd-2-clause
451
0
9
91
176
106
70
10
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} module Lazyfoo.Lesson13 (main) where import Control.Applicative import Control.Monad import Data.Foldable import Data.Monoid import Data.Word import Foreign.C.Types import Linear import Linear.Af...
svenkeidel/sdl2
examples/lazyfoo/Lesson13.hs
bsd-3-clause
3,965
0
31
1,078
1,126
547
579
94
7