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
len = fromIntegral . length rnd n x = (fromIntegral (floor (x * t))) / t where t = 10^n put = putStrLn . show mean xs = sum xs / (len xs) stddev xs = sqrt $ var xs var xs = (/(n-1)) $ sum [(x - m)^2 | x <- xs] where m = mean xs n = len xs covar xs ys = (/(n - 1)) . sum $ zipWith (*) [x - xm | x ...
wd0/-stats
correl.hs
mit
903
0
13
318
564
294
270
31
1
module SimpSymb where az = ['a'..'z'] data XPlus = '+' | '=' -- false x = ('+',x,'+',x,'+')
HaskellForCats/HaskellForCats
simpSymb.hs
mit
96
2
6
21
26
16
10
-1
-1
{-# LANGUAGE ScopedTypeVariables, ViewPatterns #-} {-| Module : Labyrinth.AStar Description : pathfinding Copyright : (c) deweyvm 2014 License : MIT Maintainer : deweyvm Stability : experimental Portability : unknown Implementation of the A* (A star) pathfinding algorithm. -} module Labyrinth.Pathing.ASt...
deweyvm/labyrinth
src/Labyrinth/Pathing/AStar.hs
mit
3,410
0
23
1,258
920
477
443
66
4
module Cases.Prelude ( module Exports, (?:), (|>), (<|), (|$>), ) where -- base ------------------------- import Control.Applicative as Exports hiding (WrappedArrow(..)) import Control.Arrow as Exports hiding (first, second) import Control.Category as Exports import Control.Concurrent as Exports import Con...
nikita-volkov/cases
library/Cases/Prelude.hs
mit
3,608
0
8
508
990
679
311
85
1
import BMSClipboard import System.Environment import Data.List import Debug.Trace import Data.Maybe sortObject a b | t1 < t2 = LT | t1 > t2 = GT | otherwise = compare c1 c2 where t1 = row(a) t2 = row(b) c1 = rawChannel(a) c2 = rawChannel(b) movePlayableNotesToBGM ([], bgmNotes) = bgmNot...
bemusic/bms-clipboarder
src/BGMize.hs
mit
1,142
0
14
222
390
199
191
28
1
module Http.Response ( Response (..) , response ) where import Text.ParserCombinators.Parsec hiding (token) data Response = Response { statusLine :: StatusLine , headers :: [(String,String)] , body :: String } deriving (Show) data StatusLine = StatusLine { code :: Int , reasonPhras...
ndreynolds/hsURL
src/Http/Response.hs
mit
2,472
0
10
1,050
553
291
262
64
2
{-# LANGUAGE MagicHash, MultiParamTypeClasses, TypeFamilies, DataKinds, FlexibleContexts #-} module JavaFX.Types where import Java data {-# CLASS "javafx.stage.Stage" #-} Stage = Stage (Object# Stage) deriving Class data {-# CLASS "javafx.scene.Scene" #-} Scene = Scene (Object# Scene) deriving Class data {-# C...
filippovitale/eta-playground
javafx-canvas-grid/src/JavaFX/Types.hs
mit
1,166
0
8
193
229
132
97
25
0
module ProjectEuler.Problem004Spec (main, spec) where import Test.Hspec import ProjectEuler.Problem004 main :: IO () main = hspec spec spec :: Spec spec = parallel $ describe "solve" $ it "finds the largest palindrome product of two 3-digit numbers" $ solve 3 `shouldBe` 906609
hachibu/project-euler
test/ProjectEuler/Problem004Spec.hs
mit
293
0
9
57
79
43
36
10
1
{-# LANGUAGE TupleSections #-} module Main where import SparseMatrix import Data.List (sortOn) import qualified System.IO.Strict as Strict import Data.Map.Strict (fromList, toList) main :: IO () main = Strict.readFile "hackage.graph.hs" >>= mapM_ print . (fmap . fmap) (*100) . take 20 . sortOn (negate . snd) . toL...
Magnap/pagerank-hs
src/Main.hs
mit
399
0
14
68
150
85
65
11
1
-- | Common helpers for the tests. module TestCommon ( mkApp' , key ) where import API (serveApp) import App (AppConfig(..), mkApp) import Control.Monad.Logger (runStderrLoggingT, filterLogger, LogLevel(..)) import qualified Data.Map.Strict as M import Mailgun.APIKey (APIK...
fusionapp/catcher-in-the-rye
test/TestCommon.hs
mit
845
0
11
176
205
126
79
23
1
-- | Functions for working with Jalaali calendar system. -- This library mimics the API of "Data.Time.Calendar.Gregorian". module Data.Time.Calendar.Jalaali ( isJalaaliLeapYear , toJalaali , fromJalaali , fromJalaaliValid , jalaaliMonthLength , showJalaali , addJalaaliMonthsClip , addJalaaliMonthsRollOv...
jalaali/jalaali-hs
src/Data/Time/Calendar/Jalaali.hs
mit
10,023
0
20
2,401
2,713
1,503
1,210
149
5
import RecursiveContents (getRecursiveContents) simpleFind :: (FilePath -> Bool) -> FilePath -> IO [FilePath] simpleFind p path = do names <- getRecursiveContents path return (filter p names)
zhangjiji/real-world-haskell
ch9/SimpleFinder.hs
mit
197
0
9
31
69
34
35
5
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} -- | -- Module : Network.OAuth.MuLens -- Copyright : (c) Joseph Abrahamson 2013 -- License : MIT -- -- Maintainer : [email protected] -- Stability : experimental -- Portability : non-portable -- -- Tiny, @Control.Lens@ compatibility...
tel/oauthenticated
src/Network/OAuth/MuLens.hs
mit
1,573
0
11
395
607
349
258
40
1
-- If the numbers 1 to 5 are written out in words: one, two, three, -- four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in -- total. -- If all the numbers from 1 to 1000 (one thousand) inclusive were -- written out in words, how many letters would be used? -- NOTE: Do not count spaces or hyphens. For ex...
whittle/euler
src/Euler/Problem017.hs
mit
2,402
0
11
952
547
310
237
59
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-| Copyright : (c) 2016 Dominik Schoop License : GPL v3 (see LICENSE) Maintainer : Dominik Schoop [email protected] Portability : GHC only Conversion of the graph part of a sequent (constraint system) to a JSON gr...
samscott89/tamarin-prover
lib/theory/src/Theory/Constraint/System/JSON.hs
gpl-3.0
17,300
3
18
5,537
3,347
1,812
1,535
272
6
module Main where import Control.Applicative ((<$>), (<|>)) import Control.Monad(replicateM) import qualified Data.HashMap.Strict as Map import Data.List (find) import Data.Maybe (isJust, isNothing) import Data.Monoid ((<>)) import quali...
pmiddend/sneakybeaky
src/SneakyBeaky/Main.hs
gpl-3.0
9,799
0
21
3,006
3,143
1,655
1,488
224
11
-- | Common args and parser. module OrgStat.CLI ( CommonArgs (..) , parseCommonArgs ) where import Universum import Options.Applicative.Simple (Parser, help, long, metavar, strOption, switch) -- | Read-only arguments that inner application needs (in contrast to, -- say, logging severity). data ...
volhovM/orgstat
src/OrgStat/CLI.hs
gpl-3.0
1,275
0
15
389
212
117
95
31
1
{-# LANGUAGE OverloadedStrings #-} -- file Spec.hs import Test.Hspec import Test.QuickCheck import Control.Exception (evaluate) import JobParser import Data.Text as T import Data.List as L import qualified Data.Text.IO as TIO singleLine = T.pack "E8 Unité de Soins de Longue Durée (USLD) ...
alexDarcy/shelly-examples
stages/tests/Integration.hs
gpl-3.0
1,850
0
17
453
453
215
238
42
1
{-# LANGUAGE DeriveGeneric #-} module Estuary.Types.EnsembleRequest where import Data.Time import Data.Text import GHC.Generics import Data.Aeson import Data.Sequence import Estuary.Types.View import Estuary.Types.Definition import Estuary.Types.Tempo import Estuary.Types.ResourceOp data EnsembleRequest = WriteTe...
d0kt0r0/estuary
common/src/Estuary/Types/EnsembleRequest.hs
gpl-3.0
698
0
8
100
147
87
60
26
0
module AFN where import Data.List (foldl') import MonadicSet (Set) import qualified MonadicSet as S import Regex import Transicao data AFN a = AFN { estados :: Set Int , estadosAtuais :: Set Int , aceitacao :: Set Int ...
lordao/lfc-regex
src/AFN.hs
gpl-3.0
5,514
0
15
2,163
1,842
954
888
101
3
module Game.Toliman.Graphical.SDL.Core( sdlCheckRet, sdlCheckRet', sdlCheckPtr, sdlCheckPtr', sdlCheckPred, sdlCheckPred', sdlGetError ) where import Foreign.C.Types (CInt) import Foreign.C.String (peekCAString) import Foreign.Ptr (Ptr, nullPtr) import Text.Printf (printf) import Control.Monad.Lift.IO (MonadI...
duncanburke/toliman-graphical
src-lib/Game/Toliman/Graphical/SDL/Core.hs
mpl-2.0
1,577
0
10
265
593
309
284
36
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Webhooks/Delete.hs
mpl-2.0
6,096
0
16
1,306
787
462
325
119
1
import System.Plugins import API conf = "../Plugin.hs" apipath = "../api" main = do status <- makeWith conf conf ["-i"++apipath] o <- case status of MakeFailure e -> mapM_ putStrLn e >> error "compile failed" MakeSuccess _ o -> return o m_v <- load o [ap...
Changaco/haskell-plugins
testsuite/makewith/global_pragma/prog/Main.hs
lgpl-2.1
527
0
12
189
174
80
94
15
3
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell, TypeOperators #-} -- | general GTK FRP functions. These may be split into a separate -- module in the future... module Jaek.UI.FrpTypes where import Graphics.UI.Gtk import Reactive.Banana as B import Data.Data import Data.Label type MotionEvent = ([EventModifier]...
JohnLato/jaek
src/Jaek/UI/FrpTypes.hs
lgpl-3.0
2,340
0
9
456
631
351
280
83
1
module Board (showBoard ,makeBoard ,move ,check ,flipChains ,hasMovesFor ,hasChain ,slice ,moves ,indexes ,value) where import Data.Array import DataTypes showBoard :: Board -> IO () showBoard b = putStrLn $ tablerize (prettify b) where prettify b = foldr1 (\x acc -> x ++ "\n" ++ acc) board where line r ...
guiocavalcanti/haskell-reversi
Board.hs
lgpl-3.0
3,004
0
16
807
1,479
815
664
68
2
replicate' :: Int -> a -> [a] replicate' n x | n <= 0 = [] | otherwise = x : replicate' (n - 1) x take' :: Int -> [a] -> [a] take' n _ | n <= 0 = [] take' _ [] = [] take' n (x:xs) = x : take' (n - 1) xs reverse' :: [a] -> [a] reverse' [] = [] reverse' (x:xs) = reverse xs ++ [x] repeat' :: a -> [a] repeat' x =...
alexliew/learn_you_a_haskell
code/recursion.hs
unlicense
1,045
0
11
261
530
277
253
29
1
{-# LANGUAGE TypeOperators #-} module Language.Sigil.Stack ( push , pop ) where import Control.Monad.Free import Language.Sigil.Types push :: a -> SigilProgram a () push x = liftF $ Push x () pop :: SigilProgram a () pop = liftF $ Pop () {- swap :: (s :. a :. b) -> (s :. b :. a) ...
erochest/sigil
Language/Sigil/Stack.hs
apache-2.0
1,482
0
7
519
117
77
40
10
1
module Lab4 where fp :: Eq a => (a -> a) -> a -> a fp f = \ x -> if x == f x then x else fp f (f x)
bartolkaruza/software-testing-2014-group-W1
week4/Lab4.hs
apache-2.0
103
0
9
36
70
37
33
3
2
module HEP.Automation.EventAnalysis.Command where import HEP.Automation.EventAnalysis.ProgType import HEP.Automation.EventAnalysis.Job commandLineProcess :: EventAnalysis -> IO () commandLineProcess (Single lhefp pdffp) = do putStrLn "test called" startSingle lhefp pdffp commandLineProcess (JsonTest fp) = do ...
wavewave/EventAnalysis
lib/HEP/Automation/EventAnalysis/Command.hs
bsd-2-clause
640
0
7
93
168
80
88
18
1
module Distribution.VcsRevision.Svn ( getRevision ) where import Control.Exception import System.Process import System.Exit import Data.List tryIO :: IO a -> IO (Either IOException a) tryIO = try -- | Nothing if we're not in a svn repo, Just (revision,modified) if we're in a repo. getRevision :: IO (Maybe (String, B...
jkff/vcs-revision
Distribution/VcsRevision/Svn.hs
bsd-2-clause
775
0
22
176
264
138
126
19
3
module Module2.Task10 where avg :: Int -> Int -> Int -> Double avg a b c = fromIntegral (a + b + c) / 3
dstarcev/stepic-haskell
src/Module2/Task10.hs
bsd-3-clause
105
0
9
26
53
28
25
3
1
{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} module Database.Dedalus.PrettyPrint where -- This code is initially based on -- https://github.com/pchiusano/datalog-refactoring/blob/master/src/PrettyPrint.hs import qualified Text.PrettyPrint as PP import Text.PrettyPrint (($$),(<>),(<+>))...
alanz/hdedalus
src/Database/Dedalus/PrettyPrint.hs
bsd-3-clause
1,773
0
13
403
744
381
363
42
0
module Language.ContextSemantics.CallByNeedLambda where import Language.ContextSemantics.Expressions import Language.ContextSemantics.Utilities () import Language.ContextSemantics.Output import Control.Arrow (second) import Data.List (nub) import Data.List.Zipper import Data.Maybe import Data.Nthable import Prelude...
batterseapower/context-semantics
Language/ContextSemantics/CallByNeedLambda.hs
bsd-3-clause
8,490
0
16
2,076
2,950
1,588
1,362
135
4
module Chp82 where {-- Derived instances --} {-- We explained that a typeclass is a sort of an interface that defines some behavior. A type can be made an instance of a typeclass if it supports that behavior. --} {-- We also mentioned that they're often confused with classes in languages like Java, Python, C++ a...
jamesyang124/haskell-playground
src/Chp82.hs
bsd-3-clause
7,414
0
8
1,555
291
185
106
21
1
module Snap.Snaplet.Config.Tests where ------------------------------------------------------------------------------ import Control.Concurrent import Control.Concurrent.Async import Control.Monad import qualified Data.ByteString.Char8 as BS import qualified Data.Configurator.Types as C import Data.Function import qua...
snapframework/snap
test/suite/Snap/Snaplet/Config/Tests.hs
bsd-3-clause
3,308
0
11
519
684
390
294
68
1
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module NumberSix.Handlers.TryRuby ( ruby , handler ) where -------------------------------------------------------------------------------- import Control.Applicative ((<$>)) impo...
itkovian/number-six
src/NumberSix/Handlers/TryRuby.hs
bsd-3-clause
1,999
0
12
433
418
234
184
37
3
module Main where import Network import System.IO (hPutStrLn, hClose, Handle) import Control.Concurrent (forkIO) main :: IO () main = startServer >>= handleConnections qotdService startServer :: IO Socket startServer = listenOn $ PortNumber 17 handleConnections :: (Handle -> IO ()) -> Socket -> IO () handleConne...
anler/tcp-quotes
app/Main.hs
bsd-3-clause
581
0
10
100
196
99
97
16
1
-- -- xmonad example config file. -- -- 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. -- import XMonad import Data.Monoid import System.Exit import qualified XMonad.StackSet ...
markus1189/xmonad-710
man/xmonad.hs
bsd-3-clause
9,677
5
12
2,399
1,360
851
509
82
1
import Distribution.Simple main = defaultMain
solidsnack/maccatcher
Setup.hs
bsd-3-clause
74
0
4
33
11
6
5
2
1
{-| This module provides the /Remove Weak Suffixes/ processor. Let @Wl#@ be forward closed, then @ |- <S# / W# + W, Q, T#> :f ------------------------------------- |- <S# / W# + Wl# + W, Q, T#> :f @ -} module Tct.Trs.Processor.DP.DPGraph.RemoveWeakSuffixes ( removeWeakSuffixesDeclaration , removeWe...
ComputationWithBoundedResources/tct-trs
src/Tct/Trs/Processor/DP/DPGraph/RemoveWeakSuffixes.hs
bsd-3-clause
4,815
0
16
1,157
979
540
439
-1
-1
{-# LANGUAGE UnicodeSyntax #-} import Prelude.Unicode data Tree a = Empty | Branch a (Tree a) (Tree a) deriving (Show, Eq) tree4 = Branch 1 (Branch 2 Empty (Branch 4 Empty Empty)) (Branch 2 Empty Empty) countLeaves ∷ Tree a → Int countLeaves Empty = 0 countLeaves (Branch _ Empty Empty) ...
m00nlight/99-problems
haskell/p-61.hs
bsd-3-clause
514
1
9
127
232
116
116
15
1
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TemplateHaskell #-} module Types.Posts ( ClientMessage , newClientMessage , cmDate , cmType , cmText , ClientMessageType(..) , Attachment , mkAttachment , attachmentName , attachmentFileId , attachmentURL , ClientPostType(..) , ClientPost , toClie...
aisamanra/matterhorn
src/Types/Posts.hs
bsd-3-clause
6,677
0
13
1,723
1,236
711
525
-1
-1
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.HU.Corpus ( corpus ) where import Data.String impo...
facebookincubator/duckling
Duckling/Numeral/HU/Corpus.hs
bsd-3-clause
2,236
0
9
933
486
270
216
62
1
module AI ( search , module AI.Types ) where import Types import AI.Types import Text.Printf import qualified AI.API.My as My import qualified AI.API.Tzaar as Tzaar import qualified AI.API.GameTree as GameTree search :: Board b => Algorithm -> Implementation -> Evaluation -> Position b -> Depth -> (PV, Score) sea...
sphynx/hamisado
AI.hs
bsd-3-clause
795
0
11
136
237
130
107
21
1
{-# LANGUAGE BangPatterns #-} -- | -- Module: Data.Aeson.Encoding.Builder -- Copyright: (c) 2011 MailRank, Inc. -- (c) 2013 Simon Meier <[email protected]> -- License: BSD3 -- Maintainer: Bryan O'Sullivan <[email protected]> -- Stability: experimental -- Portability: portable -- -- Efficie...
sol/aeson
Data/Aeson/Encoding/Builder.hs
bsd-3-clause
8,539
0
16
1,989
3,122
1,697
1,425
192
2
module Expression.AST where data Variable = Variable String deriving Eq data Expression = Const Int | Var Variable | BinExpr Expression BinOp Expression | MultiExpr MultiOp [Expression] | TimeDerivative Variable | TimeDerivative2 Variable data BinOp = Plus | Minus | Mult | Quotient | Exp d...
Zomega/thesis
Wurm/CAS/Expression/AST.hs
mit
354
0
7
87
90
54
36
15
0
-- Compiler Toolkit: basic error management -- -- Author : Manuel M. T. Chakravarty -- Created: 20 February 95 -- -- Copyright (c) [1995..2000] Manuel M. T. Chakravarty -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Library General Public -- License as...
jrockway/c2hs
src/Data/Errors.hs
gpl-2.0
2,860
0
9
702
327
201
126
23
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-kms/gen/Network/AWS/KMS/ListGrants.hs
mpl-2.0
6,056
0
14
1,416
941
561
380
111
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DetachInternetGateway.hs
mpl-2.0
4,256
0
11
834
520
315
205
71
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Test.AWS.Gen.WorkSpaces -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Bren...
fmapfmapfmap/amazonka
amazonka-workspaces/test/Test/AWS/Gen/WorkSpaces.hs
mpl-2.0
5,120
0
7
929
466
284
182
79
1
module Main where --import Test.Framework (defaultMain, Test, testGroup) import qualified Data.ByteString.Lazy.Builder.BasicEncoding.Tests import qualified Data.ByteString.Lazy.Builder.Tests import TestFramework main :: IO () main = defaultMain tests tests :: [Test] tests = [ testGroup "Build...
meiersi/bytestring-builder
tests/builder/TestSuite.hs
bsd-3-clause
470
0
7
85
87
57
30
12
1
{-# LANGUAGE ScopedTypeVariables #-} module Types where import Debug.Trace import Test.QuickCheck type Longitude = Double -- -180 .. 180 type Latitude = Double -- -90 .. 90 newtype Geographic = Geographic (Longitude,Latitude) deriving Show type ScreenX = Double -- -1 .. 1, + on right type ScreenY = Doubl...
andygill/willowbrae
projections/Types.hs
bsd-3-clause
4,672
0
14
1,013
1,590
879
711
88
1
{-# LANGUAGE CPP, NoMonomorphismRestriction #-} #include "fusion-phases.h" module Data.Array.Parallel.Unlifted.Stream.Segments ( streamSegsFromNestedUSSegd , streamSegsFromVectorsUSSegd , streamSegsFromVectorsUVSegd , streamSegsFromVectorsUSSegdSegmap , streamSegsFromVectorsUSSeg...
mainland/dph
dph-prim-seq/Data/Array/Parallel/Unlifted/Stream/Segments.hs
bsd-3-clause
13,609
0
19
5,181
2,086
1,164
922
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} -- | Resolving a build plan for...
AndrewRademacher/stack
src/Stack/BuildPlan.hs
bsd-3-clause
47,672
0
32
15,870
10,666
5,479
5,187
842
11
{-# LANGUAGE CPP, OverloadedStrings, RecordWildCards, ScopedTypeVariables #-} import Control.Monad (forM) import Data.Aeson (eitherDecode) import Data.Aeson.Encode import Data.Aeson.Parser (value) import Data.Aeson.Types import Data.Char (toUpper) import Test.Framework (Test, defaultMain, testGroup) import Test.Framew...
maximkulkin/aeson
tests/Properties.hs
bsd-3-clause
12,070
9
20
3,068
2,760
1,464
1,296
154
2
module Shared.Image where import qualified Graphics.UI.SDL as SDL import Shared.Lifecycle import Foreign.Ptr import Foreign.C.String getSurfaceFrom' :: FilePath -> IO (Ptr SDL.Surface) getSurfaceFrom' path = imgLoadSurface path >>= either throwSDLError return imgLoadSurface :: String -> IO (Either String (Ptr SDL....
oldmanmike/haskellSDL2Examples
src/shared/image.hs
gpl-2.0
631
0
12
128
191
99
92
15
2
{-# LANGUAGE ScopedTypeVariables, CPP, ForeignFunctionInterface, MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -- | Copyright : (c) 2010 - 2011 Simon Meier -- License : BSD3-style (see LICENSE) -- -- Maintainer : Simon Meie...
jwiegley/ghc-release
libraries/bytestring/Data/ByteString/Builder/ASCII.hs
gpl-3.0
11,618
0
15
2,547
1,786
1,023
763
132
1
module Network.Haskoin.Wallet.Settings ( SPVMode(..) , OutputFormat(..) , Config(..) ) where import Control.Monad (forM, mzero) import Control.Exception (throw) import Control.Monad.Logger (LogLevel(..)) import Data.Default (Default, def) import Data.FileEmbed (embedFile) import Data.Yaml (decodeEither') import Data....
tphyahoo/haskoin
haskoin-wallet/Network/Haskoin/Wallet/Settings.hs
unlicense
7,015
0
17
2,605
1,494
778
716
-1
-1
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} #ifndef MIN_VERSION_base #define MIN_VERSION_base(x,y,z) 1 #endif module Test.System.GPIO.TypesSpec (spec) where import Protolude import System.GPIO.Types import Data.Bits (unsafeShiftL, unsafeShiftR) import ...
dhess/gpio
test/Test/System/GPIO/TypesSpec.hs
bsd-3-clause
4,438
0
18
1,602
1,429
703
726
93
1
{-| Module : System.GPIO.Linux.Sysfs.IO Description : Linux @sysfs@ GPIO operations in IO Copyright : (c) 2019, Drew Hess License : BSD3 Maintainer : Drew Hess <[email protected]> Stability : experimental Portability : non-portable The actual Linux @sysfs@ implementation. This implementation will only fun...
dhess/gpio
src/System/GPIO/Linux/Sysfs/IO.hs
bsd-3-clause
4,945
0
11
997
841
494
347
84
1
module Data.Graph.Inductive.Internal.Heap (Heap(..), empty, unit, insert, merge, mergeAll, isEmpty, findMin, deleteMin, splitMin, build, toList, heapsort) where { data (Ord a) => Heap a b = Empty | Node a b [Heap a b] deriving Eq; sho...
ckaestne/CIDE
other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Internal/Heap.hs
gpl-3.0
2,169
0
9
661
1,136
623
513
49
1
{-# LANGUAGE CPP #-} #ifndef MIN_VERSION_profunctors #define MIN_VERSION_profunctors(x,y,z) 0 #endif ----------------------------------------------------------------------------- -- | -- Module : Data.Machine.Mealy -- Copyright : (C) 2012 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- M...
fumieval/machines
src/Data/Machine/Mealy.hs
bsd-3-clause
4,321
0
16
1,138
1,776
952
824
106
2
-- !!! make sure context of EQ is minimised in interface file. -- module ShouldSucceed where data NUM = ONE | TWO class (Num a) => ORD a class (ORD a, Show a) => EQ a where (===) :: a -> a -> Bool
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_compile/tc077.hs
bsd-3-clause
200
0
8
47
71
40
31
-1
-1
{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Data.STRef.Lazy -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : [email protected] -- Stability : ...
tolysz/prepare-ghcjs
spec-lts8/base/Data/STRef/Lazy.hs
bsd-3-clause
1,132
0
9
246
231
130
101
17
1
{-# LANGUAGE DeriveGeneric, DatatypeContexts #-} module CannotDoRep1_1 where import GHC.Generics -- We do not support datatypes with context data (Show a) => Context a = Context a deriving Generic1
urbanslug/ghc
testsuite/tests/generics/GenCannotDoRep1_1.hs
bsd-3-clause
201
0
6
32
33
21
12
4
0
module Rebase.GHC.Float ( module GHC.Float ) where import GHC.Float
nikita-volkov/rebase
library/Rebase/GHC/Float.hs
mit
71
0
5
12
20
13
7
4
0
{-# LANGUAGE ScopedTypeVariables #-} module Model.Post where import Import import qualified Database.Esqueleto as E import Database.Esqueleto((^.)) getPosts :: Int -> Int -> DB [Entity Post] getPosts page postsPerPage | page > 0 && postsPerPage > 0 = selectList [] [ Desc PostCreated , LimitTo postsPer...
isankadn/yesod-testweb-full
Model/Post.hs
mit
524
0
11
104
165
87
78
-1
-1
{-# OPTIONS -Wall -Werror #-} import Control.Applicative import Control.Exception import Control.Monad import Data.List import System.Directory import System.Environment import System.IO -- dist .lib include main :: IO () main = getArgs >>= write where write (dist : lib : inc : _) = readFile dist >>= writeIncludes ...
MichaeGon/pragma-maker-for-LLVM
pragma-maker-old.hs
mit
1,604
2
14
355
592
304
288
-1
-1
doubleMe x = x + x doubleUs x y = doubleMe x + doubleMe y doubleSmallNumber x = if x > 100 then x else x*2 doubleSmallNumber' x = (if x > 100 then x else x*2) + 1 boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
Sgoettschkes/learning
haskell/LearnYouAHaskell/old/baby.hs
mit
312
0
8
135
126
65
61
7
2
module Main where import Test.Tasty (defaultMain, testGroup, TestTree) import Utrecht.MasterMind.Test main :: IO () main = defaultMain tests tests :: TestTree tests = testGroup "All tests" [ masterMindSuite ]
kandersen/Utrecht
test/Test.hs
mit
215
2
6
35
64
37
27
8
1
{-# LANGUAGE FlexibleContexts, FlexibleInstances, GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings, PatternSynonyms #-} {-# LANGUAGE RankNTypes, ScopedTypeVariables, StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell, TypeFamilies, ConstraintKinds #-} {-# OPTIONS_GHC...
sboosali/commands
commands-core/sources/Commands/RHS/Types.hs
mit
7,485
3
12
2,003
1,681
916
765
85
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} ------------------------------------------- -- | -- Module : Web.Stripe.Dispute -- Copyright : (c) David Johnson, 2014 -- Maintainer : [email protected] ...
dmjio/stripe
stripe-core/src/Web/Stripe/Dispute.hs
mit
2,913
0
10
852
370
240
130
-1
-1
module Game.Poker.Cards ( Suit(..) , Card , allCards , cardSuit , cardNumber , cardStrength ) where -- | 4 types of card -- -- >>> Hearts -- Show -- Hearts -- -- >>> read "Hearts" :: Suit -- Read -- Hearts -- -- >>> Hearts == Hearts -- Eq -- True -...
tobynet/java-poker
src/Game/Poker/Cards.hs
mit
2,264
0
8
603
430
263
167
30
1
{-# LANGUAGE RankNTypes, ImpredicativeTypes, LiberalTypeSynonyms #-} module Treb.Config (withTrebEnv) where import qualified Hasql as H import qualified Hasql.Postgres as HP import qualified Data.Map as M import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Char8 as BC import qualified Database....
MadSciGuys/trebuchet
src/Treb/Config.hs
mit
11,175
0
19
3,036
3,087
1,599
1,488
191
2
module Main where import Codec.Picture import Codec.Picture.Types import Data.Maybe (fromJust) import Data.Word (Word8) import Data.List as L (transpose,foldl') import Text.Printf (printf) import Control.Arrow ((&&&)) import Options.Applicative import qualified Data.ByteString as B import System.IO (stdin) data Opti...
Drezil/img2ascii
src/Main.hs
mit
5,308
1
19
1,646
2,106
1,102
1,004
108
13
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module Celtchar.Novel.Structure where import Data.Yaml import GHC.Generics data Language = French | English deriving (Generic) data Document = Document FilePath deriving (Ge...
ogma-project/celtchar
src/Celtchar/Novel/Structure.hs
mit
2,311
0
17
823
579
305
274
58
2
module Handler.EditThread where import Authentification (isModeratorBySession, getThreadPermissions) import Captcha import CustomForms (threadMForm) import Import import Helper (spacesToMinus) import Widgets (threadWidget, postWidget, accountLinksW) getEditThreadR :: ThreadId -> Handler Html getEditThreadR tid = do ...
cirquit/HaskellPie
HaskellPie/Handler/EditThread.hs
mit
3,045
0
26
973
761
379
382
-1
-1
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 style where ops = ["+","*","-",";"] names = ["def","extern"] style = emptyDef { ...
raulfpl/kaleidoscope
src/chapter2/Lexer.hs
mit
946
0
8
240
301
164
137
28
1
{-# LANGUAGE MultiParamTypeClasses #-} module Core ( NonUnitVector , UnitVector , Point(..) , Ray(..) , Transform(..) , RayPosition , VectorUnaryOps(..) , VectorBinaryOps(..) , RefractiveIndex , RayWithMedium(..) , vector , normal , unsafeForceUnitVector , origin , to , normalize , normalizeWithLength , at , toRayP...
stu-smith/rendering-in-haskell
src/experiment08/Core.hs
mit
8,275
0
14
2,378
3,236
1,636
1,600
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html module Stratosphere.ResourceProperties.CloudFrontDistributionOrigin where...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/CloudFrontDistributionOrigin.hs
mit
4,862
0
13
411
617
353
264
52
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secrettargetattachment.html module Stratosphere.Resources.SecretsManagerSecretTargetAttachment w...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/SecretsManagerSecretTargetAttachment.hs
mit
3,164
0
15
317
370
211
159
37
1
{- ****************************************************************************** * JSHOP * * * * Module: TestSuite * *...
nbrunt/JSHOP
src/TestSuite.hs
mit
7,600
0
36
2,592
2,005
1,031
974
156
3
swap = id . uncurry . flip . curry
nkartashov/haskell
exam/swap.hs
gpl-2.0
38
1
7
12
21
9
12
1
1
{-# LANGUAGE TypeSynonymInstances #-} module Util.FailDoc where import Autolib.Reporter import Autolib.ToDoc import Text.ParserCombinators.Parsec class Monad m => FailDoc m where failDoc :: Doc -> m a instance FailDoc (GenParser tok st) where failDoc = fail . show instance FailDoc Reporter where failDo...
Erdwolf/autotool-bonn
src/Util/FailDoc.hs
gpl-2.0
333
0
8
63
89
48
41
11
0
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : ./OWL2/Sublogic.hs Copyright : (c) Dominik Luecke, Felix Gabriel Mance License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : provisional Portability : portable Complexity analysis of OWL2 -} module OWL2....
spechub/Hets
OWL2/Sublogic.hs
gpl-2.0
9,855
0
18
2,225
2,910
1,484
1,426
207
39
{-- -- Natume -- an implementation of Kana-Kanji conversion in Haskell -- Copyright (C) 2006-2012 Takayuki Usui -- -- 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 th...
takayuki/natume
Rensetu.hs
gpl-2.0
5,530
3
18
1,708
2,394
1,326
1,068
116
3
{-# LANGUAGE DeriveDataTypeable #-} {- lat - tool to track alerts from LWN. - Copyright (C) 2010 Magnus Therning - - 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, version 3 of the License...
magthe/lat
src/Commands/ArgTypes.hs
gpl-3.0
1,361
0
8
320
193
118
75
18
0
import Module (Root(b, d), Root(c, a))
evolutics/haskell-formatter
testsuite/resources/source/orders_parts/nested_import_entities_before_root_entities/Input.hs
gpl-3.0
39
0
6
6
24
17
7
1
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module Topology.Generate where import GHC.TypeLits -- import Data.Graph (scc, Tree(..) ) import qualified Data.HashSet as H import Data.List (tails) -- import Data.Partition (unitPartition) import Data.Fin1 import Graph import McKay type...
wavewave/qft
old/lib/Topology/Generate.hs
gpl-3.0
1,478
0
13
282
570
301
269
31
2
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADT...
tlaitinen/receipts
backend/Handler/DB/Routes.hs
gpl-3.0
2,452
0
5
405
222
148
74
43
1
module Beer where sing :: Int -> Int -> String sing e s = unlines . map verse $ reverse [s..e] verse :: Int -> String verse 0 = ucbs ++ location ++ ", " ++ bs ++ getMore ++ bottles 99 ++ location ++ ".\n" where bs = bottles 0 ucbs = "N" ++ tail bs verse n = if n>0 then bs ++ location ++ "...
ciderpunx/exercismo
src/Beer.hs
gpl-3.0
906
0
12
245
277
142
135
26
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Accounts/Clients/Invitations/List.hs
mpl-2.0
7,230
0
21
1,640
991
574
417
144
1
{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANG...
alanz/ghc-multirec
examples/main-ghc.hs
unlicense
7,813
0
17
1,947
1,611
875
736
143
9
module Tables.A004489 (a004489) where import Helpers.BaseRepresentation (toBase, fromBase) import Helpers.ListHelpers (zipWithPadding) import Helpers.Table (tableByAntidiagonals) a004489 :: Int -> Int a004489 i = fromBase 3 $ map tertSum $ zipWithPadding 0 (base3 n) (base3 k) where (n, k) = tableByAntidiagonals i ...
peterokagey/haskellOEIS
src/Tables/A004489.hs
apache-2.0
376
0
9
60
146
80
66
9
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1beta1.Scale where import GHC.Generics import Data.Text import Kubernetes.V1.ObjectMeta import Openshift.V1beta1.ScaleSpec import Op...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1beta1/Scale.hs
apache-2.0
1,616
0
9
213
141
86
55
21
0
{-# LANGUAGE PackageImports, OverloadedStrings, TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module TlsIo ( TlsIo, evalTlsIo, liftIO, throwError, readCached, randomByteString, Partner(..), opponent, isCiphered, readContentType, writeContentType, readVersion, writeVersion, readLen, writeLen, setVersio...
YoshikuniJujo/forest
subprojects/tls-analysis/client/TlsIo.hs
bsd-3-clause
18,760
285
18
3,437
6,477
3,268
3,209
492
6
----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.Parsec.Prim -- Copyright : (c) Daan Leijen 1999-2001 -- License : BSD-style (see the file libraries/parsec/LICENSE) -- -- Maintainer : [email protected] -- Stability : provisional -- Por...
OS2World/DEV-UTIL-HUGS
libraries/Text/ParserCombinators/Parsec/Prim.hs
bsd-3-clause
17,579
4
24
6,436
4,367
2,212
2,155
267
6
--Basically a brute force attempt. For larger numbers, say where a+b+c=10000, this will take a long long time. At 1000 though, it takes a minute or so triplet n = [(x,y,z) | x <- [1..(n-1)], y <- [1..(n-x)], z <- [1..(n-x-y)], x+y+z == n, z>y, z>x, y>x, x^2+y^2==z^2] problem9 = triplet 1000
thomas-oo/projectEulerHaskell
src/Problem9.hs
bsd-3-clause
293
0
11
53
158
84
74
2
1
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveGeneric #-} module MidiRhythm.NotePress ( Duration(..), Press(..), NotePress(..), Velocity(..), Pitch(..), ElapsedTime(..), PressCount(..), ) where import qualified Numeric.NonNegative.Wrapper as NonNeg import GHC.Generics newtype ElapsedTime ...
a10nik/midiRhythm
src/MidiRhythm/NotePress.hs
bsd-3-clause
979
0
8
168
323
190
133
27
0
{-# LANGUAGE StandaloneDeriving #-} import Data.List (concatMap, nub) import Data.Ratio import Data.ByteString.Char8 (pack) import Test.QuickCheck import Data.Trie import qualified Data.ByteString.UTF8 as UTF8 import qualified Text.JSONb as JSONb prop_structures_parse = samples structure_tests sam...
solidsnack/JSONb
test/SimpleUnits.hs
bsd-3-clause
5,575
0
13
1,726
2,007
1,066
941
-1
-1