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
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE TemplateHaskell #-} module Data.Concurrent.HashMap.Internal where import Data.Bits import Data.Word import Language.Haskell.TH whichHash :: ExpQ -> ExpQ -> Q Exp whichHash as32 as64 = if bitSize ...
arybczak/happstack-server
src/Data/Concurrent/HashMap/Internal.hs
bsd-3-clause
476
0
8
146
81
51
30
12
2
-- -- Copyright (c) 2014 Citrix Systems, 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 version. -- -- This progra...
jean-edouard/manager
upgrade-db/Migrations/M_20.hs
gpl-2.0
1,538
0
14
344
190
108
82
19
2
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Get -- Copyright : (c) Andrea Vezzosi 2008 -- Duncan Coutts 2011 -- John Millikin 2012 -- License : BSD-like -- -- Maintainer : ca...
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/Get.hs
bsd-3-clause
12,796
0
22
3,418
2,986
1,528
1,458
253
6
module Distribution.Server.Features.PackageCandidates.Backup where import Distribution.Server.Framework.BackupRestore import Distribution.Server.Framework.BackupDump import Distribution.Server.Features.PackageCandidates.State import Distribution.Server.Features.PackageCandidates.Types import Distribution.Server.Featur...
mpickering/hackage-server
Distribution/Server/Features/PackageCandidates/Backup.hs
bsd-3-clause
4,346
0
14
790
1,004
539
465
73
4
module WhereIn7 where --A definition can be lifted from a where or let to the top level binding group. --Lifting a definition widens the scope of the definition. --In this example, lift 'addthree' defined in 'fun'. --This example aims to test adding parenthese. fun x y z =inc (addthree x y z) where inc a =a ...
kmate/HaRe
old/testing/liftToToplevel/WhereIn7_TokOut.hs
bsd-3-clause
346
0
7
74
67
36
31
4
1
{-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Module : System.Exit -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability ...
frantisekfarka/ghc-dsi
libraries/base/System/Exit.hs
bsd-3-clause
2,835
0
8
455
247
154
93
26
1
import Control.Monad import Data.Word (Word8) import Foreign.Ptr import Foreign.Marshal.Array import GHC.Foreign (peekCStringLen, withCStringLen) import GHC.IO.Encoding.Failure (CodingFailureMode(..)) import qualified GHC.IO.Encoding.Latin1 as Latin1 import System.IO import System.IO.Error -- Tests for single-byte enc...
wxwxwwxxx/ghc
libraries/base/tests/IO/encoding005.hs
bsd-3-clause
5,035
0
15
818
1,244
622
622
76
8
module Main where import DynFlags import GHC import qualified GHC.LanguageExtensions as LangExt import Control.Monad (forM_) import Control.Monad.IO.Class (liftIO) import System.Environment (getArgs) main :: IO () main = do [libdir] <- getArgs runGhc (Just libdir) $ do dflags <- getSessionDynFlags setSes...
ezyang/ghc
testsuite/tests/ghc-api/T10508_api.hs
bsd-3-clause
707
0
16
194
192
105
87
26
1
module TestList where {-# CONTRACT head1 :: {ys | not1 (null1 ys)} -> {r | True} #-} -- {-# CONTRACT head1 :: {xs | not (null xs)} -> {r | True} #-} head1 :: [Bool] -> Bool head1 (x:xs) = x not1 True = False not1 False = True null1 [] = True null1 xs = False {-# CONTRACT res2 :: _ #-} res2 = head1 [True] {-# CONTR...
urbanslug/ghc
testsuite/tests/esc/TestList.hs
bsd-3-clause
407
0
7
96
112
62
50
11
1
{-# LANGUAGE OverloadedStrings #-} module WykopFavorites ( indexFavorites , listsFavorites , Favorite(..) , module WykopTypes ) where import WykopTypes import WykopUtils import Control.Applicative ((<$>),(<*>)) import Control.Monad (mzero) import Data.Aeson indexFavorites :: Keys -> Int -> Use...
mikusp/hwykop
WykopFavorites.hs
mit
898
0
11
233
274
152
122
28
1
module P023 (main, isAbundant, solveBasic) where {- A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. A number n is called deficient if the s...
yyotti/euler_haskell
src/P023.hs
mit
1,750
0
10
339
254
141
113
16
1
class Monad m => MonadPlus m where -- the identity of 'mplus'. -- It should also satisfy the equations -- mzero >>= f = mzero -- v >> mzero = mzero mzero :: m a -- an associative operation mplus :: m a -> m a -> m a instance MonadPlus [] where mzero = [] mplus = (++) instance Mona...
iharh/fp-by-example
tex/src/monadplus_class.hs
mit
410
0
9
129
115
61
54
10
0
{-| Module: Flaw.Network.Session Description: Session management. License: MIT -} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Flaw.Network.Session ( SessionManager() , SessionId(..) , Session(..) , newSessionManager , newSession , getSession , deleteSession , ensureActiveSession , SessionExce...
quyse/flaw
flaw-network/Flaw/Network/Session.hs
mit
4,522
0
19
779
930
494
436
96
2
{-# language GeneralizedNewtypeDeriving , RecordWildCards , ConstraintKinds , ViewPatterns #-} module Main(main) where import Data.Set.Interface import qualified Data.List as List import Data.Monoid(mempty) import Test.QuickCheck import Test.Framework (Test, testGroup, defaultMain, plusTestOptio...
adubovik/data-set
tests/Tests.hs
mit
3,872
0
11
1,006
1,305
707
598
88
1
f arr = sum [x | x <- arr, x `mod` 2 /= 0] main = do inputdata <- getContents putStrLn $ show $ f $ map (read :: String -> Int) $ lines inputdata
zooxyt/hackerrank_solutions
fp/intro/sum_of_odd_elements.hs
mit
153
0
11
42
84
42
42
4
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.SVGMarkerElement ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.SVGMarkerElement #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM.JSFFI...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/SVGMarkerElement.hs
mit
361
0
5
33
33
26
7
4
0
module Palindrome where isPalindrome :: (Eq a) => [a] -> Bool isPalindrome x = if (x == reverse x) then True else False
doylew/practice
haskell/palindrome.hs
mit
121
0
8
24
51
29
22
3
2
{-# LANGUAGE DeriveGeneric #-} module Hummingbird.Administration.Response where -------------------------------------------------------------------------------- -- | -- Module : Hummingbird.Administration.Response -- Copyright : (c) Lars Petersen 2017 -- License : MIT -- -- Maintainer : info@lars-peters...
lpeterse/haskell-hummingbird
src/Hummingbird/Administration/Response.hs
mit
12,157
0
24
4,292
2,926
1,389
1,537
212
11
{-| Finding all "uncrossed knight's paths" (http://en.wikipedia.org/wiki/Longest_uncrossed_knight%27s_path) on a NxM rectangular board. This part consists of I/O related components. -} module Main(main) where import UncrossedPaths import System.IO import System.Environment(getArgs, getProgName) import Text.Regex....
jasaarim/uncrossed-paths
Main.hs
mit
3,281
0
19
1,029
832
446
386
59
2
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2018.M01.D11.Exercise where {-- Okay, this was supposed to be a different exercise, but I keep plumbing depths to writing log entries to a data table, a supposedly simple and easy thing, but here we are. Today's Haskell exercise: now that we have lookup data ta...
geophf/1HaskellADay
exercises/HAD/Y2018/M01/D11/Exercise.hs
mit
1,075
0
7
185
96
58
38
9
1
{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE JavaScriptFFI #-} module JavaScript.Web.ErrorEvent ( ErrorEvent , message , filename , lineno , colno ...
tavisrudd/ghcjs-base
JavaScript/Web/ErrorEvent.hs
mit
1,410
12
6
385
259
143
116
37
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-throttlesettings.html module Stratosphere.ResourceProperties.ApiGatewayUsagePlanThrottle...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ApiGatewayUsagePlanThrottleSettings.hs
mit
2,267
0
12
205
264
151
113
27
1
module Rebase.Control.Monad.Signatures ( module Control.Monad.Signatures ) where import Control.Monad.Signatures
nikita-volkov/rebase
library/Rebase/Control/Monad/Signatures.hs
mit
116
0
5
12
23
16
7
4
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-policy.html module Stratosphere.Resources.AutoScalingScalingPolicy where import Stratosphere.ResourceImpo...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/AutoScalingScalingPolicy.hs
mit
7,140
0
15
664
1,001
568
433
72
1
----------------------------------------------------------------------------- -- | -- Module : Groove.Input -- Copyright : (c) Carlos Gómez 2013 -- -- Basic parsing of MusicXML files. -- ----------------------------------------------------------------------------- module Input where --import Debug.Trace imp...
gres147679/MaDMaG
Input.hs
gpl-2.0
12,516
0
18
3,134
3,742
1,970
1,772
237
5
module AI where import Utility {-# INLINE alphabeta #-} alphabeta :: ( Ord score, Show position ) => (position -> Bool) -> position -> ( position -> [ position ] ) -> ( position -> score ) -> score -> score -> Int -> score alphabeta isMaxFun pos moves evaluate minScore maxScore nodes = dynamic where dynamic = f...
kmandelbaum/kamisado
src/AI.hs
gpl-2.0
996
0
16
343
395
206
189
16
3
{-# OPTIONS_GHC -funbox-strict-fields #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module Data.Glome.Cone (disc, cone, cylinder) where import Data.Glome.Vec import Data.Glome.Solid import Data.Glome.Sphere -- for disc bounding box -- We define "Cone", "Cy...
jimsnow/glome
GlomeTrace/Data/Glome/Cone.hs
gpl-2.0
9,552
0
29
3,852
3,448
1,807
1,641
223
10
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module Lamdu.GUI.ExpressionEdit.ApplyEdit ( make ) where import Control.Lens.Operators import Control.Lens.Tuple import Data.Store.Transaction (Transaction) import Data.Vector.Vector2 (Vector2(..)) import qualified Gr...
da-x/lamdu
Lamdu/GUI/ExpressionEdit/ApplyEdit.hs
gpl-3.0
6,723
0
18
1,893
1,823
982
841
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Estuary.Resources where import Control.Concurrent import Control.Monad import Control.Monad.IO.Class import Data.Sequence as Seq import Data.Text (Text) import qualified Data.Text as T import Data.IORef import Estuary.Types.ResourceOp import Estuary.Types.ResourceMeta import...
d0kt0r0/estuary
client/src/Estuary/Resources.hs
gpl-3.0
5,901
0
18
961
2,135
1,091
1,044
114
3
module Infsabot.Tools.Interface ( isPrime, mod', Natural, makeNatural, unNatural, shuffle, allDifferent, sameElements, (!-!), spanNeq, doChecks, (~~>), toolsChecks, getAll ) where import Infsabot.Tools.Logic import Infsabot.Tools.Tests
kavigupta/Infsabot
Infsabot/Tools/Interface.hs
gpl-3.0
281
0
4
68
67
46
21
8
0
-- -- MTLParseCore.hs -- -- Author: Yoshikuni Jujo <PAF01143@nifty.ne.jp> -- -- This file is part of mtlparse library -- -- mtlparse is free software: you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as -- published by the Free Software Foundation, either version 3 of...
YoshikuniJujo/mtlparse
Text/ParserCombinators/MTLParse/MTLParseCore.hs
gpl-3.0
10,180
5
17
3,337
3,986
2,179
1,807
234
1
{- Copyright (C) 2009 John Millikin <jmillikin@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is ...
astro/network-protocol-xmpp
Network/Protocol/XMPP/SASL.hs
gpl-3.0
3,311
44
18
572
922
487
435
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-games-configuration/gen/Network/Google/Resource/GamesConfiguration/LeaderboardConfigurations/Update.hs
mpl-2.0
3,854
0
13
795
382
230
152
66
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-directconnect/gen/Network/AWS/DirectConnect/CreateInterconnect.hs
mpl-2.0
7,116
0
19
1,541
962
579
383
103
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/DomainAliases/List.hs
mpl-2.0
5,239
0
20
1,296
793
460
333
118
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/HTTPSHealthChecks/Patch.hs
mpl-2.0
4,199
0
16
957
470
281
189
78
1
module Text.ParserCombinators.Poly.State ( -- * The Parser datatype Parser(P) -- datatype, instance of: Functor, Monad, PolyParse , Result(..) -- internal to the parser monad , runParser -- :: Parser s t a -> s -> [t] -> (Either String a, s, [t]) -- ** Basic parsers , next -- :: Parser s t t , eof --...
Kludgy/polyparse-fork
src/Text/ParserCombinators/Poly/State.hs
lgpl-2.1
1,424
0
9
306
231
148
83
25
1
module Main where import Test.HUnit import qualified Test.Crypto.FrequencyAnalysis.English import qualified Test.Util.ByteManipulation import qualified System.Exit as Exit import Control.Monad (when) tests :: Test tests = TestList [ TestLabel "Crypto.FrequencyAnal...
stallmanifold/matasano-crypto-challenges
tests/Main.hs
apache-2.0
586
0
10
137
125
72
53
13
1
-- -- Minio Haskell SDK, (C) 2017 Minio, Inc. -- -- 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 ...
donatello/minio-hs
src/Network/Minio/Data/Time.hs
apache-2.0
1,508
0
8
243
224
134
90
23
1
module Delahaye.A338017 (a338017_list, a338017) where import Delahaye.A338012 (a338012) import Helpers.Delahaye (antidiagonalTable) a338017 :: Int -> Integer a338017 n = a338017_list !! (n-1) a338017_list :: [Integer] a338017_list = antidiagonalTable (*) a338012
peterokagey/haskellOEIS
src/Delahaye/A338017.hs
apache-2.0
265
0
7
32
82
48
34
7
1
-- http://www.codewars.com/kata/54eb33e5bc1a25440d000891 module Codewars.Kata.SqIntoSq where import Control.Applicative import Data.Foldable decompose :: Integer -> Maybe [Integer] decompose n = reverse <$> go (n-1) (n^2) go :: Integer -> Integer -> Maybe [Integer] go _ 0 = pure [] go 0 _ = empty go l m = asum $ m...
Bodigrim/katas
src/haskell/4-Square-into-Squares-Protect-trees.hs
bsd-2-clause
675
0
13
157
332
180
152
19
2
module Main where import System.Console.CmdArgs import HEP.Automation.JobQueue.Tester.Type import HEP.Automation.JobQueue.Tester.Command main :: IO () main = do putStrLn "jobtester" param <- cmdArgs mode putStrLn $ show param commandLineProcess param
wavewave/jobtester
exe/jobtester.hs
bsd-2-clause
268
0
8
45
73
39
34
10
1
{-# LANGUAGE OverloadedStrings #-} module Main(main) where import Data.Attoparsec.ByteString (parseOnly) import Data.Text.Encoding (encodeUtf8) import Data.Text (pack) import qualified Data.HashMap.Strict as M import DotLinker import Turtle import Prelude hiding (FilePath) main :: IO () main = sh $ do (dots, mapF...
pjrt/Dot-Linker
app/Main.hs
bsd-3-clause
1,160
0
12
208
303
161
142
25
1
module P24 ( p24 ) where import Data.List listToNum :: [Int] -> Int listToNum [] = 0 listToNum (x:xs) = (x*10^(length xs)) + listToNum xs perms :: [[Int]] perms = sort $ permutations [0..9] p24 :: Int p24 = listToNum $ sort perms !! 999999
pyuk/euler2
src/P24.hs
bsd-3-clause
246
0
9
51
124
68
56
10
1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell {-@ LIQUID "--real "@-} [lq| measure sumD :: [Double] -> Double sumD([]) = 0.0 sumD(x:xs) = x + (sumD xs) |] [lq| measure lenD :: [Double] -> Double lenD([]) = 0.0 lenD(x:xs) = (1.0) + (lenD xs) |] [lq| expression Avg Xs = ((sumD Xs) / (lenD...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/Avg.hs
bsd-3-clause
736
0
7
186
166
95
71
16
1
{-# LANGUAGE CPP #-} -- | Handy functions for creating much Core syntax module MkCore ( -- * Constructing normal syntax mkCoreLet, mkCoreLets, mkCoreApp, mkCoreApps, mkCoreConApps, mkCoreLams, mkWildCase, mkIfThenElse, mkWildValBinder, mkWildEvBinder, sortQuantVars, cast...
ezyang/ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
34,882
0
15
9,024
4,746
2,597
2,149
366
2
----------------------------------------------------------------------------- -- Syntax for the M language; the MLish, starting point of the compiler -- includes: -- exceptions, polymorphism, existentials, recursive types, and -- mutable references -- -- Phillip Mates, 2014 -----------------------------------------...
phillipm/mlish-to-llvm
src/MSyntax.hs
bsd-3-clause
7,758
0
19
1,538
2,550
1,291
1,259
185
4
-- -- trying to be really mean. -- module Plugin where import API import AltData.Dynamic v :: Int -> Int v = \x -> 0xdeadbeef resource_dyn :: Dynamic resource_dyn = toDyn v
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/dynload/should_fail_1/Plugin.hs
bsd-3-clause
178
0
5
37
47
29
18
7
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module BLeague.Models.Fixture where import Protolude import Data.Aeson (FromJSON, ToJSON (..), Value (..), toJSON) import qualified Data.Text as T import GHC.Ge...
ardfard/bleague
server/BLeague/Models/Fixture.hs
bsd-3-clause
1,655
0
12
448
524
294
230
42
1
module Logger.API( LoggerMonad(..) , LoggerEnv(..) , LoggerT , runLoggerT ) where import Control.Concurrent (forkIO) import Control.Monad (forever) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Reader import Data.Proxy import Game.GoreAndAsh -- | API of logging module that is used b...
Teaspot-Studio/gore-and-ash
examples/Logger/API.hs
bsd-3-clause
1,612
0
11
308
420
230
190
-1
-1
module TicTacToe.Data.Board where import qualified TicTacToe.Data.Cell as C newtype Board = Board { getCells :: [[C.Cell]] } deriving (Eq, Ord)
rodamber/haskell-tic-tac-toe
src/TicTacToe/Data/Board.hs
bsd-3-clause
154
0
9
30
48
32
16
6
0
{-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Typeable -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- S...
OS2World/DEV-UTIL-HUGS
libraries/Data/Typeable.hs
bsd-3-clause
13,577
86
16
2,939
4,025
2,168
1,857
212
4
-- parallel haskell evening stylefruits 2014-02-18 module NQueens ( nqueensDimacs ) where import Dimacs ( Dimacs ) vnot = negate atMostOne [] = [] atMostOne [x] = [] atMostOne (x:xs) = [ [vnot x, vnot y] | y <- xs ] ++ atMostOne xs onlyone [] = [] onlyone [_] = [] onlyone vars = vars : at...
malie/drolesat
NQueens.hs
bsd-3-clause
972
0
14
365
470
253
217
25
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RankNTypes #-} module Data.Tree.RBTests ( runTests ) where import Data.Functor ((<$>)) import Data.Tree.RBTree import Test.QuickCheck type Version = Int type Value = Int data Cell = Cell Version Value deriving (Show) instance Eq Cell where a == b = compare a b == ...
Concelo/concelo
test/Data/Tree/RBTests.hs
bsd-3-clause
1,864
0
17
400
621
310
311
44
2
module Data.Function.Instances.Algebra.Lattice where import Data.Function.Instances.Algebra.Internal import Algebra.Lattice as L instance C a => C ((->) k a) where up = zipFn up dn = zipFn dn
TobBrandt/function-instances-algebra
Data/Function/Instances/Algebra/Lattice.hs
bsd-3-clause
198
0
8
32
66
39
27
6
0
{-| Module : Game.GoreAndAsh.Actor.API Description : Monadic and arrow API for actor core module Copyright : (c) Anton Gushcha, 2015-2016 License : BSD3 Maintainer : ncrashed@gmail.com Stability : experimental Portability : POSIX Module that contains monadic and arrow API of actor module. -} module Game....
Teaspot-Studio/gore-and-ash-actor
src/Game/GoreAndAsh/Actor/API.hs
bsd-3-clause
11,566
1
20
2,415
3,199
1,651
1,548
-1
-1
module D12Lib where import Data.Graph import Data.List (foldl', nub, sort) import Data.Void import Text.Megaparsec (parse, endBy, sepBy, Parsec, ParseError, Token) import Text.Megaparsec.Char (string, eol) import Text.Megaparsec.Char.Lexer as L type Parser = Parsec Void String type ParseResult = Either (ParseError C...
wfleming/advent-of-code-2016
2017/D12/src/D12Lib.hs
bsd-3-clause
1,138
0
10
211
497
276
221
33
1
module Data.Expression ( Expression(..) , expressionSym , runValueExpression , runMatchExpression ) where data Expression a g f r = ClosedExpression (f r) | OpenExpression a (Expression a g f (g r)) instance (Functor f, Functor g) => Functor (Expression a g f) where ...
AshleyYakeley/countable
src/Data/Expression.hs
bsd-3-clause
1,591
0
15
337
749
390
359
27
1
{- Zachary Weaver Version 0.1.1 Rect.hs I thought I'd improve on the SDL a bit. Provides utilities for working with rectanles and points -} module Plane where import Data.Lens.Common import Control.Monad.Cont import Graphics.UI.SDL.Rect type Point = (Double, Double) type Size = (Int, Int)...
zearen-wover/Hobgoblin
Plane.hs
bsd-3-clause
3,369
0
16
831
1,203
621
582
66
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS -fno-warn-unused-do-bind -fno-warn-type-defaults #-} -- | An overview of all the IRC gubbins, stats, charts, pretty pictures, etc. module Ircbrowse.View.Overview (overview,statsOverview) where import Ircbrowse.Types.Import import I...
chrisdone/ircbrowse
src/Ircbrowse/View/Overview.hs
bsd-3-clause
3,610
0
23
868
1,129
538
591
96
1
module Util.HTML.PS ( Html , Attribute , Attributable , renderHtml , toHtml , attribute , empty , parent , leaf , makeAttr , makePar , makeLeaf , (!) , ($<) ) where import Data.Monoid ( Monoid, mappend ) import System.IO.Unsafe import Util.DOM...
johanneshilden/liquid-epsilon
Util/HTML/PS.hs
bsd-3-clause
4,824
11
13
1,317
1,136
608
528
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveDataT...
andrewthad/vinyl-vectors
src/Data/Vector/Vinyl/Default/Empty/Monomorphic/Internal.hs
bsd-3-clause
7,929
0
16
1,634
2,822
1,446
1,376
186
1
module Tactics.RandomZigZag where import System.Random import Types import Command import Game (GameState) import Play newPlayer :: IO Player newPlayer = do g <- newStdGen return $ replayPlayer $ map convert (randoms g) where convert :: Int -> Command convert n = if odd n then Move SE else Move SW
msakai/icfpc2015
src/Tactics/RandomZigZag.hs
bsd-3-clause
316
0
10
67
106
56
50
12
2
{-# LANGUAGE DeriveDataTypeable #-} module Reactor.Atomic where import Control.Monad import Control.Monad.IO.Class import Data.Bits.Atomic import Data.Data import Foreign.Ptr import Foreign.ForeignPtr import Foreign.Storable import System.IO.Unsafe newtype Atomic a = Atomic (ForeignPtr a) deriving (Data, Typeable) ...
ekmett/reactor
Reactor/Atomic.hs
bsd-3-clause
2,756
0
10
511
1,025
514
511
60
1
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTyp...
jwiegley/hnix
src/Nix/Effects/Basic.hs
bsd-3-clause
11,262
8
30
3,424
3,080
1,544
1,536
256
9
{-- snippet join --} join :: Monad m => m (m a) -> m a join x = x >>= id {-- /snippet join --}
binesiyu/ifl
examples/ch14/MonadJoin.hs
mit
105
0
9
35
43
21
22
2
1
module TextGen where import Test.QuickCheck import Data.Char (isLower, isUpper) genLowerChar, genUpperChar :: Gen Char genLowerChar = elements ['a'..'z'] genUpperChar = elements ['A'..'Z'] -- A lower or upper-case character. genPascalChar :: Gen Char genPascalChar = oneof [genLowerChar, genUpperChar] -- A string of...
PhDP/Sphinx-AI
tests/TextGen.hs
mit
814
0
11
121
195
106
89
16
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module CryptoDef ( BcryptPassword , bcryptPassword ) where import Crypto.BCrypt import Data.ByteString import qualified Data.Profunctor.Product.Default as D import ...
meditans/haskell-webapps
SpockOpaleye/src/CryptoDef.hs
mit
1,182
0
10
245
247
134
113
31
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | 'Arbitrary' instances for 'Pos.Infra.Communication' types defined in 'src' module Test.Pos.Infra.Arbitrary.Txp () where import Test.QuickCheck (Arbitrary (..)) import Test.QuickCheck.Arbitrary.Generic (genericArbitrary, ...
input-output-hk/pos-haskell-prototype
infra/test/Test/Pos/Infra/Arbitrary/Txp.hs
mit
559
0
6
123
88
59
29
11
0
{-#LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} module Carnap.Languages.PurePropositional.Logic.EbelsDuggan (parseEbelsDugganTFL, EbelsDugganTFL, ebelsDugganTFLCalc) where import Data.Map as M (lookup, Map) import Text.Parsec import Carnap.Core.Data.Types (Form) import Carnap.Languages...
opentower/carnap
Carnap/src/Carnap/Languages/PurePropositional/Logic/EbelsDuggan.hs
gpl-3.0
5,620
0
17
1,845
1,364
744
620
113
12
{-# 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-autoscaling/gen/Network/AWS/AutoScaling/CreateAutoScalingGroup.hs
mpl-2.0
13,759
0
13
2,561
1,606
973
633
178
1
{-# LANGUAGE CPP, TypeFamilies #-} -- Type definitions for the constraint solver module TcSMonad ( -- The work list WorkList(..), isEmptyWorkList, emptyWorkList, extendWorkListNonEq, extendWorkListCt, extendWorkListDerived, extendWorkListCts, extendWorkListEq, appendWorkList, selectNextWorkItem, ...
AlexanderPankiv/ghc
compiler/typecheck/TcSMonad.hs
bsd-3-clause
111,130
42
24
31,401
17,801
9,408
8,393
-1
-1
-- (c) The University of Glasgow 2006 {-# LANGUAGE DeriveDataTypeable, CPP #-} -- | Module for (a) type kinds and (b) type coercions, -- as used in System FC. See 'CoreSyn.Expr' for -- more on System FC and how coercions fit into it. -- module ETA.Types.Coercion ( -- * Main data type Coercion(..), Var...
pparkkin/eta
compiler/ETA/Types/Coercion.hs
bsd-3-clause
79,840
1,008
12
20,984
11,717
7,259
4,458
937
16
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Sandbox -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- UI for the sandboxing functionality. ----------------------------------------------------------...
edsko/cabal
cabal-install/Distribution/Client/Sandbox.hs
bsd-3-clause
40,327
0
22
10,895
6,450
3,361
3,089
599
7
{-# LANGUAGE CPP #-} -- | In/with newtype functions generation with Template Haskell. -- -- Example: -- -- > {-# LANGUAGE TemplateHaskell #-} -- > import Control.Applicative (Applicative(..), ZipList(..)) -- > import Data.Newtype (mkWithNewTypeFuncs) -- > -- > $(mkWithNewtypeFuncs [2] ''ZipList) -- > -- > > withZipLis...
gxtaillon/peakachu
src/Data/Newtype.hs
bsd-3-clause
4,211
0
21
1,311
1,190
628
562
78
4
module PackageTests.BuildDeps.TargetSpecificDeps2.Check where import Test.HUnit import PackageTests.PackageTester import System.FilePath import Data.List suite :: Test suite = TestCase $ do let spec = PackageSpec ("PackageTests" </> "BuildDeps" </> "TargetSpecificDeps2") [] result <- cabal_build spec ass...
IreneKnapp/Faction
libfaction/tests/PackageTests/BuildDeps/TargetSpecificDeps2/Check.hs
bsd-3-clause
402
0
14
59
95
50
45
10
1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Network/HTTP/Types.hs" #-} {-# LANGUAGE OverloadedStrings #-} module Network.HTTP.Types ( -- * Methods Method , methodGet , methodPost , methodHead , methodPut , methodDelete , methodTrace , methodConnect , methodOptions , methodPatch , StdMethod(..) , parseMethod , renderMeth...
phischu/fragnix
tests/packages/scotty/Network.HTTP.Types.hs
bsd-3-clause
3,191
0
5
443
574
392
182
175
0
import Test.Hspec import Test.QuickCheck import Test.QuickCheck.Modifiers(NonEmptyList (..)) -- import Data.Ord import Data.Char -- import Debug.Trace -- START COUNTING import Data.List b 0="" b n=b(n`div`2)++(show$n`mod`2) s=nub.(tails=<<).inits p x=s x\\[x] n(_,l)x|(p.b)x\\l/=[]=(x,l++(s.b)x)|1<2=(0,l) g=scanl n(1,...
clupascu/codegolf
139335-generate-unseen-numbers/139335-generate-unseen-numbers.golfed.hs
mit
607
1
12
102
395
230
165
16
1
module Bead.View.Fay.JSON.ClientSide where import FFI import Prelude import Data.Data import Bead.Domain.Shared.Evaluation evResultJson :: EvResult -> String evResultJson = ffi "JSON.stringify(%1)" evConfigJson :: EvConfig -> String evConfigJson = ffi "JSON.stringify(%1)" resultJson :: Result -> String resultJson =...
pgj/bead
snaplets/fay/src/Bead/View/Fay/JSON/ClientSide.hs
bsd-3-clause
437
0
5
52
95
55
40
13
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE CPP #-} -- | Backend for Common Gateway Interface. Almost all users should use the -- 'run' function. module Network.Wai.Handler.CGI ( run , runSendfile , runGeneric , requestBodyFunc ) where import Network.Wai import Netwo...
jberryman/wai
wai-extra/Network/Wai/Handler/CGI.hs
mit
7,335
0
32
2,223
1,967
1,024
943
166
7
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sr-CS"> <title>Online Menu | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref ...
thc202/zap-extensions
addOns/onlineMenu/src/main/javahelp/org/zaproxy/zap/extension/onlineMenu/resources/help_sr_CS/helpset_sr_CS.hs
apache-2.0
972
78
66
159
413
209
204
-1
-1
{-# LANGUAGE CPP #-} -- -- (c) The University of Glasgow 2002-2006 -- -- The IO Monad with an environment -- -- The environment is passed around as a Reader monad but -- as its in the IO monad, mutable references can be used -- for updating state. -- module IOEnv ( IOEnv, -- Instance of Monad -- Mona...
sgillespie/ghc
compiler/utils/IOEnv.hs
bsd-3-clause
7,316
0
18
1,575
1,951
1,032
919
108
1
module Mod where import A h :: Int h = g
ezyang/ghc
testsuite/tests/backpack/cabal/bkpcabal03/Mod.hs
bsd-3-clause
41
0
4
11
17
11
6
4
1
-- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you ma...
jcgruenhage/dendrite
vendor/src/github.com/apache/thrift/test/hs/TestServer.hs
apache-2.0
10,520
0
20
3,214
2,740
1,404
1,336
221
12
{- | Module : $Header$ Description : Provides basic help functionality. Author : Nils 'bash0r' Jonsson Copyright : (c) 2015 Nils 'bash0r' Jonsson License : MIT Maintainer : aka.bash0r@gmail.com Stability : unstable Portability : non-portable (Portability is untested.) Provides basic help fu...
aka-bash0r/headergen
src/Headergen/Commands/Help.hs
mit
1,173
0
8
245
217
107
110
30
1
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, UndecidableInstances #-} {-# LANGUAGE FlexibleInstances, DefaultSignatures #-} module Control.Monad.Namer ( MonadNamer (..) , NameGen , fresh, freshVar ) where import Control.Applicative import Control.Monad.List import Control.Mo...
pxqr/unification
Control/Monad/Namer.hs
mit
1,980
0
12
405
532
293
239
37
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.MediaStreamTrackEvent (js_getTrack, getTrack, MediaStreamTrackEvent, castToMediaStreamTrackEvent, gTypeMediaStreamTrackEvent) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, D...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/MediaStreamTrackEvent.hs
mit
1,450
6
11
171
377
238
139
25
1
module Parser.Common where import Text.Parsec import Text.Parsec.String import Text.Parsec.Char import Types openParen :: Parser Char openParen = do { spaces; char '('} closeParen :: Parser Char closeParen = do { spaces; char ')'} openCurly :: Parser Char openCurly = do { spaces; char '{'} closeCurly :: Parser Ch...
PelleJuul/popl
src/Parser/Common.hs
mit
634
0
10
127
223
115
108
24
1
{-# LANGUAGE ExistentialQuantification, FlexibleInstances, FunctionalDependencies, KindSignatures, MultiParamTypeClasses, TupleSections #-} module Jatek.Actor where -- NOTE: this is not intended as a general-purpose Actor library. Its main -- purpose is to reify (through System) abstractions like InteractT. import ...
michaelochurch/jatek
Jatek/Actor.hs
mit
3,665
0
17
930
1,444
762
682
74
2
module Rebase.Text.Read.Lex ( module Text.Read.Lex ) where import Text.Read.Lex
nikita-volkov/rebase
library/Rebase/Text/Read/Lex.hs
mit
83
0
5
12
23
16
7
4
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternSynonyms #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Physics.Orbit.QuickCheck ( CircularOrbit(..) , EllipticOrbit(..) , ParabolicOrbit(..) , HyperbolicOrbit(..) , CanonicalOrbit(..) ,...
expipiplus1/orbit
test/Physics/Orbit/QuickCheck.hs
mit
9,261
0
15
2,557
2,305
1,222
1,083
168
1
module WallFollower where import Frob import RobotSim --import MyRobotModel emptyWorld = maybeReadWorldFromPath "as33" maybeReadWorldFromPath p = do w <- readWorldFromPath p case w of Right w' -> return w' Left s -> return [] wheelSpeedsT :: WheelControl o => Behavior i Speed -> Behavior i Sp...
jatinshah/autonomous_systems
as3/second.hs
mit
2,856
46
12
705
1,014
516
498
61
2
{-# OPTIONS_GHC -fno-warn-orphans #-} module Graphics.Urho3D.Graphics.Viewport( Viewport , viewportContext , SharedViewport , viewportSetScene , viewportSetCamera , viewportSetRect , viewportSetRenderPath , viewportSetRenderPathXML , viewportSetDrawDebug , viewportSetCullCamera , viewportGetScen...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/Viewport.hs
mit
8,489
0
20
1,449
1,905
1,027
878
-1
-1
module Main where import Lib import TspProblem import Utils import System.Environment main :: IO () main = do args <- getArgs main_ args main_ :: [String] -> IO () main_ args = do problem <- read_tsp_problem_from_file $ get_elem_by_idx 0 args let initial_state = [0] ++ [1..(pred $ points_num problem)] ++ [0...
CaptainTrunky/pure_tsp
app/Main.hs
mit
745
0
15
141
273
135
138
21
1
revFacAux :: (Int, Int) -> String revFacAux (1, m) = " = " ++ show (m - 1) ++ "!" revFacAux (0, m) = " NONE" revFacAux (n, m) = revFacAux (n `div` m, m + 1) revFac :: [Int] -> [String] revFac [] = [] revFac (x:xs) = (show(x) ++ revFacAux(x, 1)) : revFac xs main = mapM_ putStrLn $ revFac [3628800, 479001600, 6, 18]
dariosilva/dailyProgrammer
easy/286/main.hs
mit
319
0
9
69
193
106
87
8
1
module Exploration.Data.Identity.Instance.Functor where import Exploration.Data.Identity.Definition import Exploration.Category.Functor import Exploration.Template.Functor $(mkFunctor [t|Identity|] [|identityMap|])
SamuelSchlesinger/Exploration
Exploration/Data/Identity/Instance/Functor.hs
mit
217
0
7
14
47
32
15
-1
-1
-- Fixes behaviour of spaces and other special signs module Cipher where import Data.Char transform :: Char -> Int -> Char transform c n = chr $ (+) (denormalizeLetterPosition c) $ findPosition $ (+) (normalizeLetterPosition c) n findPosition :: Int -> Int findPosition p = p `mod` 26 normalizeLetterPosition :: Char...
raventid/coursera_learning
haskell/common_chapters/cipher.hs
mit
718
0
10
148
306
157
149
19
1
------------------------------------------------------------------------ -- | -- Module : Main -- License : GPL -- ------------------------------------------------------------------------ -- This program is free software; you can redistribute it and/or -- modify it under the terms of the GNU General Public Lic...
juhp/haskal
src/Haskal.hs
gpl-2.0
6,006
0
16
1,503
1,958
1,015
943
-1
-1
{- | Module : $Header$ Description : Generation of Lemmata for CMDs Copyright : (c) Dominik Dietrich, DFKI Bremen, 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : Dominik.Dietrich@dfki.de Stability : provisional Portability : portable Interface for Reduce CAS system. -} module CSL.L...
nevrenato/Hets_Fork
CSL/Lemma_Export.hs
gpl-2.0
2,581
0
9
569
534
267
267
35
1
{-# LANGUAGE FlexibleContexts #-} module Code.Huffman.Throw where -- $Id$ import Code.Type import Code.Huffman.Config import Autolib.Reader import Autolib.ToDoc import System.Random throw :: ( Ord a , ToDoc [a], Reader [a] ) => Config a -> IO ( Frequency a ) throw conf = do xis <- sequence $ do ...
Erdwolf/autotool-bonn
src/Code/Huffman/Throw.hs
gpl-2.0
465
0
17
122
163
84
79
17
1