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
{-# LINE 1 "Data.Either.hs" #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, TypeOperators, UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module ...
phischu/fragnix
builtins/base/Data.Either.hs
bsd-3-clause
8,051
1
9
1,708
848
510
338
50
1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell {-@ LIQUID "--no-termination "@-} import Language.Haskell.Liquid.Prelude mmax x y | x < y = y | otherwise = x for lo hi acc f | lo < hi = for (lo + 1) hi (f lo acc) f | otherwise = acc sumRange i j = for i j 0 (+) prop = liquidAssertB (m >= 0) ...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/forloop.hs
bsd-3-clause
471
0
9
152
206
104
102
17
1
{-# LANGUAGE DataKinds #-} module Ivory.Tower.Monitor ( handler , state , stateInit , monitorModuleDef , Handler() , Monitor() ) where import Ivory.Tower.Types.Unique import Ivory.Tower.Monad.Handler import Ivory.Tower.Monad.Monitor import Ivory.Tower.Monad.Base import Ivory.Language state :: (IvoryAr...
GaloisInc/tower
tower/src/Ivory/Tower/Monitor.hs
bsd-3-clause
782
0
12
181
300
158
142
33
1
{-# language CPP #-} -- | = Name -- -- VK_EXT_sample_locations - device extension -- -- == VK_EXT_sample_locations -- -- [__Name String__] -- @VK_EXT_sample_locations@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 144 -- -- [__Revision__] -- 1 -- -- [__Extensi...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_EXT_sample_locations.hs
bsd-3-clause
52,025
0
19
9,141
7,432
4,294
3,138
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} module Main where import Lib import Resources import Authentication import Control.Applicative (Applicative) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Logger (runNoLoggingT, runStdoutLoggingT) import Control.Monad.Reader (...
clample/lift-tracker
app/Main.hs
bsd-3-clause
4,681
0
15
894
1,465
763
702
139
4
{-# LANGUAGE TypeOperators, ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, TypeSynonymInstances #-} {-# LANGUAGE UndecidableInstances, OverlappingInstances #-} {-# LANGUAGE FlexibleInstances, FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} {-# LAN...
pepeiborra/narradar
src/Narradar/Types/DPIdentifiers.hs
bsd-3-clause
3,373
0
9
715
945
492
453
69
1
module Lambda.Evaluator.Debug where import DeepControl.Applicative import DeepControl.Monad import DeepControl.MonadTrans import Lambda.Evaluator.Eval import Lambda.Compiler import Lambda.Parser (readSExpr) import Lambda.Action import Lambda.Convertor import Lambda.Debug import Lambda.DataType import Lambda.DataTyp...
ocean0yohsuke/Simply-Typed-Lambda
src/Lambda/Evaluator/Debug.hs
bsd-3-clause
4,535
0
33
1,338
1,362
709
653
91
5
{-# Language TemplateHaskell #-} {-| Module : Client.Image.MircFormatting Description : Parser for mIRC's text formatting encoding Copyright : (c) Eric Mertens, 2016 License : ISC Maintainer : [email protected] This module parses mIRC encoded text and generates VTY images. -} module Client.Image.MircFor...
glguy/irc-core
src/Client/Image/MircFormatting.hs
isc
7,477
0
16
2,249
2,066
1,097
969
161
9
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE FunctionalDependencies #-} -- data declarations that are empty {-# LANGUAGE EmptyDataDecls #-} module Symengine.Internal ( cIntToEnum, cIntFromEnum, mkForeignPtr, Wrapped(..), with2, with3, with4, CBasicSym, ...
bollu/symengine.hs-1
src/Symengine/Internal.hs
mit
2,666
1
19
640
856
452
404
-1
-1
-- HACKERRANK: String-o-Permute -- https://www.hackerrank.com/challenges/string-o-permute module Main where import qualified Control.Monad as M solve :: String -> String solve [] = [] solve (x1:x2:xs) = x2:x1:(solve xs) main :: IO () main = getLine >>= \tStr -> M.replicateM_ ((read::String->Int) tStr) (getLine >>...
everyevery/programming_study
hackerrank/functional/string-o-permute/string-o-permute.hs
mit
348
0
13
53
136
75
61
7
1
------------------------------------------------------------------------- -- -- Haskell: The Craft of Functional Programming, 3e -- Simon Thompson -- (c) Addison-Wesley, 1996-2011. -- -- Chapter 1 -- -- The Pictures example code is given in the file Pitures.hs. -- This file can be used by importing it; more de...
Numberartificial/workflow
snipets/src/craft/Chapter1.hs
mit
1,751
0
7
311
192
119
73
18
1
{- | Module : $Header$ Description : Manchester syntax parser for OWL 2 Copyright : (c) DFKI GmbH, Uni Bremen 2007-2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : provisional Portability : portable Contains : Parser for the Manchester Syntax i...
mariefarrell/Hets
OWL2/Parse.hs
gpl-2.0
18,656
0
19
4,110
5,709
2,811
2,898
454
8
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeMaintenanceStartTime.hs
mpl-2.0
5,458
0
17
1,061
764
448
316
82
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-sdb/gen/Network/AWS/SDB/CreateDomain.hs
mpl-2.0
3,390
0
9
677
373
232
141
51
1
{-# LANGUAGE RankNTypes #-} module Main where import Test.Framework (defaultMain) ------------------------------------------------------------------------------ import qualified Data.HashTable.Test.Common as Common import qualified Data.HashTable.ST.Basic as B import qualified Data.HashTable.ST.Cuckoo as C import qua...
cornell-pl/HsAdapton
weak-hashtables/test/suite/TestSuite.hs
bsd-3-clause
1,086
0
10
208
226
139
87
20
1
module Web.Routes.Site where import Data.ByteString import Data.Monoid import Data.Text (Text) import Web.Routes.Base (decodePathInfo, encodePathInfo) {-| A site groups together the three functions necesary to make an application: * A function to convert from the URL type to path segments. * A function to convert ...
shockkolate/web-routes
Web/Routes/Site.hs
bsd-3-clause
2,569
0
15
681
427
232
195
28
2
module Main where import Test.QuickCheck import Data.List mult :: Int -> Int -> Int -> Int mult x y z = x*y*z prop_mult x y z = (x * y * z) == mult x y z prop_factorial_monotone (Positive x) = factorial x <= (factorial x+1) newtype SmallIntList = SmallIntList [Int] deriving (Eq,Show) instance Arbitrary SmallInt...
chadbrewbaker/combinat
tests/Check.hs
bsd-3-clause
599
0
15
160
256
132
124
16
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, TupleSections, GeneralizedNewtypeDeriving, DeriveTraversable #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| JSON utility functions. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and...
grnet/snf-ganeti
src/Ganeti/JSON.hs
bsd-2-clause
20,109
0
18
4,796
4,831
2,549
2,282
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 \section[DataCon]{@DataCon@: Data Constructors} -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module DataCon ( -- * Main data types DataCon, DataConRep(..), SrcStrictness(..), SrcUnpackedness(..), ...
AlexanderPankiv/ghc
compiler/basicTypes/DataCon.hs
bsd-3-clause
51,933
0
19
15,151
5,866
3,310
2,556
490
4
{-# LANGUAGE BangPatterns #-} module Randomish ( randomishInts , randomishDoubles) where import Data.Word import Data.Vector.Unboxed (Vector) import qualified Data.Vector.Unboxed.Mutable as MV import qualified Data.Vector.Unboxed as V import qualified Data.Vector.Generic as G -- | Use the "minimal standard"...
agremm/Matryoshka
examples/lib/Randomish.hs
bsd-3-clause
2,267
87
11
515
519
300
219
52
1
{-# LANGUAGE StandaloneKindSignatures #-} module SAKS_Fail007 where import Data.Kind (Type) type May a :: Type data May a = Nay | Yay a
sdiehl/ghc
testsuite/tests/saks/should_fail/saks_fail007.hs
bsd-3-clause
139
0
6
26
35
23
12
-1
-1
module HN.Blaze (module Text.Blaze.Extra ,module Text.Blaze.Html5 ,module Text.Blaze.Html5.Attributes ,module Text.Blaze.Renderer.Text ,module Text.Blaze.Linkify ,module Text.Blaze.Pagination ,module Text.Blaze.Bootstrap ) where import Text.Blaze.Extra import Text.Blaze.Html5 hiding (output,map,i,t...
jwaldmann/haskellnews
src/HN/Blaze.hs
bsd-3-clause
547
0
5
57
151
104
47
15
0
{-# LANGUAGE MagicHash #-} {-# OPTIONS_GHC -Werror #-} -- Trac #2806 module Foo where import GHC.Base foo :: Int foo = 3 where (I# _x) = 4
hvr/jhc
regress/tests/1_typecheck/4_fail/ghc/T2806.hs
mit
149
0
8
37
36
22
14
7
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ConstraintKinds #-} -- | Tag a Binary instance with the stack version number to ensure we're -- reading a compatible format. module Data.Binary.VersionTagged ( ta...
phadej/stack
src/Data/Binary/VersionTagged.hs
bsd-3-clause
3,108
0
14
785
718
387
331
73
2
{-# LANGUAGE ScopedTypeVariables #-} module BinaryDerive where import Data.Generics import Data.List deriveM :: (Typeable a, Data a) => a -> IO () deriveM (a :: a) = mapM_ putStrLn . lines $ derive (undefined :: a) derive :: (Typeable a, Data a) => a -> String derive x = "instance " ++ context ++ "Binary " ++...
ezyang/binary
tools/derive/BinaryDerive.hs
bsd-3-clause
2,273
4
18
739
863
454
409
48
6
{-# Language TemplateHaskell #-} {-# Language DisambiguateRecordFields #-} module T12130 where import T12130a hiding (Block) b = $(block)
olsner/ghc
testsuite/tests/th/T12130.hs
bsd-3-clause
141
0
6
21
24
16
8
5
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedLists#-} module Tests.Math.Hclaws.Systems.ShallowWater ( tests ) where import Test.Tasty (TestTree, testGroup) import qualified Test.Tasty.QuickCheck as QC import qualified Test.Tasty.SmallCheck as SC import qualified Test.Tasty.HUnit as HU import Test.Curves im...
mikebenfield/hclaws
test/Tests/Math/Hclaws/Systems/ShallowWater.hs
isc
958
0
8
157
196
117
79
24
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {- | Module : Database.Couch.Explicit.Design Description : Design Document-oriented requests to CouchDB, with explicit parameters Copyright : Copyright (c) 2015, Michael Alan Dorman License : MIT Mainta...
mdorman/couch-simple
src/lib/Database/Couch/Explicit/Design.hs
mit
8,043
0
15
2,008
836
456
380
94
1
{-# LANGUAGE BangPatterns #-} module Feitoria.Types where import Codec.MIME.Type import qualified Data.ByteString as B import Data.Time import Data.Word import Foreign.Ptr import qualified Data.Text as T import qualified Data.Vector as V --data MMapTable = MMapTable { -- mmapTblHeader :: !TableHead...
MadSciGuys/feitoria
src/Feitoria/Types.hs
mit
1,412
0
9
460
190
122
68
27
0
{-# htermination addToFM_C :: (Ord a, Ord k) => (b -> b -> b) -> FiniteMap (Either a k) b -> (Either a k) -> b -> FiniteMap (Either a k) b #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_addToFM_C_10.hs
mit
160
0
3
35
5
3
2
1
0
module EntityWrapper.Schema ( module EntityWrapper.Schema , module EntityWrapper.Schema.Virus ) where import qualified Database.Orville.PostgreSQL as O import EntityWrapper.Schema.Virus schema :: O.SchemaDefinition schema = [O.Table virusTable]
flipstone/orville
orville-postgresql/test/EntityWrapper/Schema.hs
mit
254
0
7
33
56
36
20
7
1
module Typing.Util where import Typing.Env import Typing.Kinds import {-# SOURCE #-} Typing.Stmt import Typing.Substitution import Typing.Subtyping import Typing.TypeError import Typing.Types import Util.Error import Absyn.Base import Absyn.Meta import qualified Absyn.Untyped as U import qualified Absyn.Typed as T ...
tadeuzagallo/verve-lang
src/Typing/Util.hs
mit
3,258
0
16
687
1,305
657
648
98
2
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Game.Implement.Card -- Copyright : (c) 2017 Christopher A. Gorski -- License : MIT -- Maintainer : Christopher A. Gorski <[email protected]> -- -- The Game.Implement.Card module provides fundamental operations for...
cgorski/general-games
src/Game/Implement/Card.hs
mit
8,909
0
21
1,871
1,269
715
554
76
0
import qualified Data.Hash.MD5 as MD5 md5snum str x = MD5.md5s $ MD5.Str $ str ++ show x firstSixZeros str x | take 6 (md5snum str x) == "000000" = x | otherwise = -1 main = do let word_part = "iwrupvqb" print $ head [firstSixZeros word_part x | x <- [0..], firstSixZeros word_part x > 0]
RatanRSur/advent-of-haskell
day4/part2.hs
mit
309
0
12
76
139
68
71
8
1
module Problem2 ( secondToLastElem ) where secondToLastElem :: [a] -> a secondToLastElem x = last (init x)
chanind/haskell-99-problems
Problem2.hs
mit
107
0
7
17
38
21
17
3
1
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} module Y2018.M05.D25.Solution where import Control.Arrow ((&&&)) import Control.Concurrent (threadDelay) import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as BL import Database.PostgreSQL.Simple import Database.PostgreSQL.Simple....
geophf/1HaskellADay
exercises/HAD/Y2018/M05/D25/Solution.hs
mit
5,075
0
24
1,175
1,255
669
586
-1
-1
module Main where import Lib import Text.Printf n = 100::Integer main :: IO () main = do printf "Square of sum minus sum of squares = %d\n" (squareSum n - sumSquares n)
JohnL4/ProjectEuler
Haskell/Problem006/app/Main.hs
mit
174
0
10
37
56
30
26
7
1
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} module Chatwork.V0.Api ( module Chatwork.V0.ChatworkConfig , module Chatwork.V0.Type , module Chatwork.V0.Message , login , loadChat , loadRoom , readChat , getUpdate , sendChat , getRoomInfo ) where import Network.HTTP.Conduit import Network.H...
totem3/cwhs
src/Chatwork/V0/Api.hs
mit
7,809
0
24
2,212
2,702
1,440
1,262
193
3
{-# LANGUAGE RecordWildCards #-} module StructuralIsomorphism.Declarations ( -- * Types Constructor(..), DataType(..), -- * Map from Template Haskell to these simpler types constructor, dataType ) where import Language.Haskell.TH.Syntax data Constructor = Constructor { conName :: !Name ...
antalsz/hs-to-coq
structural-isomorphism-plugin/src/StructuralIsomorphism/Declarations.hs
mit
1,795
0
11
645
457
247
210
50
1
{-# LANGUAGE OverloadedStrings #-} import Prelude as P import Data.Binary as Bin import Data.ByteString as BS import Data.ByteString.Lazy as BSL import Data.ByteString.Char8 as BSC import Data.ByteString.Lazy.Char8 as BSLC import Data.String import Data.Maybe import Data.Text as Txt import Control.Exception import D...
danoctavian/bit-smuggler
scripts/Main.hs
gpl-2.0
14,427
0
19
3,408
3,374
1,715
1,659
259
2
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} -- | Data type for holding server state. -- -- The server state consists mainly of the allocators needed for different types of resources, such as nodes, buffers and buses. module...
kaoskorobase/hsc3-server
Sound/SC3/Server/State.hs
gpl-2.0
6,115
0
15
1,162
1,440
778
662
122
1
module Data.Pocketmine.Block ( BlockType(..) ) where import Data.Maybe (fromJust) import Data.Tuple (swap) import qualified Data.Map as M {- - Yes, I know most of this code is terribly inefficient doing linear lookups - for everything. However! I'm currently in the "make it work" phase, which comes - befor...
greyson/HasCraft
src/Data/Pocketmine/Block.hs
gpl-2.0
7,719
0
9
3,699
1,697
1,110
587
165
1
{-# LANGUAGE RecordWildCards #-} module VirMat.IO.Export.ANG.RasterEngine ( rasterTriangle , rasterTriangleFaster , flexmicroToANG , getGrainMeshAndProp , isInsideTriangle ) where import Data.Vector (Vector) import Data.Maybe (fromMaybe) import Data.List import Data.Function import DeUni.Dim2.Base2D import...
lostbean/VirMat
src/VirMat/IO/Export/ANG/RasterEngine.hs
gpl-3.0
9,574
0
22
2,319
3,262
1,782
1,480
193
1
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-} {-| This module exports routes for all the files in the static directory at compile time, allowing compile-time verification that referenced files exist. However, any files added during run-time can't be accessed this way; use their FilePath or URL to access...
Lainepress/hledger
hledger-web/Hledger/Web/Settings/StaticFiles.hs
gpl-3.0
534
0
7
76
36
22
14
5
0
{-# LANGUAGE FlexibleContexts #-} module Jumpie.Parsec( int, safeParseFromFile ) where import Text.Parsec.Prim(Stream,ParsecT) import Text.Parsec.String(parseFromFile,Parser) import Text.Parsec(many1,digit) import Text.Read(read) import Data.List((++)) import Text.Show(show) import Data.String(String) import Con...
pmiddend/jumpie
lib/Jumpie/Parsec.hs
gpl-3.0
811
0
13
126
314
179
135
27
2
{-# LANGUAGE OverloadedStrings #-} module Flat where import Data.Vector import Data.Time import Data.Csv csvTimeFormat :: String csvTimeFormat = iso8601DateFormat (Just "%H:%M:%S%z") data HouseType = HouseTypeFrame | -- Каркасный. HouseTypeBlock | -- Блочный. HouseTypeBrick | -- Ки...
kurnevsky/flats
src/Flat.hs
agpl-3.0
4,958
0
11
2,165
879
478
401
109
1
module Ch22Exercises where import Control.Applicative import Data.Maybe x :: [Integer] x = [1, 2, 3] y :: [Integer] y = [4, 5, 6] z :: [Integer] z = [7, 8, 9] xs :: Maybe Integer xs = lookup 3 $ zip x y ys :: Maybe Integer ys = lookup 6 $ zip y z zs :: Maybe Integer zs = lookup 4 $ zip x y z' :: Integer -> Mayb...
thewoolleyman/haskellbook
22/11/maor/Ch22Exercises.hs
unlicense
1,199
0
12
301
669
360
309
44
1
module HelperSequences.A006519Spec (main, spec) where import Test.Hspec import HelperSequences.A006519 (a006519) main :: IO () main = hspec spec spec :: Spec spec = describe "A006519" $ it "correctly computes the first 20 elements" $ take 20 (map a006519 [1..]) `shouldBe` expectedValue where expectedValue...
peterokagey/haskellOEIS
test/HelperSequences/A006519Spec.hs
apache-2.0
366
0
10
59
160
95
65
10
1
{-# LANGUAGE PackageImports #-} import "ministeam" Application (getApplicationDev) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort) import Control.Concurrent (forkIO) import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDel...
XxNocturnxX/ministeam
devel.hs
bsd-2-clause
703
0
10
123
186
101
85
23
2
module Foundation ( App (..) , Route (..) , AppMessage (..) , resourcesApp , Handler , Widget , Form , maybeAuth , requireAuth , module Settings , module Model ) where import Prelude import Yesod import Yesod.Static import Yesod.Auth import Yesod.Auth.BrowserId import Ye...
jgenso/comunidadhaskell.org
Foundation.hs
bsd-2-clause
6,083
0
17
1,324
871
487
384
-1
-1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGraphicsPathItem_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:25 Warning : this file is machine generate...
keera-studios/hsQt
Qtc/Gui/QGraphicsPathItem_h.hs
bsd-2-clause
98,043
0
18
20,812
30,664
14,671
15,993
-1
-1
module Frontend.Val(Val(..), TVal(TVal), WithVal(..)) where import qualified Data.Map as M import Name import Frontend.NS import Frontend.Expr import Frontend.Type -- Value data Val = BoolVal Bool | IntVal Integer | StructVal (M.Map Ident TVal) ...
termite2/tsl
Frontend/Val.hs
bsd-3-clause
1,399
0
13
469
476
260
216
36
0
import Data.Foldable (foldMap, foldr) import Data.Monoid import Data.Maybe newtype Min a = Min { getMin :: Maybe a } deriving (Eq, Ord, Show) newtype Max a = Max { getMax :: Maybe a } deriving (Eq, Ord, Show) instance Ord a => Monoid (Min a) where mempty = Min Nothing Min (Nothing) `mappend` y = y x `mappend` Mi...
chengzh2008/hpffp
src/ch20-Foldable/foldable.hs
bsd-3-clause
2,460
0
10
587
1,233
647
586
55
2
{-# LANGUAGE RankNTypes #-} {-| Generic equal temperament pitch. Use the type-level numbers to construct an temperement dividing the octave in any number of equal-sized steps. Common cases such as 6, 12 and 24 are provided for convenience. -} module Music.Pitch.Equal ( -- * Equal temperament Equal, toEq...
music-suite/music-pitch
src/Music/Pitch/Equal.hs
bsd-3-clause
3,792
0
10
868
888
488
400
-1
-1
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} #endif #if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Data.Set.Base -- Copyri...
ekmett/containers
Data/Set/Base.hs
bsd-3-clause
54,658
0
21
14,626
11,947
6,175
5,772
-1
-1
{-# OPTIONS_GHC -F -pgmF inch #-} {-# LANGUAGE RankNTypes, GADTs, KindSignatures, ScopedTypeVariables, NPlusKPatterns #-} module MergeSort where import Vectors comp f g x = f (g x) data DTree :: * -> Integer -> * where Empty :: DTree a 0 Leaf :: a -> DTree a 1 Even :: forall a (n :: In...
adamgundry/inch
examples/MergeSort.hs
bsd-3-clause
2,457
14
13
740
1,236
649
587
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module GithubWebhook.Types.Events.PushEvent ( PushEvent(..) ) where import qualified Data.Text as T import qualified Data.Aeson as A import qualified Data.Aeson.TH as A import qualified GithubWebhook.Types.SmallUser as SmallUser import qualified GithubW...
bgwines/hueue
src/GithubWebhook/Types/Events/PushEvent.hs
bsd-3-clause
997
0
10
192
247
160
87
31
0
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.TransformFeedback2 -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <[email protected]> -- Stability : stable -- Portability : portab...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/TransformFeedback2.hs
bsd-3-clause
1,062
0
4
134
70
54
16
13
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- | Description: Unique identifiers for internal an external use. module Retcon.Identifier ( -- * Configuration names EntityName(..), SourceName(..), -- * Unique identifiers InternalID, ForeignID, ForeignKey(..), Interna...
anchor/retcon
lib/Retcon/Identifier.hs
bsd-3-clause
3,539
0
11
763
749
422
327
76
1
----------------------------------------------------------------------------- -- | -- Module : Graphics.X11.Xlib -- Copyright : (c) Alastair Reid, 1999-2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : [email protected] -- Stability : provisional -- Portability...
FranklinChen/hugs98-plus-Sep2006
packages/X11/Graphics/X11/Xlib.hs
bsd-3-clause
3,374
12
5
538
289
213
76
28
0
{-# LANGUAGE OverloadedStrings #-} -- | High level functions for downloading files. module Control.Shell.Download ( URI , fetch, fetchBytes , fetchFile , fetchTags, fetchXML, fetchFeed ) where import Data.ByteString as BS (ByteString, writeFile) import Data.ByteString.UTF8 as BS import Data.ByteString.Lazy as...
valderman/shellmate
shellmate-extras/Control/Shell/Download.hs
bsd-3-clause
2,534
0
12
482
634
338
296
-1
-1
module QACG.CircGen.Bit.Toffoli ( tof ,tofMatchedD1 ,leftTof ,rightTof ) where import QACG.CircUtils.CircuitState import Control.Exception(assert) tof :: String -> String -> String -> CircuitState () tof a b c = do consts <- getConst 4 assert (length consts == 4) $ applyTof a b c consts ...
aparent/qacg
src/QACG/CircGen/Bit/Toffoli.hs
bsd-3-clause
2,226
0
11
1,174
758
319
439
83
2
#!/usr/bin/env stack -- stack --install-ghc runghc --package=shake --package=extra --package=zip-archive --package=mime-types --package=http-types --package=http-conduit --package=text --package=conduit-combinators --package=conduit --package=case-insensitive --package=aeson --package=zlib --package tar {-# OPTIONS_GHC...
robstewart57/stack
etc/scripts/release.hs
bsd-3-clause
28,996
0
25
7,815
6,422
3,254
3,168
602
6
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE DeriveFunctor #-} ----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.ReadP -- Copyright : (c) The University of...
spacekitteh/smcghc
libraries/base/Text/ParserCombinators/ReadP.hs
bsd-3-clause
14,899
1
17
3,939
3,771
1,944
1,827
222
6
-- | -- Type classes and built-in implementation for primitive Haskell types -- module Ntha.Z3.Class ( -- ** Types whose values are encodable to Z3 internal AST Z3Encoded(..), -- ** Types representable as Z3 Sort -- XXX: Unsound now -- XXX: Too flexible, can be used to encode Type ADT Z3Sorted...
zjhmale/Ntha
src/Ntha/Z3/Class.hs
bsd-3-clause
7,015
0
16
2,161
1,872
926
946
-1
-1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module System.EtCetera.LxcSpec where import Control.Monad.Trans (liftIO) import Data.List (intercalate) import System.EtCetera.Internal (Optional(..)) import System.EtCetera.Lxc.Internal (Ar...
paluh/et-cetera
test/System/EtCetera/LxcSpec.hs
bsd-3-clause
6,700
0
19
2,844
941
534
407
114
1
#! /usr/bin/env stack -- stack runghc module Advent.Day8 where import Advent import Data.Char (chr) import Numeric (readHex) unencode ('"':s) = _unencode s where _unencode ('\\':'"':s) = '"':_unencode s _unencode ('\\':'\\':s) = '\\':_unencode s _unencode ('\\':'x':a:b:s) = (chr $ (fst . head) parses):...
cpennington/adventofcode
src/Advent/Day8.hs
bsd-3-clause
1,084
0
12
246
520
265
255
26
7
{-# LANGUAGE TypeSynonymInstances #-} module CarbonCopy.MailHeaders ( Header(..), StrHeader, HeaderMatcher, extractHeaders, msg_id_hdr, from_hdr, in_reply_to_hdr ) where import Prelude as P import Data.Char import Data.ByteString.Char8 as BStr hiding (concatMap, takeWhile) import Text.P...
jdevelop/carboncopy
CarbonCopy/MailHeaders.hs
bsd-3-clause
1,110
0
13
323
283
161
122
26
1
{-# LANGUAGE PatternGuards, TypeSynonymInstances, TypeFamilies, FlexibleInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Berp.Compile.Compile -- Copyright : (c) 2010 Bernie Pope -- License : BSD-style -- Maintainer : [email protected] -- Stabil...
bjpop/berp
libs/src/Berp/Compile/Compile.hs
bsd-3-clause
35,150
0
25
7,948
10,239
5,207
5,032
623
5
{-# LANGUAGE OverloadedStrings #-} {- This file is part of the Haskell package cassava-streams. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at git://pmade.com/cassava-streams/LICENSE. No part of cassava-streams package, including this file, may be c...
pjones/cassava-streams
src/System/IO/Streams/Csv/Tutorial.hs
bsd-3-clause
5,484
0
13
1,217
608
350
258
61
2
{-# LANGUAGE GADTs #-} {- | * Parse 'String' into @['Node']@. * Parse macro definitions in @['Node']@ giving a @'Context'@ and an @'Program' 'RenderI'@. Only macro definition in the current level is parsed. * @'IO' a@. -} module Text.Velocity.Example where import Control.Error import T...
edom/velocity
Text/Velocity/Example.hs
bsd-3-clause
891
0
8
155
153
84
69
17
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE CPP #-} -- #define DEBUG {-| Module : AERN2.PPoly.MinMax Description : PPoly pointwise min and max Copyright : (c) Michal Konecny, Eike Neumann License : BSD3 Maintainer : [email protected] Stability : experimental Portabi...
michalkonecny/aern2
aern2-fun-univariate/src/AERN2/PPoly/MinMax.hs
bsd-3-clause
3,049
0
19
784
919
510
409
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} module Language.Haskell.Liquid.Bare.GhcSpec ( GhcSpec(..) , makeGhcSpec ) where import CoreSyn hiding (Expr) import HscTypes import Id impo...
rolph-recto/liquidhaskell
src/Language/Haskell/Liquid/Bare/GhcSpec.hs
bsd-3-clause
13,679
0
24
4,294
4,485
2,324
2,161
259
5
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE TypeFamilies #-} module Physics.Falling3d.Transform3d ( Transform3d ) where import Control.Monad(liftM) import qualified Data.Vector.Generic as G import qualified Data.Vector.Generic.Mutable as M import Data.Vector.Unb...
sebcrozet/falling3d
Physics/Falling3d/Transform3d.hs
bsd-3-clause
3,759
0
10
1,158
965
520
445
74
0
module Data.Astro.TypesTest ( tests , testDecimalDegrees , testDecimalHours ) where import Test.Framework (testGroup) import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.HUnit import Test.HUnit.Approx import Test.QuickCheck import Data.Ratio ((%)) import...
Alexander-Ignatyev/astro
test/Data/Astro/TypesTest.hs
bsd-3-clause
9,736
0
16
3,163
3,730
1,878
1,852
149
1
module Foreign.Storable.OrphansSpec (main, spec) where import Test.Hspec import Data.Complex import Data.Orphans () import Data.Ratio import Foreign.Storable main :: IO () main = hspec spec spec :: Spec spec = do describe "Storable Complex instance" $ do it "has twice the sizeOf its realPart" $ do sizeOf...
phadej/base-orphans
test/Foreign/Storable/OrphansSpec.hs
mit
781
0
18
172
275
146
129
20
1
{-# LANGUAGE OverloadedStrings #-} module Foreign.JavaScript.V8.ContextSpec (main, spec) where import Test.Hspec import Data.String.Builder (build) import Control.Monad (replicateM_) import Control.Exception (bracket) import Foreign.JavaScript.V8 import For...
sol/v8
test/Foreign/JavaScript/V8/ContextSpec.hs
mit
3,307
0
29
1,078
888
415
473
84
1
{-# LANGUAGE OverloadedStrings #-} module Dashdo.Rdash (rdash, charts, controls, defaultSidebar, Sidebar(..)) where import Dashdo.Types import Lucid import Lucid.Bootstrap3 import qualified Lucid.Rdash as RD import qualified Data.Text as T import qualified Data.Text.Lazy as TL import Data.Text hiding (map, interspers...
diffusionkinetics/open
dashdo/src/Dashdo/Rdash.hs
mit
3,346
0
27
887
1,043
532
511
74
1
module Generator where import Data.Bits import Data.Word import Syntax import Token import Transform opcodeOp :: Token -> Word8 opcodeOp tok = let (Just x) = lookup tok opList in x where opList = [ (PUSHA, 0x0E), (POPA, 0x0F), (RET, 0x2A), (NOP, 0x2B), ...
dosenfrucht/mcasm
src/Generator.hs
gpl-2.0
5,353
0
10
1,721
1,951
1,082
869
150
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-elastictranscoder/gen/Network/AWS/ElasticTranscoder/ListJobsByStatus.hs
mpl-2.0
6,124
0
13
1,273
880
518
362
103
1
<?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="az-AZ"> <title>Code Dx | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref loc...
veggiespam/zap-extensions
addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_az_AZ/helpset_az_AZ.hs
apache-2.0
969
80
66
160
415
210
205
-1
-1
{-# LANGUAGE RankNTypes, FlexibleContexts #-} {-| Implementation of functions specific to configuration management. -} {- Copyright (C) 2013, 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a...
bitemyapp/ganeti
src/Ganeti/WConfd/ConfigWriter.hs
bsd-2-clause
8,861
0
15
2,264
1,358
699
659
-1
-1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Generate.Index (toHtml, getInfo, getPkg) where import Control.Monad import Control.Monad.Except (ExceptT, liftIO, runExceptT, throwError) import Data.Aeson as Json import qualified Data.ByteString.Lazy.UTF8 as BSU8 import qualified Data.List as List i...
rehno-lindeque/elm-reactor
src/backend/Generate/Index.hs
bsd-3-clause
4,630
0
16
1,153
1,302
706
596
122
2
{- (c) The University of Glasgow, 1994-2006 Core pass to saturate constructors and PrimOps -} {-# LANGUAGE BangPatterns, CPP #-} module CorePrep ( corePrepPgm, corePrepExpr, cvtLitInteger, lookupMkIntegerName, lookupIntegerSDataConName ) where #include "HsVersions.h" import OccurAnal import HscType...
snoyberg/ghc
compiler/coreSyn/CorePrep.hs
bsd-3-clause
57,558
1
19
15,683
9,549
5,017
4,532
619
18
-- | -- Module: Data.Aeson.Types -- Copyright: (c) 2011-2016 Bryan O'Sullivan -- (c) 2011 MailRank, Inc. -- License: BSD3 -- Maintainer: Bryan O'Sullivan <[email protected]> -- Stability: experimental -- Portability: portable -- -- Types for working with JSON data. module Data.Aeson.Types ...
tolysz/prepare-ghcjs
spec-lts8/aeson/Data/Aeson/Types.hs
bsd-3-clause
2,392
0
7
671
443
306
137
87
1
module B1 (myFringe)where import D1 hiding (sumSquares) import qualified D1 instance SameOrNot Float where isSame a b = a ==b isNotSame a b = a /=b myFringe:: Tree a -> [a] myFringe (Leaf x ) = [x] myFringe (Branch left right) = myFringe right sumSquares (x:xs)= x^2 + sumSquares xs sumSquares [] =0
kmate/HaRe
old/testing/renaming/B1.hs
bsd-3-clause
320
0
7
73
145
77
68
11
1
module WhereIn3 where sumSquares x y = (sq_1 pow x) + (sq_1 pow y) where pow = 2 sq_1 pow 0 = 0 sq_1 pow z = z ^ pow anotherFun 0 y = sq y sq x = x ^ 2
kmate/HaRe
old/testing/liftOneLevel/WhereIn3_AstOut.hs
bsd-3-clause
163
0
7
53
90
46
44
7
1
{-# LANGUAGE CPP #-} module GHCi.Signals (installSignalHandlers) where import Control.Concurrent import Control.Exception import System.Mem.Weak ( deRefWeak ) #ifndef mingw32_HOST_OS import System.Posix.Signals #endif #if defined(mingw32_HOST_OS) import GHC.ConsoleHandler #endif -- | Install standard signal handle...
tolysz/prepare-ghcjs
spec-lts8/ghci/GHCi/Signals.hs
bsd-3-clause
1,393
0
16
292
186
97
89
18
2
{-# LANGUAGE UndecidableInstances, OverlappingInstances, Rank2Types, KindSignatures, EmptyDataDecls, MultiParamTypeClasses, CPP #-} {- (C) 2004--2005 Ralf Laemmel, Simon D. Foster This module approximates Data.Generics.Basics. -} module T1735_Help.Basics ( module Data.Typeable, module T1735_...
siddhanathan/ghc
testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs
bsd-3-clause
13,203
0
15
4,357
2,841
1,526
1,315
-1
-1
{- © 2012 Johan Kiviniemi <[email protected]> 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 AUTHOR DISCL...
ion1/rcon-haskell
Network/Rcon/Parse.hs
isc
2,916
0
13
673
581
308
273
52
3
module Geometria.Cuboide ( volume , area ) where volume :: Float -> Float -> Float -> Float volume a b c = areaRetangulo a b * c area :: Float -> Float -> Float -> Float area a b c = areaRetangulo a b * 2 + areaRetangulo a c * 2 + areaRetangulo c b * 2 areaRetangulo :: Float -> Float -> Float areaRetangulo a b...
tonussi/freezing-dubstep
proj1/Cuboide.hs
mit
329
0
10
81
143
73
70
9
1
{-# LANGUAGE DeriveFunctor #-} module Test.Smoke.Types.Results where import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Test.Smoke.Paths import Test.Smoke.Types.Assert import Test.Smoke.Types.Base import Test.Smoke.Types.Errors import Test.Smoke.Types.Plans import Test.Smoke.Types.Tests clas...
SamirTalwar/Smoke
src/lib/Test/Smoke/Types/Results.hs
mit
1,689
0
11
293
437
244
193
48
0
module AddStuff where addStuff :: Integer -> Integer -> Integer addStuff a b = a + b + 5 addTen = addStuff 5 fifteen = addTen 5 main :: IO () main = do let x = addStuff 10 15 y = addTen 100 z = fifteen putStrLn "=== Calculations ===" putStr "addStuff 10 15: " print x putStr "addTen 100 ...
Lyapunov/haskell-programming-from-first-principles
chapter_5/addstuff.hs
mit
408
0
10
131
137
64
73
17
1
module Yesod.Auth.WeiXin.Utils where import ClassyPrelude import Yesod import Control.Monad.Except hiding (replicateM) import Data.List ((!!)) import Network.Wai (rawQueryString) import System.Random (randomIO) imp...
txkaduo/yesod-auth-wx
Yesod/Auth/WeiXin/Utils.hs
mit
6,525
0
23
2,426
1,099
537
562
-1
-1
{------------------------------------------------------------------------------ uPuppet: Catalog rendering in JSON ------------------------------------------------------------------------------} module UPuppet.ShowJSON ( showJSON ) where import UPuppet.CState import UPuppet.Catalog import UPuppet.AST import Data...
dcspaul/uPuppet
Src/UPuppet/ShowJSON.hs
mit
2,224
11
11
384
612
336
276
36
2
module Pattern1 where data Bool = False | True not True = False not False = True
Lemmih/haskell-tc
tests/Pattern1.hs
mit
83
0
5
19
30
17
13
4
1
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Hpack.Render.Dsl ( -- * AST Element (..) , Value (..) -- * Render , RenderSettings (..) , CommaStyle (..) , defaultRenderSettings , Alignment (..) , Nesting , render -- * Utils , sortFieldsBy #ifdef TEST , Line...
haskell-tinc/hpack
src/Hpack/Render/Dsl.hs
mit
4,314
0
14
834
1,478
792
686
96
4
module Storage.Distributed where
axman6/HaskellMR
src/Storage/Distributed.hs
mit
34
0
3
4
6
4
2
1
0
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Tup...
MaxDaten/yage-geometry
src/Yage/Geometry.hs
mit
7,237
0
17
1,890
2,124
1,143
981
-1
-1
-- | pontarius core module Main where
Philonous/pontarius-core
src/Main.hs
mit
39
0
2
8
5
4
1
1
0