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
import Data.List import Data.Char vowels = "aeiou" doubles = [ [c, c] | i <- [0..25], let c = chr (ord 'a' + i) ] bad = ["ab", "cd", "pq", "xy"] good s = hasVowels && hasDoubles && notBad where hasVowels = length (filter (`elem` vowels) s) >= 3 hasDoubles = any (`isInfixOf` s) doubles notBad = not ...
msullivan/advent-of-code
2015/A5a.hs
mit
434
0
13
105
207
116
91
11
1
module Main where -- β€’ How many different ways can you find to write allEven? allEvenComprehension :: [Integer] -> [Integer] allEvenComprehension list = [x | x <- list, even x] allEvenFilter :: [Integer] -> [Integer] allEvenFilter list = filter even list -- β€’ Write a function that takes a list and returns the...
hemslo/seven-in-seven
haskell/day1/day1.hs
mit
1,400
0
10
301
390
215
175
16
1
-- From a blog post: http://www.jonmsterling.com/posts/2012-01-12-unifying-monoids-and-monads-with-polymorphic-kinds.html {-# LANGUAGE PolyKinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances, FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FunctionalDependencies #-} ...
ghcjs/ghcjs
test/ghc/polykinds/monoidsTF.hs
mit
4,111
2
12
993
1,105
613
492
-1
-1
module Topology.Main where import Notes import Topology.MetricSpace import Topology.TopologicalSpace topology :: Note topology = chapter "Topology" $ do topologicalSpaceS metricSpaceS
NorfairKing/the-notes
src/Topology/Main.hs
gpl-2.0
229
0
7
65
42
23
19
8
1
module PrefixTree (Dict ,suggest ,suggestAny ,mkDict) where import Data.List (find, groupBy, isPrefixOf, stripPrefix) import Data.Map (Map) import Data.Maybe (maybe) import Data.Function (on) import qualified Data.Map as Map data Dict = Index (Map Char Dict) | Words [String] deriving (Show)...
holmisen/hrunner
src/PrefixTree.hs
gpl-3.0
1,209
0
16
350
460
245
215
30
2
module Hob.Ui.CommandEntrySpec (main, spec) where import Control.Monad.Reader import Data.IORef import Graphics.UI.Gtk import Graphics.UI.Gtk.General.StyleContext import Hob.Context import Hob.Context.UiContext import Hob.Control import Hob.Ui.CommandEntry import Test.Hspec import HobTest.Context.Default import Hob...
svalaskevicius/hob
test/Hob/Ui/CommandEntrySpec.hs
gpl-3.0
5,477
0
17
1,291
1,407
689
718
122
1
module Parser ( module Parser.Ast, module Parser.Utils, parse ) where import Data.Maybe import Parser.Ast import Parser.Utils import Lexer -- Define the top-level `parse` function class Parsable p where parse :: [p] -> Ast instance Parsable Char where parse s = parse $ getTokens s instance Parsable Token w...
bgw/hs-rpal
src/Parser.hs
gpl-3.0
11,824
0
16
3,609
3,422
1,750
1,672
233
13
import Network.HaskellNet.IMAP.SSL import System.Environment (getArgs) import System.Directory (getHomeDirectory) main = connectIMAP' >>= authenticate' >>= getUnreadBoxes >>= printCounts isVerbose = getArgs >>= \a -> return (not (null a) && head a == "-v") getAuth = getHomeDirectory >>= \hd -> readFile (hd ++ "/.maila...
Reyu/MailCheck
Split.hs
gpl-3.0
967
0
13
169
423
215
208
14
2
-- this is from ghc/syslib-ghc originally, module CharSeq ( CSeq, cNil, cAppend, cIndent, cNL, cStr, cPStr, cCh, cInt, cLength, cShows, cShow ) where cShow :: CSeq -> [Char] -- not used in GHC cShows :: CSeq -> ShowS cLength :: CSeq -> Int cNil :: CSeq cAppend :: CSeq -> CSeq -> CSeq ...
jwaldmann/rx
src/CharSeq.hs
gpl-3.0
2,310
56
10
582
917
486
431
62
2
module Test.StandOff.TestSetup where import Data.Map as Map hiding (drop) import Data.UUID.Types (UUID, fromString, toString) import StandOff.AnnotationTypeDefs as A import StandOff.DomTypeDefs as X import StandOff.LineOffsets as L pos :: Int -> L.Position pos p = L.Position {L.pos_offset=p, L.pos_line=1, L.pos_colu...
lueck/standoff-tools
testsuite/Test/StandOff/TestSetup.hs
gpl-3.0
1,556
0
11
588
445
253
192
32
2
{-# LANGUAGE ExistentialQuantification #-} module Hastistics.Types where import Text.Printf (printf) data HSValue = HSString String | HSInt Int | HSInteger Integer | HSDouble Double | None deriving(Eq) instance Ord HSValue where (<=) (HSString a) (HSString b) = a <= b (<=) (HSString a...
fluescher/hastistics
src/Hastistics/Types.hs
lgpl-3.0
9,594
2
11
2,882
3,991
2,106
1,885
176
1
module Main where import Data.Maybe (fromJust) import Data.List (findIndex) fib :: [Integer] fib = 1 : 1 : zipWith (+) fib (tail fib) main :: IO () main = print . (+ 1) . fromJust . findIndex ((>= 1000) . length . show) $ fib
AlexLusitania/ProjectEuler
025-fibonacci-number/Main.hs
unlicense
228
0
11
47
113
64
49
7
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -- Type definitions to avoid circular imports. module Language.K3.Codegen.CPP.Materialization.Hints where import Control.DeepSeq import Data.Binary import Data.Hashable import Data.Serialize import Data.Typeable import GHC.Generics (Generic) data Met...
DaMSL/K3
src/Language/K3/Codegen/CPP/Materialization/Hints.hs
apache-2.0
805
0
6
117
198
109
89
27
1
module Str.String where import Prelude hiding (null) import qualified Prelude as P type Str = String null :: Str -> Bool null = P.null singleton :: Char -> Str singleton c = [c] splits :: Str -> [(Str, Str)] splits [] = [([], [])] splits (c:cs) = ([], c:cs):[(c:s1,s2) | (s1,s2) <- splits cs] parts :: Str -> [[Str...
DanielG/cabal-helper
tests/bkpregex/str-impls/Str/String.hs
apache-2.0
423
0
10
84
279
160
119
15
1
module IndentInBracesAgain where f = r{ render = do make return f }
Atsky/haskell-idea-plugin
data/indentTests/IndentInBracesAgain.hs
apache-2.0
87
0
10
32
27
14
13
3
1
-- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file....
tmiw/4peas
Settings.hs
bsd-2-clause
2,645
0
14
490
320
202
118
-1
-1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGraphicsSceneHelpEvent.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:21 Warning : this file is machine gene...
keera-studios/hsQt
Qtc/Gui/QGraphicsSceneHelpEvent.hs
bsd-2-clause
4,319
0
12
568
987
509
478
-1
-1
{-# LANGUAGE TupleSections #-} {-| Auto-repair tool for Ganeti. -} {- Copyright (C) 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the...
apyrgio/snf-ganeti
src/Ganeti/HTools/Program/Harep.hs
bsd-2-clause
20,587
0
23
7,211
3,568
1,867
1,701
320
7
{-# LANGUAGE OverloadedStrings #-} module CurrentCmd where import Data.Text (Text) import qualified Data.Text as T import Text.Printf -- friends import Time import Record import RecordSet -- This command doesn't actually use any command line arguments -- but still respects the spec. currentCmd :: ZonedTime -> [Strin...
sseefried/task
src/CurrentCmd.hs
bsd-3-clause
627
0
14
143
142
77
65
16
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIO...
adinapoli/myo
src/Myo/WebSockets/Types.hs
bsd-3-clause
11,449
0
16
2,108
2,774
1,485
1,289
308
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} module Test.Tasty.Hspec ( -- * Test testSpec -- * Options -- | === Re-exported from <https://hackage.haskell.org/package/tasty-smallcheck tasty-smallcheck> , SmallCheckDepth(..) -- | === Re-exported from <https://hackage.haskell.org/pac...
markus1189/tasty-hspec
Test/Tasty/Hspec.hs
bsd-3-clause
3,986
0
15
1,075
968
540
428
71
1
{- - Claq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Claq. - Claq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} module Data.C...
ti1024/claq
src/Data/ClassicalCircuit.hs
bsd-3-clause
805
0
9
140
192
112
80
14
0
module Graphics.UI.SDL.Basic ( -- * Initialization and Shutdown init, initSubSystem, quit, quitSubSystem, setMainReady, wasInit, -- * Configuration Variables addHintCallback, clearHints, delHintCallback, getHint, setHint, setHintWithPriority, -- * Error Handling clearError, getError, setError, -- ...
ekmett/sdl2
Graphics/UI/SDL/Basic.hs
bsd-3-clause
3,737
64
11
531
986
529
457
79
1
module EarleyExampleSpec where import EarleyExample (grammar, NumberWord, Expected) import qualified Text.Earley as E import qualified Data.List.NonEmpty as NonEmpty import Test.Hspec (Spec, hspec, describe, it, shouldMatchList) -- | Required for auto-discovery. spec :: Spec spec = describe "EarleyExample" $ do ...
FranklinChen/twenty-four-days2015-of-hackage
test/EarleyExampleSpec.hs
bsd-3-clause
665
0
14
116
194
110
84
16
1
module Consts where import Data.Text -- | TODO: move to SDL module type WindowName = Text mainWindowName :: WindowName mainWindowName = "mainWindow"
Teaspot-Studio/gore-and-ash-game
src/client/Consts.hs
bsd-3-clause
153
0
4
26
26
17
9
5
1
{-# LANGUAGE TypeFamilies, ExistentialQuantification, FlexibleInstances, UndecidableInstances, FlexibleContexts, ScopedTypeVariables, MultiParamTypeClasses #-} -- | The Signal module serves as a representation for the combined shallow and -- deep embeddings of sequential circuits. The shallow portion is repren...
andygill/kansas-lava
Language/KansasLava/Signal.hs
bsd-3-clause
18,502
177
15
5,530
6,300
3,284
3,016
258
1
{-# LANGUAGE MultiParamTypeClasses #-} -- Standard modules. import Control.Monad import Control.Monad.Trans import Data.List import qualified Data.Map as M import Data.Maybe import System.Random -- Modules provided by this library. import Control.Monad.Dist import Control.Monad.Maybe import Control.Monad.Perhaps impo...
emk/haskell-probability-monads
examples/Probability.hs
bsd-3-clause
7,598
0
11
1,588
2,033
1,055
978
161
4
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE...
AlexaDeWit/haskellsandboxserver
src/db/Schema.hs
bsd-3-clause
1,356
0
8
310
194
112
82
29
1
{-# LANGUAGE CPP, DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : Language.Python.Common.SrcLocation -- Copyright : (c) 2009 Bernie Pope -- License : BSD-style -- Maintainer : bjpop@csse.unimelb.edu.au -- Stability : experimental -- P...
jb55/language-javascript
src/Language/JavaScript/Parser/SrcLocation.hs
bsd-3-clause
9,900
0
11
2,494
1,939
1,081
858
182
5
module Data.Name.Iso where import Data.Name import Control.Lens import qualified Language.Haskell.TH as TH nameIso :: Iso String String (Maybe Name) Name nameIso = iso nameMay unName -- | unsafe -- >>> "hello" ^. nameIso' -- hello nameIso' :: Iso' String Name nameIso' = iso toName unName -- | there are lack of info...
kmyk/proof-haskell
Data/Name/Iso.hs
mit
414
0
8
72
118
67
51
10
1
module Model ( AgentId , SugAgentState (..) , SugAgentObservable (..) , SugEnvCellOccupier (..) , SugEnvCell (..) , SugEnvironment , SugContext (..) , SugAgent , SugAgentMonad , SugAgentIn (..) , SugAgentOut (..) , nextAgentId , getEnvironment , (<Β°>) , sugarGrowbackUnits ...
thalerjonathan/phd
thesis/code/concurrent/sugarscape/SugarScapeSTMTArray/src/Model.hs
gpl-3.0
4,511
0
12
941
895
515
380
107
4
{- Copyright 2019 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
alphalambda/codeworld
codeworld-auth/src/CodeWorld/Auth/Util.hs
apache-2.0
1,685
0
10
364
317
173
144
27
2
{-| Module : Base Description : Base/radix module for the MPL DSL Copyright : (c) Rohit Jha, 2015 License : BSD2 Maintainer : rohit305jha@gmail.com Stability : Stable Functionality for: * Converting decimal numbers to binary, octal, hexadecimal or any other base/radix * Converting numbers from binary, ...
rohitjha/DiMPL
src/Base.hs
bsd-2-clause
5,416
0
12
1,337
567
302
265
47
2
{-# LANGUAGE ScopedTypeVariables #-} module Properties.Layout.Tall where import Test.QuickCheck import Instances import Utils import XMonad.StackSet hiding (filter) import XMonad.Core import XMonad.Layout import Graphics.X11.Xlib.Types (Rectangle(..)) import Data.Maybe import Data.List (sort) import Data.Ratio ---...
Happy-Ferret/xmonad
tests/Properties/Layout/Tall.hs
bsd-3-clause
3,761
0
13
1,100
1,013
531
482
67
2
{-| Module : Fit Copyright : Copyright 2014-2015, Matt Giles License : Modified BSD License Maintainer : matt.w.giles@gmail.com Stability : experimental -} module Fit ( -- * Messages API -- $messages readMessages, readFileMessages, parseMessages, Messages(..), Message(..), Field(..), Va...
bitemyapp/fit
src/Fit.hs
bsd-3-clause
1,671
0
5
337
136
101
35
26
0
module Data.Tiled ( module X , module Data.Tiled ) where import Data.Tiled.Load as X import Data.Tiled.Types as X import Data.Vector (Vector, force, slice) -- | Yield a slice of the tile vectors without copying it. -- -- The vectors must be at least x+w wide and y+h tal...
chrra/htiled
src/Data/Tiled.hs
bsd-3-clause
822
0
14
204
199
113
86
18
1
{-# LANGUAGE FlexibleInstances #-} module Kalium.Nucleus.Vector.Show where import Kalium.Prelude import Kalium.Nucleus.Vector.Program deriving instance Show NameSpecial deriving instance Show Literal instance Show Name where show = \case NameSpecial op -> show op NameGen n -> "_" ++ show n insta...
rscprof/kalium
src/Kalium/Nucleus/Vector/Show.hs
bsd-3-clause
952
0
13
277
338
162
176
-1
-1
module Data.IP.Op where import Data.Bits import Data.IP.Addr import Data.IP.Mask import Data.IP.Range ---------------------------------------------------------------- {-| >>> toIPv4 [127,0,2,1] `masked` intToMask 7 126.0.0.0 -} class Eq a => Addr a where {-| The 'masked' function takes an 'Addr' and a con...
greydot/iproute
Data/IP/Op.hs
bsd-3-clause
3,378
0
11
675
477
259
218
29
1
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "Control/Concurrent/STM/TBQueue.hs" #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# LANGUAGE CPP, DeriveDataTypeable #-} {-# LANGUAGE Trustworthy #-} --------------------------------------------------------------------------...
phischu/fragnix
tests/packages/scotty/Control.Concurrent.STM.TBQueue.hs
bsd-3-clause
6,106
0
21
1,692
1,290
647
643
119
3
{-# LANGUAGE OverloadedStrings #-} -- Module : Network.AWS.Internal.Log -- Copyright : (c) 2013-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the...
romanb/amazonka
amazonka/src/Network/AWS/Internal/Log.hs
mpl-2.0
1,623
0
13
356
315
172
143
25
1
{-# LANGUAGE CPP #-} -- | Groups black-box tests of cabal-install and configures them to test -- the correct binary. -- -- This file should do nothing but import tests from other modules and run -- them with the path to the correct cabal-install binary. module Main where -- Modules from Cabal. import Distributi...
garetxe/cabal
cabal-install/tests/IntegrationTests.hs
bsd-3-clause
12,691
0
16
2,596
2,826
1,479
1,347
210
4
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module: Web.Twitter.Conduit -- Copyright: (c) 2014 Takahiro Himura -- License: BSD -- Maintainer: Takahiro Himura <taka@himura.jp> -- Stability: experimental -- Portability: portable -- -- A client library for Twitter APIs (see <ht...
johan--/twitter-conduit
Web/Twitter/Conduit.hs
bsd-2-clause
6,423
0
5
1,258
357
295
62
39
0
module Test.Tests where import Test.Framework import Test.AddDays import Test.ClipDates import Test.ConvertBack import Test.LongWeekYears import Test.TestCalendars import Test.TestEaster import Test.TestFormat import Test.TestMonthDay import Test.TestParseDAT import Test.TestParseTime import Test.TestTime import Test...
bergmark/time
test/Test/Tests.hs
bsd-3-clause
619
0
5
150
120
75
45
27
1
module RmOneParameter.D2 where {-remove parameter 'ys' from function 'sumSquares'. This refactoring affects module 'D1', and 'A1'. This aims to test removing a parameter from a recursion function-} sumSquares (x:xs) = sq x + sumSquares xs sumSquares [] = 0 sq x = x ^ pow pow =2
RefactoringTools/HaRe
test/testdata/RmOneParameter/D2.expected.hs
bsd-3-clause
289
0
7
57
59
31
28
5
1
-- | This is mostly dummy, JHC does not support inexact exceptions. module Control.Exception where import Prelude hiding(catch) import qualified Prelude as P type IOException = IOError data Exception = IOException IOException -- throw :: Exception -> a assert :: Bool -> a -> a assert True x = x assert False _ = e...
m-alvarez/jhc
lib/haskell-extras/Control/Exception.hs
mit
1,617
0
10
428
750
372
378
40
2
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import Accumulate (accumulate) import System.Exit (ExitCode(..), exitWith) import Data.Char (toUpper) exitProperly :: IO Counts -> IO () exitProperly m = do counts <- m exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 ...
ullet/exercism
haskell/accumulate/accumulate_test.hs
mit
1,400
1
14
281
532
290
242
34
2
import Map import P import Q main = do x <- foo print (mymember 5 x)
mfine/ghc
testsuite/tests/cabal/sigcabal02/Main.hs
bsd-3-clause
78
1
9
25
39
18
21
6
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module T13674 where import Data.Proxy import Dat...
sdiehl/ghc
testsuite/tests/indexed-types/should_fail/T13674.hs
bsd-3-clause
1,544
0
11
332
670
360
310
-1
-1
{-# LANGUAGE TemplateHaskell, StandaloneDeriving, GeneralizedNewtypeDeriving, DeriveDataTypeable, TypeFamilies, FlexibleInstances, MultiParamTypeClasses, BangPatterns #-} module Distribution.Server.Features.DownloadCount.State where import Data.Time.Calendar (Day(..)) import Data.Version (Ver...
ocharles/hackage-server
Distribution/Server/Features/DownloadCount/State.hs
bsd-3-clause
10,210
0
17
1,971
2,683
1,413
1,270
194
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.Strip -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides an library interface to the @strip@ program. module Distribution.Simple.Program.Strip...
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Program/Strip.hs
bsd-3-clause
2,876
0
20
882
539
281
258
43
8
{-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.DynamicWorkspaceOrder -- Copyright : (c) Brent Yorgey 2009 -- License : BSD-style (see LICENSE) -- -- Maintainer : <byorgey@gmail.com> -- Stability : expe...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Actions/DynamicWorkspaceOrder.hs
bsd-2-clause
6,450
0
20
1,256
1,139
624
515
74
2
{- Haskell version of ... ! Text of rule base for Boyer benchmark ! ! Started by Tony Kitto on 6th April 1988 ! ! Changes Log ! ! 07-04-88 ADK Corrected errors in rules ! 08-04-88 ADK Modified "or" rule to remove extra f...
philderbeast/ghcjs
test/nofib/spectral/boyer2/Rulebasetext.hs
mit
15,416
0
5
8,947
343
229
114
109
1
module A where data A = A other :: Int other = 2 -- | Doc for test2 test2 :: Bool test2 = False -- | Should show up on the page for both modules A and B data X = X -- ^ Doc for consructor -- | Should show up on the page for both modules A and B reExport :: Int reExport = 1
DavidAlphaFox/ghc
utils/haddock/html-test/src/A.hs
bsd-3-clause
279
0
5
72
52
33
19
9
1
module Main where import Control.Concurrent main = do c <- newChan let writer = writeList2Chan c "Hello World\n" forkIO writer let reader = do char <- readChan c if (char == '\n') then return () else do putChar char; reader reader
urbanslug/ghc
testsuite/tests/concurrent/should_run/conc002.hs
bsd-3-clause
262
4
15
72
101
47
54
11
2
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} module Stutter.Parser where import Control.Applicative import Control.Monad import Text.Read (readMaybe) import Data.Attoparsec.Text ((<?>)) import qualified Data.Attoparsec.Text as Atto import qualified Data.Text as T import Stutter.Producer hiding (Produc...
nmattia/stutter
src/Stutter/Parser.hs
mit
5,112
0
14
1,047
1,176
645
531
113
4
-- This source code is distributed under the terms of a MIT license, -- Copyright (c) 2016-present, SoundCloud Ltd. -- All rights reserved. -- -- This source code is distributed under the terms of a MIT license, -- found in the LICENSE file. {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOp...
soundcloud/haskell-kubernetes
server/Main.hs
mit
519
0
8
86
71
45
26
10
1
module Euler008 (euler8) where import Common import Data.Char euler8 :: Int euler8 = maximum [product adjacents | adjacents <- sliding 13 num] num :: [Int] num = map digitToInt "\ \73167176531330624919225119674426574742355349194934\ \96983520312774506326239578318016984801869478851843\ \8586156078911294...
TrustNoOne/Euler
haskell/src/Euler008.hs
mit
1,324
0
9
134
67
37
30
7
1
module Types( Matrix(..), Point(..), Point3d(..), IntPoint, IntPoint3d, GLPoint, GLPoint3d, Line(..), Line3d(..), Viewport(..), Axis, mkViewport, translateMatrix, scaleMatrix, rotationMatrix, translate3d, scale3d, rotate3d ) where import Graphics.Rendering.OpenGL.Raw.Core31 data Ma...
5outh/Haskell-Graphics-Projects
Project3/Types.hs
mit
1,881
0
14
467
1,058
637
421
48
3
module Y2017.M07.D04.Exercise where {-- Another Mensa-puzzler from the Genius Mensa Quiz-a-Day Book by Dr. Abbie F. Salny. July 2 problem: Jemima has the same number of brothers as she has sisters, but her brother, Roland, has twice as many sisters as he has brothers. How many boys and girls are there in this family...
geophf/1HaskellADay
exercises/HAD/Y2017/M07/D04/Exercise.hs
mit
805
0
7
160
182
108
74
17
1
{-# LANGUAGE FlexibleContexts #-} module Metropolis (arb) where import Data.Random arb :: (Distribution Uniform a, Distribution Uniform b, Ord a, Num b, Ord b) => (a->b) -> (a,a) -> b -> RVar a arb f (low, high) top = do site <- uniform low high test <- uniform 0 top if f site > test then return site else a...
rprospero/NeutronPipe
Metropolis.hs
mit
341
0
9
76
161
84
77
10
2
fromJust (Just v) = v -- data E = Constant Int | Var String | StrictCall String [E] | IfThenElse E E E | FunctionCall String [E] data Fb = [String] := E type F = (String, Fb) -- f_f = ("f", ["x"] := IfThenElse (Var "x") (StrictCall "*" [Var "x", FunctionCall "f" [StrictCall "-" [Var "...
orchid-hybrid/absint-study
Ch2_Strictness.hs
gpl-2.0
1,371
0
15
339
609
318
291
31
2
module TypedPE where import Data.List (union, intersect, (\\)) import Exp import Type import TypedExp data PrefixSpecies = LambdaPT | FixPT | LetPT deriving (Show, Eq) type TypedPrefix = (PrefixSpecies, Id, Type) type TypedPE = ([TypedPrefix], TypedExp) prefixSpecies :: TypedPrefix -> PrefixSpecies prefixSpecies (p,...
pbevin/milner-type-poly
src/TypedPE.hs
gpl-2.0
1,908
0
12
449
746
417
329
42
6
{-| Unittest runner for ganeti-htools -} {- Copyright (C) 2009, 2011 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 vers...
ekohl/ganeti
htools/test.hs
gpl-2.0
4,312
0
20
1,317
1,191
631
560
103
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module Dolls.Controller where import Control.Lens ((^.)) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE)...
emhoracek/smooch
app/src/Dolls/Controller.hs
gpl-3.0
6,052
0
26
1,613
1,499
758
741
120
3
{-# LANGUAGE OverloadedStrings #-} -- | A simple fileserver that uses the @sendfile(2)@ system call: -- -- - receive and parse the incoming request, and -- -- - @sendfile@ the requested file. -- module Main where import Data.ByteString.Char8 () import Network.Socket ( Socket ) import Network.Socket.ByteString ( sen...
scvalex/dissemina2
SendFile.hs
gpl-3.0
676
0
8
123
147
81
66
16
1
module System.DevUtils.Parser.KV.ByteString ( defaultKV, runKV, weirdKV ) where -- runKV defaultKV ";a=1\r\nb=2\rc=1\nd=2\r\ne=1\n>f=odkgodkgsdo" -- runKV weirdKV "h>1.g>2{....}p>1" import Text.Parsec import Text.Parsec.ByteString import qualified Data.ByteString.Char8 as B import Data.Maybe type Pair = (B.ByteSt...
adarqui/DevUtils-Parser
src/System/DevUtils/Parser/KV/ByteString.hs
gpl-3.0
2,001
1
13
434
867
440
427
68
2
module Teb.Types where type CurrentWorkingDirectory = String type Arguments = [String] type TebManifestFile = String type RemoteLocator = String
ignesco/teb-h
Teb/Types.hs
gpl-3.0
146
0
5
20
33
22
11
5
0
module Murex.Syntax.Abstract where import Import import Data.Sequence ( Seq, (|>), (<|), (><) , ViewL(..), ViewR(..), viewl, viewr) import qualified Data.Sequence as S import Data.Foldable (toList) data AST = Lit Literal | Sequence [AST] | Record (AList Label AST) | Va...
Zankoku-Okuno/murex
Murex/Syntax/Abstract.hs
gpl-3.0
4,869
0
12
1,696
1,405
769
636
87
3
module Utils ( squear , mag2 , indexToK , indexFromK ) where import Control.Monad (join) import Data.Complex (Complex(..), realPart, conjugate) squear :: Num a => a -> a squear = join (*) mag2 :: RealFloat a => Complex a -> a mag2 x = realPart $ (conjugate x) * x -- functions to convert indexies [0..(n-1...
AlexanderKoshkarov/spectralHaskellRepa
src/Utils.hs
gpl-3.0
609
0
9
161
249
135
114
21
1
module Util.Shuffle (shuffle) where import System.Random import Data.Map as M hiding (foldl) fisherYatesStep :: RandomGen g => (Map Int a, g) -> (Int, a) -> (Map Int a, g) fisherYatesStep (m, gen) (i, x) = ((insert j x . insert i (m ! j)) m, gen') where (j, gen') = randomR (0, i) gen fisherYates :: RandomGen ...
EPashkin/gamenumber-gloss
src/Util/Shuffle.hs
gpl-3.0
653
0
11
148
350
193
157
15
1
-- https://esolangs.org/wiki/Brainfuck -- Build: ghc --make brainfuck -- Usage: brainfuck SRC-FILE import Data.Char(chr,ord) import System.Environment(getArgs) bf :: Integral cell => (String,String) -> [cell] -> [cell] -> Maybe cell -> String -> String bf ([],_) _ _ _ _ = [] bf ('>':prog,rprog) (cell:tape) rtape eof...
qpliu/esolang
featured/brainfuck.hs
gpl-3.0
1,931
0
10
302
1,072
580
492
37
1
module Tracker where import BEncode import Torrent.Env import Peer import CompactPeer import HTorrentPrelude import Data.Attoparsec.ByteString import qualified Data.ByteString.Char8 as CBS import Network.HTTP import Network.HTTP.Types.URI import Network.Socket import Network.URI formatRequest :: TorrentInfo -> Reque...
ian-mi/hTorrent
Tracker.hs
gpl-3.0
1,658
0
16
389
521
290
231
38
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE DeriveDataTypeable #-} module Data.Ephys.Spike where import Data.Ephys.Timeseries.Filter import Data.Ord (comparing) import Da...
imalsogreg/tetrode-ephys
lib/Data/Ephys/Spike.hs
gpl-3.0
5,629
0
13
1,375
1,096
591
505
101
2
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} module Main where import Control.Applicative import Control.Lens import Control.Monad.IO.Class import Control.Monad.Trans.Either import qualified Data.Attoparsec.ByteString.Char8 as A import qualified Data.ByteStri...
wavewave/lhc-analysis-collection
heavyhiggs/optresult.hs
gpl-3.0
6,385
0
20
1,586
2,340
1,274
1,066
129
2
module Engine.Graphics.Render(render) where import Engine.Graphics.Render.Depth import Engine.Graphics.Render.Light import Engine.Graphics.Render.ShadowVolume import qualified Graphics.GLUtil.Camera3D as GLUtilC import Graphics.Rendering.OpenGL import qualified Graphi...
halvorgb/AO2D
src/Engine/Graphics/Render.hs
gpl-3.0
3,641
0
13
1,254
794
405
389
74
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-cloudhsm/gen/Network/AWS/CloudHSM/DeleteHsm.hs
mpl-2.0
3,252
0
9
774
450
273
177
56
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/BillingAccounts/Locations/Operations/Cancel.hs
mpl-2.0
7,009
0
16
1,448
797
472
325
121
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Instances/Tables/Create.hs
mpl-2.0
5,999
0
17
1,331
795
466
329
120
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adsense-host/gen/Network/Google/Resource/AdSenseHost/CustomChannels/Insert.hs
mpl-2.0
3,363
0
14
741
386
232
154
64
1
{-# LANGUAGE NoMonomorphismRestriction #-} -- | -- Module : GameKeeper.Nagios -- Copyright : (c) 2012-2015 Brendan Hay <brendan@soundcloud.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found i...
brendanhay/gamekeeper
src/GameKeeper/Nagios.hs
mpl-2.0
4,324
0
11
1,404
1,082
584
498
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {- | Module : $Header$ Description : Entities for tests. Copyright : (c) plaimi 2014-2015 License : AGPL-3 M...
plaimi/tempuhs-server
test/Tempuhs/Spoc/Entity.hs
agpl-3.0
6,897
0
14
1,434
1,744
973
771
126
8
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} module Language.Haskell.Brittany.Internal ( parsePrintModule , parsePrintModuleTests , pPrintModule , pPrintModuleAndCheck -- re-export from utils: , parseModule , parseModuleFromString , extractComment...
lspitzner/brittany
source/library/Language/Haskell/Brittany/Internal.hs
agpl-3.0
24,946
0
24
6,505
5,707
2,974
2,733
527
17
module PhhhbbtttEither where import Test.QuickCheck import Test.QuickCheck.Checkers import Test.QuickCheck.Classes data PhhhbbtttEither b a = Left a | Right b deriving (Eq, Show) -- Required for checkers instance (Eq a, Eq b) => EqProp (PhhhbbtttEither b a) where (=-=) = eq -- QuickCheck arbitrary instance (Arbitrar...
dmp1ce/Haskell-Programming-Exercises
Chapter 18/MonadInstances/src/PhhhbbtttEither.hs
unlicense
1,479
0
12
281
509
265
244
32
1
ans s [] = if s == 0 then "YES" else "NO" ans s (l:ls) = case l of "A" -> ans (s+1) ls "Un" -> if s == 0 then "NO" else ans (s-1) ls main = do _ <- getLine c <- getContents let i = lines c o = ans 0 i putStrLn o
a143753/AOJ
2738.hs
apache-2.0
241
0
11
86
141
70
71
11
4
{-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -O2 #-} -- | * Author: Jefferson Heard (jefferson.r.heard at gmail.com) -- -- * Copyright 2008 Renaissance Computing Institute < http://www.renci.org > -- -- * License: GNU LGPL -- -- * Compatibility GHC (I could change the data declarations to not be...
ghc-ios/FTGLES
Graphics/Rendering/FTGL.hs
bsd-2-clause
13,564
0
15
2,357
2,551
1,342
1,209
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Scoutess.Service.Source.Dir (fetchDir, fetchVersionsDir) where import Control.Monad.Trans (MonadIO, liftIO) import Data.Monoid ((<>)) import Data.Set (singleton) import Data.Text (pack) import Data.Version (showVersion) import Distribution.PackageDescription.Parse (readPackag...
cartazio/scoutess
Scoutess/Service/Source/Dir.hs
bsd-3-clause
1,631
0
15
351
411
210
201
36
2
{-#LANGUAGE ScopedTypeVariables, QuasiQuotes, OverloadedStrings #-} module Web.Horse.Forms.Basic where import Control.Arrow import Data.Monoid textField :: String -> Maybe String -> String -> String -> String textField label err val name = mconcat $ [ maybe "" (\x -> mconcat ["<span class=\"error\">", x, ...
jhp/on-a-horse
Web/Horse/Forms/Basic.hs
bsd-3-clause
1,334
0
11
414
334
191
143
28
2
import Control.Concurrent import Control.Concurrent.STM.TChan import Control.Monad import Control.Monad.STM import Quant.MatchingEngine.BasicTypes import Quant.MatchingEngine.Book import Quant.MatchingEngine.Feed import Quant.MatchingEngine...
tdoris/StockExchange
Main.hs
bsd-3-clause
4,420
0
12
853
1,122
556
566
72
3
----------------------------------------------------------------------------- -- -- Module : Language.Haskell.Parser.ParsePostProcess -- Copyright : -- License : AllRightsReserved -- -- Maintainer : -- Stability : -- Portability : -- -- Description: Post processing for the Haskell Parser suite. -- -- ...
emcardoso/CTi
src/Haskell/Parser/ParsePostProcess.hs
bsd-3-clause
8,149
0
14
1,942
1,880
954
926
136
5
{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-} -- | -- Module: Data.Aeson.Parser.Internal -- Copyright: (c) 2011, 2012 Bryan O'Sullivan -- (c) 2011 MailRank, Inc. -- License: Apache -- Maintainer: Bryan O'Sullivan <bos@serpentine.com> -- Stability: experimental -- Portability: portabl...
beni55/aeson
Data/Aeson/Parser/Internal.hs
bsd-3-clause
12,821
0
31
3,922
3,330
1,731
1,599
254
9
module Language.SOS.Data.Rule where newtype Rule = Rule Name [Premiss] Conclusion [CompileTimeCondition] [RuntimeCondidtion] deriving (Eq, Ord, Show) type Name = String type Premiss = Transformation type Conclusion = Transformation newtype CompileTimeCondition = CTC newtype RuntimeCondition = RTC
JanBessai/hsos
src/Language/SOS/Data/Rule.hs
bsd-3-clause
309
3
8
47
75
46
29
-1
-1
module Math.Probably.Student where import Numeric.LinearAlgebra import Math.Probably.FoldingStats import Text.Printf --http://www.haskell.org/haskellwiki/Gamma_and_Beta_function --cof :: [Double] cof = [76.18009172947146,-86.50532032941677,24.01409824083091, -1.231739572450155,0.001208650973866179,-0.000005395...
glutamate/probably-baysig
src/Math/Probably/Student.hs
bsd-3-clause
2,739
0
16
688
1,259
662
597
56
1
{-# LANGUAGE TemplateHaskell #-} module Gifter.Giveaway.Internal where import Control.Lens import qualified Data.Text as T type Points = Integer data GiveawayStatus = Open Points | Closed | ContributorsOnly | AlreadyOwn | NoLogin | Entered | MissingBaseGame ...
arjantop/gifter
src/Gifter/Giveaway/Internal.hs
bsd-3-clause
674
0
10
251
136
83
53
24
0
{- This file is part of the Haskell package cassava-streams. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at git://pmade.com/cassava-streams/LICENSE. No part of cassava-streams package, including this file, may be copied, modified, propagated, or dist...
pjones/cassava-streams
bin/tutorial.hs
bsd-3-clause
938
0
10
140
102
57
45
11
3
{- Lets.RoseTree A Rose Tree (or multi-way tree) is a tree structure with a variable and unbounded number of branches at each node. This implementation allows for an empty tree. References [1] Wikipedia, "Rose Tree", http://en.wikipedia.org/wiki/Rose_tree [2] Jeremy Gibbons, "Origami Programming", appears in The F...
peterson/lets-tree
src/Lets/RoseTree.hs
bsd-3-clause
1,983
0
8
475
603
324
279
47
1
import Test.Hspec import Test.QuickCheck import Lib main :: IO () main = hspec $ do describe "Prelude.head" $ do it "returns the first element of a list" $ do head [23..] `shouldBe` (23 :: Int) it "returns the first element of an *arbitrary* list" $ property $ \x xs -> head (x:xs) == (x :: Int)...
kazeula/haskell-json-sample
test/Spec.hs
bsd-3-clause
322
0
16
82
115
59
56
10
1
{- | Module : SAWScript.SBVModel Description : Abstract representation for .sbv file format. Maintainer : jhendrix Stability : provisional -} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module SAWScript.SBVModel where import Data.Binary import Data.List(sortBy) import Control.Mon...
GaloisInc/saw-script
src/SAWScript/SBVModel.hs
bsd-3-clause
7,300
0
19
2,598
2,466
1,256
1,210
212
1
{-# LANGUAGE CPP #-} -- #hide -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.Types -- Copyright : (c) Sven Panne 2009 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability : ...
Laar/OpenGLRawgen
BuildSources/Types.hs
bsd-3-clause
1,632
0
15
342
278
178
100
34
0
import System.Environment (getArgs) import Data.List.Split (splitOn) import Data.List (intercalate, intersect) doIntersect :: Eq a => [[a]] -> [a] doIntersect l = intersect (head l) (last l) main :: IO () main = do [inpFile] <- getArgs input <- readFile inpFile putStr . unlines . map (intercalate "," . d...
nikai3d/ce-challenges
easy/intersection.hs
bsd-3-clause
380
0
15
74
171
87
84
10
1
module Render.Stmts.Poke.SiblingInfo where import Prettyprinter import Polysemy import Polysemy.Input import Relude import Error import Marshal.Scheme import Spec.Name data SiblingInfo a = SiblingInfo { siReferrer :: Doc () -- ^ How to ref...
expipiplus1/vulkan
generate-new/src/Render/Stmts/Poke/SiblingInfo.hs
bsd-3-clause
688
0
12
201
178
101
77
-1
-1