code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE Haskell2010, OverloadedStrings #-} {-# LINE 1 "Network/Wai/Middleware/AddHeaders.hs" #-} -- | -- -- Since 3.0.3 module Network.Wai.Middleware.AddHeaders ( addHeaders ) where import Network.HTTP.Types (Header) import Network.Wai (Middleware, modifyResponse, mapResponseHeaders) import Net...
phischu/fragnix
tests/packages/scotty/Network.Wai.Middleware.AddHeaders.hs
bsd-3-clause
760
0
11
119
179
109
70
14
1
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-} {- | Module : $Header$ Description : COL instance of class Logic Copyright : (c) Till Mossakowski, Uni Bremen 2002-2004 License : GPLv2 or higher, see LICENSE.txt Maintainer : till@informatik.uni-bremen.de Stability : p...
keithodulaigh/Hets
COL/Logic_COL.hs
gpl-2.0
3,110
0
9
791
596
307
289
70
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/CreateTags.hs
mpl-2.0
3,796
0
10
837
405
251
154
51
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative ((<$>)) import Control.Monad (forM_) import qualified Data.Aeson as Json import qualified Data.ByteString.Lazy as BS import qualified Data.Text.Lazy as Text import qualified Data.Text.Lazy.Encoding as Text import qualified Data.Text.Lazy.I...
Dedoig/package.elm-lang.org
upgrade-docs.hs
bsd-3-clause
1,977
0
16
519
535
291
244
53
2
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1994-1998 Core-syntax unfoldings Unfoldings (which can travel across module boundaries) are in Core syntax (namely @CoreExpr@s). The type @Unfolding@ sits ``above'' simply-Core-expressions unfoldings, capturing ``higher-level'' things w...
alexander-at-github/eta
compiler/ETA/Core/CoreUnfold.hs
bsd-3-clause
58,307
0
19
16,859
6,694
3,556
3,138
499
32
f = foo (\x -> \y -> x x y y)
mpickering/hlint-refactor
tests/examples/Lambda18.hs
bsd-3-clause
29
1
9
10
33
15
18
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="el-GR"> <title>Image Locaiton and Privacy Scanner | ZAP Extension</title> <maps> <homeID>top...
kingthorin/zap-extensions
addOns/imagelocationscanner/src/main/javahelp/org/zaproxy/zap/extension/imagelocationscanner/resources/help_el_GR/helpset_el_GR.hs
apache-2.0
995
104
29
162
429
215
214
-1
-1
import Graphics.Rendering.OpenGL import Graphics.UI.GLUT myPoints :: [(GLfloat,GLfloat,GLfloat)] myPoints = map (\k -> (sin(2*pi*k/12),cos(2*pi*k/12),0.0)) [1..12] main = do (progname, _) <- getArgsAndInitialize createWindow "Hello World" displayCallback $= display mainLoop display = do clear [ColorBuffe...
erantapaa/haskell-platform
hptool/os-extras/win/test/glut.hs
bsd-3-clause
407
2
13
63
206
103
103
13
1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE TypeFamilies, UndecidableInstances #-} module T2448 where import Data.Kind (Type) -- Demonstrates a bug in propagating type equality constraints class VectorSpace v where type Scalar v :: Type class VectorSpace v => InnerSpace v instance (VectorSp...
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T2448.hs
bsd-3-clause
505
0
8
87
150
80
70
-1
-1
-- Test for trac ticket #1287; ghc 6.6 and 6.6.1 panicked on this module ShouldCompile where {-# SPECIALIZE delta' :: Num b => Int -> Int -> b -> b -> b #-} delta' :: Eq a => a -> a -> b -> b -> b delta' x y e f = if (x==y) then f else e {-# SPECIALIZE delta :: Num b => Int -> Int -> b #-} delta :: (Eq a, Num b) => ...
spacekitteh/smcghc
testsuite/tests/simplCore/should_compile/simpl016.hs
bsd-3-clause
360
0
9
97
111
60
51
7
2
{-# LANGUAGE OverloadedStrings #-} module Main where import Web.Spock.Safe import Data.Aeson (object, (.=)) import Data.Monoid ((<>)) import Data.Maybe (fromMaybe) import Helpers (breakTextByDot) import System.Environment (lookupEnv) import qualified FizzBuzz as FB main :: IO () main = do maybePort <- lookupEnv "P...
ifo/fbaas
src/Main.hs
isc
651
0
22
136
245
132
113
19
2
{-# LANGUAGE OverloadedStrings #-} module Commands ( respond ) where import qualified Data.ByteString.Char8 as B import Data.Maybe (listToMaybe) import Data.UUID (fromString) import Data.UUID.V4 (nextRandom) import System.IO (Handle) import Control.Applicative ((<$>)) import Control.Monad.IO.Class import Control.Mona...
shak-mar/botstrats
server/Commands.hs
mit
1,322
0
15
248
455
242
213
36
3
{-# LANGUAGE TemplateHaskell #-} -- このソースコードは、次の記事を信頼して書かれました. -- http://osecpu.osask.jp/wiki/?page0104 -- http://osecpu.osask.jp/wiki/?page0092 -- 変数のレジスタ割当は,レキシカルスコープのように,ある時点で使用されている変数を管理すれば良い. -- ラベルの割当は,プログラム中でユニークであるべきなので,コンパイル中全体で管理する. module ChageComp where import Data.Word import Data.List (genericLength,...
ryna4c2e/chage
ChageComp.hs
mit
9,595
0
21
3,406
2,929
1,441
1,488
-1
-1
module Handler.Euler where import Import import Yesod.Form.Bootstrap3 getEulerR :: Handler Html getEulerR = error "Not yet implemented: getEulerR" postEulerR :: Handler Html postEulerR = error "Not yet implemented: postEulerR" getEulerSolutionR :: ProblemNumber -> Handler Html getEulerSolutionR = error "Not yet imp...
terrelln/terrelln.me
Handler/Euler.hs
mit
807
0
11
121
178
89
89
18
1
{-# LANGUAGE CPP #-} module Test.Mockery.ActionSpec (spec) where import Test.Hspec import Control.Monad import Test.HUnit.Lang import Test.Mockery.Action #if MIN_VERSION_HUnit(1,4,0) hUnitFailure :: String -> HUnitFailure -> Bool hUnitFailure actual (HUnitFailure _ reason) = c...
robbinch/tinc
test/Test/Mockery/ActionSpec.hs
mit
5,251
0
29
1,590
1,370
657
713
101
1
import Data.Char import Data.List import System.Environment( getArgs ) import System.Random import System.Console.GetOpt main = do args <- getArgs let key = head args randomNote <- randomRIO (0, 6) randomSuff <- randomRIO (0, 6) -- prints random key in scale putStrLn $ (deriveScale key !! randomNote) -- pri...
rebennett/figbass
figbass.hs
mit
2,508
5
10
617
816
442
374
31
1
module Main where import Protolude import Lib main :: IO () main = someFunc
Archimidis/md2html
app/Main.hs
mit
78
0
6
16
25
15
10
5
1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE LambdaCase #-} module StorePacka...
philopon/find-hackage
src/StorePackage.hs
mit
8,633
0
26
2,552
2,776
1,457
1,319
171
9
-- | -- Types and instances of anonymous records. module Record where import BasePrelude hiding (Proxy) import Data.Functor.Identity import GHC.TypeLits import Foreign.Storable import Foreign.Ptr (plusPtr) import Control.Lens.Basic import qualified Record.TH as TH -- | -- A specialised version of "Data.Proxy.Proxy"....
nikita-volkov/record
library/Record.hs
mit
2,122
0
16
430
423
247
176
-1
-1
module E16 where definition usedArgument unusedArgument = usedArgument {- definition usedArgument = usedArgument -}
pascal-knodel/haskell-craft
Examples/· Errors/E16.hs
mit
141
0
5
39
15
9
6
3
1
test = if isNothing x then (-1.0) else fromJust x
alphaHeavy/hlint
tests/brackets.hs
gpl-2.0
50
1
7
10
28
13
15
1
2
{-# OPTIONS -funbox-strict-fields -O2 #-} module Support.MD5( Hash(), emptyHash, md5,md5file,md5lazy,md5lazyIO, md5show32,md5Bytes,md5String,md5Handle,hashToBytes) where import Control.Monad import Data.Binary import Data.Char import Foreign import Foreign.C import System.IO import qualified Data.ByteString a...
dec9ue/jhc_copygc
src/Support/MD5.hs
gpl-2.0
5,314
0
19
1,600
2,267
1,152
1,115
-1
-1
{-# LANGUAGE CPP #-} module Hkl.Sixs ( main_sixs ) where import Prelude hiding (concat, head, print) #if __GLASGOW_HASKELL__ < 710 import Control.Applicative ((<$>), (<*>)) #endif import Data.ByteString.Char8 (pack) import Data.Vector.Storable (concat, head) import Control.Exception (bracket) import Co...
picca/hkl
contrib/haskell/src/Hkl/Sixs.hs
gpl-3.0
5,041
0
15
1,655
1,283
668
615
105
1
module Language.Subleq.Assembly.Prim where import Data.Maybe import Data.Set (Set) import qualified Data.Set as S import Data.Map (Map) import qualified Data.Map as M import Text.Printf import Data.List import Data.Bits type Id = String type Location = String type Substitution = Map Id Expr data Expr = Identifier Id...
Hara-Laboratory/subleq-toolchain
Language/Subleq/Assembly/Prim.hs
gpl-3.0
10,113
0
13
2,242
3,814
1,957
1,857
187
3
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} module Ampersand.Output.ToJSON.Relations (Relationz) where import Ampersand.ADL1 import Ampersand.FSpec.FSpecAux import Ampersand.Output.ToJSON.JSONutils import Data.Maybe import qualified Data.Set as Set ...
AmpersandTarski/ampersand
src/Ampersand/Output/ToJSON/Relations.hs
gpl-3.0
3,737
0
13
956
831
461
370
79
0
import Development.Hake import Development.Hake.FunSetRaw main = hake [ file [ "program" ] [ "main.o", "iodat.o", "dorun.o", "lo.o", "./usr/fred/lib/crtn.a" ] $ const [ [ "cc", "-o", "program", "main.o", "iodat.o", "dorun.o", "lo.o", "./usr/fred/lib/crtn.a" ] ] , file [ "main.o" ] [ "main.c" ] $ const [ [ "cc",...
YoshikuniJujo/hake_haskell
examples/nutshell/chap1/1/hakeMainRaw.hs
gpl-3.0
641
1
9
133
244
142
102
10
1
module Fun.Parser.Pragma where -- Imports de parsec. import Text.Parsec import Text.Parsec.Token( colon, symbol, reservedOp ) import Data.Text ( Text, unpack ) -- Imports de fun. import Fun.Parser.Internal -- Imports de equ. import Equ.Syntax ( Operator(..) ) import qualified Equ.Theories.FOL as F ( theoryOperator...
alexgadea/fun
Fun/Parser/Pragma.hs
gpl-3.0
1,169
0
9
205
345
191
154
26
1
<?xml version='1.0' encoding='ISO-8859-1' ?> <!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"> <title>Xena Help</title> <maps> <homeID>xenahelp</homeID> <mapref locatio...
srnsw/xena
xena/doc/xena-help.hs
gpl-3.0
1,151
116
13
173
520
237
283
-1
-1
module Sound.Tidal.MIDI.Tanzbar where import Sound.Tidal.Params import Sound.Tidal.MIDI.Control (bd1_attack, bd1_attack_p) = pF "bd1_attack" (Just 0) (bd1_decay, bd1_decay_p) = pF "bd1_decay" (Just 0) (bd1_tune, bd1_tune_p) = pF "bd1_tune" (Just 0) (bd1_noise, bd1_noise_p) = pF "bd1_noise" (Just 0) (bd1_filter, bd1_...
tidalcycles/tidal-midi
Sound/Tidal/MIDI/Tanzbar.hs
gpl-3.0
6,380
0
8
1,207
2,575
1,336
1,239
178
1
module Paths_lambda ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO a) ->...
nastya13/lambda
dist/build/autogen/Paths_lambda.hs
gpl-3.0
1,466
0
10
182
371
213
158
28
1
module He.Error ( module Control.Monad.Except , Error() , err , err' , report , check , checked , fatal , logExceptT , logExceptT' , log ) where import Control.Lens import Control.Monad.Except import qualified Data.DList as D import H.Prelude hiding ((<>), empty, show) import Prelude (show) im...
ktvoelker/helium
src/He/Error.hs
gpl-3.0
2,139
0
13
457
946
496
450
-1
-1
import System.IO import System.FilePath import Data.List import Data.List.Split main :: IO () main = do contents <- readFile "..\\goldi_input_1.txt" let (pref:orgs) = zip [0..] $ conv $ getGoldi contents putStrLn $ intercalate " " $ map (show . fst) $ filter (checkSeats (snd pref)) $ orgs checkSeats :: (...
jandersen7/Daily
src/291e/hs/goldi.hs
gpl-3.0
639
0
13
142
370
187
183
16
1
{- ============================================================================ | Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/Fallback/Draw.hs
gpl-3.0
1,660
0
5
696
36
25
11
5
0
-- 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
source/Game/Grid/GridWorld/SegmentArray.hs
gpl-3.0
7,214
0
51
2,150
1,491
812
679
76
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/DeregisterInstance.hs
mpl-2.0
3,538
0
9
707
351
216
135
47
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-swf/gen/Network/AWS/SWF/DeprecateWorkflowType.hs
mpl-2.0
4,915
0
9
962
423
264
159
54
1
{-# LANGUAGE OverloadedStrings #-} -- -- Copyright (c) 2005-2022 Stefan Wehr - http://www.stefanwehr.de -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of th...
skogsbaer/HTF
Test/Framework/TestReporter.hs
lgpl-2.1
12,583
0
31
3,265
2,865
1,470
1,395
247
6
module ViperVM.Library.FloatMatrixSub ( builtin, function, metaKernel, kernels ) where import Control.Applicative ( (<$>) ) import ViperVM.VirtualPlatform.FunctionalKernel hiding (metaKernel,proto) import ViperVM.VirtualPlatform.MetaObject import ViperVM.VirtualPlatform.Descriptor import ViperVM.VirtualPlatform.Me...
hsyl20/HViperVM
lib/ViperVM/Library/FloatMatrixSub.hs
lgpl-3.0
2,695
0
15
691
686
386
300
54
1
module ProjectEuler.A268398Spec (main, spec) where import Test.Hspec import ProjectEuler.A268398 (a268398) main :: IO () main = hspec spec spec :: Spec spec = describe "A268398" $ it "correctly computes the first 20 elements" $ take 20 (map a268398 [1..]) `shouldBe` expectedValue where expectedValue = [1,...
peterokagey/haskellOEIS
test/ProjectEuler/A268398Spec.hs
apache-2.0
373
0
10
59
160
95
65
10
1
import System.Environment (getArgs) import Control.Arrow (first) import Graphics.Rendering.Chart.Easy hiding (argument) import Graphics.Rendering.Chart.Backend.Diagrams import Data.Time import System.Process import Options.Applicative import Data.Semigroup ((<>)) import Data.Text.Time (parseISODateTime) import qualifi...
klangner/timeseries
examples/Resample.hs
bsd-2-clause
2,108
17
14
430
661
312
349
48
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : Graphics.Hoodle.Render.Util.HitTest -- Copyright : (c) 2011-2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : ex...
wavewave/hoodle-render
src/Graphics/Hoodle/Render/Util/HitTest.hs
bsd-2-clause
6,782
0
21
1,751
2,152
1,174
978
118
5
{-# LANGUAGE DeriveDataTypeable #-} module Gwist.JSON ( Result (..), decodeJSON, readJSON ) where import Data.Typeable import qualified Data.Attoparsec as AP import qualified Data.Aeson as AE import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS data Result a = Success a...
shugo/gwist
Gwist/JSON.hs
bsd-2-clause
816
0
11
176
292
153
139
24
4
module Propellor.Property.Dns ( module Propellor.Types.Dns, primary, signedPrimary, secondary, secondaryFor, mkSOA, writeZoneFile, nextSerialNumber, adjustSerialNumber, serialNumberOffset, WarningMessage, genZone, ) where import Propellor.Base import Propellor.Types.Dns import Propellor.Types.Info import P...
ArchiveTeam/glowing-computing-machine
src/Propellor/Property/Dns.hs
bsd-2-clause
19,165
748
20
3,628
4,997
2,719
2,278
-1
-1
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternGuards #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.ComboP -- Description : Combine multiple layouts and specify where to put new windows. -- Copyright : (c) Kons...
xmonad/xmonad-contrib
XMonad/Layout/ComboP.hs
bsd-3-clause
9,693
0
16
3,123
2,184
1,156
1,028
106
5
{-# LANGUAGE Arrows #-} module Arrow where import Control.Arrow import Control.Arrow.Operations integral :: ArrowCircuit a => Int -> a Double Double integral rate = proc x -> do rec let i' = i + x * dt i <- delay 0 -< i' returnA -< i where dt = 1 / fromIntegral rate
svenkeidel/stream-bench
src/Arrow.hs
bsd-3-clause
285
1
14
71
107
53
54
10
1
----------------------------------------------------------------------------- -- | -- Module : Graphics.UI.Toy.Gtk.Prelude -- Copyright : (c) 2012 Michael Sloan -- License : BSD-style (see the LICENSE file) -- -- Maintainer : Michael Sloan <mgsloan@gmail.com> -- Stability : experimental -- Portabilit...
mgsloan/toy-gtk-diagrams
src/Graphics/UI/Toy/Gtk/Prelude.hs
bsd-3-clause
1,493
0
5
193
196
148
48
23
0
-- 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.Duration.SV.Tests ( tests ) where import Prelude import Data.String import Test.Tasty impor...
facebookincubator/duckling
tests/Duckling/Duration/SV/Tests.hs
bsd-3-clause
509
0
9
80
79
50
29
11
1
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} module Language.SimplePi.Types ( Position (..) , dummyPos , Statement (..) , Expr , Ident (..) , Binding (..) , ExprF (..) , get...
esmolanka/simple-pi
src/Language/SimplePi/Types.hs
bsd-3-clause
1,871
0
13
470
605
345
260
63
6
-- | Transforms MultiCoreStatus' into diagrams module Graphics.Diagrams.Transformations.MultiCoreStatus2Diagram ( transformStatus ) where -- External imports import Data.Maybe import Data.History -- Internal imports import Config.Preferences import Config.Config import Graphics.Diagrams.Simple.Diagram import Gra...
ivanperez-keera/SoOSiM-ui
src/Graphics/Diagrams/Transformations/MultiCoreStatus2Diagram.hs
bsd-3-clause
1,641
0
12
292
436
234
202
28
3
module Main where import Data.AhoCorasick main :: IO () main = do let acm = construct ["he", "she", "his", "hers"] print $ run acm "ushers" let acm' = constructWithValues [("he", 1.2), ("she", 3.4), ("his", 5.6), ("hers", 7.8)] print $ run acm' "ushers"
yuttie/ac-machine
examples/Simple.hs
bsd-3-clause
273
0
12
61
120
66
54
8
1
-- {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE ExplicitForAll #-} --{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} -- {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} --{-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE RankNTypes #-} --{-# LANGUAGE RebindableSyntax...
LATBauerdick/fv.hs
src/FV/Types.hs
bsd-3-clause
10,884
1
20
3,200
4,393
2,343
2,050
277
1
-- !!! local aliases module M where import qualified Data.OldList as M import qualified Data.Maybe as M x = M.length b = M.isJust
jstolarek/ghc
testsuite/tests/module/mod106.hs
bsd-3-clause
132
0
5
25
35
24
11
5
1
module Main where main :: IO() main = do putStrLn "Give me a list, and I'll give you it's last...Maybe" ls <- getLine print $ myLast ls myLast :: [a] -> Maybe a myLast [] = Nothing myLast [x] = Just x myLast (_:xs) = myLast xs myLast' :: [a] -> a myLast' [] = error "Cannot operate on empty lists, ex...
Jaso-N7/H99-solutions
1-10/1.hs
bsd-3-clause
375
0
8
92
153
77
76
14
1
{-# LANGUAGE CPP, FlexibleInstances, RankNTypes, TypeSynonymInstances #-} {-# OPTIONS -Wall #-} -- | An extension module of building blocks. Contains booleans, comparison operations, branchings. module Language.Paraiso.OM.Builder.Boolean (eq, ne, lt, le, gt, ge, select) where import Data.Dynamic (Typeable, typeOf...
drmaruyama/Paraiso
Language/Paraiso/OM/Builder/Boolean.hs
bsd-3-clause
2,474
0
12
589
834
450
384
60
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeApplications #-} import Control.Monad.Classes hiding (exec) import Control.Monad.Classes.Log import Control.Monad.Log (LoggingT, runLoggingT) import Control.Monad.Trans.Reader (ReaderT(..)) import Control.Monad.Trans.State (State, execState) import Test.Tasty import T...
edwardgeorge/monad-classes-logging
test/Spec.hs
bsd-3-clause
1,754
0
15
365
713
377
336
33
1
{-# OPTIONS -Wall #-} module Main where import Codec.Picture( PixelRGBA8( .. ), writePng ) import Graphics.Rasterific import Graphics.Rasterific.Texture import qualified Data.Vector as V import qualified Data.Vector.Unboxed as UV import qualified Data.Vector.Unboxed.Mutable as UM import Control...
ismailmustafa/Paint
src/Main.hs
bsd-3-clause
6,243
0
15
1,507
2,486
1,304
1,182
142
2
{-# LANGUAGE FlexibleInstances #-} module Shader where import Prelude hiding (any, floor, ceiling) import Control.Monad (when) import Control.Monad.IO.Class (MonadIO, liftIO) import Foreign import Foreign.C.String import Graphics.GL import Linear import Paths_hadoom import Util import qualified Data.ByteString as BS ...
ocharles/hadoom
hadoom/Shader.hs
bsd-3-clause
3,772
0
22
1,085
957
493
464
92
1
{-# LANGUAGE RecordWildCards #-} module TemplateParse (parseChordTemplate) where import Text.ParserCombinators.Parsec import Control.Applicative ((<$>), (*>), (<*), (<$), (<*>)) import Data.Maybe (fromMaybe, isJust, catMaybes) import Note (ABC (..), Octave (..)) import Interval (Interval (..)) import qualified Interv...
blacktaxi/inversion
src/TemplateParse.hs
bsd-3-clause
6,807
0
14
1,900
1,973
1,089
884
137
10
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wall #-} -- | Algebra module Tower.Ring ( -- * Ring Semiring , Ring , CRing ) where import Protolude (Double, Float, Int, Integer,Bool(..)) import Dat...
tonyday567/tower
src/Tower/Ring.hs
bsd-3-clause
1,384
0
7
268
337
176
161
-1
-1
module Main where import GameIO import System.Console.ANSI main :: IO () main = runGame
MikePors/FizzBuzzWarz
app/Main.hs
bsd-3-clause
90
0
6
16
28
17
11
5
1
{-# OPTIONS_GHC -Wall #-} module Canonicalize.Variable where import qualified Data.Either as Either import qualified Data.Map as Map import qualified Data.Set as Set import qualified AST.Helpers as Help import qualified AST.Module.Name as ModuleName import qualified AST.Type as Type import qualified AST.Variable as V...
pairyo/elm-compiler
src/Canonicalize/Variable.hs
bsd-3-clause
6,338
0
21
1,834
1,911
987
924
183
4
module Main where main :: IO () main = putStrLn "sup"
bts/free-transformers
app/Main.hs
bsd-3-clause
55
0
6
12
22
12
10
3
1
{-# LANGUAGE OverloadedStrings, CPP #-} module HPACK.HuffmanSpec where #if __GLASGOW_HASKELL__ < 709 import Control.Applicative ((<$>)) #endif import Data.ByteString (ByteString) import qualified Data.ByteString.Base16 as B16 import qualified Data.ByteString.Char8 as BS import Data.Char (toLower) import Network.HPACK...
kazu-yamamoto/http2
test/HPACK/HuffmanSpec.hs
bsd-3-clause
2,149
0
18
426
548
306
242
51
1
module Graphics.Hexif.Utils where import Data.Binary import Data.Binary.Get import qualified Data.ByteString.Lazy as BL import Data.Hex -- | The encoding of the binary data. -- Motorola is big endian, Intel is low endian data Encoding = Intel | Motorola deriving (Show) -- | Little support function to read ...
hansroland/hexif
src/Graphics/Hexif/Utils.hs
bsd-3-clause
1,291
0
9
252
306
165
141
26
2
{-# LANGUAGE Arrows #-} module Karamaan.Plankton.Arrow where import Prelude hiding (id) import Control.Arrow ((&&&), Arrow, arr, returnA, second) import Control.Category ((<<<), id) import Data.List (foldl') voidArr :: Arrow arr => arr a () voidArr = arr (const ()) andVoid :: Arrow arr => arr a () -> arr a () -> ar...
karamaan/karamaan-plankton
Karamaan/Plankton/Arrow.hs
bsd-3-clause
1,878
1
10
459
978
496
482
41
1
module SLM.Model where import SLM.DataTypes class TrainedModel a where predictInstance :: a -> [Predictor] -> Double predict :: a -> [[Predictor]] -> [Double] predict model = map (predictInstance model)
timveitch/Gobble
src/SLM/Model.hs
bsd-3-clause
211
0
10
37
75
41
34
6
0
-- | -- Module : -- License : BSD-Style -- Maintainer : Nicolas DI PRIMA <nicolas@di-prima.fr> -- Stability : experimental -- Portability : unknown -- module Network.SMTP ( module Network.SMTP.Types , module Network.SMTP.Monad -- * Client , module Network.SMTP.Client -- * Utils -- ...
NicolasDP/hs-smtp
Network/SMTP.hs
bsd-3-clause
4,230
0
21
1,057
1,184
619
565
83
4
{-# LANGUAGE RecordWildCards #-} module Plugin.Jira ( respond , hear , help ) where import Control.Applicative import Control.Lens import Data.Aeson import Data.List (nub) import Data.Maybe import Data.Text (Text) import qualifi...
wamaral/slaskellbot
src/Plugin/Jira.hs
bsd-3-clause
6,218
0
18
1,663
1,772
914
858
127
6
module Data.Wright.RGB.Model.AdobeRGB1998 (adobeRGB1998) where import Data.Wright.Types (Model(..), Primary(..), Gamma(..)) import Data.Wright.CIE.Illuminant.D65 (d65) adobeRGB1998 :: Model adobeRGB1998 = d65 { gamma = Gamma 2.2 , red = Primary 0.6400 0.3300 0.297361 , green = Primary 0.2100 0.7100 0.627355 ...
fmap-archive/wright
src/Data/Wright/RGB/Model/AdobeRGB1998.hs
mit
365
0
7
59
116
72
44
9
1
import Data.Array import Data.Function (on) import Data.List (intercalate, maximumBy) import Data.Ratio type Matrix a = Array (Int, Int) a type Vector a = Array Int a swapRows :: Int -> Int -> Matrix a -> Matrix a swapRows r1 r2 m | r1 == r2 = m | otherwise = m // concat [[((r2, c), m ! (r1, c)), ((r1, c...
Gathros/algorithm-archive
contents/gaussian_elimination/code/haskell/gaussianElimination.hs
mit
2,573
10
12
781
1,495
798
697
-1
-1
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-} -------------------------------...
geraldus/yesod
yesod-static/Yesod/Static.hs
mit
21,599
0
22
5,540
4,118
2,244
1,874
342
4
{-# 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/DeleteEventSourceMapping.hs
mpl-2.0
3,080
0
9
621
336
209
127
53
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} module BitcoinCore.Transaction.Transactions where import General.Util import BitcoinCore.Transaction.Script import BitcoinCore.Keys (PublicKeyRep(..), PubKeyFormat(..)) import General.Hash (Hash(..), hashObject, doubleSHA) import Prelude hiding (conc...
clample/lamdabtc
backend/src/BitcoinCore/Transaction/Transactions.hs
bsd-3-clause
10,065
0
15
1,909
2,702
1,447
1,255
286
2
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-}...
AndrewRademacher/stack
src/Stack/Build.hs
bsd-3-clause
16,147
0
20
5,022
3,238
1,725
1,513
264
6
module BrownPLT.JavaScript.Contracts.Interface ( module BrownPLT.JavaScript.Contracts.Types ) where import BrownPLT.JavaScript.Contracts.Types
brownplt/javascript-contracts
src/BrownPLT/JavaScript/Contracts/Interface.hs
bsd-3-clause
148
0
5
14
25
18
7
3
0
-- Module : Network.AWS.StorageGateway -- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- ...
romanb/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway.hs
mpl-2.0
6,542
0
5
630
773
570
203
101
0
{-# LANGUAGE TemplateHaskell #-} {-| Lenses for Ganeti config objects -} {- Copyright (C) 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 are met: 1. Redistributions of source code must reta...
apyrgio/ganeti
src/Ganeti/Objects/Lens.hs
bsd-2-clause
3,779
0
10
587
596
304
292
70
0
module List2 where import FFI import Prelude hiding (take) main :: Fay () main = putStrLn (showList (take 5 (let ns = 1 : map' (foo 123) ns in ns))) foo :: Double -> Double -> Double foo x y = x * y / 2 take :: Int -> [a] -> [a] take 0 _ = [] take n (x:xs) = x : take (n - 1) xs map' :: (a...
fpco/fay
tests/List2.hs
bsd-3-clause
460
0
18
138
261
138
123
15
1
{-| Module : Idris.ProofSearch Description : Searches current context for proofs' Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards #-} module Idris.ProofSearch( trivial , trivialHoles , proofSearch , resolveTC ) where import Idris.Core.Elaborate hidin...
tpsinnem/Idris-dev
src/Idris/ProofSearch.hs
bsd-3-clause
23,017
160
22
9,737
6,142
3,222
2,920
422
39
module DeadRecursiveBoxed where import Prelude topEntity :: Bool -> Bool topEntity y = f ((\x -> x) . (\y -> y)) y f x y = fst (x, f x y) y
christiaanb/clash-compiler
tests/shouldwork/BoxedFunctions/DeadRecursiveBoxed.hs
bsd-2-clause
143
0
9
35
78
43
35
5
1
{-# LANGUAGE OverloadedStrings, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Documentation.Haddock.ParserSpec (main, spec) where import Data.String import qualified Documentation.Haddock.Parser as Parse import Documentation.Haddock.Types import Documentation.Haddock...
DavidAlphaFox/ghc
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
bsd-3-clause
33,032
0
76
11,371
6,446
3,142
3,304
713
1
-- Copyright (c) 2014-present, Facebook, Inc. -- All rights reserved. -- -- This source code is distributed under the terms of a BSD license, -- found in the LICENSE file. An additional grant of patent rights can -- be found in the PATENTS file. {-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE Constrain...
iblumenfeld/Haxl
Haxl/Core/Monad.hs
bsd-3-clause
26,121
0
24
6,164
5,906
2,996
2,910
378
5
{-# LANGUAGE TemplateHaskell #-} -- Trac #2632 module MkData where import Language.Haskell.TH op :: Num v => v -> v -> v op a b = a + b decl1 = [d| func = 0 `op` 3 |] decl2 = [d| op x y = x func = 0 `op` 3 |]
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/th/T2632.hs
bsd-3-clause
228
0
7
71
64
40
24
8
1
import System.IO hiding (writeFile) import System.Environment import Prelude hiding (writeFile, concat) import Data.ByteString.Lazy (writeFile, concat) import Data.Binary (encode) import Control.Monad (when) import System.Exit (exitFailure) import System.FilePath ((</>)) import Language.RuScript.Serialize import Langu...
izgzhen/RuScript
rusc/src/Main.hs
mit
1,680
0
25
523
455
231
224
39
5
-- To turn a file list like: 01.first 02.second 03.third into, say: 25.first 26.second 27.third import System.Environment import Data.List import Text.Printf import System.Posix.Files import System.Directory prependNewTag :: FilePath -> FilePath -> FilePath prependNewTag orig newNum = newNum ++ ( dropWhile (/='.') o...
ChristopherMorton/Renumber.hs
renumber.hs
mit
848
0
13
163
295
151
144
20
1
import XMonad import System.Taffybar.Support.PagerHints (pagerHints) import XMonad.Hooks.EwmhDesktops (ewmh) import XMonad.Hooks.ManageDocks import XMonad.Util.EZConfig myKeys = [ ("<XF86AudioMute>" , spawn "amixer -c 0 set Master toggle") , ("<XF86AudioLowerVolume>", spawn "amixer -c 0 set Master 5%-"...
rossabaker/dotfiles
xmonad/xmonad.hs
mit
775
0
10
183
165
98
67
20
1
module Data.LTE ( ) where
mckeankylej/fast-nats
src/Data/LTE.hs
mit
30
0
3
9
9
6
3
2
0
module Lesson2.BFS.Enumerator where import Control.Monad.Trans (MonadIO, liftIO) import Data.Ord (Ord(..), comparing) import qualified Data.Set as Set -------------------- import Data.Enumerator ( Stream(..) , Step(..) , Iteratee(..) , Enumerator , (>>==) , returnI , continue , yield ) import Dat...
roman/ai-class-haskell
src/Lesson2/BFS/Enumerator.hs
mit
788
0
12
176
220
134
86
25
1
{-# LANGUAGE NoImplicitPrelude, FlexibleInstances, OverloadedStrings #-} module IHaskell.Eval.Hoogle ( search, document, render, OutputFormat(..), HoogleResult, ) where import IHaskellPrelude import qualified Data.Text as T import qualified Data.Text.Lazy as LT import qualified Data....
sumitsahrawat/IHaskell
src/IHaskell/Eval/Hoogle.hs
mit
8,550
0
20
2,263
2,518
1,267
1,251
199
4
module Error where import LispData import Control.Monad.Except import Text.ParserCombinators.Parsec (ParseError) data LispError = NumArgs Integer [LispVal] | TypeMismatch String LispVal | Parser ParseError | BadSpecialForm String LispVal | NotFunction String...
evinstk/scheme-by-haskell
Error.hs
mit
1,222
0
8
284
339
176
163
24
1
-- Game State module State(State(..), initialGameState, resetGameState) where import Playfield import Piece import System.Random data State = State { well :: Well , time :: Float , deltaTime :: Float , secondsToNextMove :: Float , piece :: Piece , piecePos :: (Int, Int) , r...
mgeorgoulopoulos/TetrisHaskellWeekend
State.hs
mit
866
0
9
252
215
137
78
28
1
module Main where import Git main :: IO () main = do putStrLn <- currentBranch putStrLn <- remoteUrl return ()
roberto/octo-reviews
src/Main.hs
mit
119
0
8
28
44
22
22
7
1
{-# LANGUAGE OverloadedStrings #-} module JoScript.Data.Error where import Protolude hiding (Location) import Data.Aeson ((.=)) import qualified Data.Aeson.Types as A import JoScript.Data.Position (Position) import JoScript.Util.Json (withObject) import JoScript.Data.Lexer (LpRepr(..), LpReprKind(..)) import qualif...
AKST/jo
source/lib/JoScript/Data/Error.hs
mit
4,220
0
11
795
1,197
638
559
-1
-1
data ArrowOpts n = ArrowOpts { _arrowHead :: ArrowHT n , _arrowTail :: ArrowHT n , _arrowShaft :: Trail V2 n , _headGap :: Measure n , _tailGap :: Measure n , _headStyle :: Style V2 n , _headLength :: Measure n , _tailStyle :: Style V2 n , _tailLength :: Measure n , _...
jeffreyrosenbluth/NYC-meetup
meetup/ArrowOpts.hs
mit
351
0
9
116
109
60
49
12
0
import Probs1to10 import Probs11to20 import Probs21to30 import Probs31to40 main :: IO () main = do putStrLn $ show $ mlast "RandPer" putStrLn $ show $ lastbutone "RandPer" putStrLn $ show $ kth "RandPer" 0 putStrLn $ show $ mlen "RandPer" putStrLn $ show $ rev "RandPer" putStrLn $ show $ frev "...
ajjaic/Problems99
src/Main.hs
mit
1,011
0
17
224
420
197
223
22
1
module Utils where import Data.Aeson import qualified Data.ByteString.Lazy as B import Control.Applicative loadJSON :: (FromJSON a) => FilePath -> IO a loadJSON a = do x <- B.readFile a >>= return . decode case x of Nothing -> error $ "Cannot load from " ++ a Just y -> return y writeJSON :: (ToJSON a) => FileP...
edwardwas/haskcal
src/Utils.hs
mit
375
0
11
78
149
77
72
12
2
{-Generation of pink noise roughly based on the algorithm from here: http://www.firstpr.com.au/dsp/pink-noise/phil_burk_19990905_patest_pink.c From here: http://www.firstpr.com.au/dsp/pink-noise/ -} module PinkVMBurk (genPink,initialPinkNoise) where import WhiteNoise (whiteRandom) import Data.Bits trailingZeros:: In...
danplubell/color-noise
library/PinkVMBurk.hs
mit
2,590
0
16
897
737
387
350
51
2
fibs :: [Integer] fibs = 1:2:zipWith (+) fibs (tail fibs) main = print . sum . takeWhile (<4000000) . filter even $ fibs
chrisfosterelli/euler.hs
solutions/002.hs
mit
121
0
9
23
68
36
32
3
1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGNumber (setValue, getValue, SVGNumber(..), gTypeSVGNumber) where import Prelude ((.), (==), (>>=), return, IO,...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGNumber.hs
mit
1,486
0
12
171
414
260
154
23
1
module RotButtons where import Control.Monad import Control.Monad.Instances import Data.IORef import Graphics.UI.Gtk hiding (on,get) import qualified Graphics.UI.Gtk as G import Graphics.UI.Gtk.Glade import Numeric.LinearAlgebra ((<>),(><),(|>),(@>),(@@>),Vector,Matrix) import qualified Numeric.LinearAlgebra as V i...
benjaminjkraft/nmines
RotButtons.hs
mit
2,190
0
19
477
795
403
392
52
6