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
-- | The endpoints on the server module Development.Shake.Internal.History.Cloud( Cloud, newCloud, addCloud, lookupCloud ) where import Development.Shake.Internal.Value import Development.Shake.Internal.Core.Database import Development.Shake.Internal.History.Types import Development.Shake.Internal.History.Net...
ndmitchell/shake
src/Development/Shake/Internal/History/Cloud.hs
bsd-3-clause
3,161
0
18
657
1,261
650
611
62
2
module BFS where -- Creating tree ds data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show) -- DFS traverseBFS :: Tree a -> [a] traverseBFS tree = tbf [tree] where tbf [] = [] tbf xs = map nodeValue xs ++ tbf (concat (map leftAndRightNodes xs)) nodeValue (Node a _ _) = a leftAndRig...
Cnidarias/al-go-rithms
graphsearch/breadth-first-search/haskell/BFS.hs
mit
487
0
12
128
223
117
106
11
5
import Control.Monad ---------------------------------- -- Getting our feet wet with Maybe ---------------------------------- applyMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b applyMaybe Nothing f = Nothing applyMaybe (Just x) f = f x ----------------------- -- The Monad type class ----------------------- --insta...
zxl20zxl/learnyouahaskell
A-Fistful-of-Monads.hs
mit
4,580
0
13
1,181
1,062
583
479
71
1
module Lab3 where import Prelude ----------------------------------------------------------------------------------------------------------------------------- -- LIST COMPREHENSIONS ------------------------------------------------------------------------------------------------------------------------------ -- =====...
ltfschoen/HelloHaskell
src/Chapter2/Section2/lab3.hs
mit
4,301
0
10
1,072
338
204
134
17
1
module InfixAmbiguous where infix +++ main = 3 +++ 4 +++ 4 (+++) x y = x
roberth/uu-helium
test/parser/InfixAmbiguous.hs
gpl-3.0
75
0
6
19
33
19
14
-1
-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-elasticache/gen/Network/AWS/ElastiCache/ModifyCacheSubnetGroup.hs
mpl-2.0
5,731
0
13
1,107
733
438
295
93
1
{- Author : shelarcy 2004 Advised by: Sean Seefried Adapted from: BezCurve.hs By: (c) Sven Panne 2003 <sven_panne@yahoo.com> "BezCurve.hs (adapted from fog.c which is (c) Silicon Graphics, Inc) This file is part of HOpenGL and distributed under a BSD-style license See the file librar...
sherwoodwang/wxHaskell
samples/contrib/GLCanvas.hs
lgpl-2.1
3,862
0
13
964
1,353
692
661
74
2
module Propellor.Property.Cron where import Propellor import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import Utility.SafeCommand import Utility.FileMode import Data.Char -- | When to run a cron job. -- -- The Daily, Monthly, and Weekly options allow the cron job to be ...
avengerpenguin/propellor
src/Propellor/Property/Cron.hs
bsd-2-clause
2,862
20
19
567
629
342
287
57
8
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 @DsMonad@: monadery used in desugaring -} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- instance MonadThings is necessarily an orphan module DsMonad ( DsM, mapM, mapAndUnzipM, ...
nushio3/ghc
compiler/deSugar/DsMonad.hs
bsd-3-clause
20,093
2
18
6,416
3,759
2,027
1,732
320
5
{- Teak synthesiser for the Balsa language Copyright (C) 2007-2010 The University of Manchester 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...
balangs/eTeak
src/Gen.hs
bsd-3-clause
82,718
0
22
29,996
28,203
14,617
13,586
1,275
19
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP , NoImplicitPrelude , MagicHash , UnboxedTuples , UnliftedFFITypes #-} {-# OPTIONS_HADDOCK not-home #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.TopHandler -- Copy...
sdiehl/ghc
libraries/base/GHC/TopHandler.hs
bsd-3-clause
9,882
0
22
2,251
1,166
626
540
125
7
module Graphics.Gnuplot.Private.Graph3D where import qualified Graphics.Gnuplot.Private.FrameOptionSet as OptionSet import qualified Graphics.Gnuplot.Private.FrameOption as Option import qualified Graphics.Gnuplot.Private.LineSpecification as LineSpec import qualified Graphics.Gnuplot.Private.Graph3DType as GraphType ...
wavewave/gnuplot
src/Graphics/Gnuplot/Private/Graph3D.hs
bsd-3-clause
2,456
0
16
635
784
427
357
59
1
module Test.Hspec.Formatters (module Test.Hspec.Core.Formatters) where import Test.Hspec.Core.Formatters
hspec/hspec
src/Test/Hspec/Formatters.hs
mit
115
0
5
17
24
17
7
2
0
{-# LANGUAGE NoImplicitPrelude #-} -- | A sourcemap maps a package name to how it should be built, -- including source code, flags, options, etc. This module contains -- various stages of source map construction. See the -- @build_overview.md@ doc for details on these stages. module Stack.Types.SourceMap ( -- * Diffe...
juhp/stack
src/Stack/Types/SourceMap.hs
bsd-3-clause
5,716
0
11
1,070
777
473
304
144
1
module GA4 where failBoundPrecon :: IO [String] failBoundPrecon = do fileName <- getLine file <- readFile fileName return $ lines file failOrderPrecon :: IO (Int,Int) failOrderPrecon = do b <- getB a <- getA return (a,b) getA = return 1 getB = return 2
RefactoringTools/HaRe
test/testdata/GenApplicative/GA4.hs
bsd-3-clause
270
0
8
61
108
54
54
13
1
module RefacDupTrans where import System.IO.Unsafe import PosSyntax hiding (ModuleName, HsName, SN) import SourceNames import ScopeModule import UniqueNames hiding (srcLoc) import HsName import HsLexerPass1 import PNT import TiPNT import SimpleGraphs(reverseGraph,reachable) import HsTokens import PrettyPrint import Ref...
SAdams601/HaRe
old/refactorer/RefacDupTrans.hs
bsd-3-clause
27,405
0
21
7,489
10,220
5,178
5,042
-1
-1
module Network.XmlRpc.Base64 ( encode, decode ) where import Data.ByteString import qualified Data.ByteString.Base64 as B64 encode :: ByteString -> ByteString encode = B64.encode decode :: ByteString -> ByteString decode = B64.decodeLenient
laurencer/confluence-sync
vendor/haxr/Network/XmlRpc/Base64.hs
bsd-3-clause
262
0
5
51
61
38
23
9
1
{-| Module : Text.Parsec Copyright : (c) Daan Leijen 1999-2001, (c) Paolo Martini 2007 License : BSD-style (see the LICENSE file) Maintainer : aslatter@gmail.com Stability : provisional Portability : portable This module includes everything you need to get started writing a parser. By default thi...
23Skidoo/parsec
Text/Parsec.hs
bsd-2-clause
2,279
0
5
688
328
224
104
86
0
module CSV () where -- | Using LiquidHaskell for CSV lists -- c.f. http://www.reddit.com/r/scala/comments/1nhzi2/using_shapelesss_sized_type_to_eliminate_real/ data CSV = Csv { headers :: [String] , rows :: [[String]] } {-@ data CSV = Csv { headers :: [String] , ro...
abakst/liquidhaskell
tests/neg/csv.hs
bsd-3-clause
973
0
10
420
190
123
67
16
1
{-# LANGUAGE Unsafe #-} {-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-} module GHC.Event.Internal ( -- * Event back end Backend , backend , delete , poll , modifyFd -- * Event type , Event , evtRead , evtWrite , evtClose , eventIs -- * Timeout typ...
beni55/haste-compiler
libraries/ghc-7.8/base/GHC/Event/Internal.hs
bsd-3-clause
4,024
0
16
1,175
1,000
557
443
99
3
{-# LANGUAGE GADTs #-} module ShouldCompile where data T a where T :: b -> (b->Int) -> a -> T a f (T b f a) = a
siddhanathan/ghc
testsuite/tests/gadt/gadt6.hs
bsd-3-clause
118
0
9
34
55
31
24
5
1
{-# LANGUAGE QuasiQuotes #-} import HarmLang.Interpreter import HarmLang.Types import HarmLang.InitialBasis import HarmLang.QuasiQuoter import HarmLang.IO progression = [hl|[CM C7 F7 C7 G7 F7 G#7]|] main :: IO () main = do putStrLn "Welcome to the Blues Buddy!" putStrLn "Original 12 bar blues in C." ...
lrassaby/harmlang
examples/bluesmachine.hs
mit
1,029
0
16
202
258
126
132
24
1
addOneTo i = i + 1 alwaysEven a b = let isEven x = if even x then x else x - 1 in (isEven a, isEven b) alwaysEven a b = (isEven a, isEven b) where isEven x = if even x then x else x - 1
betoesquivel/haskell
tut1.hs
mit
290
0
10
153
111
55
56
7
3
{-# LANGUAGE OverloadedStrings #-} module Data.Streaming.NetworkSpec where import Control.Concurrent.Async (withAsync) import Control.Exception (bracket) import Control.Monad (forever, replicateM_) import Data.Array.Unboxed (elems) import qualified Data.B...
fpco/streaming-commons
test/Data/Streaming/NetworkSpec.hs
mit
1,673
0
24
600
432
221
211
35
1
module PatternGuard where import Prelude hiding (take) checkNum :: Int -> Bool checkNum 2 = True checkNum _ = False -- Inline data structures, so that this test case -- works independent of inter-module data flow data Pairing a b = Pair a b data List a = Nil | Cons a (List a) -- Reverse order of arguments to make ...
antalsz/hs-to-coq
examples/base-tests/PatternGuard.hs
mit
689
0
12
218
271
138
133
16
3
import Data.List.Split import Control.Monad.State data Dir = N | E | S | W deriving Show data Turn = L | R deriving (Show, Read) data Move = Move { dir :: Turn , step :: Integer } deriving Show mkMove :: String -> Move mkMove [] = undefined mkMove (x:xs) = Move { dir = read [x...
wizzup/advent_of_code
2016/1/part1.hs
mit
1,476
0
12
511
721
393
328
51
11
module Yesod.Hunt.Routes where import Control.Applicative import Hunt.Interpreter.Interpreter import Yesod -- | wrapper type for index environment data HuntS = HuntS { getHunt :: DefHuntEnv } -- | helper for easy initiation initHuntS :: IO HuntS initHuntS = HuntS <$> initHunt -- | clas...
hunt-framework/yesod-hunt
src/Yesod/Hunt/Routes.hs
mit
715
0
8
161
86
51
35
-1
-1
------------------------------------------------------------------------- -- -- Haskell: The Craft of Functional Programming, 3e -- Simon Thompson -- (c) Addison-Wesley, 1996-2011. -- -- Chapter 7 -- ------------------------------------------------------------------------- module Chapter7 where -- Defining functi...
tonyfloatersu/solution-haskell-craft-of-FP
Chapter7.hs
mit
5,637
1
10
1,381
1,779
965
814
115
2
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE GADTs #-} module DB.Users where import Prelude hiding (readFile, putStrLn) import Data.String import Control.Monad import Control.Monad.Writer import Database.SQLite.Simple im...
paolino/mootzoo
DB/Users.hs
mit
3,241
0
19
962
1,049
532
517
62
5
module Parser ( parseExpr ) where import Text.Parsec import Text.Parsec.String (Parser) import qualified Text.Parsec.Expr as Ex import Lexer import Pretty import Syntax ------------------------------------------------------------------------------- -- Expression...
JoshuaGross/STILC
Parser.hs
mit
3,257
0
13
647
1,148
577
571
82
2
-- Template Haskell -- ref: https://wiki.haskell.org/A_practical_Template_Haskell_Tutorial -- ref: https://wiki.haskell.org/Template_Haskell
Airtnp/Freshman_Simple_Haskell_Lib
Incomplete/Template-Haskell.hs
mit
140
0
2
8
5
4
1
1
0
{-# LANGUAGE OverloadedStrings #-} module GeoChat.WebsocketServer (wsApplication) where import Control.Concurrent (MVar, newMVar, modifyMVar_, readMVar) import Control.Monad (forM_, liftM) import qualified Data.Map as M import Data.Monoid (mappend) import Data.Text (Text) import Control.OldException import Control...
danchoi/geochat
src/WebsocketServer.hs
mit
5,862
0
21
1,433
1,916
959
957
119
6
-- | Physics for bead bouncing. module Collide where import World import Actor import Graphics.Gloss.Data.Point import Graphics.Gloss.Data.Vector import Graphics.Gloss.Geometry -- Config ----------------------------------------------------------------------------------------- -- How bouncy the beads are -- at 0.2 and ...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/picture/Styrene/Collide.hs
mit
5,094
148
16
1,312
1,085
601
484
85
1
module Main where import Criterion.Main import Data.CReal.Internal main :: IO () main = defaultMain [ bgroup "pi" [ bench "0" $ whnf (pi `atPrecision`) 0 , bench "4" $ whnf (pi `atPrecision`) 4 , bench "16" $ whnf (pi `atPrecision`) 16 ...
expipiplus1/exact-real
bench/Bench.hs
mit
2,341
0
14
1,263
707
389
318
28
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ConstraintKinds #-} module EndToEndSpec (spec) where import Prelude hiding (writeFile) import qualified Prelude import Helper import Test.HUnit import...
sol/hpack
test/EndToEndSpec.hs
mit
54,809
0
27
21,715
7,020
3,859
3,161
-1
-1
module Main where import Zelus import Optimize import Plot import Data.List( nub, sortOn ) import Test.QuickCheck import Test.QuickCheck.Modifiers -------------------------------------------------------------------------------- -- heater + controller type Level = Double -- pump level type Temp = Double -- temperat...
koengit/cyphy
src/Heater.hs
mit
5,830
1
20
1,650
2,154
1,163
991
130
2
module Agda.Convert where import Render ( Block(..), Inlines, renderATop, Render(..) ) import Agda.IR (FromAgda (..)) import qualified Agda.IR as IR import Agda.Interaction.Base import Agda.Interaction.BasicOps as B import Agda.Interaction.EmacsCommand (Lisp) import Agda.Interaction.Highlighting.Common (chooseHighlig...
banacorn/agda-language-server
src/Agda/Convert.hs
mit
24,621
0
23
6,457
6,639
3,313
3,326
-1
-1
{- - Copyright (c) 2016 Christopher Wells <cwellsny@nycap.rr.com> - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to us...
ExcaliburZero/binary-search-tree-haskell
src/CLI.hs
mit
3,334
0
12
740
460
217
243
40
7
-- -- Copyright (c) 2013 Bonelli Nicola <bonelli@antifork.org> -- -- 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 version. --...
YelaSeamless/cgrep
src/CGrep/Output.hs
gpl-2.0
8,335
0
18
2,565
3,074
1,611
1,463
141
3
{-# language TemplateHaskell #-} {-# language DeriveDataTypeable #-} module BDD.Quiz where import Expression.Op import Boolean.Op import qualified Boolean.BDD import qualified OBDD as O import Inter.Types hiding ( Var ) import Autolib.TES.Term import qualified Autolib.TES.Binu as B import Autolib.ToDoc import Auto...
marcellussiegburg/autotool
collection/src/BDD/Quiz.hs
gpl-2.0
2,206
0
21
809
736
390
346
58
3
-------------------------------------------------------------------------------- -- Copyright (C) 1997, 1998, 2008 Joern Dinkla, www.dinkla.net -------------------------------------------------------------------------------- -- -- see -- Joern Dinkla, Geometrische Algorithmen in Haskell, Diploma Thesis, -- Univ...
smoothdeveloper/GeoAlgLib
src/Tests/Nearest.hs
gpl-3.0
2,072
8
15
539
608
319
289
40
2
module Language.Mulang.Transform.Renamer (rename) where import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Language.Mulang.Ast import Language.Mulang.Ast.Visitor import Data.Maybe (catMaybes) import Control.Monad.State type RenameState a = Sta...
mumuki/mulang
src/Language/Mulang/Transform/Renamer.hs
gpl-3.0
5,247
0
11
1,197
2,079
1,040
1,039
95
1
{- This file is part of evolutionary-algorithms-sandbox. evolutionary-algorithms-sandbox 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. ev...
jpzk/ea-sandbox
bitflip/bitflip.hs
gpl-3.0
1,996
0
11
468
511
267
244
31
1
{-# LANGUAGE ConstraintKinds #-} module Constraints.Vector ( SomeVector ) where import Linear import Data.Functor.Rep -- Constraint for vector type variables. type SomeVector v = ( Applicative v , Traversable v , Metric v , Representable v , Ord (v Int) )
MatthiasHu/4d-labyrinth
src/Constraints/Vector.hs
gpl-3.0
276
0
8
61
65
38
27
11
0
module Main (main) where import qualified Utility.TSLogAnalyzer main :: IO () main = Utility.TSLogAnalyzer.main
taktoa/TSLogAnalyzer
executable/Main.hs
gpl-3.0
114
0
6
16
33
20
13
4
1
module FormalLanguage.GrammarProduct.Op.Add where import Control.Lens hiding (outside,indices) import Control.Lens.Fold import "newtype" Control.Newtype import Data.List (genericReplicate) import Data.Monoid hiding ((<>)) import Data.Semigroup import qualified Data.Set as S import Text.Printf import Data.Default imp...
choener/GrammarProducts
FormalLanguage/GrammarProduct/Op/Add.hs
gpl-3.0
1,971
0
15
654
491
268
223
-1
-1
{-# language PatternSignatures #-} {-# language DeriveDataTypeable #-} module Game where import Prelude hiding ( catch ) import Spieler import Wurf import State import Bank import Registrar import Call import Rating import qualified Data.Map as M import Data.Typeable import System.IO import Control.Monad ( when, v...
jwaldmann/mex
src/Game.hs
gpl-3.0
4,147
0
20
1,236
1,334
668
666
97
4
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module TestUtil where import Test.SmallCheck import Test.SmallCheck.Series import Control.Applicative import Music.Muse.Pitch instance Monad m => Serial m PitchClass where series = cons0 PC0 \/ cons0 PC1 \/ cons0 PC2 \/ cons0 PC3 \/ cons0 PC4 ...
alxgnon/muse
test/TestUtil.hs
gpl-3.0
843
0
17
197
361
184
177
18
2
import Rsa import Data.Char import Data.List import Data.List.Split import System.Environment import System.IO import System.IO.Error padd :: [String]->[Int] padd x = map (foldl (\a b -> 1000 * a + b) 0) enc_blocks where enc_blocks = map (map ord) x main = do args <- getArgs input <- readFile (head args...
h3nnn4n/rsa-haskell
encrypt.hs
gpl-3.0
705
0
18
173
320
167
153
21
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Compute.Types -- Copyright : (c) 2015-2016 Brendan Hay...
rueshyna/gogol
gogol-compute/gen/Network/Google/Compute/Types.hs
mpl-2.0
50,592
0
7
12,903
5,747
3,955
1,792
1,689
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE ScopedTypeVariables #-} module Controller ( withFoundation , withDevelApp ) where import Foundation import Settings import Yesod.Helpers.Static impor...
tehgeekmeister/apters-web
Controller.hs
agpl-3.0
2,436
0
12
371
488
269
219
48
1
module TestTree23(test23) where import Test.Tasty import Test.Tasty.QuickCheck import Test.QuickCheck import Data.FixFile import Data.FixFile.Tree23 as Tree23 import Data.List hiding (null) import Data.Maybe import Data.Monoid import Prelude hiding (null) empty23 :: Fix (Tree23 d) empty23 = empty prop_SetInse...
revnull/fixfile
tests/TestTree23.hs
lgpl-3.0
5,516
0
13
1,323
1,902
985
917
134
4
module Network.Haskoin.Wallet.Tests (tests) where import Test.Framework (Test, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty) import Data.Aeson (FromJSON, ToJSON, encode, decode) import Data.HashMap.Strict (singleton) import Network.Haskoin.Wallet.Arbitrary () import Network.Haskoin.Wallet te...
plaprade/haskoin
haskoin-wallet/test/Network/Haskoin/Wallet/Tests.hs
unlicense
716
0
10
128
224
131
93
15
1
{- Copyright 2014 David Farrell <shokku.ra@gmail.com> - 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 law or...
shockkolate/arata
src/Dated.hs
apache-2.0
796
0
8
151
86
47
39
5
0
{-# LANGUAGE OverloadedStrings #-} module Page ( Message(..) , PageConfig(..) , defaultPageConfig , render ) where --import Control.Monad.Trans (liftIO) import Data.Monoid ((<>)) import qualified Data.Text as T import Text.Blaze.Internal (textValue) import Text.Blaze.Html5 (Html, (!)) import qualified Text....
DataStewardshipPortal/ds-wizard
DSServer/app/Page.hs
apache-2.0
7,597
0
28
1,654
2,582
1,259
1,323
140
3
{-# OPTIONS_GHC -cpp #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Either -- Copyright : (C) 2008 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimenta...
urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav
Control/Monad/Either.hs
apache-2.0
2,283
4
14
545
620
328
292
41
0
{-# LANGUAGE FlexibleContexts #-} import AdventOfCode (readInputFile) import Control.Monad (forM, forM_, when) import Data.Array.IArray (elems) import Data.Array.MArray (newListArray, readArray, writeArray) import Data.Array.ST (runSTUArray) import Data.Bits (shiftL) import Data.Int (Int8) import Data.Maybe (catMaybe...
petertseng/adventofcode-hs
bin/18_game_of_life.hs
apache-2.0
2,867
0
24
698
1,354
729
625
68
3
{-# LANGUAGE FlexibleContexts #-} module Etch.Types.Analysis where import qualified Data.HashMap.Lazy as HM import Data.Text import Etch.Types.SemanticTree type Scope = HM.HashMap Text Term data Term = Term Type Scope deriving Show data AnalysisState = AnalysisState { _analysisStateNextID :: Integer ...
shockkolate/etch
src/Etch/Types/Analysis.hs
apache-2.0
649
0
8
224
105
66
39
14
1
module Main where import Life.Engine.QTree import Life.Types --import Life.Scenes -- or import Life.Formations -- Libraries for testing import qualified Life.Engine.Hutton as Hutton -- Needed to test correctness with QuickCheck import Test.QuickCheck -- For correctness tests import Data.List (sort) import Criter...
ku-fpg/better-life
examples/engines/QTreeEngine.hs
bsd-2-clause
1,289
0
11
227
327
181
146
18
1
{-# LANGUAGE BangPatterns, CPP, Rank2Types #-} {-# OPTIONS_HADDOCK not-home #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Text.Internal.Builder -- Copyright : (c) 2013 Bryan O'Sullivan -- (c) 2010 Johan Tibell -- License : BSD-style (se...
bgamari/text
src/Data/Text/Internal/Builder.hs
bsd-2-clause
10,887
0
17
2,506
1,917
1,066
851
155
2
{-| Module : $Header$ Copyright : (c) Petr Penzin, 2015 License : BSD2 Maintainer : penzin.dev@gmail.com Stability : stable Portability : cross-platform Test reading and writing build configuration -} -- module Junta.TestProjectConfiguration where import Junta.ProjectConfiguration import Control.Appl...
ppenzin/junta
src/test/haskell/Junta/TestBuildConfiguration.hs
bsd-2-clause
1,909
0
20
394
504
268
236
33
1
{-# LANGUAGE GADTs #-} import Control.Applicative import Control.Monad.Trans import Control.Monad.Operational type Stack s = [s] data StackI s a where Push :: s -> StackI s () Pop :: StackI s s type StackP s m a = ProgramT (StackI s) m a push :: (Monad m) => s -> StackP s m () push = singleton . Push p...
fujiyan/toriaezuzakki
haskell/operational/StackT.hs
bsd-2-clause
1,054
0
12
291
510
263
247
32
3
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} module Snap.Snaplet.HTTPAuth.Types.AuthHeader ( AuthHeade...
anchor/snaplet-httpauth
lib/Snap/Snaplet/HTTPAuth/Types/AuthHeader.hs
bsd-3-clause
519
0
5
119
51
39
12
13
0
module Graphics.GChart.ChartItems.Basics where import Graphics.GChart.Types import Graphics.GChart.ChartItems.Util -- Chart Size instance ChartItem ChartSize where set size = updateChart $ \chart -> chart { chartSize = Just size } encode (Size width height) = asList ("chs", widthStr ++ show height) where ...
deepakjois/hs-gchart
Graphics/GChart/ChartItems/Basics.hs
bsd-3-clause
1,763
0
11
1,032
287
151
136
29
0
module SLM.DataTypes where import Data.List.Split import qualified Data.ByteString.Lazy.Char8 as LC type PredictorName = LC.ByteString data PredictorType = FactorType | MeasureType | InvalidType deriving (Show) data PredictorDefinition = PredictorDefinition !Predictor...
timveitch/Gobble
src/SLM/DataTypes.hs
bsd-3-clause
1,820
0
9
309
453
249
204
43
1
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, DataKinds #-} {-# LANGUAGE CPP #-} ---------------------------------------------------------...
achirkin/fastvec
src/Data/Geometry/Transform/SpaceTransform.hs
bsd-3-clause
5,730
0
13
1,346
1,152
626
526
61
1
import Data.List (sort) fibonacciTail :: [Int] fibonacciTail = 1 : 1 : zipWith (\x y -> (x + y) `mod` 1000000000) fibonacciTail (tail fibonacciTail) fibonacciHead :: [Int] fibonacciHead = [ gen n | n <- [1 .. ] ] where logPhi = log ((1 + sqrt 5) / 2) / (log 10) :: Double logSqrt5 = (log (sqrt 5)) / (log 10) :...
foreverbell/project-euler-solutions
src/104.hs
bsd-3-clause
704
5
16
184
360
188
172
15
1
{- Inspired by the article "Evaluating Cellular Automata is Comonadic" by Dan Piponi. See: http://blog.sigfpe.com/2006/12/evaluating-cellular-automata-is.html -} module Lets.Cellular where -- define a Zipper for type x data U x = U [x] x [x] -- deriving Show -- move one step left left :: U x -> U x left (U (l:...
peterson/lets-haskell
src/Lets/Cellular.hs
bsd-3-clause
3,835
0
15
1,028
1,460
776
684
70
2
-- 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 GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Quantity.R...
facebookincubator/duckling
Duckling/Quantity/RO/Rules.hs
bsd-3-clause
1,463
0
17
288
318
188
130
40
2
module Language.Xi.Base.Data where
fizruk/xi-base
src/Language/Xi/Base/Data.hs
bsd-3-clause
35
0
3
3
8
6
2
1
0
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, StandaloneDeriving, MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} #include "MachDeps.h" #if SIZEOF_HSWORD == 4 #define DIGITS 9 #define BASE 1000000000 #elif SIZEOF_HSWORD == 8 #define DIGITS 18...
ezyang/ghc
libraries/base/GHC/Show.hs
bsd-3-clause
21,363
0
18
6,006
6,054
3,283
2,771
-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 RecordWildCards #-} module Duckling.Ranking.Train ( makeClassifiers ) where import Data.HashSe...
facebookincubator/duckling
exe/Duckling/Ranking/Train.hs
bsd-3-clause
3,632
0
16
705
919
500
419
62
3
-------------------------------------------------------------- -------------------------------------------------------------- -- -- HaskellEngine -- MyForteIsTimeTravel -- -------------------------------------------------------------- -------------------------------------------------------------- module Window (fps, ...
MyForteIsTimeTravel/HaskellEngine
src/Window.hs
bsd-3-clause
1,753
0
12
238
333
204
129
19
5
module Observable.MCMC.NUTS (nuts) where import Control.Monad import Control.Monad.Primitive import Control.Monad.Trans import Control.Monad.Trans.State.Strict import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as HashMap import Data.Vector.Unboxed (Vector, Unbox) import qualified Data.Vector.Un...
jtobin/deprecated-observable
src/Observable/MCMC/NUTS.hs
bsd-3-clause
5,611
0
22
1,723
2,255
1,201
1,054
119
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RecordWildCards, NamedFieldPuns #-} {-# LANGUAGE PatternGuards, BangPatterns #-} {-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.HTTP2.Worker ( Responder , response , worker ) where #if __GLASGOW_HASKELL__ < 709 import Control.Applicative #endif import C...
mfine/wai
warp/Network/Wai/Handler/Warp/HTTP2/Worker.hs
mit
7,312
0
20
2,045
1,668
839
829
131
4
module Main where import qualified Data.ByteString.Lazy as BL import qualified Data.Vector as V -- from cassava import Data.Csv -- a simple type alias for data type BaseballStats = (BL.ByteString, Int, BL.ByteString, Int) main :: IO () main = do csvData <- BL.readFile "batting.csv" let v = decode NoHeader csvDat...
dawsonc/bassbull
src/Main.hs
mit
512
0
13
94
176
97
79
12
1
data A = A data B = B deriving Show main = show A
roberth/uu-helium
test/typeerrors/Examples/NoInstance2.hs
gpl-3.0
51
4
4
15
33
14
19
3
1
-- https://projecteuler.net/problem=8 import Data.Char adjacentWithGreatestProduct :: Int -> String -> Int adjacentWithGreatestProduct nAdjacent inputStr = maximum [ product (adjacentNumbers startingIndex) | startingIndex <- [0..(inputLength-nAdjacent)]] where inputLength = length inputStr adjacentNumbers f...
nothiphop/project-euler
008/solution.hs
apache-2.0
1,512
1
11
80
112
55
57
6
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Reporting -- Copyright : (c) David Waern 2008 -- License : BSD-like -- -- Maintainer : david.waern@gmail.com -- Stability : experimental -- Portability : portable -- -- Anonymous build ...
seereason/cabal
cabal-install/Distribution/Client/BuildReports/Storage.hs
bsd-3-clause
5,883
0
19
1,585
1,338
739
599
101
4
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Arrow import qualified Data.Aeson as Json import Data.Aeson ((.=)) import qualified Data.Text.Lazy.Encoding as T import qualified Data.Text.Lazy.IO as T import qualified Distribution.PackageDescription as PD import Distribution.PackageDescription.Par...
kgadek/SublimeHaskell
CabalInspector.hs
mit
3,258
0
21
801
932
494
438
80
3
{-# LANGUAGE CPP #-} module DataFamilies.Properties (tests) where import Prelude () import Prelude.Compat import DataFamilies.Encoders import DataFamilies.Instances () import Properties hiding (tests) import Test.Framework (Test, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty) ---------------...
sol/aeson
tests/DataFamilies/Properties.hs
bsd-3-clause
7,598
0
17
1,634
1,154
616
538
111
1
{-| Module : Idris.Elab.Clause Description : Code to elaborate clauses. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards #-} module Idris.Elab.Clause where import Idris.AbsSyntax import Idris.ASTUtils import Idris.Core.CaseTree import Idris.Core.Elaborate hiding (T...
mpkh/Idris-dev
src/Idris/Elab/Clause.hs
bsd-3-clause
61,872
9
30
24,648
17,385
8,614
8,771
956
52
{-# LANGUAGE OverloadedStrings #-} module Main where import Graphics.UI.Gtk import Data.List ( findIndex ) import Control.Monad.IO.Class (MonadIO(..)) import qualified Data.Text as T main = do initGUI win <- windowNew on win deleteEvent $ liftIO mainQuit >> return False combo <- comboBoxNewWithEntry combo...
k0001/gtk2hs
gtk/demo/menu/ComboDemo.hs
gpl-3.0
1,120
0
15
238
295
140
155
30
2
-- | Benchmarks various pure functions from the Text library -- -- Tested in this benchmark: -- -- * Most pure functions defined the string types -- {-# LANGUAGE BangPatterns, CPP, GADTs, MagicHash #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Benchmarks.Pure ( benchmark ) where import Control.DeepSeq (NFDa...
beni55/text
benchmarks/haskell/Benchmarks/Pure.hs
bsd-2-clause
19,718
0
22
7,932
7,376
3,773
3,603
378
1
module HAD.Y2014.M04.D09.Solution where import Data.List (sortBy) import Data.Monoid (mconcat, (<>)) import Data.Ord (comparing) -- $setup -- >>> import Data.List data Foo = Foo {x :: Int, y :: String, z :: String} deriving (Read, Show, Eq) {- | orderXYZ Order Foo by x then by y and then by z prop> sort...
1HaskellADay/1HAD
exercises/HAD/Y2014/M04/D09/Solution.hs
mit
710
0
8
163
175
102
73
10
1
module Foo where -- TODO: Expressions inside applications of type and predicate aliases. {-@ predicate Rng Lo V Hi = (Lo <= V && V < Hi) @-} {-@ bog :: {v:Int | (Rng 0 v 10)} @-} bog :: Int bog = 5
ssaavedra/liquidhaskell
tests/todo/aliasConst.hs
bsd-3-clause
201
0
4
47
17
12
5
3
1
module Boilerplater where import Test.Framework.Providers.QuickCheck2 import Language.Haskell.TH testProperties :: [Name] -> Q Exp testProperties nms = fmap ListE $ sequence [[| testProperty $(stringE prop_name) $(varE nm) |] | nm <- nms ...
dolio/vector
tests/Boilerplater.hs
bsd-3-clause
1,150
0
13
328
171
93
78
-1
-1
/* { dg-options "-I. -Winvalid-pch -g" } */ extern int x;
SanDisk-Open-Source/SSD_Dashboard
uefi/gcc/gcc-4.6.3/gcc/testsuite/gcc.dg/pch/valid-1b.hs
gpl-2.0
59
4
5
12
26
14
12
-1
-1
{-# LANGUAGE GADTs, DataKinds, KindSignatures, TypeFamilies, PolyKinds #-} module T7386 where data Nat = Zero | Succ Nat data family Sing (a :: k) data instance Sing (a :: Nat) where SZero :: Sing Zero SSucc :: Sing n -> Sing (Succ n)
ghc-android/ghc
testsuite/tests/ghci.debugger/scripts/T7386.hs
bsd-3-clause
244
0
9
52
72
42
30
7
0
module Parser where import Expense import Errors import Data.Maybe import Data.Time.Calendar import Data.Time.Format import System.Locale parseExpenseList :: String -> [Either Expense ErrString] parseExpenseList s = map parseExpense $ lines s parseExpense :: String -> Either Expense ErrString parseExpense es | pExpL...
fredmorcos/attic
projects/pet/archive/pet_haskell_master_complete/Parser.hs
isc
2,072
0
9
676
687
348
339
45
1
{-# LANGUAGE MagicHash #-} module Physics.Contact.Circle.Benchmark where import Physics.Contact.Circle import Physics.Linear test = contact (Circle (P2 $ V2 (-1.0##) 0.0##) 1.1) (Circle (P2 $ V2 1.0## 0.0##) 1.1)
ublubu/shapes
shapes/bench/Physics/Contact/Circle/Benchmark.hs
mit
226
0
12
41
75
42
33
8
1
module TicTacToe.StateSpec where import Test.Hspec import Control.Lens ((^.)) import qualified TicTacToe.Board as Board import TicTacToe.Player (Player(..)) import TicTacToe.State (board, player) import qualified TicTacToe.State as State spec :: Spec spec = describe "TicTacToe.State" $ desc...
tomphp/haskell-tictactoe
test/TicTacToe/StateSpec.hs
mit
551
0
11
120
149
86
63
15
1
-- Strings Mix -- http://www.codewars.com/kata/5629db57620258aa9d000014 module Codewars.G964.Mixin where import Data.Map.Lazy (fromList, unionWith, mapWithKey, elems) import Data.List (group, sort, sortBy, intercalate) import Data.Char (isLower) mix :: String -> String -> String mix s1 s2 = intercalate "/" (sortBy h...
gafiatulin/codewars
src/4 kyu/Mixin.hs
mit
931
0
17
361
354
185
169
19
4
import Test.Hspec -- Problem 3 -- Find the K'th element of a list. The first element in the list is number 1. elementAt :: [a] -> Int -> a elementAt ls i = ls !! index where index = i - 1 main :: IO() main = hspec $ describe "99-exercises.3 = k th element of a list" $ it "returns the element in defined positi...
baldore/haskell-99-exercises
3.hs
mit
421
1
10
102
130
67
63
10
1
{-# LANGUAGE UndecidableInstances, TypeSynonymInstances, FlexibleInstances, GeneralizedNewtypeDeriving #-} -- this module is part of the risc386 simulator (IntelMain) module Risc386Clone.FrameIntel where -- import Data.List -- reverse import Data.Map (Map) import qualified Data.Map as Map import Text.PrettyPri...
cirquit/hjc
src/Risc386Clone/FrameIntel.hs
mit
3,356
0
20
723
1,003
523
480
58
1
{-- Copyright (c) 2014 Gorka Suárez García Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
gorkinovich/Haskell
Problems/Problem0010a.hs
mit
1,943
0
11
359
268
140
128
14
1
module Absyn.ValueOccursCheck where import Absyn.Base import Absyn.Meta import Typing.Env import Typing.TypeError import Util.Error import Control.Monad (mapM_, when) class ValueOccursCheck b where valueOccursCheck :: String -> AST b String c -> Tc Bool instance ValueOccursCheck BaseExpr where -- TRIVIAL val...
tadeuzagallo/verve-lang
src/Absyn/ValueOccursCheck.hs
mit
4,395
0
13
852
1,579
761
818
-1
-1
module Zwerg.UI.Port where import Zwerg.Prelude import Zwerg.Data.Position import Zwerg.UI.Menu import qualified Data.List.NonEmpty as NE (repeat, zip) data Port = MainScreen | MainMenu (Menu ()) | ChooseTarget | LoadingScreen | ViewEquipment | ViewInventory (MenuGroupSelect UUID) | Exam...
zmeadows/zwerg
lib/Zwerg/UI/Port.hs
mit
660
0
10
136
179
106
73
-1
-1
{-# htermination (esEsTup0 :: Tup0 -> Tup0 -> MyBool) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil data Tup0 = Tup0 ; esEsTup0 :: Tup0 -> Tup0 -> MyBool esEsTup0 Tup0 Tup0 = MyTrue;
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/EQEQ_1.hs
mit
247
0
8
60
74
41
33
6
1
{-| Module : MillerRabin Description : Module is a wrapper for all functions required for proper MillerRabin primality test. Copyright : (c) Grzegorz Jasinski, Wojtek Chmielarz License : MIT Module provides service for checking if given numbers is prime. -} module MillerRabin ( isPrime ) where im...
gjasinski/rsa-haskell
src/MillerRabin.hs
mit
2,165
0
13
632
847
443
404
36
2