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 ParallelListComp #-} module UnitTests.Distribution.Solver.Modular.WeightedPSQ ( tests ) where import qualified Distribution.Solver.Modular.WeightedPSQ as W import Data.List (sort) import Test.Tasty (TestTree) import Test.Tasty.HUnit (testCase, (@?=)) import Test.Tasty.QuickCheck (Blind(..), testProp...
sopvop/cabal
cabal-install/tests/UnitTests/Distribution/Solver/Modular/WeightedPSQ.hs
bsd-3-clause
2,011
1
17
550
767
426
341
41
1
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, OverlappingInstances, UndecidableInstances, Rank2Types, KindSignatures, EmptyDataDecls #-} {-# OPTIONS_GHC -Wall #-} module Main (main) where import Data.Typeable cla...
urbanslug/ghc
testsuite/tests/typecheck/should_run/T3731.hs
bsd-3-clause
6,601
0
15
2,291
1,348
722
626
121
2
-- Copyright © 2014 <code@io7m.com> http://io7m.com -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE...
io7m/r2
com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/Vector3f.hs
isc
2,331
0
11
594
719
396
323
55
2
module ResultTypes ( ResultRec (..), Results (..) , Chain (..), Section (..) ,Scheme (..),SchemeRec (..), TdsParms (..), SecOrSchm ,section2String,schemeRec2String, omd2ResultRec ,omd2Results,readSection,writeSecOrSchm ,readSectionsFromOutFile,resultsPerChain -- tdsChains ,readResultsPerChain ...
rawlep/EQS
sourceCode/ResultTypes.hs
mit
41,169
0
18
13,439
10,110
5,446
4,664
511
5
module Main where import System.Uptime import Test.Hspec main :: IO () main = hspec $ do describe "sysUpTime" $ do it "returns positive number" $ do sysuptime <- sysUpTime sysuptime `shouldSatisfy` (>0)
IMOKURI/sysuptime
tests/Tests.hs
mit
225
0
15
54
73
38
35
9
1
module Main where import Application (ApplicationState (..)) import Doppler.GHCJS.View (render) main :: IO () main = render ApplicationState { getNumberOfClicks = 0 }
oinuar/doppler
samples/skeleton/Main.hs
mit
188
0
7
44
53
32
21
7
1
module Statistics ( geometric, harmonic, median, mean, nthroot, sd, variance, varianceRatio ) where import Data.List -- | Exported functions -- foreign export ccall nthroot :: Float -> Float -> Float -- | Geometric mean of values geometric :: [Float] -> Float geometric xs = nthroot (fromIntegral(leng...
korczis/haskell-world
lib/Statistics.hs
mit
1,577
0
12
399
687
364
323
37
3
module Grains ( square , total ) where square :: Int -> Integer square n = 2 ^ (n - 1) total :: Integer total = 2 ^ 64 - 1
tfausak/exercism-solutions
haskell/grains/Grains.hs
mit
125
0
7
33
58
33
25
7
1
{-| Module: Flaw.Editor.UI.FileDialog Description: Dialog allowing user to select a file. License: MIT -} {-# LANGUAGE OverloadedStrings, ViewPatterns #-} module Flaw.Editor.UI.FileDialog ( FileDialogService(..) , newFileDialogService , FileDialogConfig(..) , runFileDialog ) where import Control.Concurrent...
quyse/flaw
flaw-editor/Flaw/Editor/UI/FileDialog.hs
mit
6,832
0
25
1,471
1,837
910
927
168
7
module CAH.Cards.Serialize where import CAH.Cards.Types import System.IO import Control.Monad import Data.Monoid import Control.Applicative import Data.Set (Set) import qualified Data.Set as S import qualified Data.Text as T import qualified Data.Text.IO as T...
EXio4/ircah
src/CAH/Cards/Serialize.hs
mit
3,723
0
17
1,039
1,300
676
624
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} -- | Data types describing the execution environment -- of virtual machine builds. -- 'ExecEnv', 'Resources' and 'SharedDirectory' describe how -- "B9.LibVirtLXC" should configure and execute -- build scripts, as defined in "B9.ShellScript" and "B9.Vm". module B9.ExecEnv...
sheyll/b9-vm-image-builder
src/lib/B9/ExecEnv.hs
mit
2,562
0
10
545
691
376
315
83
1
module Filters (get, post, dir) where import MyHttp(RequestType(..), Request(..), Context(..), ServerPart) iff :: (Context -> Bool) -> Context -> Maybe Context iff condition context = if condition context then Just context else Nothing get :: ServerPart get = iff (\ctx -> reqtype (request c...
nicolocodev/learnhappstack
5_UsingMsum/Filters.hs
mit
493
0
11
114
200
111
89
13
2
module FrontEnd.Tc.Unify( subsumes, boxyMatch, printRule, listenSolvePreds ) where import Control.Monad import Control.Monad.Trans import Control.Monad.Writer(Monoid(..)) import qualified Data.Map as Map import qualified Data.Set as Set import Doc.DocLike import Doc.PPrint import FrontEnd.Tc.Clas...
m-alvarez/jhc
src/FrontEnd/Tc/Unify.hs
mit
9,422
4
18
3,103
3,642
1,737
1,905
-1
-1
{-# LANGUAGE TemplateHaskell, GADTs, OverloadedStrings #-} -- TODO: Split this module into public and private parts. module App where import Control.Applicative ((<$>)) import Control.Concurrent.STM.TQueue (writeTQueue) import Control.Monad.IO.Class import Control.Monad.Reader import Control.Monad.STM (atomically) i...
wass80/WXCS
src/App.hs
mit
11,623
4
35
2,575
3,667
1,759
1,908
257
9
module Pretty where import Text.PrettyPrint (Doc, (<>), (<+>)) import qualified Text.PrettyPrint as PP parensIf :: Bool -> Doc -> Doc parensIf True = PP.parens parensIf False = id block :: [Doc] -> Doc block [] = PP.text "{}" block ts = (PP.text "{") PP.$$ (PP.nest 2 ((PP.vcat $ PP.punctuate (PP.text " ; ") ts)...
sdiehl/unirewrite
src/Pretty.hs
mit
388
0
15
79
182
99
83
12
1
module PetaVision.Data.Histogram1D where import Control.Monad as M import Data.Vector.Unboxed as VU import Graphics.Rendering.Chart.Backend.Cairo import Graphics.Rendering.Chart.Easy data Histogram1D = Histogram1D { histogram1DStep ...
XinhuaZhang/PetaVisionHaskell
PetaVision/Data/Histogram1D.hs
gpl-3.0
2,470
0
27
745
828
447
381
65
2
{-# LANGUAGE TemplateHaskell, FlexibleInstances, IncoherentInstances#-} module Bmp where import Images import Test.QuickCheck import Data.Binary( Binary(..), encode ) import Codec.Picture.Bitmap import Codec.Picture.Types import Codec.Picture.Metadata import qualified Data.ByteString.Lazy as L import Data.DeriveTH ...
fcostantini/QuickFuzz
src/Bmp.hs
gpl-3.0
758
0
8
87
147
89
58
18
1
{-# LANGUAGE DeriveGeneric #-} module Estuary.Types.ImageMeta where import Data.Text import GHC.Generics import Data.Aeson import Estuary.Types.AspectRatio data ImageMeta = ImageMeta { imageResolution :: (Int, Int), imageAspectRatio :: AspectRatio } deriving (Show,Generic) instance ToJSON ImageMeta where t...
d0kt0r0/estuary
common/src/Estuary/Types/ImageMeta.hs
gpl-3.0
393
0
9
54
90
53
37
13
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE TemplateHaskell #-} -- | -- Copyright : (c) 2019 Robert Künnemann -- License : GPL v3 (see LICENSE) -- -- Maintainer : Robert Künnemann <robert@kunnemann.de> -- Portability : GHC only -- -- Exceptions used during translation module...
kmilner/tamarin-prover
lib/sapic/src/Sapic/Exceptions.hs
gpl-3.0
3,696
12
22
1,062
575
313
262
62
1
{- | If you have a Traversable instance of a record, you can load and store all elements, that are accessible by Traversable methods. In this attempt we support elements of unequal size. However this can be awfully slow, since the program might perform size computations at run-time. -} module Foreign.Storable.Traversab...
elitak/hs-datahand
stm32f10x/hs_src/Foreign/Storable/TraversableUnequalSizes.hs
gpl-3.0
2,405
0
13
518
752
393
359
68
1
module Robatira.Model.Exceptions where type ExceptionMessage = String data Exception a = NotEnoughCardsException ExceptionMessage | ThrowingCardNotInHandException ExceptionMessage | EmptyDealingStackException ExceptionMessage a | NoCardsToRefillDealingStack ExceptionMess...
pbrandwijk/robatira
src/Robatira/Model/Exceptions.hs
gpl-3.0
420
0
6
111
58
35
23
8
0
module LibPico.CellManagement where libPicoCellManagement :: ([String],[String],String) libPicoCellManagement = ([ "%copy", "@>", "=0", "@>", "=0", "@<2", "[/0]~copyloop1", "-1", "@>", "+1", "@>", "+1", "@<2", "[END]~copyloop1", ...
toish/Pico
src/LibPico/CellManagement.hs
gpl-3.0
958
108
7
387
311
188
123
56
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-apps-reseller/gen/Network/Google/Resource/Reseller/Customers/Insert.hs
mpl-2.0
3,343
0
14
758
393
236
157
62
1
-- -- Copyright 2017-2018 Azad Bolour -- Licensed under GNU Affero General Public License v3.0 - -- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md -- {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} module BoardGame.Common.Domain.InitPieces ( InitPieces(..) ) where import GHC.Gene...
azadbolour/boardgame
haskell-server/src/BoardGame/Common/Domain/InitPieces.hs
agpl-3.0
727
0
9
99
150
94
56
16
0
{-# LANGUAGE TypeFamilies #-} -- | Functions for working with Device entity -- This module is intended to be imported qualified as Device module Gonimo.Server.Db.Device where import Control.Monad (MonadPlus, guard) import Control.Monad.State.Class import Control.Monad....
gonimo/gonimo-back
src/Gonimo/Server/Db/Device.hs
agpl-3.0
1,883
0
11
591
443
251
192
-1
-1
{- | Module : Network.Textocat.Simple Description : Simple binding for Textocat API Copyright : (c) Mansur Ziatdinov, 2014--2015 License : Apache-2.0 Maintainer : mz+textocat-api@fosslabs.ru Stability : experimental Portability : POSIX Functions in this module are in one-to-one correspondence with API ca...
gltronred/textocat-api-haskell
src/Network/Textocat/Simple.hs
apache-2.0
3,594
2
21
930
651
345
306
66
3
-- Copyright (c) 2010 - Seweryn Dynerowicz -- 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 agree...
sdynerow/SemiringsLibrary
Policy/Paths.hs
apache-2.0
1,731
0
11
433
543
288
255
39
1
-- http://www.codewars.com/kata/5426d7a2c2c7784365000783 module Balanced.Parens where import Control.Monad balancedParens :: Int -> [String] balancedParens 0 = [""] balancedParens n = concatMap f [0..n-1] where f m = liftM2 (\a -> \b -> '(':a ++ ')':b) (balancedParens m) (balancedParens (n-1-m))
Bodigrim/katas
src/haskell/4-All-Balanced-Parentheses.hs
bsd-2-clause
300
0
13
41
122
66
56
6
1
{-# LANGUAGE NoMonomorphismRestriction #-} module DetermineTheTypeProblem1 where -- simple example example = 1 a = (* 9) 6 b = head [(0,"doge"),(1,"kitteh")] c = head [(0 :: Integer ,"doge"),(1,"kitteh")] d = if False then True else False e = length [1, 2, 3, 4, 5] f = (length [1, 2, 3, 4]) > (length "TACOCAT")
OCExercise/haskellbook-solutions
chapters/chapter05/exercises/determine_the_type_p1.hs
bsd-2-clause
315
0
8
57
147
90
57
9
2
module Main where import Orbit as O import Graphics.UI.GLUT as G import System.Exit (exitWith, ExitCode(ExitSuccess)) import Control.Monad (unless,when,forM_) import Data.IORef (IORef, newIORef) import Data.List.Split (chunk) import System.Random delta :: Int delta = 25 objectCount :: Int objectCount = 60 data St...
fffej/haskellprojects
newton/Main.hs
bsd-2-clause
3,410
0
19
770
1,416
710
706
92
1
module Combinatorics where factorials :: [Integer] factorials = scanl (*) 1 [1..] choose :: Int -> Int -> Integer k `choose` i = (product [k'-i'+1..k']) `div` (factorials!!i) where i' = fromIntegral i k' = fromIntegral k
robbertkrebbers/fewdigits
Combinatorics.hs
bsd-2-clause
230
0
10
45
105
59
46
8
1
---------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Rename -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2009 -- License : BSD-like -- -- Maintainer : haddock@projects.haskell.org -- Stability : experimen...
nominolo/haddock2
src/Haddock/Interface/Rename.hs
bsd-2-clause
14,578
0
17
3,384
4,834
2,319
2,515
319
17
{-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} type Apply a m = m a type Binary f a = f a (f a a) type family Listo a type instance Listo Double = [Double] xs :: Apply Int [] xs = [6,7] mul :: Binary (->) Int mul = (*) mulu :: Binary (,) Int mulu = (6,(7,42)) main = do print $ mul 6 7
nushio3/funky
attic/tctest.hs
bsd-3-clause
309
0
8
76
144
84
60
14
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {- | The functions in this module correspond to the [Consul Session API](https://www.consul.io/api/session). Feel free to contribute via the [repo on GitHub](https://github.com/A...
alphaHeavy/consul-haskell
src/Network/Consul/Client/Session.hs
bsd-3-clause
4,731
0
19
1,564
1,050
535
515
99
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE FlexibleContexts #-} ----------------------------------------------------------------------------- -- | -- Module : Yesod.Auth.LdapNative -- Copyright : (C) 2015 Maciej Kazulak -- License : BSD-style ...
mulderr/yesod-auth-ldap-native
src/Yesod/Auth/LdapNative.hs
bsd-3-clause
10,677
0
20
2,346
2,245
1,220
1,025
171
12
module T where import Tests.Basis prop_push_pop_idempotent = property (\s a -> s == pop (push (a::Int) s)) -- dodgy test prop_pop_push_mostly_idempotent = property (\s -> let x = top s in s == push (x::Int) (pop s)) -- fixed prop_pop_push_idempotent = property (\s -> let x = top s in s == empty || s == push...
peteg/TBC
Sample/Tests/02_idempotent.hs
bsd-3-clause
516
0
13
103
177
95
82
8
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Install -- Copyright : (c) 2005 David Himmelstrup -- 2007 Bjorn Bringert -- 2007-2010 Duncan Coutts -- License : BSD-like -- -- Mai...
thomie/cabal
cabal-install/Distribution/Client/Install.hs
bsd-3-clause
69,810
274
34
20,003
12,710
6,732
5,978
1,231
12
{-# LANGUAGE OverloadedStrings #-} module Auth.DbAuth where import Data.Text import Database.Persist.MySQL import Database.Persist.Sql import Control.Monad.IO.Class import Control.Monad.Trans.Either import Servant.API import Servant import Auth.AuthHeader import Db.Common import qualified Db.User as Db import qualif...
dbushenko/biblio
src/Auth/DbAuth.hs
bsd-3-clause
1,427
0
14
298
438
227
211
33
2
module Util where import Data.Rated import Data.Char (isSpace) -- Utility functions infixr 2 <?> (<?>) :: Rated a -> a -> a m1 <?> s = fromRated s m1 trim :: String -> String trim = let f = reverse . dropWhile isSpace in f . f maybeToRated :: Int -> Maybe a -> Rated a maybeToRated i (Just t) = Rate i t maybeToRa...
jb55/hmetadata
Util.hs
bsd-3-clause
343
0
10
78
145
75
70
11
1
{-# LANGUAGE OverloadedStrings #-} -- | Module to handle the news items. module Website.News ( newsCxt, newsField, allNewsField , newsRules ) where import Data.Monoid ( (<>) ) import Data.String import Hakyll import Prelude import System.FilePath import Config import Website.Utils categorie...
indian-curry/indian-curry.github.io
Website/News.hs
bsd-3-clause
2,767
0
22
678
608
307
301
58
1
{-# LANGUAGE TemplateHaskell, GeneralizedNewtypeDeriving, RecordWildCards #-} module AbstractInterpretation.Sharing.Result where import Data.Set (Set) import Data.Map (Map) import qualified Data.Set as Set import qualified Data.Map as Map import Lens.Micro.Platform import Grin.Grin (Name, Tag) import Abstract...
andorp/grin
grin/src/AbstractInterpretation/Sharing/Result.hs
bsd-3-clause
1,178
0
12
163
285
159
126
27
1
module Unix where import control.monad.Instances import container.List import container.Char import container.Maybe import text.Printf import sys.Environment -- First, two helpers io f = interact (unlines . f . lines) showln = (++ "\n") . show -- remove duplicate lines from a file (like uniq) uniq = nub --...
ppedemon/Bluejelly
bluejelly-bjc/src/test/resources/parser.tests/Unix.hs
bsd-3-clause
3,970
6
12
1,502
870
495
375
-1
-1
-- | -- Module: Control.Wire.Core -- Copyright: (c) 2013 Ertugrul Soeylemez -- License: BSD3 -- Maintainer: Ertugrul Soeylemez <es@ertes.de> module Control.Wire.Core ( -- * Wires Wire(..), stepWire, -- * Constructing wires mkConst, mkEmpty, mkGen, mkGen_, mk...
Teaspot-Studio/netwire
Control/Wire/Core.hs
bsd-3-clause
13,495
0
19
4,725
5,668
2,948
2,720
-1
-1
{-# LANGUAGE MultiWayIf, ScopedTypeVariables #-} module Spec.VirtualMemory ( translate, getVPN, getMode, translateHelper, VirtualMemoryMode(..)) where import Spec.Machine import Utility.Utility import qualified Spec.CSRField as Field import Data.Bits import Prelude import Data.Int data VirtualMemoryMode = None | Sv32 ...
mit-plv/riscv-semantics
src/Spec/VirtualMemory.hs
bsd-3-clause
6,606
1
30
1,713
2,185
1,104
1,081
127
9
{-| Module : Werewolf.Command.Vote Description : Options and handler for the vote subcommand. Copyright : (c) Henry J. Wylde, 2016 License : BSD3 Maintainer : public@hjwylde.com Options and handler for the vote subcommand. -} module Werewolf.Command.Vote ( -- * Options Options(..), -- * Hand...
hjwylde/werewolf
app/Werewolf/Command/Vote.hs
bsd-3-clause
1,759
0
15
395
407
224
183
34
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuo...
jamshidh/ethereum-data-sql
src/Blockchain/Data/Address.hs
bsd-3-clause
4,618
0
12
887
1,219
658
561
98
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main where import Data.ByteString.Lazy.Char8 as BS import Data.String import Data.Text import Data.Word import qualified Prelude import Prelude hiding (show) import Test.Hspec import ...
chrra/htiled
tests/UnitTests.hs
bsd-3-clause
3,808
0
27
1,178
1,042
544
498
90
1
{- FSQL : Expr.hs -- Expression functions - - Copyright (C) 2015 gahag - All rights reserved. - - This software may be modified and distributed under the terms - of the BSD license. See the LICENSE file for details. -} module Expr ( Expr, TypeError(..), compile ) where import Control.Monad.Exce...
gahag/FSQL
src/Expr.hs
bsd-3-clause
670
0
7
198
125
76
49
10
1
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} module RPC.Internal.Types where import qualified Data.Aeson as A import qualified Data.Aeson.Types as AT import qualified Data.HashMap.Strict as M import Data.Aeson ((.=), (.:)) import Data.Functor ((<$>)) import Control.Applicative ((<*>)) data Request params = Reque...
max630/json-exec
RPC/Internal/Types.hs
bsd-3-clause
1,722
0
13
297
681
358
323
42
2
module Main (main) where import Criterion.Main (bench, bgroup, defaultMain, whnf) import qualified Data.DList as DList import qualified Data.DList.DNonEmpty as DNonEmpty import qualified Data.DList.NonEmpty as NonEmptyDList import qualified Data.Foldable as Foldable import qualified Data.List.NonEmpty as NonEmpty impo...
spl/dlist
bench/Main.hs
bsd-3-clause
2,855
0
15
972
1,094
580
514
79
2
module Main where import Reflex.Dom main :: IO () main = mainWidget $ el "div" $ do el "h1" $ text "reflex-starter" el "a" $ text "Now you can start playing with Reflex!"
yamafaktory/reflex-starter
app/Main.hs
bsd-3-clause
177
0
9
39
61
29
32
6
1
module RealWorld.Api.Profiles where import RealWorld.Prelude import Servant import RealWorld.Monad type Api = Get '[JSON] () server :: ServerT Api RealWorld server = pure ()
zudov/servant-realworld-example-app
src/RealWorld/Api/Profiles.hs
bsd-3-clause
183
0
7
33
58
33
25
-1
-1
{-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} -- | This module wraps th...
mikeizbicki/simd
src/Data/SIMD/SIMD8.hs
bsd-3-clause
18,958
0
13
5,026
3,359
1,863
1,496
-1
-1
{-# LANGUAGE LambdaCase #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Main where import Commands.Test.Properties import Test.DocTest.Discover import Test.DocTest import Test.Tasty import Test.Tasty.QuickCheck import System.Exit (exitFailure) main = do doctests -- ByteCodeLink: can't fin...
sboosali/commands-core
tests/Tests.hs
mit
851
0
15
148
148
77
71
22
2
module Classifier ( Classifier, samples, newClassifier, trainClassifier, classifyWithClassifier, Sample(..), Score(..), Results, ) where import Control.Monad import Control.Concurrent.STM -- import Data.Heap import Data.List (foldl', sortBy, sort) import qualified Data.Map as Hash import Data.Maybe...
kirel/detexify-hs-backend
src/Classifier.hs
mit
2,339
0
15
488
914
486
428
55
2
{-# 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-rds/gen/Network/AWS/RDS/DescribeDBSecurityGroups.hs
mpl-2.0
7,224
0
16
1,483
1,016
598
418
115
1
{-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} ...
deepfire/mood
tests/Refstress.hs
agpl-3.0
2,548
0
20
563
670
349
321
58
3
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, ScopedTypeVariables, TypeFamilies, BangPatterns, CPP, RecordWildCards #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Server.BlobStorage -- Copyright : Duncan C...
agrafix/hackage-server
Distribution/Server/Framework/BlobStorage.hs
bsd-3-clause
9,844
0
18
2,356
2,172
1,159
1,013
189
4
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TemplateHaskell #-} module Encoders where import Prelude () import Prelude.Compat import Data.Aeson.TH import Data.Aeson.Types import Options import Types -------------------------------------------------------------------------------- -- Nullary encoders/dec...
tolysz/prepare-ghcjs
spec-lts8/aeson/tests/Encoders.hs
bsd-3-clause
13,958
0
12
1,248
2,330
1,205
1,125
172
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[PrelInfo]{The @PrelInfo@ interface to the compiler's prelude knowledge} -} {-# LANGUAGE CPP #-} module Eta.Prelude.PrelInfo ( -- * Known-key names isKnownKeyName, lookupKnownKeyName, -- ** Internal use -- | '...
rahulmutt/ghcvm
compiler/Eta/Prelude/PrelInfo.hs
bsd-3-clause
9,287
0
13
2,587
1,155
648
507
115
2
module Functions.Standard ( module Functions.Standard.Desugar, module Functions.Standard.Eval, module Functions.Standard.Inference, module Functions.Standard.FreeVars) where import Functions.Standard.Desugar import Functions.Standard.Eval import Functions.Standard.Inference import Functions.Standa...
spacekitteh/compdata
benchmark/Functions/Standard.hs
bsd-3-clause
331
0
5
41
60
41
19
9
0
-- This module can (and perhaps should) be separate into its own -- package, it's generally useful. {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE NoImplicitPrelude #-} module Stack.StaticBytes ...
anton-dessiatov/stack
src/Stack/StaticBytes.hs
bsd-3-clause
7,627
0
27
1,809
2,543
1,291
1,252
218
3
----------------------------------------------------------------------------- -- | Separate module for HTTP actions, using a proxy server if one exists ----------------------------------------------------------------------------- module Distribution.Client.HttpUtils ( DownloadResult(..), downloadURI, getHTT...
Helkafen/cabal
cabal-install/Distribution/Client/HttpUtils.hs
bsd-3-clause
6,196
0
20
1,758
1,526
817
709
134
11
import Control.Monad import Data.Char import System.Exit import System.IO import System.Process main = do hw <- openFile "po003.out" WriteMode ph <- runProcess "pwd" [] (Just "/dev") Nothing Nothing (Just hw) Nothing ec <- waitForProcess ph hClose hw unless (ec == ExitSuccess) ...
jimenezrick/unix
tests/libposix/posix003.hs
bsd-3-clause
513
0
14
148
174
81
93
14
1
{-# LANGUAGE CPP #-} -- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 1994-2004 -- -- ----------------------------------------------------------------------------- module PPC.Regs ( -- squeeze functions virtualRegSqueeze, real...
siddhanathan/ghc
compiler/nativeGen/PPC/Regs.hs
bsd-3-clause
9,917
0
15
3,142
2,433
1,265
1,168
224
13
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, TemplateHaskell, BangPatterns, GeneralizedNewtypeDeriving, NamedFieldPuns, RecordWildCards, PatternGuards #-} module Distribution.Server.Features.AdminLog where import Distribution.Server.Users.Types (UserId) import Distribution.Server.Users.Gro...
grayjay/hackage-server
Distribution/Server/Features/AdminLog.hs
bsd-3-clause
6,301
0
18
1,336
1,701
914
787
125
5
{-# LANGUAGE PartialTypeSignatures, RankNTypes #-} module HigherRank2 where foo :: (forall a. [a] -> [a]) -> (_, _ _) foo x = (x [True, False], x ['a', 'b'])
urbanslug/ghc
testsuite/tests/partial-sigs/should_compile/HigherRank2.hs
bsd-3-clause
159
0
9
29
73
43
30
4
1
replicate' :: (Num i, Ord i) => i -> a -> [a] replicate' n x | n <= 0 = [] | otherwise = x:replicate' (n-1) x take' :: (Num i, Ord i) => i -> [a] -> [a] take' n _ | n <= 0 = [] take' _ [] = [] take' n (x:xs) = x : take' (n-1) xs reverse' :: [a] -> [a] reverse' [] = [] reverse' (x:xs) = reverse' x...
dotnetCarpenter/haskell1
ch05/more_recursion.hs
isc
1,080
0
12
297
659
343
316
34
1
-- Are arrow functions odd? -- http://www.codewars.com/kata/559f80b87fa8512e3e0000f5/ module Odds where odds :: [Int] -> [Int] odds = filter odd
gafiatulin/codewars
src/8 kyu/Odds.hs
mit
147
0
6
21
29
18
11
3
1
import Data.Monoid isBigGang :: Int -> (Bool, String) isBigGang x = (x > 9,"Compared gang size to 9") applyLog :: Monoid m => (a,m) -> (a -> (b,m)) -> (b, m) applyLog (x, log) f = let (y, newLog) = f x in (y, log `mappend` newLog)
rglew/lyah
gang.hs
mit
235
0
10
51
133
75
58
5
1
{-# LANGUAGE GeneralizedNewtypeDeriving, ExistentialQuantification, KindSignatures, FlexibleContexts #-} -- Copyright (c) 2010-2018 Brett Lajzer -- See LICENSE for license information. -- | C dependency scanner. Runs a stripped-down pre-processor to scan for -- include files (recursively). module Dib.Scanners.CDepScan...
blajzer/dib
src/Dib/Scanners/CDepScanner.hs
mit
5,922
0
14
953
1,979
1,027
952
112
2
module Text.Sass.FunctionsSpec where import Test.Hspec import Text.Sass hiding (headerFunction) fooFunction :: SassValue -> IO SassValue fooFunction _ = return $ SassNumber 1 "px" barFunction :: SassValue -> IO SassValue barFunction (SassList [SassString "a"] _) = return $ SassNumber 1 "px" barF...
jakubfijalkowski/hsass
test/Text/Sass/FunctionsSpec.hs
mit
2,536
0
15
615
642
324
318
54
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} import Prelude hiding (takeWhile, FilePath, sequence) import qualified Data.ByteString as B import qualified Data.IntMap as M import Data.Text (Text) import Data.Text.Read (decimal, double) import Data.Time impor...
f-me/xlsx-parser
temp/xlsx-conduit.hs
mit
4,558
0
26
1,445
1,161
614
547
71
7
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} module Codec.Xlsx.Types.Internal.CfPair where import GHC.Generics (Generic) import Text.XML.Cursor import Codec.Xlsx.Parser.Internal import Codec.Xlsx.Types.Common import Codec.Xlsx.Types.ConditionalFormatting import Codec.Xlsx.Writer.Internal -- | In...
qrilka/xlsx
src/Codec/Xlsx/Types/Internal/CfPair.hs
mit
1,265
0
15
235
291
159
132
26
0
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} module Network.Google.Calendar.Common where import Data.Char (toLower) import Control.Monad
georgeee/haskell-google-calendar-api
Network/Google/Calendar/Common.hs
mit
155
0
5
19
24
16
8
4
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE RecordWildC...
schell/caltrops
src/Main.hs
mit
6,006
0
27
1,919
1,523
776
747
139
4
module Examples.PayoffToHaskell where import Data.List import ContractTranslation import Contract internalFuncName = "payoffInternal" funcName = "payoff" fromBinOp op = case op of ILAdd -> "+" ILSub -> "-" ILMult -> "*" ILDiv -> "/" ...
annenkov/contracts
Coq/Extraction/contracts-haskell/src/Examples/PayoffToHaskell.hs
mit
3,652
0
17
1,467
1,119
543
576
70
11
module Rebase.GHC.IO.Device ( module GHC.IO.Device ) where import GHC.IO.Device
nikita-volkov/rebase
library/Rebase/GHC/IO/Device.hs
mit
83
0
5
12
23
16
7
4
0
module Ch13.Passwdmap where import qualified Data.Map as Map import System.IO import Text.Printf (printf) import System.Environment (getArgs) import System.Exit import Control.Monad (when) import Control.Arrow ((&&&)) {- | The primary piece of data this program will store. It represents the fields in a POSIX /etc...
futtetennista/IntroductionToFunctionalProgramming
RWH/src/ch13/Passwdmap.hs
mit
4,346
0
16
1,521
983
513
470
97
7
module BST ( BST , bstLeft , bstRight , bstValue , empty , fromList , insert , singleton , toList ) where data BST a = Dummy deriving (Eq, Show) bstLeft :: BST a -> Maybe (BST a) bstLeft tree = error "You need to implement this function." bstRight :: BST a -> Maybe (BST a) bst...
exercism/xhaskell
exercises/practice/binary-search-tree/src/BST.hs
mit
900
0
8
219
279
141
138
27
1
module Text.Bcodex.Html (ampEscape, showCxLeftAsHtml, codexHtml) where import Text.Bcodex import Data.List (intercalate) import Text.Bcodex.Utils (groupRights) ampEscape :: String -> String ampEscape = concatMap esc where esc '<' = "&lt;" esc '>' = "&gt;" esc '&' = "&amp;" esc c = ...
betaveros/bcodex
Text/Bcodex/Html.hs
mit
1,098
0
8
200
366
191
175
25
4
{-# LANGUAGE MultiParamTypeClasses #-} module Main (main) where --Sql handling import Database.HDBC (SqlValue, quickQuery', fromSql, disconnect) import Database.HDBC.Sqlite3 (connectSqlite3) --Csv handling import Text.CSV (Record, printCSV) --Time handling import Data.Time (UTCTime, getCurrentTime) import Data.Time...
tismith/ausbird
Main.hs
mit
7,030
0
16
1,363
1,760
923
837
121
2
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.WebGPURenderPipelineDescriptor (newWebGPURenderPipelineDescriptor, reset, setVertexFunction, getVertexFun...
ghcjs/jsaddle-dom
src/JSDOM/Generated/WebGPURenderPipelineDescriptor.hs
mit
6,837
0
12
1,133
1,085
610
475
-1
-1
threes = [3, 6 ..] fives = [5, 10 ..] merge (x:xs) (y:ys) | x < y = x : merge xs (y:ys) | x > y = y : merge (x:xs) ys | otherwise = x : merge xs ys main = do let mixed = merge threes fives under1000 = takeWhile (< 1000) mixed summation = sum under1000 -- print under1000 print summation
mohsen3/crispy-goggles
ProjectEuler/problem01/A.hs
mit
316
0
11
94
170
87
83
11
1
module Main ( main ) where import Data.Maybe (catMaybes, isNothing) import Control.Exception import Control.Monad (when) import Data.Word import qualified Graphics.UI.SDL as SDL import Window import GameState import Chopper import Graphics import Game windowWidth, windowHeight :: Int fullscreen :: Bool --windowWid...
bitc/crap-chopper-game
Main.hs
mit
4,746
0
18
1,354
1,725
962
763
98
16
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} module RouteConfig ( RouteConfig , Route(..) , RouteInfo(..) , newRouteConfig , routeAdd , routeDel , routeSize , pruneStaleRoutes , withBestRoute , RouteException(..) , dumpRtConf ) w...
ondrap/horouter
RouteConfig.hs
mit
8,836
0
26
2,734
2,190
1,140
1,050
164
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {- | Module : Data.Syntax.Indent Description : Simple indentation. Copyright : (c) Paweł Nowak License : MIT Maintainer : Paweł Nowak <pawel834@gmail.com> Stability : experimental Provides ...
pawel-n/syntax
Data/Syntax/Indent.hs
mit
2,336
0
11
483
574
315
259
43
1
{-# LANGUAGE OverloadedStrings #-} module HayooTypes ( HayooResult(..) , HayooResponse(..) ) where import Control.Monad (mzero) import Data.Aeson data HayooResult = HayooResult { resultUri :: String , tag :: String , resultPackage ...
Gonzih/hayoo-cli
HayooTypes.hs
mit
2,040
0
30
1,130
352
199
153
42
0
{-# OPTIONS_GHC -funbox-strict-fields #-} -- Implements SHA-256 as defined in FIPS 180-2 -- <http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf>. module Purecoin.Digest.SHA256 (sha256, sha256Ascii, Hash256) where import Data.Word import Data.Bits import Data.Monoid import Data.Serialize imp...
laanwj/Purecoin
Purecoin/Digest/SHA256.hs
mit
5,511
0
22
1,176
1,833
1,009
824
89
2
module Transition (Transition(Jump, Fork)) where import State import Value import JSON import Expression import Binding import Kontinuation import Text.JSON data Transition = Jump State | Fork Symbol Expression Expression Environment Kontinuation Heap instance JSON Transition where showJSON (Jump st) = JSObje...
lachrist/kusasa-hs
transition.hs
gpl-2.0
1,378
0
12
480
385
201
184
26
0
module Zepto.Primitives(primitives , ioPrimitives , evalPrimitives , eval , evalString ) where import Data.Array import Data.Maybe import Control.Monad import Control.Monad.Except import System.Directory i...
zepto-lang/zepto
src/Zepto/Primitives.hs
gpl-2.0
56,089
1,555
31
15,660
19,313
10,265
9,048
-1
-1
-- Copyright (C) 2002-2004,2007 David Roundy -- -- 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, or (at your option) -- any later version. -- -- This program is distrib...
DavidAlphaFox/darcs
src/Darcs/UI/Commands/Rollback.hs
gpl-2.0
8,696
0
21
2,313
1,839
1,032
807
-1
-1
import Distribution.Simple import Distribution.PackageDescription import Data.Monoid (Monoid(mempty, mappend)) main = defaultMainWithHooks (simpleUserHooks { preInst = myPreInst }) myPreInst a f = return (Nothing, [("framework-tests", mempty { buildable = False})])
VictorDenisov/vim-netbeans
Setup.hs
gpl-2.0
268
2
9
31
93
49
44
5
1
{- | Module : $Header$ Description : Sublogics for propositional logic Copyright : (c) Dominik Luecke, Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : luecke@informatik.uni-bremen.de Stability : experimental Portability : non-portable (imports Logic.Logic) Sublogics for Pr...
nevrenato/Hets_Fork
Propositional/Sublogic.hs
gpl-2.0
13,597
0
21
4,551
2,785
1,469
1,316
224
14
module Keys ( module Keys , module Modifier ) where import qualified Data.Map as M -- X Keys import Graphics.X11.Types import XMonad (Layout (..), X, XConfig (..), focus, mouseMoveWindow, mouseResizeWindow, ...
NorfairKing/sus-depot
shared/shared/xmonad/dvorak.kinesis/Keys.hs
gpl-2.0
6,004
0
12
2,867
1,343
823
520
90
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} ---------------------------------------------------------------------- -- | -- Module : Text.Doc.Writer.Html -- Copyright : 2015-2017 Mathias Schenner, -- 2015-2016 Language Science Press. -- License : GPL-3 -- -- Maintainer : mschen...
synsem/texhs
src/Text/Doc/Writer/Html.hs
gpl-3.0
14,748
0
18
2,678
3,810
1,980
1,830
268
2
import System.Process import Data.ByteString(hPut) import Control.Monad (when) import System.IO import Data.Time.Clock import Data.Maybe (isJust) import Data.Maybe (maybeToList) import System.Environment (getArgs) import qualified Data.Text as T import System.Posix.Resource import System.Exit import Layout import Data....
prannayk/conj
Judge/judge.hs
gpl-3.0
5,825
2
24
1,067
2,751
1,382
1,369
134
4
{-# LANGUAGE OverloadedStrings, TypeFamilies #-} module Lamdu.GUI.ExpressionEdit(make) where import Control.Applicative ((<$>)) import Control.Lens.Operators import Control.MonadA (MonadA) import Lamdu.GUI.ExpressionGui (ExpressionGui, ParentPrecedence(..)) import Lamdu.GUI.ExpressionGui.Monad (ExprGuiM) import qualif...
sinelaw/lamdu
Lamdu/GUI/ExpressionEdit.hs
gpl-3.0
4,560
0
15
655
1,153
647
506
-1
-1
{-# LANGUAGE StandaloneDeriving #-} -- | Core dataType definitions for P -- | Juan García Garland (Nov. 2016) module Language where type Variable = Int -- | The AST definitions for P data Program = Program Variable Sec Variable data Sent = Assign Variable Expr | While Cond Sec data Expr = Zero...
jota191/PLang
src/Language.hs
gpl-3.0
558
0
7
126
123
70
53
14
0
module Handler.Document where import Import import System.Directory (doesFileExist,getDirectoryContents) import Yesod.Markdown import Data.List (nub) import Text.Pandoc (writerExtensions,writerWrapText, WrapOption(..), readerExtensions, Pandoc(..), lookupMeta) import Text.Pandoc.Walk (walkM, walk) import Text.Julius (...
gleachkr/Carnap
Carnap-Server/Handler/Document.hs
gpl-3.0
10,601
0
24
4,687
2,013
975
1,038
-1
-1