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
module Unison.Util.Map ( unionWithM ) where import qualified Control.Monad as Monad import qualified Data.Map as Map import Unison.Prelude unionWithM :: forall m k a. (Monad m, Ord k) => (a -> a -> m a) -> Map k a -> Map k a -> m (Map k a) unionWithM f m1 m2 = Monad.foldM go m1 $ Map.toList m2 where go :: Ma...
unisonweb/platform
parser-typechecker/src/Unison/Util/Map.hs
mit
491
0
14
127
256
133
123
-1
-1
-- file ch02/myDrop.hs -- From chapter 2, http://book.realworldhaskell.org/read/types-and-functions.html myDrop n xs = if n <= 0 || null xs then xs else myDrop (n - 1) (tail xs)
Sgoettschkes/learning
haskell/RealWorldHaskell/ch02/myDrop.hs
mit
187
0
8
37
50
26
24
3
2
pent n = n * (3*n-1) `div` 2 pentn = take 10000 $ map pent [1..] intPairsSum s = [ (i, j) | i <- [1..(s-1)], let j=s-i, j>i ] intPairs = concat $ map intPairsSum [1..] absPentn = [ (n1, n2, n2-n1) | (i,j) <- intPairs, let n1 = pent i, let n2 = pent j, isPentagonal (n2-n1), isPentagonal (n1+n2)] main = print absPen...
arekfu/project_euler
p0044/p0044.hs
mit
600
0
12
125
332
175
157
11
1
module AnsibleModules.Apt where import Data.Monoid import Data.Sansible import Data.Sansible.Playbook import qualified Data.Aeson.TH as A import qualified Data.Text as T data State = Latest | Absent | Present $(A.deriveToJSON encodingOptions ''State) data Upgrade = Yes | Safe | Full | Dist $(A.deriveToJSON encoding...
ostapneko/sansible
src/AnsibleModules/Apt.hs
mit
2,610
0
10
960
585
329
256
-1
-1
{- | module: $Header$ description: Higher order logic terms license: MIT maintainer: Joe Leslie-Hurd <joe@gilith.com> stability: provisional portability: portable -} module HOL.Term where import Data.Maybe (isJust) import qualified Data.Map.Strict as Map import qualified Data.Set as Set import System.IO.Unsafe (unsa...
gilith/hol
src/HOL/Term.hs
mit
8,839
0
16
2,065
2,999
1,559
1,440
209
15
module Config.Load ( loadConfig , ConfigLocation(..) ) where import Control.Applicative import Data.Aeson import qualified Data.ByteString.Char8 as BS import Network.AWS.AWSConnection import Network.AWS.S3Object import System.Environment data ConfigLocation = ConfigFile FilePath | ConfigS3 Bucket Key typ...
flipstone/glados
src/Config/Load.hs
mit
1,604
0
19
503
404
212
192
49
4
{-| Module : Main Description : Main module for 'breadu-exe' program Stability : experimental Portability : POSIX Main module for 'breadu-exe' program. This program is very simple, it just uses 'breadu' library to run a server. -} module Main where -- This space after 'import' keyword is for 'qualified' word....
denisshevchenko/breadu.info
src/app/Main.hs
mit
1,266
0
9
383
101
61
40
15
1
module Data (Nucleotide, s2n) where import Data.Char (toUpper) data Nucleotide = A|B|C|D|H|G|K|M|R deriving (Ord,Eq,Enum,Show) charToNucleotide :: Char -> Nucleotide charToNucleotide 'A' = A charToNucleotide 'B' = B charToNucleotide 'C' = C charToNucleotide 'D' = D charToNucleotide 'H' = H charToNucleotide 'G' = G c...
epsilonhalbe/Nucleotide
Data.hs
mit
632
0
7
87
208
115
93
18
1
{-| Module : PostgREST.Request.Parsers Description : PostgREST parser combinators This module is in charge of parsing all the querystring values in an url, e.g. the select, id, order in `/projects?select=id,name&id=eq.1&order=id,name.desc`. -} module PostgREST.Request.Parsers ( pColumns , pLogicPath , pLogi...
steve-chavez/postgrest
src/PostgREST/Request/Parsers.hs
mit
9,983
0
20
2,565
3,228
1,673
1,555
-1
-1
module Handler.Repeat ( repeatHandler ) where import Handler import ByteStringTools import Network.Socket.ByteString (sendAllTo) repeatHandler :: HandlerFunc repeatHandler sock addr pkt = do putStrLn ("From " ++ show addr ++ ": " ++ show (lazyToStrictBS pkt)) sendAllTo sock (lazyToStrictBS pkt) addr
stnma7e/scim_serv
src/Handler/Repeat.hs
mit
311
2
13
50
97
50
47
9
1
-- A nifty animated fractal of a tree, superimposed on a background -- of three red rectangles. import Graphics.Gloss main :: IO () main = animate (InWindow "Zen" (800, 600) (5, 5)) (greyN 0.2) frame -- Produce one frame of the animation. frame :: Float -> Picture frame timeS = Pictures -...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/picture/Zen/Main.hs
mit
1,536
34
14
352
450
232
218
36
1
module ISO where import Control.Monad import Data.Void -- A type of `Void` have no value. -- So it is impossible to construct `Void`, -- unless using undefined, error, unsafeCoerce, infinite recursion, etc -- And there is a function -- absurd :: Void -> a -- That get any value out of `Void` -- We can do this becuase w...
delta4d/codewars
kata/algebraic-isomorphism/ISO.hs
mit
8,028
0
13
2,295
3,002
1,633
1,369
146
5
#!/usr/bin/env stack {- stack runghc --package shakers -} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} import Development.Shakers -- | Main entry point. -- main :: IO () main = shakeMain $ do let pats = [ "stack.yaml" , "Shakefile.hs" , "main//*.hs" ...
swift-nav/wolf
Shakefile.hs
mit
605
0
11
174
106
59
47
15
1
module Trace (traceJSON) where import qualified Data.Aeson as JSON import qualified Data.Text as Text import Debug.Trace import qualified Data.Text.Encoding as Text import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS traceJSON :: (JSON.ToJSON a) => a -> b -> b traceJSON subject resul...
IreneKnapp/ozweb
Haskell/Trace.hs
mit
468
0
11
111
127
77
50
15
1
{-# LANGUAGE OverloadedStrings #-} module Joebot.Plugins.Steam.Util where import qualified Data.ByteString.Lazy as LBS import qualified Data.Text as T import Network.HTTP.Conduit import Network import System.IO import Data.Monoid import Data.Aeson import Data.Aeson.Types import qualified Data.Map as M import qualif...
joeschmo/joebot2
src/Joebot/Plugins/Steam/Util.hs
mit
1,619
0
13
329
534
268
266
52
1
module BinToDecimal where import Data.Char (digitToInt) import Data.List (foldl') binToDec :: String -> Int binToDec = foldl' (\acc x -> acc * 2 + digitToInt x) 0
cojoj/Codewars
Haskell/Codewars.hsproj/BinToDecimal.hs
mit
168
0
9
32
64
36
28
5
1
{-# LANGUAGE OverlappingInstances, TemplateHaskell, DeriveDataTypeable, StandaloneDeriving #-} module Syntax.Data where import Syntax.Syntax import Syntax.Checker import Syntax.Generator import Autolib.ToDoc import Autolib.Reader import Autolib.Size import Data.Typeable deriving instance Ord Graph deriving instanc...
Erdwolf/autotool-bonn
src/Syntax/Data.hs
gpl-2.0
1,034
0
9
157
287
162
125
30
0
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.VertexArrays -- Copyright : (c) Sven Panne 2002-2009 -- License : BSD-style (see the file libraries/OpenGL/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability : st...
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/VertexArrays.hs
gpl-2.0
19,413
0
12
2,625
3,860
2,004
1,856
366
14
module Reachability where import Data.Maybe import AST import Util unreachable :: CompilationUnit -> [Statement] unreachable (Comp _ _ (CLS _ _ _ _ constructors _ methods _) _) = let constructorDefinitions = mapMaybe constructorDefinition constructors unreachableConstructorStatements = concat $ map (unreacha...
yangsiwei880813/CS644
src/Reachability.hs
gpl-2.0
4,463
0
18
924
1,214
612
602
87
17
-- | Neuron module encapsulates behavior of a 'Neuron' -- -- Some considerations for event driven simulation of SNN -- -- * Given current 'state' of 'Neuron', it should be possible to predict the time at -- which it will generate a spike (if any) -- -- * For a synapse model with dynamics it is possible that the neuron ...
drwebb/HSimSNN
src/Simulation/HSimSNN/Neuron.hs
gpl-2.0
3,824
0
14
876
611
330
281
36
1
module Main where import Data.Int fib :: Int64 -> Int64 fib n = if n < 2 then 1 else (fib (n-1)) + (fib (n-2)) main = print (fib 38)
uelis/intc
Examples/Comparison/fib1.hs
gpl-2.0
138
0
10
35
82
45
37
6
2
{-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : HEP.Automation.EventChain.LHEConn -- Copyright : (c) 2012,2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental...
wavewave/evchain
lib/HEP/Automation/EventChain/LHEConn.hs
gpl-3.0
8,674
0
21
2,634
2,646
1,415
1,231
158
3
module Language.Objection.CodeGen where import Control.Applicative import Data.Int import qualified Data.Map as M import LLVM.Untyped.Core hiding (Module, Type) import qualified LLVM.Untyped.Core as L (Module, Type) import Language.Objection.SyntaxTree type SymbolMap = M.Map String (Type, Value) -- | Gets the corre...
jhance/objection
Language/Objection/CodeGen.hs
gpl-3.0
7,067
0
14
2,130
1,768
875
893
140
12
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the Lice...
karamellpelle/grid
designer/source/MEnv/GLFW/PlayersObject.hs
gpl-3.0
1,194
0
9
224
107
70
37
13
1
module Carbon.Website.Paging where import Carbon.Website.Common pageItems :: OBW Response pageItems = do p <- getPaging plusm (count p) $ do l <- lookRead "limit" o <- plusm (return 0) $ lookRead "offset" is <- liftB $ PageItems p{limit = l, offset = o} respOk $ responseJSON' is where coun...
runjak/carbon-adf
Carbon/Website/Paging.hs
gpl-3.0
847
0
14
226
281
140
141
-1
-1
-- | The decision has been made to represent a BibTeX file as a list of entries, along with possibly some preamble. module Common.BibTypes where -- | a bibtex file is just a list of entries, with a list of preamble-strings data BibTex = BibTex [String] [Entry] deriving Show -- | a bibte...
toothbrush/cco-bibtex2html
Common/BibTypes.hs
gpl-3.0
3,836
0
10
1,233
684
369
315
46
1
module Jumpie.Geometry.Intersection( rectIntersects, rectLineSegmentIntersects, rectLineSegmentIntersection, pointInsideRect, lineSegmentIntersects, lineSegmentIntersection, lineSegmentInsideRect, parabolaPointIntersects ) where import Jumpie.Maybe(headOrNothing) import Jumpie.Tuple(between) import D...
pmiddend/jumpie
lib/Jumpie/Geometry/Intersection.hs
gpl-3.0
3,546
0
16
621
1,380
735
645
52
1
-- Author: Viacheslav Lotsmanov -- License: GPLv3 https://raw.githubusercontent.com/unclechu/xmonadrc/master/LICENSE {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# LANGUAGE PackageImports #-} module Main (main) where import "xmonad" XMonad (xmonad, logHook, (<+>)) import "xmonad-contrib" XMonad.Util.Run (spaw...
unclechu/xmonadrc
xmonad/src/Main.hs
gpl-3.0
2,465
0
13
801
518
288
230
52
11
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANG...
bennofs/vplan
src/Data/VPlan/Modifier/Combine.hs
gpl-3.0
3,274
0
12
807
1,285
661
624
53
0
-- |Simple Socket IO for UNIX domain sockets without massive -- dependencies like conduits. module SimpleSockets (foreverAccept) where import Control.Concurrent (ThreadId, forkIO) import Control.Exception.Base (SomeException, catch, finally, bracket) import Control.Monad (forever) import Network.Socket import System.I...
koodilehto/kryptoradio
encoder/SimpleSockets.hs
agpl-3.0
1,440
0
10
306
381
196
185
26
1
{- Copyright (C) 2007 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file COPYRIGHT -} -- FIXME -- better code is in offlineimap v7 branch module TestInfrastructure where import Test.QuickCheck import Test.QuickCheck.Batch import qualified Data.ByteString a...
jgoerzen/listlike
testsrc/TestInfrastructure.hs
lgpl-2.1
9,439
0
14
2,580
3,966
2,066
1,900
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Scotty where import Web.Scotty import Control.Monad.IO.Class main :: IO () main = scotty 3000 $ do get "/:word" $ do beam <- param "word" liftIO (putStrLn "hello") html $ mconcat ["<h1>Scotty, ", beam, " me up!<h1>"]
dmvianna/haskellbook
src/Ch26-Scotty.hs
unlicense
278
0
13
60
90
46
44
10
1
-- Copyright 2017 Google Inc. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in...
google/haskell-indexer
haskell-indexer-pipeline-ghckythe-wrapper/src/Language/Haskell/Indexer/Args.hs
apache-2.0
7,010
0
21
1,954
1,511
810
701
153
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Pattern-matching literal patterns -} {-# LANGUAGE CPP, ScopedTypeVariables #-} module MatchLit ( dsLit, dsOverLit, hsLitKey, hsOverLitKey , tidyLitPat, tidyNPat , matchLiterals, matchNPlus...
gridaphobe/ghc
compiler/deSugar/MatchLit.hs
bsd-3-clause
19,576
1
21
5,836
4,424
2,270
2,154
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Bead.View.Content.Bootstrap where {- Collection of bootstrap related pagelets. -} import Control.Monad (when) import Data.Data import Data.Maybe (fromMaybe) import Data.Monoid import Data.String import Text.Blaze.H...
pgj/bead
src/Bead/View/Content/Bootstrap.hs
bsd-3-clause
14,954
0
22
3,310
3,459
1,734
1,725
274
2
module Paths_LA ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exc...
chalmers-kandidat14/LA
dist/build/autogen/Paths_LA.hs
bsd-3-clause
1,108
0
10
167
332
190
142
26
1
------------------------------------------------------------------------------------- -- | -- Copyright : (c) Hans Hoglund 2012 -- -- License : BSD-style -- -- Maintainer : hans@hanshoglund.se -- Stability : experimental -- Portability : portable -- ------------------------------------------------------------...
music-suite/musicxml2
src/Data/Music/MusicXml/Write/Score.hs
bsd-3-clause
28,422
0
19
11,599
6,465
3,235
3,230
438
1
{-# LANGUAGE RecordWildCards #-} module Aws.CloudFront.Signer ( URL , JSONPOlicy , CloudFrontSigningKey(..) , CloudFrontPolicy(..) , readCloudFrontSigningKeyFromDER , parseRSAPrivateKeyDER , signCannedPolicyURL , signCustomPolicyURL , signCustomPolicyURL_ , cannedPol...
adinapoli/aws-cloudfront-signer
src/Aws/CloudFront/Signer.hs
bsd-3-clause
5,891
0
15
1,716
1,051
583
468
107
4
{-# LANGUAGE OverloadedStrings #-} module Deck where import Card import System.Random.Shuffle import System.Random (getStdRandom) import Data.Aeson data Deck = Deck [Card] deriving Show numbers = [ Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King, Ace ] suits = [...
hmac/whist-hs
src/Deck.hs
bsd-3-clause
870
0
11
194
364
209
155
38
1
{-# LANGUAGE GeneralizedNewtypeDeriving, DefaultSignatures, ScopedTypeVariables, NamedFieldPuns, OverloadedStrings, MultiParamTypeClasses, TemplateHaskell, FlexibleContexts, TypeFamilies, StandaloneDeriving, RecordWildCards, RankNTypes, Trustworthy, UndecidableInstances #-} {-| SimpleLog is a library for convenient a...
exFalso/SimpleLog
src/System/Log/SLog.hs
bsd-3-clause
22,855
3
20
5,876
4,706
2,465
2,241
302
7
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE Over...
rfranek/duckling
Duckling/Numeral/FR/Corpus.hs
bsd-3-clause
3,206
0
11
1,399
587
334
253
89
1
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, ConstraintKinds, PatternGuards, StandaloneDeriving #-} #if !(MIN_VERSION_base(4,8,0)) {-# LANGUAGE OverlappingInstances #-} #endif module Idris.ParseHelpers where import Prelude hiding (pi) import Text.Trifecta.Delta import Text.Trifecta hiding (span, stringLiteral, charL...
bkoropoff/Idris-dev
src/Idris/ParseHelpers.hs
bsd-3-clause
25,667
0
25
8,472
7,356
3,758
3,598
433
8
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} #ifdef LIFT_COMPAT {-# LANGUAGE TemplateHaskell ...
Soostone/uri-bytestring
src/URI/ByteString/Types.hs
bsd-3-clause
6,855
0
10
1,458
872
530
342
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} module AllSorts where certainCmp :: Ord α => α -> α -> [Bool] certainCmp a b = [a <= b] uncertainCmp :: α -> α -> [Bool] uncertainCmp _ _ = [True, False] ------------------------------------------------------------------------------- insertSortBy :: forall μ α. Monad μ ...
Bodigrim/all-sorts
src/AllSorts.hs
bsd-3-clause
4,133
0
13
1,786
1,531
804
727
89
6
{-# LANGUAGE ViewPatterns, CPP, FlexibleInstances, FlexibleContexts #-} module Data.TrieMap.UnionMap.Subset () where import Data.TrieMap.UnionMap.Base #define UVIEW uView -> UView instance (Subset (TrieMap k1), Subset (TrieMap k2)) => Subset (TrieMap (Either k1 k2)) where (UVIEW m1L m1R) <=? (UVIEW m2L m2R) = ...
lowasser/TrieMap
Data/TrieMap/UnionMap/Subset.hs
bsd-3-clause
352
0
9
55
114
63
51
6
0
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TypeFamilies #-} -- | Provides spherical harmonic models of scalar-valued functions. module Math.SphericalHarmonics ( SphericalHarmonicModel , sphericalHarmonicModel , scaledSphericalHarmonicModel , evaluateModel , evaluateModelCartesian , evaluateModelGradient , evaluate...
dmcclean/igrf
src/Math/SphericalHarmonics.hs
bsd-3-clause
7,080
0
12
1,856
1,675
924
751
98
1
module HsLib where func :: Int -> Int func = (+2)
michaxm/dynamic-linking-exploration
testlibs/testlibHS1/src/HsLib.hs
bsd-3-clause
51
0
5
12
22
14
8
3
1
{-# LANGUAGE OverloadedStrings #-} {-| Sprites are the most important concept in Monono, check the "Graphics.UI.Monono" docs for a general description of Sprites. This module contains functions for creating, modifying a Sprite's attributes and its event handlers. -} module Graphics.UI.Monono.Sprite ( -- * Creation...
nubis/Monono
Graphics/UI/Monono/Sprite.hs
bsd-3-clause
21,990
0
20
4,569
5,210
2,842
2,368
318
6
{-# LANGUAGE OverloadedStrings #-} module Site.Pandoc ( pandocFeedCompiler, pandocCompiler, readerOptions, writerOptions ) where import Site.Types import Site.Pygments import Site.TableOfContents import Text.Pandoc import Text.Pandoc.Walk (walk) import Data.Maybe (fromMaybe) import Hakyll hiding (pandocComp...
da-x/hakyll-site
src/Site/Pandoc.hs
bsd-3-clause
4,082
0
18
776
1,119
601
518
-1
-1
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} module Dang.TypeCheck.Subst ( Subst(), emptySubst...
elliottt/dang
src/Dang/TypeCheck/Subst.hs
bsd-3-clause
9,792
0
19
2,831
3,963
1,970
1,993
251
4
{-# LANGUAGE OverloadedStrings #-} import System.IO import Text.XML.Pipe import Network import HttpPush main :: IO () main = do ch <- connectTo "localhost" $ PortNumber 80 soc <- listenOn $ PortNumber 8080 (sh, _, _) <- accept soc testPusher (undefined :: HttpPush Handle) (Two ch sh) (HttpPushArgs "localhost" ...
YoshikuniJujo/forest
subprojects/xml-push/testHttpPushE.hs
bsd-3-clause
540
2
9
99
221
114
107
18
1
module Expressions ( module Expressions.Expressions , module Expressions.Parser , module Expressions.Printer ) where import Expressions.Expressions import Expressions.Parser import Expressions.Printer
etu-fkti5301-bgu/alt-exam_automated_theorem_proving
src/Expressions.hs
bsd-3-clause
217
0
5
35
39
25
14
7
0
module WhereDoesYourGardenGrow where -- 1. Given the type -- data FlowerType = -- Gardenia -- | Daisy -- | Rose -- | Lilac -- deriving Show type Gardener = String -- data Garden = -- Garden Gardener FlowerType -- deriving Show -- What is the sum of products form of Garden? data Garden = Garde...
brodyberg/Notes
ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/WhereDoesYourGardenGrowChapter11.hs
mit
404
0
6
101
48
34
14
8
0
-- -- -- ----------------- -- Exercise 4.11. ----------------- -- -- -- module E'4'11 where -- import Test.QuickCheck hiding ( Result ) -- -- Avoids ambiguous occurrences of Result that would cause an exception -- if QuickCheck is imported without care. data Result = Win | Lose | Draw deriving E...
pascal-knodel/haskell-craft
_/links/E'4'11.hs
mit
487
0
6
129
67
44
23
10
0
f :: a -> b -> Bool f = undefined :: Int -> Int -> Bool
roberth/uu-helium
test/typeerrors/Examples/TooGeneral.hs
gpl-3.0
56
0
6
16
30
16
14
2
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DeleteVpnConnectionRoute.hs
mpl-2.0
3,982
0
9
800
396
243
153
55
1
module Main where import qualified Text.XML.Expat.UnitTests import qualified Text.XML.Expat.Cursor.Tests import qualified Text.XML.Expat.Proc.Tests import qualified Text.XML.Expat.ParseFormat import qualified Text.XML.Expat.ParallelTest import Test.Framework (defaultMain, testGroup) main :: IO () main = defaultMain ...
the-real-blackh/hexpat
test/suite/TestSuite.hs
bsd-3-clause
907
0
9
281
151
98
53
19
1
{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, ViewPatterns #-} import Network.TLS import Network.TLS.Extra.Cipher import Network.BSD import Network.Socket import Data.Default.Class import Data.IORef import Data.X509 as X509 import Data.X509.Validation import System.X509 import Control.Applicative import Con...
lancelotsix/hs-tls
debug/src/RetrieveCertificate.hs
bsd-3-clause
5,628
8
22
1,811
1,600
808
792
119
8
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sr-CS"> <title>Port Scan | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref l...
veggiespam/zap-extensions
addOns/zest/src/main/javahelp/org/zaproxy/zap/extension/zest/resources/help_sr_CS/helpset_sr_CS.hs
apache-2.0
971
85
52
160
398
210
188
-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="da-DK"> <title>Windows WebDrivers</title> <maps> <homeID>top</homeID> <mapref location=...
thc202/zap-extensions
addOns/webdrivers/webdriverwindows/src/main/javahelp/org/zaproxy/zap/extension/webdriverwindows/resources/help_da_DK/helpset_da_DK.hs
apache-2.0
963
82
52
156
390
206
184
-1
-1
module Overload where import Maybe(isJust) class ToBool a where toBool :: a -> Bool instance ToBool (Maybe a) where toBool = maybeToBool maybeToBool = isJust assert Trivial = {True} === {True} assert Simple = {maybeToBool (Just 'a')} === {True} assert Overloaded = {toBool (Just 'a')} === {True}
forste/haReFork
tools/property/tests/Overload.hs
bsd-3-clause
303
5
8
54
116
72
44
-1
-1
{- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 \section[Specialise]{Stamping out overloading, and (optionally) polymorphism} -} {-# LANGUAGE CPP #-} module Specialise ( specProgram, specUnfolding ) where #include "HsVersions.h" import Id import TcType hiding( substTy, extendTvSubstList ) import Type ...
acowley/ghc
compiler/specialise/Specialise.hs
bsd-3-clause
91,336
1
22
26,681
11,002
5,953
5,049
-1
-1
{-# LANGUAGE NamedWildCards #-} module NamedWildcardInTypeFamilyInstanceLHS where type family F a where F _t = Int
acowley/ghc
testsuite/tests/partial-sigs/should_fail/NamedWildcardInTypeFamilyInstanceLHS.hs
bsd-3-clause
118
0
6
19
20
13
7
-1
-1
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module T13272 where import GHC.Generics class TypeName a where typeName :: forall proxy. ...
ezyang/ghc
testsuite/tests/deriving/should_compile/T13272.hs
bsd-3-clause
652
0
12
178
163
89
74
19
1
{-# LANGUAGE GADTs, TypeFamilies #-} module T3851 where type family TF a :: * -> * type instance TF () = App (Equ ()) data Equ ix ix' where Refl :: Equ ix ix data App f x = App (f x) -- does not typecheck in 6.12.1 (but works in 6.10.4) bar :: TF () () -> () bar (App Refl) = () -- does typecheck in 6...
ghc-android/ghc
testsuite/tests/indexed-types/should_compile/T3851.hs
bsd-3-clause
537
0
11
148
243
132
111
14
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} import PgInit import Data.Aes...
naushadh/persistent
persistent-postgresql/test/main.hs
mit
5,706
0
23
1,264
968
515
453
143
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {- Straight stolt on from virtual-dom virtual-dom bindings demo, rendering a large pixel grid with a bouncing red square. the step and patch are calculated asynchronously, the update is batched in an animation frame -} module Shakespeare....
plow-technologies/shakespeare-dynamic
ghcjs-shakespeare-dynamic/src/Shakespeare/Dynamic/Render.hs
mit
3,474
0
11
966
677
353
324
66
2
module Main where import Control.Monad (forever) import Data.Char (toLower) import Data.Maybe (isJust) import Data.List (intersperse) import System.Exit (exitSuccess) import System.Random (randomRIO) type WordList = [String] allWords :: IO WordList allWords = do dict <- readFile "data/dict.txt" return (lines dic...
raventid/coursera_learning
haskell/chapter13/hangman/src/Main.hs
mit
3,572
0
14
903
1,134
567
567
104
4
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} module StringCompression(runTests) where import Data.List import Test.QuickCheck main :: IO () main = interact run run :: String -> String run input = output where output = concatMap print' $ group input print' group' = case...
alexander-matsievsky/HackerRank
All_Domains/Functional_Programming/Recursion/src/StringCompression.hs
mit
583
0
13
143
175
90
85
19
3
module XBattBar.Types (Options(..), Position(..), Orientation(..), XContext(..), ExtContext(..), XWidget(..)) where import Graphics.X11.Types (expose, Window, EventType) import Graphics.X11.Xlib.Event (XEventPtr) import Graphics.X11.Xlib.Font (FontStruct) import Graphics.X11.Xlib.Window (mapWindow) import Graphics.X11...
polachok/xbattbar
src/XBattBar/Types.hs
mit
2,430
0
13
1,006
510
296
214
45
0
module Proxy.Math.Rectangle where import Proxy.Math.Interval import Proxy.Math.Line data Rectangle a = Rectangle {xI,yI :: (Interval a)} deriving (Show,Eq) height :: (Num a) => Rectangle a -> a height = ilength.yI width :: (Num a) => Rectangle a -> a width = ilength.xI area :: (Num a) => Rectang...
mapinguari/SC_HS_Proxy
src/OLD/Rectangle.hs
mit
858
0
11
210
450
238
212
21
4
-- | Rewrite the staments in a Lua program, to add explicit reference -- allocation, reference reads, and writes. module Galua.Micro.Translate.ExplicitRefs (explicitBlocks) where import Data.Set (Set) import qualified Data.Set as Set import qualified Data.Vector as Vector import Data.Map (Map) impo...
GaloisInc/galua
galua-jit/src/Galua/Micro/Translate/ExplicitRefs.hs
mit
7,342
0
18
2,542
2,817
1,338
1,479
199
24
{-# LANGUAGE GADTs, CPP, Trustworthy, TemplateHaskell, TupleSections, ViewPatterns, DeriveDataTypeable, ScopedTypeVariables #-} module Main where import JavaScript.Web.Worker.Extras import qualified Tarefa6_li1g100 as G100 main :: IO () main = runSyncWorker $ \(inp::[String],player::Int,ticks::Int) -> G100.bot inp...
hpacheco/HAAP
examples/gameworker/Worker4.hs
mit
341
0
9
47
75
45
30
6
1
module Y2017.M01.D26.Exercise where import Data.Map (Map) -- below imports available from 1HaskellADay git repository import Data.Bag import Y2017.M01.D25.Exercise {-- So, yesterday we were able to find out what Haskell source files were in a directory, then, as a bonus, we were also able to drill down into subdire...
geophf/1HaskellADay
exercises/HAD/Y2017/M01/D26/Exercise.hs
mit
1,223
0
8
207
96
57
39
8
1
{- -- Tests.hs -- Contains all the tests for the loop-solver project and some test-tests. -- -- Fundamentals unceremoniously stolen/borrowed from: -- https://github.com/spockz/TravisHSTest/blob/master/Tests.hs -} import Test.QuickCheck import Text.Printf main :: IO () main = mapM_ (\(s,a) -> printf "%-25s: " s >> a)...
DrSLDR/loop-solver
Tests.hs
mit
932
0
9
117
174
96
78
11
1
{- | Module : ./RDF/Parse.hs Copyright : (c) Felix Gabriel Mance License : GPLv2 or higher, see LICENSE.txt Maintainer : f.mance@jacobs-university.de Stability : provisional Portability : portable RDF syntax parser -} module RDF.Parse where import Common.Parsec import Common.Lexer import Common....
gnn/Hets
RDF/Parse.hs
gpl-2.0
5,402
0
14
1,135
1,553
764
789
138
1
{- | Module : $Header$ Description : String constants for HybridCASL keywords to be used for parsing and printing Copyright : (c) Renato Neves and Mondrian Project 2012 License : GPLv2 or higher, see LICENSE.txt Maintainer : nevrenato@gmail.com Stability : experimental Portability : portable ...
nevrenato/Hets_Fork
Hybrid/Keywords.hs
gpl-2.0
584
0
4
119
27
17
10
5
1
{-# LANGUAGE FlexibleContexts , InstanceSigs , ScopedTypeVariables #-} module HFlint.FMPQ.Reduction where import Data.Proxy ( Proxy(..) ) import Data.Reflection ( reflect ) import System.IO.Unsafe ( unsafePerformIO ) import HFlint.FMPQ.FFI import HFlint.FMPZ.FFI import HFlint.NMod.Context import HFlint.N...
martinra/hflint
src/HFlint/FMPQ/Reduction.hs
gpl-3.0
2,100
0
19
566
671
336
335
58
3
-- {-# OPTIONS_GHC -F -pgmF htfpp #-} {-# LANGUAGE CPP #-} {- | A simple test runner for hledger's built-in unit tests. -} module Hledger.Cli.Tests ( testmode ,test' ) where import Control.Monad import System.Exit import Test.HUnit import Hledger import Hledger.Cli #ifdef TESTS import Test.Framework import {-...
kmels/hledger
hledger/Hledger/Cli/Tests.hs
gpl-3.0
1,957
0
7
377
82
51
31
25
2
{-# LANGUAGE DeriveDataTypeable #-} module Nicomachus where import Prelude hiding ((+),(*)) import HipSpec.Prelude import Test.QuickSpec.Signature data Nat = Z | S Nat deriving (Eq,Ord,Show,Typeable) (+) :: Nat -> Nat -> Nat S n + m = S (n + m) Z + m = m (*) :: Nat -> Nat -> Nat S n * m = m + (n * m) Z * m = Z ...
danr/hipspec
testsuite/examples/Nicomachus.hs
gpl-3.0
918
1
14
240
491
249
242
35
1
module Parsing.HashParser where import Language.Expressions import Text.Parsec.String (Parser) import Text.Parsec.Char (digit, char, string, spaces, letter, satisfy, alphaNum, anyChar, noneOf, oneOf) import Text.Parsec (parse, ParseError, try, optionMaybe) import Text.Parsec.Combinator (many1, sepBy1) import Text.Pars...
IvanSindija/Project-Shell-Hash
Parsing/HashParser.hs
gpl-3.0
4,441
0
14
1,253
1,671
820
851
174
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/ReleaseAddress.hs
mpl-2.0
4,523
0
9
937
483
297
186
56
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Images/Delete.hs
mpl-2.0
3,046
0
15
740
388
233
155
62
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.LibraryAgent.Types -- Copyright : (c) 2015-2016 Brenda...
brendanhay/gogol
gogol-libraryagent/gen/Network/Google/LibraryAgent/Types.hs
mpl-2.0
2,078
0
7
366
161
112
49
38
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionInstanceGroupManagers/Get.hs
mpl-2.0
4,405
0
16
975
466
278
188
82
1
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright (C) 2014 2015, Julia Longtin (julial@turinglace.com) -- Released under the GNU AGPLV3+, see LICENSE -- Allow us to use explicit foralls when writing function type declarations. {-# LANGUAGE ExplicitForAll #-} -- FIXME: required. why? ...
krakrjak/ImplicitCAD
Graphics/Implicit/ExtOpenScad/Util/OVal.hs
agpl-3.0
5,805
1
17
1,446
1,800
977
823
112
3
ans' v d = sum $ map (\i -> if i > v then v else i) d ans ([0,0]:_) = [] ans ([n,m]:d:r) = (ans' (div m n) d):(ans r) main = do c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] o = ans i mapM_ print o
a143753/AOJ
2944.hs
apache-2.0
241
0
14
74
185
94
91
9
2
module Cis194.Week2.LogAnalysis where import Log parseMessage :: String -> LogMessage parseMessage msg = case words msg of ("I":ts:m) -> LogMessage Info (read ts) (unwords m) ("W":ts:m) -> LogMessage Warning (read ts) (unwords m) ("E":level:ts:m) -> LogMessage (Error (read level)) (read ts) (unwords...
gsnewmark/cis194
src/Cis194/Week2/LogAnalysis.hs
apache-2.0
1,156
0
12
301
519
263
256
27
4
{-# LANGUAGE OverloadedStrings #-} import Data.Textocat import Network.Textocat import Control.Monad (when) import System.Exit (exitFailure) cfg = mkConfig "API-KEY" documents = [ mkDocument "Привет, мир!" , setTag "haskell" $ mkDocument "Язык Haskell признан лучшим языком для выдающихся хакеров на ICFP...
gltronred/textocat-api-haskell
examples/Example1.hs
apache-2.0
1,069
1
11
205
248
109
139
24
1
module Samples where import qualified Data.ByteString as B sampleLogLines :: [B.ByteString] sampleLogLines = ["GET", "GET", "POST", "GET", "PUT", "GET", "GETD"] sampleStatusLines :: [B.ByteString] sampleStatusLines = ["200", "200", "404", "500", "900", "201"] sampleCombinedLines :: [B.ByteString] sampleCombinedL...
mazelife/logparser_blog_post
src/Samples.hs
bsd-2-clause
436
2
6
89
119
77
42
15
1
-- 190569291 import Euler(countParts) nn = 100 -- "100" is not a valid partition for this problem numParts n = countParts n - 1 main = putStrLn $ show $ numParts nn
higgsd/euler
hs/76.hs
bsd-2-clause
168
1
6
35
50
25
25
4
1
module Move ( toLAN , nullMove , getFromSquare , getToSquare , getPromotionPiece , getMoveType , isCapture , isQuiet , isTactical , isCheck , materialGain , see , pass , makeMove , play , legalPositions , notSuicidal...
syanidar/Sophy
src/Foundation/Move.hs
bsd-3-clause
13,091
0
23
5,065
3,557
1,866
1,691
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main where import Startups.Base import Startups.Cards import Startups.CardList import Startups.GameTypes import Startups.Utils import Backends.Pure import Control.Lens import Data.List (foldl') import Test.Hspec import qualified Data.Set as S import qualified Data.Text as T i...
bitemyapp/7startups
tests/tests.hs
bsd-3-clause
4,946
0
23
2,184
1,263
680
583
-1
-1
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.Ordinal.JA.Tests ( tests ) where import Prelude import Data.String import Test.Tasty import D...
facebookincubator/duckling
tests/Duckling/Ordinal/JA/Tests.hs
bsd-3-clause
504
0
9
78
79
50
29
11
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[HsBinds]{Abstract syntax: top-level bindings and signatures} Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@. -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleConte...
bitemyapp/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
33,758
0
17
9,681
6,011
3,233
2,778
376
4
{-# LANGUAGE FlexibleContexts #-} module Music.Time.Voice ( -- * Voice type Voice, -- * Construction voice, notes, pairs, durationsAsVoice, -- * Traversal -- ** Separating rhythms and values valuesV, durationsV, -- ** ...
music-suite/music-score
src/Music/Time/Voice.hs
bsd-3-clause
20,066
0
17
4,834
5,019
2,744
2,275
-1
-1
{-# LANGUAGE ExplicitNamespaces #-} module Halytics.Monitor ( I.Collect (..) , I.Default (..) , I.Initialize (..) , I.Monitor , I.Resultable (..) , type (I.|^) , I.fromPlaceholder , I.generate , I.monitorWith , I.result , (L.%<~)) where import qualified Halytics.Monitor.Tuple as I import qualif...
nmattia/halytics
src/Halytics/Monitor.hs
bsd-3-clause
351
0
5
69
104
70
34
15
0
import Music.Prelude -- | -- Bela Bartok: Wandering (excerpt) -- From Mikrokosmos, vol. III -- -- Inspired by the Abjad transcription -- music :: Music music = let meta = id . title "Mikrokosmos (excerpt)" . composer "Bela Bartok" . timeSignature (2/4) . timeSignatureDuring ((2/4) >-> (...
music-suite/music-preludes
examples/bartok.hs
bsd-3-clause
840
0
20
255
361
193
168
19
1
-- -- Copyright (c) 2009-2011, ERICSSON AB -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list...
emwap/feldspar-language
src/Feldspar/Core/Frontend/SourceInfo.hs
bsd-3-clause
1,949
0
8
342
104
70
34
6
1
module RefacLocUtils(module HsTokens,PosToken, simpPos, SimpPos,unmodified,modified,simpPos0,ghead,glast,gfromJust,gtail, tokenCol, tokenRow, tokenPos,tokenCon,tokenLen,lengthOfToks, mkToken,defaultToken,newLnToken,whiteSpacesToken,whiteSpaceTokens,isWh...
forste/haReFork
refactorer/RefacLocUtils.hs
bsd-3-clause
68,936
34
22
25,334
18,504
9,728
8,776
-1
-1