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
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Test.Hspec (Spec, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import School (add, empty, grade, sorted) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec specs = do let f...
exercism/xhaskell
exercises/practice/grade-school/test/Tests.hs
mit
1,651
0
13
609
502
286
216
33
1
{-# LANGUAGE QuasiQuotes, TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE Rank2Types #-} -- | A Yesod plugin for Authentication via e-mail -- -- This plugin works out of the box by only setting a few methods on the type class -- that tell...
wujf/yesod
yesod-auth/Yesod/Auth/Email.hs
mit
21,028
0
24
6,373
3,966
2,038
1,928
339
10
module ComputeDigest where import Data.Digest.Pure.SHA import qualified Data.ByteString.Lazy as L computeDigest :: FilePath -> IO String computeDigest fName = showDigest . sha1 <$> L.readFile fName
mjansen/convert-log-helper
ComputeDigest.hs
mit
201
0
7
28
53
31
22
5
1
{-# LANGUAGE TemplateHaskell #-} import Control.Monad import Data.Default import Control.Concurrent(threadDelay) import Control.Monad.Trans.Free import Control.Monad.Trans.State import Control.Lens hiding (Level) import System.IO import qualified Data.Map as M import Types import Game as G import Random import Textlu...
5outh/textlunky
src/textlunky.hs
mit
968
0
13
197
243
125
118
34
1
-- Examples from chapter 4 -- http://learnyouahaskell.com/syntax-in-functions lucky :: (Integral a) => a -> String lucky 7 = "LUCKY NUMBER SEVEN!" lucky x = "Sorry, you're out of luck, pal!" factorial :: (Integral a) => a -> a factorial 0 = 1 factorial x = x * factorial (x - 1) addVectors :: (Num a) => (a, a) ->...
Sgoettschkes/learning
haskell/LearnYouAHaskell/04.hs
mit
1,755
0
11
527
762
399
363
44
3
module GHCJS.DOM.DeviceOrientationEvent ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/DeviceOrientationEvent.hs
mit
52
0
3
7
10
7
3
1
0
module Y2018.M01.D03.Exercise where {-- Now. For something COMPLETELY different: From the wikipedia entry on Baron Munchhausen: https://en.wikipedia.org/wiki/Baron_Munchausen We have the following note on Munchausen numbers: ... the mathematical term "Munchausen number", coined by Daan van Berkel in 2009 to desc...
geophf/1HaskellADay
exercises/HAD/Y2018/M01/D03/Exercise.hs
mit
1,017
0
6
166
51
30
21
5
1
{-# LANGUAGE Haskell2010 , TypeFamilies , FlexibleContexts , Trustworthy , StandaloneDeriving , DeriveDataTypeable , ConstrainedClassMethods #-} {-# OPTIONS_GHC -Wall -fno-warn-name-shadowing #-} -- | Efficient matrix operations in 100% pure Haskell. -- -- This package uses miscellaneous imple...
scravy/bed-and-breakfast
src/Numeric/Matrix.hs
mit
31,373
2
31
10,376
10,486
5,475
5,011
536
4
module Language.Haskell.Lexer.Tokens where -- | Haskell token classifications: data Token = Varid -- ^ Variable | Conid -- ^ Constructor | Varsym -- ^ Variable operator | Consym -- ^ Constructor operator | Reservedid -- ^ Reserved keyword | Reservedop -- ^ Reserved operator | Spec...
yav/haskell-lexer
Language/Haskell/Lexer/Tokens.hs
mit
1,432
0
6
392
151
107
44
31
0
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving, FlexibleInstances #-} module Syntax.Term where import Data.Generics.Fixplate (Mu(..)) import qualified Data.Generics.Fixplate as Fix import Data.Map (Map) import Data.Scientific (Scientific) import Data.Typeable import Data.Data import Syntax.Type (Type) import ...
fredun/compiler
src/Syntax/Term.hs
mit
1,714
0
9
308
590
331
259
45
0
-- | -- Module : FCH.Java -- Copyright : Joe Jevnik -- -- License : GPL-2 -- Maintainer : joejev@gmail.org -- Stability : stable -- Portability : GHC -- -- The language module for C headers. module FCH.Java (java) where import Data.Char (toUpper) import FCH.Data -- | The c programming language (and ma...
llllllllll/fch
FCH/Java.hs
gpl-2.0
858
0
12
330
186
109
77
13
1
-- File: ch3/exB12.hs -- A function that computes the convex hull of a finite list of points. import Data.List (groupBy, nub, sort, sortBy) -- | Type alias for points in the Cartesian plane. type Point = (Double, Double) slope :: Point -> Point -> Double -- ^ Calculates the slope between two points. slope (x1, y1) (x...
friedbrice/RealWorldHaskell
ch3/exB12.hs
gpl-2.0
3,165
0
18
950
912
518
394
48
6
module TypeCheckProblem( fitness , generateInput , worstScore , bestScore , generateTestCases , readTestCases , writeTestCases ) where import GRPCommon import System.Random import Control.Monad import Data.List import GRPMath import Dictionary import GhciEval --TODO: This file will generate Haskell expressions as S...
vektordev/GP
src/TypeCheckProblem.hs
gpl-2.0
3,955
0
15
704
880
448
432
63
1
{- This source file is a part of the noisefunge programming environment. Copyright (C) 2015 Rev. Johnny Healey <rev.null@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...
revnull/noisefunge
src/Language/NoiseFunge/Befunge/Process.hs
gpl-3.0
7,924
0
13
2,600
2,235
1,216
1,019
212
1
{-# LANGUAGE NoMonomorphismRestriction #-} module DetermineTheType where example = 1 co :: (b -> c) -> (a -> b) -> a -> c co bToC aToB a = bToC (aToB a)
dkensinger/haskell
haskellbook/determineTypes.hs
gpl-3.0
157
0
8
35
62
34
28
5
1
module Ignifera.Piece where import Ignifera.Color import Ignifera.PieceType data Piece = Piece Color PieceType deriving (Eq, Read, Show)
fthomas/ignifera
src/Ignifera/Piece.hs
gpl-3.0
141
0
6
21
42
24
18
5
0
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} module Cegt.PrettyPrinting where import Cegt.Syntax import Text.PrettyPrint import Text.Parsec.Pos import Data.Char import Text.Parsec.Error(ParseError,showErrorMessages,errorPos,errorMessages) class Disp d where disp :: d -> Doc precedence :: d -> Int pr...
Fermat/CEGT
src/Cegt/PrettyPrinting.hs
gpl-3.0
2,112
0
13
611
873
436
437
68
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Shortner.Types where import Control.Applicative ((<*>)) import Data.Aeson hiding (json) import Data.Aeson.TH import Data.Functor ((<$>)) import Data.UUID import Data.UUID.Aeson import...
divarvel/scotty-short
src/Shortner/Types.hs
gpl-3.0
1,106
0
10
293
300
177
123
33
0
module Main where import qualified Pacman as P main :: IO () main = P.run
josuf107/Pacman
Main.hs
gpl-3.0
76
0
6
17
27
17
10
4
1
module Generation.Pattern ( Language (..) , Shaped(..) , generate ) where import Data.List import Data.Function {- -- p = pattern -- a = map -- m = generating monad -- l = map boundary limit (to declare a subpattern has a smaller domain than the initial pattern) -} data Language b a m l = Language { empty :: a l...
xaphiriron/maps
Generation/Pattern.hs
gpl-3.0
1,104
42
10
255
488
274
214
23
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-cloudtasks/gen/Network/Google/Resource/CloudTasks/Projects/Locations/List.hs
mpl-2.0
6,103
0
19
1,439
962
556
406
133
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.People.Types -- Copyright : (c) 2015-2016 Brendan Hay ...
brendanhay/gogol
gogol-people/gen/Network/Google/People/Types.hs
mpl-2.0
16,255
0
7
4,086
1,937
1,320
617
513
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/FloodlightActivities/Delete.hs
mpl-2.0
5,315
0
19
1,234
825
476
349
116
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-firestore/gen/Network/Google/Resource/FireStore/Projects/Locations/Get.hs
mpl-2.0
4,549
0
15
1,037
698
408
290
101
1
{-# LANGUAGE RecordWildCards #-} module Handler.Image where import Import import Yesod.Core.Types import Data.Conduit import Data.Conduit.List (foldMap) import Control.Monad.Trans.Resource import Data.Text.Encoding import Widgets.Time getImageR :: Text -> Handler TypedContent getImageR image_handle = do Entit...
chreekat/snowdrift
Handler/Image.hs
agpl-3.0
3,736
0
26
895
1,009
486
523
73
4
{-# LANGUAGE CPP #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} module StearnsWharf.Repos.SteelElementRepository where import qualified Data.Map as Map import Control.Monad (liftM3) import Control.Applicative ((<$>),(<*>)) import Database.PostgreSQL.Simple (Con...
baalbek/stearnswharf
src/StearnsWharf/Repos/SteelElementRepository.hs
lgpl-3.0
3,194
0
15
887
735
400
335
68
1
module FreePalace.Domain.GUI where -- TODO Need Disconnect menu item and Quit menu item import qualified FreePalace.Domain.Chat as Chat import qualified System.FilePath as Path data MainWindow = MainWindow { quit :: IO (), showMainWindow :: IO (), closeMainWindow :: IO (), onMainWind...
psfblair/freepalace
src/FreePalace/Domain/GUI.hs
apache-2.0
1,235
0
11
329
355
203
152
36
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RecordWildCards #-} module Target where import Control.Arrow import Control.Lens import Data.AffineSpace import Data.Default import qualified Data.Set as Set import Data.VectorSpace import Graphics.Gloss import ...
nilcons/tag-game
src/Target.hs
apache-2.0
1,437
0
11
375
501
274
227
-1
-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="ru-RU"> <title>Script Console</title> <maps> <homeID>top</homeID> <mapref location="map...
secdec/zap-extensions
addOns/scripts/src/main/javahelp/org/zaproxy/zap/extension/scripts/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
970
77
66
156
427
215
212
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module RulesGen.Rules where import qualified Data.Map as Map newtype NonterminalID = NonterminalID String deriving (Show, Eq, Ord) newtype Rules = Rules (Map.Map NonterminalID Rule) deriving (Show) newtype Rule = Rule (Map.Map ProductionID (Int, [Symbol])) der...
arotenberg/rulesgen
src/RulesGen/Rules.hs
apache-2.0
536
0
9
97
153
88
65
22
0
module MDC_Utils where import Data.List import Data.List.Split --function to coma separate values, from a list containing doubles listSeparate :: String -> [Double] -> String listSeparate c xs = concat . intersperse c . map show $ xs --convert from list of strings to list of doubles string2Double :: [String] -> [Doub...
ozkar99/HaskellEstadistica
MDC/MDC_Utils.hs
bsd-2-clause
989
1
12
177
252
134
118
13
1
-- -- Copyright (c) 2013, Carl Joachim Svenn -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- 1. Redistributions of source code must retain the above copyright notice...
karamellpelle/MEnv
source/MEnv/IOS.hs
bsd-2-clause
4,205
0
16
1,097
639
337
302
63
1
{-# LANGUAGE RecordWildCards #-} module Development.Hake.Types ( hakeParser , HakeMode(..) , InitOptions(..) , PersistedEnvironment(..)) where import Control.DeepSeq import Control.Monad (liftM5) import Data.Binary import Data.Hashable import Data.Typeable import Development.Shake.FilePath import Options.App...
HakeIO/hake
hake-library/src/Development/Hake/Types.hs
bsd-3-clause
2,622
0
22
504
644
345
299
73
1
{-# LANGUAGE OverloadedStrings #-} module Network.CrazeSpec where import Control.Concurrent import Control.Monad.IO.Class import Data.ByteString (ByteString, isInfixOf) import Network.Craze import Network.Curl import Network.HTTP.Base hiding (port) import Network.HTTP.Proxy.Server import Test.Hspec ...
etcinit/craze
test/Network/CrazeSpec.hs
bsd-3-clause
2,806
0
16
697
790
415
375
68
3
----------------------------------------------------------------------------- -- | -- Module : TestSuite.CRC.CCITT_Unidir -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Test suite for Examples.CRC.CCITT_Unidir ---------------------...
josefs/sbv
SBVTestSuite/TestSuite/CRC/CCITT_Unidir.hs
bsd-3-clause
1,942
0
11
415
529
289
240
34
2
-------------------------------------------------------------------------------- -- | -- Module : Database.EventStore.Internal.Operations -- Copyright : (C) 2015 Yorick Laupa -- License : (see the file LICENSE) -- -- Maintainer : Yorick Laupa <yo.eight@gmail.com> -- Stability : provisional -- Portability : non-portable...
YoEight/eventstore
Database/EventStore/Internal/Operations.hs
bsd-3-clause
1,769
0
5
171
176
137
39
19
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Distribution.Types.BenchmarkType ( BenchmarkType(..), knownBenchmarkTypes, ) where import Prelude () import Distribution.Compat.Prelude import Distribution.Version import Distribution.Text import Text.PrettyPrint as Disp -- | The \"b...
sopvop/cabal
Cabal/Distribution/Types/BenchmarkType.hs
bsd-3-clause
1,130
0
11
248
245
135
110
22
1
module History where -- Create new history. new :: a -> ([a], a, [a]) new a = ([], a, []) -- Get present value. present :: ([a], a, [a]) -> a present (_, present, _) = present -- Accept new present value. Adjust history. record :: ([a], a, [a]) -> a -> ([a], a, [a]) record (past, prev, _) cur = ([prev] ++ past, cur,...
sakhnik/FreeCell
History.hs
bsd-3-clause
1,201
0
10
317
557
335
222
30
1
-- $Id: HsPatStruct.hs,v 1.29 2005/05/31 02:25:25 hallgren Exp $ module HsPatStruct where import SrcLoc1 import HsIdent import HsLiteral import HsFieldsStruct import Data.Generics data PI i p = HsPId (HsIdentI i) -- Variables and nullary constructors | HsPLit SrcLoc HsLiteral -- Literal | HsP...
forste/haReFork
tools/base/AST/HsPatStruct.hs
bsd-3-clause
1,967
0
8
833
177
109
68
21
0
-- adapted code from the Haskoin project module BitD.Protocol.BitcoinAddress ( addressToHash160 , hash160ToAddress , AddressVersion(..) ) where import BitD.Protocol.Types (Hash256(..), Hash160(..), Address(..)) import qualified Crypto.Hash.SHA256 as SHA256 import Control.Monad (guar...
benma/bitd
src/BitD/Protocol/BitcoinAddress.hs
bsd-3-clause
3,447
0
14
738
1,204
628
576
80
2
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE LambdaCase #-} module Run.SendReceive where import Control.Applicative import Control.Concurrent import Control.Monad import qualified Data.Con...
Philonous/pontarius-xmpp
tests/Run/SendReceive.hs
bsd-3-clause
3,629
0
19
1,180
862
417
445
87
6
-- https://www.reddit.com/r/dailyprogrammer/comments/5e4mde/20161121_challenge_293_easy_defusing_the_bomb/ import qualified Data.Map as Map import Data.Map (Map) data Color = White | Red | Black | Orange | Green | Purple deriving (Show, Read, Enum, Eq, Ord) getNexts :: Color -> [Color] getNexts White = [...
wangbj/excises
e293.hs
bsd-3-clause
1,629
0
13
334
657
357
300
32
2
-- | -- Module : $Header$ -- Copyright : (c) 2013-2014 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable import Distribution.Simple main = defaultMainWithHooks autoconfUserHooks
TomMD/cryptol
Setup.hs
bsd-3-clause
268
0
5
56
21
14
7
2
1
module Main where import Word2Vec import System.Environment (getArgs) main :: IO () main = do args <- getArgs case args of "train" : path : num : _ -> trainWith path $ read num "most-similar" : words@(w:ws) -> mostSimilar words _ -> showHelp showHelp :: IO () showHelp = do putStrLn "usage: wv <com...
shuhei/wv
app/Main.hs
bsd-3-clause
520
0
13
122
148
71
77
17
3
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2014 Dimitri Sabadie -- License : BSD3 -- -- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com> -- Stability : experimental -- Portability : portable -- --------------...
phaazon/quaazar
src/Quaazar/Technics/Lighting/Phong.hs
bsd-3-clause
6,240
0
18
1,355
998
548
450
-1
-1
{-# LANGUAGE TypeFamilies #-} module PrioritySync.Internal.Constrained (Constrained(..)) where import PrioritySync.Internal.UserData import PrioritySync.Internal.RoomGroup import PrioritySync.Internal.ClaimContext import PrioritySync.Internal.Room import PrioritySync.Internal.RoomConstraint -- | Require that ...
clanehin/priority-sync
PrioritySync/Internal/Constrained.hs
bsd-3-clause
793
0
8
124
197
108
89
17
0
-- Copyright (c) 2015, Travis Bemann -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- o Redistributions of source code must retain the above copyright notice, this -- list of conditio...
tabemann/amphibian
src_old/Network/IRC/Client/Amphibian/ChannelServer.hs
bsd-3-clause
25,961
4
25
7,703
6,740
3,254
3,486
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 The @match@ function -} {-# LANGUAGE CPP #-} module Match ( match, matchEquations, matchWrapper, matchSimply, matchSinglePat ) where #include "HsVersions.h" import {-#SOURCE#-} DsExpr (dsLExpr, dsSyntaxExpr) import Dy...
GaloisInc/halvm-ghc
compiler/deSugar/Match.hs
bsd-3-clause
41,027
12
21
10,866
7,091
3,722
3,369
397
28
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveGeneric #-} module Aria.Types where import Data.Text hiding (replicate, length, take) import Data.Data import Data.Time (UTCTime(..), NominalDiffTime) import Data.SafeCopy import Control.Lens import GHC.Generics hiding (to) type ...
theNerd247/ariaRacer
src/Aria/Types.hs
bsd-3-clause
1,109
0
9
190
335
190
145
34
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} module Andromeda.Simulator.Internal.SimulationCompiler where import qualified Data.ByteString.Char8 as BS import qualified Data.Map as M import qualified Control.Monad.Trans.Stat...
graninas/Andromeda
src/Andromeda/Simulator/Internal/SimulationCompiler.hs
bsd-3-clause
2,754
0
14
423
721
364
357
-1
-1
{-# LANGUAGE BangPatterns #-} module Strip (strip) where import Data.List (tails, minimumBy) import Data.Ord (comparing) import Control.Monad (forM_, when) import qualified Data.ByteString.Lazy.Char8 as B import Options import Fasta -- Find best match starting within 'shift' elements from the beginning of 'y' -- t...
b4winckler/iseq
src/Strip.hs
bsd-3-clause
3,142
0
23
941
1,073
556
517
56
3
{-# LANGUAGE LambdaCase #-} module Main where import Control.Monad.Error import Search.Types import Search.Graph import qualified Data.List as List import qualified Data.List.Split as List import System.Environment (getArgs) import Mote.Debug import Mote.LoadFile import Mote.Search import qualified Data.Map as M impo...
imeckler/mote
Search/Test.hs
bsd-3-clause
964
0
23
226
370
199
171
32
1
module Data.UpperBoundedPred ( UpperBoundedPred , applyUpperBoundedPred , OC (..) , comparator , Interval (..) , isIn , lcro , fromInterval , intervalUpperBound ) where data UpperBoundedPred a = UpperBoundedPred (a -> Bool) (Maybe a) deriving (Typeable) applyUpperBoundedPred ...
kmyk/proof-haskell
Data/UpperBoundedPred.hs
mit
1,576
0
8
347
623
333
290
34
1
solve a b l | a * b > l = 0 | b * c > l = (l `div` a - b) `div` a + 1 | otherwise = 1 + (solve a c l) + (solve b c l) where c = a + b main = print $ solve 1 100 l + 49 where l = (10 ^ 8) `div` 2
EdisonAlgorithms/ProjectEuler
vol4/198.hs
mit
228
0
10
99
155
80
75
6
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- --...
ChrisLane/leksah
src/IDE/Pane/WebKit/Output.hs
gpl-2.0
9,042
0
27
2,416
2,255
1,216
1,039
94
3
module Char where isSpace :: Char -> Bool isSpace c = i == ord ' ' || i == ord '\t' || i == ord '\n' || i == ord '\r' || i == ord '\f' || i == ord '\v' where i = ord c isUpper :: Char -> Bool isUpper c = ord c >= ord 'A' && ord c <= ord 'Z' isLower :: Char -> Bool isLower c = ord c >= ord 'a'...
roberth/uu-helium
lib/simple/Char.hs
gpl-3.0
756
0
16
230
386
180
206
24
1
module ErrEmptyWhere2 where class X a where y :: a -> a
roberth/uu-helium
test/typeClassesStatic/ErrEmptyWhere2.hs
gpl-3.0
59
0
5
15
22
12
10
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-lambda/gen/Network/AWS/Lambda/UpdateFunctionConfiguration.hs
mpl-2.0
6,508
0
11
1,320
821
499
322
101
1
------------------------------------------------------------------------------------------- -- | -- Module : Control.Morphism.Universal -- Copyright : 2008 Edward Kmett -- License : BSD3 -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability : portable -- -- Note the choice of wh...
urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav
Control/Morphism/Universal.hs
apache-2.0
1,501
4
12
244
404
223
181
-1
-1
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedLists #-} {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module Database.DSH.VSL.Builtins where import Control.Monad import qualified Data.List as List import qualified Data.List.NonEmpty ...
ulricha/dsh
src/Database/DSH/VSL/Builtins.hs
bsd-3-clause
25,491
0
21
6,476
8,961
4,466
4,495
431
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-missing-methods #-} {-| Use this module to either: * match `Text` with light-weight backtracking patterns, or: * parse structured values from `Text`. ...
bitemyapp/Haskell-Turtle-Library
src/Turtle/Pattern.hs
bsd-3-clause
13,573
0
15
3,134
2,507
1,299
1,208
212
2
import System.Plugins import API -- an example where we just want to load an object and run it main = do m_v <- load_ "../Null.o" ["../api",".."] "resource" t <- load_ "../Dep.o" ["../api"] "resource" case m_v of LoadFailure err -> error (unlines err) LoadSuccess m v -> do putStrLn...
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/unloadAll/null/prog/Main.hs
bsd-3-clause
539
0
16
148
175
82
93
11
3
-- Example taken from Lee Pike's paper on SmartCheck: -- https://github.com/leepike/SmartCheck/blob/master/paper/paper.pdf -- -- An enumerative testing library, using a standard enumeration for integers, -- won't be able to find a counter-example. -- -- However, if we tweak the enumeration to include extremely large in...
rudymatela/llcheck
eg/overflow.hs
bsd-3-clause
1,138
0
10
235
319
175
144
20
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListEntitiesForPolicy.hs
mpl-2.0
8,080
0
20
1,639
1,041
622
419
103
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Snap.Internal.Http.Server.Session ( httpAcceptLoop , httpSession , snapToServerHandl...
sopvop/snap-server
src/Snap/Internal/Http/Server/Session.hs
bsd-3-clause
36,542
0
22
12,455
6,560
3,414
3,146
569
21
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RecordWildCards #-} module Stack.Options.GlobalParser where import Options.Applicative import Options.Applicative.Builder.Extra import Path.IO (getCurrentDir, resolveDir', resolveFile') import qualified Stack.Docker as ...
juhp/stack
src/Stack/Options/GlobalParser.hs
bsd-3-clause
5,213
0
25
1,426
898
453
445
106
4
<?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>Custom Payloads Add-on</title> <maps> <homeID>custompayloads</homeID> <m...
thc202/zap-extensions
addOns/custompayloads/src/main/javahelp/org/zaproxy/zap/extension/custompayloads/resources/help_az_AZ/helpset_az_AZ.hs
apache-2.0
978
77
67
157
413
209
204
-1
-1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Stg to C--: heap management functions -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmHeap ( getVirtHp, setVirtHp...
gcampax/ghc
compiler/codeGen/StgCmmHeap.hs
bsd-3-clause
25,474
0
20
7,157
3,737
1,937
1,800
298
8
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Concurrent.STM import qualified Control.Exception as E main = do x <- atomically (newTVar 0) y <- atomically (newTVar 1) atomically (always $ invariant x y) updates x y `E.catch` \(e :: E.SomeException) -> print e print =<< atomically (r...
seereason/ghcjs
test/conc/stm004.hs
mit
875
0
13
214
305
144
161
26
2
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} {-# LANGUAGE TypeFamilies, EmptyCase, LambdaCase #-} {-# LANGUAGE UndecidableInstances #-} -- Check some DataFamilies, warning appearance and other stuff module EmptyCase005 where data Void newtype Void2 = Void2 Void data Void3 = Void3 Void -- Exhaustive f1 :: Void2...
ezyang/ghc
testsuite/tests/pmcheck/should_compile/EmptyCase005.hs
bsd-3-clause
2,154
0
7
453
461
279
182
-1
-1
module Main where import UnitTesting.UnitTests import Test.QuickCheck main :: IO () main = quickCheck (prop_idempotent :: [Integer] -> Bool)
iduhetonas/haskell-projects
main.hs
mit
142
0
8
20
45
26
19
5
1
{- Copyright (c) 2006-2011 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} {- | Module : Data.Quantity Copyright : Copyright (C) 2006-2011 John Goerzen License : BSD3 Maintainer : John Goerzen <jgoerzen@complete.org> St...
haskellbr/missingh
missingh-all/src/Data/Quantity.hs
mit
8,470
0
13
2,628
1,302
708
594
100
6
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLBaseFontElement (js_setColor, setColor, js_getColor, getColor, js_setFace, setFace, js_getFace, getFace, js_setSize, setSize, js_getSize, getSize, HTMLBaseFontElement, castToHTMLBaseFont...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/HTMLBaseFontElement.hs
mit
3,576
42
11
506
831
473
358
56
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Oczor.Converter.CodeGenAst (module Oczor.Converter.CodeGenAst) where import Data.Functor.Foldable.TH import Data.Functor.Foldable import ClassyPrelude import Oczor.Utl type Name = String data Lits = LitNull | LitBool Bool | LitChar Char | ...
ptol/oczor
src/Oczor/Converter/CodeGenAst.hs
mit
1,496
0
14
335
571
316
255
-1
-1
module Parser.Reader where import Text.ParserCombinators.Parsec (parse) import Parser.Parser import Parser.Types.LispVal readExpr :: String -> LispVal readExpr input = case parse parseExpr "lisp" input of Left err -> String $ "No match: " ++ show err Right val -> val
slogsdon/haskell-exercises
write-a-scheme/evaluation-part1/src/Parser/Reader.hs
mit
310
0
9
81
85
45
40
8
2
module Data.TargetPlatform ( allTargetPlatforms , TargetPlatform (..) ) where import Data.Char import Data.Maybe import Text.Read import qualified Text.Read.Lex as L data TargetPlatform = IOS | MacOS | TVOS | WatchOS deriving (Ord, Eq) instance Show TargetP...
r-peck/Rome
src/Data/TargetPlatform.hs
mit
824
0
13
253
225
122
103
25
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module TypeCheck where import Foundation (($),(.),Maybe(Just,Nothing),pure,(<>)) import Foundation.Collection (reverse) import Prelude (Show) import qualified Prelude as P (show,error) import GHC.Stack (HasCallStack) import Control.Monad.Logger (MonadLogger) imp...
jyrimatti/alava
src-lib/TypeCheck.hs
mit
8,683
0
18
2,143
3,386
1,726
1,660
-1
-1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} module Language.C.Inline.ParseSpe...
fpco/inline-c
inline-c/test/Language/C/Inline/ParseSpec.hs
mit
4,700
0
16
1,137
1,258
689
569
97
4
module GHCJS.DOM.StorageErrorCallback ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/StorageErrorCallback.hs
mit
50
0
3
7
10
7
3
1
0
-- | Static tiles and collections module Game.Mahjong.Static.Tiles ( -- ** Individual tiles c1, c2, c3, c4, c5, c6, c7, c8, c9, b1, b2, b3, b4, b5, b6, b7, b8, b9, k1, k2, k3, k4, k5, k6, k7, k8, k9, wn, ws, we, ww, dr, dg, dw, f1, f2, f3, f4, s1, s2, s3, s4, -- ** Tile collections coin...
gspindles/mj-score-eval
src/Game/Mahjong/Static/Tiles.hs
mit
3,681
0
9
830
1,140
696
444
98
1
module Common.Debug ( trace, traceList ) where import Data.List import qualified Debug.Trace as Trace trace :: Show a => String -> a -> a trace t a = Trace.trace (t ++ " = " ++ show a) a -- trace _ = id traceList :: Show a => String -> [a] -> [a] traceList t as = Trace.trace (t ++ " = [\n\t" ++ intercalate "...
Chatanga/kage
src/Common/Debug.hs
mit
372
0
11
87
151
81
70
9
1
module SpaceState.Space(runGame, Difficulty(..)) where import System.Random import Data.List import Data.Maybe import Control.Monad import Control.Monad.State as State import Prelude hiding (catch) import Graphics.UI.SDL as SDL import Graphics.Rendering.FTGL as FTGL import Entity import Camera import AObject import ...
anttisalonen/starrover2
src/SpaceState/Space.hs
mit
3,264
0
18
913
928
472
456
99
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Auth where import Control.Lens import Control.Monad.Catch ...
wz1000/haskell-webapps
ServantPersistent/src/Auth.hs
mit
2,898
0
22
926
729
374
355
60
5
module Day2 ( ) where import Data.List.Split input = readFile "input/day2.txt" sideAreas l w h = [l * w, w * h, h* l] area [l, w, h] = 2 * (sum $ sideAreas l w h) + (minimum $ sideAreas l w h) toSides = map ((map read) . splitOn "x") . lines :: String -> [[Int]] p1 = sum . map area . toSides <$> input -- 1588178 ...
farrellm/advent
src/Day2.hs
mit
500
0
10
125
294
158
136
11
1
{-# htermination (elemOrdering :: Ordering -> (List Ordering) -> MyBool) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil data Ordering = LT | EQ | GT ; map :: (b -> a) -> (List b) -> (List a); map f Nil = Nil; map f (Cons x xs) = Cons (f x) (map f xs); f...
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/elem_7.hs
mit
1,140
0
9
296
523
284
239
31
1
module Language.TaPL.Boolean.Syntax (Term(..), isVal) where import Test.QuickCheck (Arbitrary, arbitrary, sized, oneof) import Control.Monad (liftM3) import Control.Applicative ((<$>)) import Language.TaPL.ShowPretty (ShowPretty, showp) data Term = TmTrue | TmFalse | TmIf Term Term Term derivi...
zeckalpha/TaPL
src/Language/TaPL/Boolean/Syntax.hs
mit
1,081
0
11
361
320
174
146
26
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-basepathmapping.html module Stratosphere.Resources.ApiGatewayBasePathMapping where import Stratosph...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/ApiGatewayBasePathMapping.hs
mit
3,169
0
15
353
461
262
199
40
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveFunctor #-} module FVL.TypeAST ( Expr(..) , FType(..) , typeTransform ) where import FVL.Algebra import qualified FVL.FAST as FAST data Expr a b = CInt Integer | CBool Bool | CVar String | Add b b | Sub b b | Mul b b | Div b b | An...
burz/Feval
FVL/TypeAST.hs
mit
1,737
0
8
550
882
452
430
64
1
{- | Module : $Header$ Description : Definition of signature morphisms for first-order logic with dependent types (DFOL) Copyright : (c) Kristina Sojakova, DFKI Bremen 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : k.sojakova@jacobs-university.de Stability : experimenta...
nevrenato/HetsAlloy
DFOL/Morphism.hs
gpl-2.0
16,137
0
21
5,196
4,062
2,048
2,014
298
6
{-# LANGUAGE MagicHash #-} module Darcs.Patch.Witnesses.Unsafe ( unsafeCoerceP , unsafeCoercePStart , unsafeCoercePEnd , unsafeCoerceP2 , unsafeCoerceP1 ) where import GHC.Base (unsafeCoerce#) unsafeCoerceP :: a wX wY -> a wB wC unsafeCoerceP = unsafeCoerce# unsafeCoercePStart :: a wX1 wY -> ...
DavidAlphaFox/darcs
src/Darcs/Patch/Witnesses/Unsafe.hs
gpl-2.0
583
0
6
113
160
86
74
18
1
-- -- -- (C) 2011-14 Nicola Bonelli <nicola@pfq.io> -- -- 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. -- -- T...
Mr-Click/PFQ
user/pfqd/src/Daemon.hs
gpl-2.0
2,649
0
15
538
613
327
286
48
2
{- Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu> 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 program is ...
poxu/pandoc
benchmark/benchmark-pandoc.hs
gpl-2.0
2,173
0
16
486
526
275
251
35
2
module Main where import System.Environment(getArgs) import Control.Monad freeSpaces :: Int -> Int -> [Int] -> [Int] freeSpaces l p [] = [l-p] freeSpaces l p (x:xs) = (x-p) : freeSpaces l x xs placeBats :: Int -> Int -> Int -> Int -> Int placeBats ld d rd s = if s >= ld + rd then ((s - ld - rd) `div` d) + 1 else 0 ...
cryptica/CodeEval
Challenges/146_BatsChallenge/main.hs
gpl-3.0
860
0
14
258
418
215
203
21
2
{-| Module : Network.Gopher.Util Stability : experimental Portability : POSIX Helper utilities used within the library and the server which also could be useful for other application code. -} {-# LANGUAGE OverloadedStrings #-} module Network.Gopher.Util ( -- * Security santinizePath , santinizeIfNotUrl ...
lukasepple/spacecookie
src/Network/Gopher/Util.hs
gpl-3.0
1,832
0
14
382
410
234
176
36
2
module HandlersClient ( doClient, lookupHandlerClient ) where import GHC.IO.Handle import System.IO import Control.Monad import Control.Concurrent.STM.TChan import PupEventsPQueue import qualified PupEventsClient as Client import Graphics.Rendering.OpenGL.GL (($=)) import qualified Graphics.Rendering.OpenG...
RocketPuppy/PupCollide
Client/HandlersClient.hs
gpl-3.0
3,619
0
10
473
429
259
170
35
1
double x = x + x
forflo/snippetbin
haskell/double.hs
gpl-3.0
17
0
5
6
13
6
7
1
1
{-# LANGUAGE ImplicitParams #-} -- | This module contains Version of Ampersand module Ampersand.Basics.Version ( ampersandVersionStr , ampersandVersionWithoutBuildTimeStr , fatal ) where import Ampersand.Basics.BuildInfo_Generated import Ampersand.Basics.Exit import Ampersand.Basics.Prelude...
AmpersandTarski/ampersand
src/Ampersand/Basics/Version.hs
gpl-3.0
1,893
0
11
391
230
131
99
-1
-1
process s = upCase s >>= \upStr -> toWords upStr
hmemcpy/milewski-ctfp-pdf
src/content/3.4/code/haskell/snippet20.hs
gpl-3.0
61
0
7
22
24
11
13
3
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-composer/gen/Network/Google/Resource/Composer/Projects/Locations/Environments/Patch.hs
mpl-2.0
10,757
0
17
2,001
927
569
358
127
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Settings/UpdatePop.hs
mpl-2.0
5,182
0
20
1,264
785
457
328
117
1