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 SPARC.CodeGen.Amode ( getAmode ) where import GhcPrelude import {-# SOURCE #-} SPARC.CodeGen.Gen32 import SPARC.CodeGen.Base import SPARC.AddrMode import SPARC.Imm import SPARC.Instr import SPARC.Regs import SPARC.Base import NCGMonad import Format import Cmm import OrdList -- | Generate code to r...
ezyang/ghc
compiler/nativeGen/SPARC/CodeGen/Amode.hs
bsd-3-clause
1,646
0
16
490
610
303
307
55
1
{-# LANGUAGE MagicHash #-} -- !!! test tryTakeMVar import Control.Concurrent import Control.Exception import GHC.Exts ( fork# ) import GHC.IO ( IO(..) ) import GHC.Conc ( ThreadId(..) ) main = do m <- newEmptyMVar r <- timeout 5 (tryTakeMVar m) (putStrLn "timed out!" >> return Nothing) ...
ezyang/ghc
testsuite/tests/concurrent/should_run/conc022.hs
bsd-3-clause
1,107
0
14
377
325
158
167
31
2
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE ConstraintKinds, TemplateHaskell, PolyKinds, TypeFamilies, RankNTypes #-} module T7021a where import GHC.Exts import Language.Haskell.TH type IOable a = (Show a, Read a) type family ALittleSilly :: Constraint data Proxy a = Proxy foo :: IOable a => a...
ezyang/ghc
testsuite/tests/th/T7021a.hs
bsd-3-clause
704
0
8
154
191
99
92
-1
-1
module Main where import Data.Array.Unboxed type Lights = UArray (Int,Int) Bool main :: IO () main = do input <- loadInput let steps = 100 print $ countLights $ iterate (applyRule life) input !! steps print $ countLights $ iterate (applyRule (addCorners life)) input !! steps countLights :: Lights -...
glguy/advent2015
Day18.hs
isc
1,422
0
16
508
676
356
320
38
2
{- Lab Session Software Testing 2013, Week 6 Tuba Kaya Chomette, Sander Leer, Martijn Stegeman 13 October 2013 -} module Benchmark where import Week6 import Criterion.Main import Criterion.Config import Data.Bits {- To actually run this benchmark, you need to install Criterion by running cabal ins...
stgm/prac-testing
week6/Benchmark.hs
mit
2,998
0
13
944
509
272
237
21
2
module NetHack.Data.BUC (BUC(..)) where data BUC = Blessed | Uncursed | Cursed deriving(Eq, Show)
Noeda/Megaman
src/NetHack/Data/BUC.hs
mit
115
0
6
31
40
25
15
4
0
{-# LANGUAGE BangPatterns #-} module Vec2 where data Vec2 = Vec2 {-# UNPACK #-}!Double {-# UNPACK #-}!Double deriving Show vecZero :: Vec2 vecZero = Vec2 0.0 0.0 vecAdd :: Vec2 -> Vec2 -> Vec2 vecAdd (Vec2 a b) (Vec2 x y) = Vec2 (a+x) (b+y) vecSub :: Vec2 -> Vec2 -> Vec2 vecSub (Vec2 a ...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/picture/Boids/Vec2.hs
mit
999
0
9
306
479
248
231
36
2
-- | This module implements GL_ARB_texture_storage with -- GL_EXT_direct_state_access in terms of glTexImageX calls. -- -- The implementation is unlikely to be perfect but it should work for most -- cases. {-# LANGUAGE NoImplicitPrelude, MultiWayIf #-} module Graphics.Caramia.Internal.TexStorage ( fakeTextureStor...
Noeda/caramia
src/Graphics/Caramia/Internal/TexStorage.hs
mit
14,120
0
19
5,999
3,021
1,458
1,563
310
63
{-| Module : Language.Common.Storage Description : Storage size definition Copyright : (c) Jacob Errington and Frederic Lafrance, 2016 License : MIT Maintainer : goto@mail.jerrington.me Stability : experimental -} module Language.Common.Storage where -- | Types having an associated storage requirement a...
djeik/goto
libgoto/Language/Common/Storage.hs
mit
501
0
7
97
29
18
11
3
0
{- Author: Jeff Newbern Maintainer: Jeff Newbern <jnewbern@nomaware.com> Time-stamp: <Wed Jul 2 16:34:28 2003> License: GPL -} {- DESCRIPTION Example 11 - Using the Maybe monad Usage: Compile the code and execute the resulting program with an argument that is the name or nickname of a ...
maurotrb/hs-exercises
AllAboutMonads/examples/example11.hs
mit
2,352
16
13
639
440
242
198
30
1
module Text.Noise.Parser.Character ( Location , Length , Range , locationAt , rangeAt ) where import Text.Parsec.Pos (SourcePos, updatePosChar, initialPos, sourceName) import Text.Noise.SourceRange (SourceRange) import Data.List (elemIndex) type Location = Int type Length = Int type Range = (Location, Length) loca...
brow/noise
src/Text/Noise/Parser/Character.hs
mit
715
0
9
117
221
123
98
21
1
module Lab2 where ------------------------------------------------------------------------------------------------------------------------------ -- Lab 2: Validating Credit Card Numbers ------------------------------------------------------------------------------------------------------------------------------ -- ==...
supermitch/learn-haskell
edx-fp101x/5_lab.hs
mit
9,109
0
14
3,064
1,444
813
631
176
1
-------------------------------------------------------------------- -- | -- Module : Data.MessagePack.Put -- Copyright : (c) Hideyuki Tanaka, 2009-2015 -- License : BSD3 -- -- Maintainer: tanaka.hideyuki@gmail.com -- Stability : experimental -- Portability: portable -- -- MessagePack Serializer using @Data.Bina...
voidlizard/ntced-tcp-proxy
contrib/msgpack/src/Data/MessagePack/Put.hs
mit
3,761
0
14
1,043
1,304
628
676
101
6
module Bench ( main ) where import Criterion.Main import Data.Bifunctor import qualified Data.ByteString as BS import Data.List import Data.Text.Encoding (decodeUtf8) import qualified Javran.MaxFlow.Algorithm.Dinitz as Dinitz import qualified Javran.MaxFlow.Algorithm.DinitzCherkassky as DinitzCherkassky import qua...
Javran/misc
max-flow/bench/Bench.hs
mit
1,764
0
13
405
479
272
207
50
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} module Test.Target ( target, targetResult, targetWith, targetResultWith , targetTH, targetResultTH, targetWithTH, targetResultWithTH , Result(..), Testable, Targetable(..) , Targ...
gridaphobe/target
src/Test/Target.hs
mit
3,744
0
19
953
821
445
376
69
3
{-| Module : TestPrint.Problen.BSP.CNF.Builder Description : The CNFBuilder module Printer tests Copyright : (c) Andrew Burnett 2014-2015 Maintainer : andyburnett88@gmail.com Stability : experimental Portability : Unknown The Test Tree Node for the CNFBuilder module Printer Tests -} module TestPrint.Problem...
aburnett88/HSat
tests-src/TestPrint/Problem/BSP/CNF/Builder.hs
mit
1,419
0
9
254
374
223
151
42
1
module GHCJS.DOM.VTTRegionList ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/VTTRegionList.hs
mit
43
0
3
7
10
7
3
1
0
-- problem 1 -- find the last element of a list last' :: [a] -> a last' = head . reverse -- problem 2 -- find the penultimate element of a list penult :: [a] -> a penult = last . init -- problem 3 -- find the k'th element of a list, 1-based indexing. elemAt :: [a] -> Int -> a elemAt x k = x !! (k - 1) -- problem 4 -...
autocorr/lyah
99qs/01_lists.hs
mit
714
0
8
167
228
133
95
13
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} module CodeGenerator( generatePISA, showPISAProgram ) where import Data.List import Control.Arrow import Control.Monad.Except import Control.Monad.State import Debug.Trace (trace, traceShow) import Text.Pretty.Simple (...
cservenka/ROOPLPPC
src/CodeGenerator.hs
mit
48,614
0
47
15,509
14,532
7,548
6,984
799
20
{-# LANGUAGE DeriveDataTypeable #-} -- | This module provides a simple leftist-heap implementation based on Chris -- Okasaki's book \"Purely Functional Data Structures\", Cambridge University -- Press, 1998, chapter 3.1. -- -- A @'HeapT' prio val@ associates a priority @prio@ to a value @val@. A -- priority-value pair...
PepeLui17/Proyecto_Lenguajes_De_Programacion_Segundo_Parcial
HeapInternal.hs
gpl-2.0
9,423
0
15
2,548
2,650
1,430
1,220
167
4
-- -- Copyright (c) 2013 Citrix Systems, Inc. -- -- 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 progra...
OpenXT/manager
xenmgr/Vm/Utility.hs
gpl-2.0
6,721
0
18
1,633
1,892
954
938
129
8
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-} {- | Module : ./Modal/Logic_Modal.hs Description : Instance of class Logic for Modal CASL Copyright : (c) Till Mossakowski, Uni Bremen 2002-2004 License : GPLv2 or higher, see LICENSE.txt Maintainer : luecke@informatik.uni...
gnn/Hets
Modal/Logic_Modal.hs
gpl-2.0
4,510
0
16
1,128
891
450
441
95
2
-- Copyright (C) 2006-2011 Angelos Charalambidis <a.charalambidis@di.uoa.gr> -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2, or (at your option) -- any later version...
acharal/hopes
src/prover/Subst.hs
gpl-2.0
3,226
18
12
849
963
507
456
46
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module TestVals ( env , list , factorialVal, euler1Val, solveDepressedQuarticVal , factorsVal , lambda, lambdaRecord, letItem, recordType , eLet , listTypePair, boolTypePair, polyIdTypePair, unsafeCoerceTypePair , ignoredParamTypePai...
da-x/Algorithm-W-Step-By-Step
src/TestVals.hs
gpl-3.0
11,046
0
29
3,823
4,256
2,333
1,923
276
1
{- http://cryptopals.com/sets/1/challenges/1/ -} module Base64 where import Hex import Data.Bits (shift, (.&.)) import Data.List (elemIndex) import Data.Maybe (fromJust) import CryptoChallenge base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" toBase64Char n = base64Chars !! n fromBa...
CharlesRandles/cryptoChallenge
base64.hs
gpl-3.0
2,065
0
14
561
797
433
364
43
1
-------------------------------------------------------------------------------- -- Copyright (C) 1997, 1998, 2008 Joern Dinkla, www.dinkla.net -------------------------------------------------------------------------------- module Tests.Polys where import Point2 (Point2 (..)) import Polygon (Polygon (..), Polygon2, v...
smoothdeveloper/GeoAlgLib
src/Tests/Polys.hs
gpl-3.0
2,472
0
10
434
1,779
1,155
624
38
1
{-| Module : Control.Monad.EitherCont Description : The 'EitherCont' type and API Copyright : (c) Eitan Chatav, 2015 License : PublicDomain Maintainer : eitan.chatav@gmail.com Stability : experimental The 'EitherCont' type and API provide an idiomatic way to handle errors in continuation passing style. -...
echatav/error-continuations
src/Control/Monad/EitherCont.hs
unlicense
2,443
0
10
548
506
285
221
40
1
module Main where import System.Environment import Options.Applicative import ServerAPI (OpLimit(..),Problem(..), TrainingResponse(..)) import StringClient as SC (getMyproblems, getStatus, getTrainingProblem, evalProgram, evalProgramById, guessProgram) import FileClient as FC (getUnsolved, getUnsolvedHS, filterByIds, ...
atemerev/icfpc2013
src/client/client.hs
apache-2.0
10,339
1
28
2,455
3,170
1,598
1,572
198
10
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Phaedrus.Text.BetaCode ( betaCode , fromBeta , fromBetaIgnore , normalizeChars , betanorm , clean , BetaCode , unBeta , toBeta ) where import Control.Applicative import Control.Er...
erochest/phaedrus
Phaedrus/Text/BetaCode.hs
apache-2.0
7,445
0
14
3,001
1,642
877
765
160
8
module DeliveryQueue where import qualified Data.Set as Set import qualified Data.PSQueue as PSQueue import Transaction import Commutating import Position import NonCommutatingTransactionSet newtype DeliveryQueue = DeliveryQueue (PSQueue.PSQ TransactionID Position) empty :: DeliveryQueue empty = DeliveryQueue P...
kdkeyser/halvin
src/halvin/DeliveryQueue.hs
apache-2.0
652
0
10
102
169
92
77
19
2
{-# LANGUAGE OverloadedStrings #-} module Util.JSONWebToken where import Control.Applicative import Control.Monad import Data.Aeson import qualified Data.ByteString.Char8 as C import qualified Data.ByteString.Lazy.Char8 as CL import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified J...
alexandrelucchesi/pfec
server-common/src/Util/JSONWebToken.hs
apache-2.0
2,756
0
15
493
503
280
223
41
2
-- -*- coding: utf-8; -*- module Show where import Model import qualified Data.Map as Map showElements :: Int -> [Element] -> String showElements n (e@(Element name props subelements):es) = (take (2*n) $ repeat ' ') ++ show (Element name props []) ++ "\n" ++ showElements (n+1) subelemen...
grzegorzbalcerek/orgmode
Show.hs
bsd-2-clause
628
0
13
149
293
151
142
18
1
{-| Copyright : (C) 2013-2016, University of Twente License : BSD2 (see the file LICENSE) Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com> -} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} module CLaSH.GHC.Evaluator where import Control.Monad.Trans.Except (r...
ggreif/clash-compiler
clash-ghc/src-ghc/CLaSH/GHC/Evaluator.hs
bsd-2-clause
15,675
0
21
3,339
5,569
2,785
2,784
277
62
-- {-# LANGUAGE TemplateHaskell #-} module Main (main) where import Test.HUnit hiding (Test) import Test.Framework (Test, defaultMain, testGroup) import Test.Framework.Providers.HUnit import MiniSat2 -- should be SAT case_test1 :: IO () case_test1 = do solver <- newSolver a <- newVar solver b <- newVar solver ...
msakai/haskell-minisat
test/Test.hs
bsd-3-clause
676
0
9
112
209
108
101
18
1
{-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Network.DHT.Kademlia.Workers.Interactive (interactive) where import Control.Concurrent.STM import Control.Monad import Data.Aeson as JSON import Data.Binary import D...
phylake/kademlia
Network/DHT/Kademlia/Workers/Interactive.hs
bsd-3-clause
1,558
0
20
374
363
208
155
37
2
{-# LANGUAGE MultiParamTypeClasses, OverloadedStrings #-} module Model.UserProfile ( UserProfile (..) , Name , Id , mkUserProfile , MachineUsage (..) , concretize ) where import qualified Data.Map as M import qualified Data.Binary as B import Data.Aeson import Database.HDBC import Data.Con...
redelmann/e-zimod-server
Model/UserProfile.hs
bsd-3-clause
2,168
0
10
485
713
390
323
62
1
import Test.HUnit import Control.Monad (void) main :: IO () main = void $ runTestTT $ TestList [ TestLabel "test" simpleTest ] simpleTest = TestCase (assertEqual "1 == 1" 1 1)
DAHeath/Tetris
test/Spec.hs
bsd-3-clause
213
0
8
67
68
35
33
5
1
module HipChat where
mjhopkins/hipchat
src/HipChat.hs
bsd-3-clause
21
0
2
3
4
3
1
1
0
module Yesod.CoreBot.Bliki.Cache.UpdateHTML where import Yesod.CoreBot.Bliki.Prelude import Yesod.CoreBot.Bliki.Config import Yesod.CoreBot.Bliki.Resources.Base import Yesod.CoreBot.Bliki.Store import Yesod.CoreBot.Bliki.DB import HereDoc import Control.Monad.Reader import qualified Data.ByteString.Lazy as B impo...
coreyoconnor/corebot-bliki
src/Yesod/CoreBot/Bliki/Cache/UpdateHTML.hs
bsd-3-clause
3,452
0
20
912
747
401
346
-1
-1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE CPP #-} -- ---------------------------------------------------------------------------- -- | This module provides scalable event notification for file -- descriptors and timeouts. -- -- This module should be considered GHC internal. -- -- ---...
forked-upstream-packages-for-ghcjs/ghc
libraries/base/GHC/Event.hs
bsd-3-clause
1,218
0
3
269
22
19
3
31
0
{-# OPTIONS_GHC -fno-warn-orphans #-} import Control.Applicative import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BC import Data.Monoid import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck import Network.HTTP.QueryString.Internal instance Arbitrary ByteString where a...
worksap-ate/http-querystring
test/Spec.hs
bsd-3-clause
1,195
0
11
219
383
204
179
32
1
{-| Module : Data.Boltzmann.System.Utils Description : Various routines for combinatorial systems. Copyright : (c) Maciej Bendkowski, 2017-2021 License : BSD3 Maintainer : maciej.bendkowski@tcs.uj.edu.pl Stability : experimental The following module implements subroutines for combinatorial system...
maciej-bendkowski/boltzmann-brain
Data/Boltzmann/System/Utils.hs
bsd-3-clause
5,979
0
13
1,717
1,690
862
828
106
3
module Data.Sass.Internal ( ) where
athanclark/shashh
src/Data/Sass/Internal.hs
bsd-3-clause
44
0
3
13
10
7
3
2
0
{-# LANGUAGE Arrows, FlexibleContexts, TypeOperators, TypeFamilies, ConstraintKinds, ScopedTypeVariables #-} module BenchTasks.Logistic where import MixedTypesNumPrelude -- import qualified Prelude as P -- import Text.Printf import Control.Arrow taskDescription :: Integer -> String taskDescription n = "taskLogisti...
michalkonecny/aern2
aern2-real/attic/bench/BenchTasks/Logistic.hs
bsd-3-clause
1,637
6
16
368
524
278
246
45
2
-- | Quasi quoters to make it easier to enter some values that are -- tedious to express in Haskell source. module Penny.Quasi where import Data.Data (Data) import qualified Data.Text as X import qualified Language.Haskell.TH as T import qualified Language.Haskell.TH.Quote as TQ import Text.Read (readMaybe) import Pe...
massysett/penny
penny/lib/Penny/Quasi.hs
bsd-3-clause
2,569
0
13
501
623
341
282
45
2
-- | The assembler module Assembler where import Control.Monad import Data.Bits import Data.List import Data.Maybe (isJust, fromJust, mapMaybe) import System.IO import Text.Parsec import qualified Text.Parsec.Token as Token import Text.Parsec.Language import Text.Groom import Assembly -- * The parser -- | The p...
Shadytel/Computer
Emulator/Assembler.hs
bsd-3-clause
17,374
0
20
7,023
5,056
2,655
2,401
337
42
module CustomCodes ( customChr , customDecrypt ) where import FastDegree import RSA customDecrypt :: PrivateKey -> Integer -> String customDecrypt (n, d) code = go (deg n code d) "" where go 0 word = word go x word = go (x `div` 100) ((customChr $ mod x 100):word) customChr :: Integer -> Char c...
GOGEN/rsa
app/CustomCodes.hs
bsd-3-clause
1,617
0
12
339
646
329
317
75
2
module Graphics.X11.HLock(xLocker, hlock) where import Data.Maybe(fromMaybe) import Control.Arrow(second) import Data.Bits((.|.)) import Control.Monad.State import Control.Concurrent(threadDelay) import System.Exit(exitFailure) import System.Posix.User.Password import HLock hiding (hlock) import qualified HLock(hlock) ...
zsedem/hlock
src/Graphics/X11/HLock.hs
bsd-3-clause
5,011
0
25
1,467
1,457
737
720
116
4
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Monadic type operations This module contains monadic operations over types that contain mutable type variables -} {-# LANGUAGE CPP, TupleSections, MultiWayIf #-} module TcMType ( TcTyVar, TcKind, TcType, TcTauType, Tc...
mcschroeder/ghc
compiler/typecheck/TcMType.hs
bsd-3-clause
57,998
7
21
15,974
10,245
5,326
4,919
-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.AmountOfMoney.RU.Tests ( tests ) where import Data.String import Prelude import Test.Tasty im...
facebookincubator/duckling
tests/Duckling/AmountOfMoney/RU/Tests.hs
bsd-3-clause
522
0
9
78
79
50
29
11
1
module Trace.Haptics.ShowTix (showtix_plugin) where import qualified Data.Set as Set import Trace.Haptics.Flags import Trace.Haptics.Mix import Trace.Haptics.Tix showtix_options :: FlagOptSeq showtix_options = excludeOpt . includeOpt . srcDirOpt . hpcDirOpt . resetHpcDirsOpt . outputOpt . ve...
Javran/haptics
src/Trace/Haptics/ShowTix.hs
bsd-3-clause
2,089
0
28
724
592
306
286
61
2
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE QuantifiedConstraints #-} -- | NamedStructure definition for sequences of bits. -- -- This module provides the core data types and functions for -- conversion of finite bit sequences from an to conv...
sheyll/isobmff-builder
src/Data/Type/BitRecords/Core.hs
bsd-3-clause
28,864
16
14
5,338
8,238
4,409
3,829
-1
-1
module Pos.Core.NetworkAddress ( NetworkAddress , localhost , addrParser , addrParserNoWildcard ) where import Universum import qualified Data.ByteString.Char8 as BS8 import qualified Serokell.Util.Parse as P -- We should really be using Megaparsec here instead of Parsec, ...
input-output-hk/pos-haskell-prototype
core/src/Pos/Core/NetworkAddress.hs
mit
1,141
0
10
227
222
135
87
21
2
{-# LANGUAGE DeriveAnyClass #-} module Commands.Plugins.Spiros.Act.Types where import Commands.Plugins.Spiros.Extra.Types import Commands.Plugins.Spiros.Edit import Commands.Backends.Workflow (KeySequence) data Acts = ActsRW Int Act -- ^ repeated read/write actions deriving (Show,Read,Eq,Or...
sboosali/commands-spiros
config/Commands/Plugins/Spiros/Act/Types.hs
gpl-2.0
671
0
6
122
131
78
53
13
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-swf/gen/Network/AWS/SWF/CountPendingDecisionTasks.hs
mpl-2.0
5,814
0
11
1,187
623
380
243
70
1
{-# LANGUAGE OverloadedStrings #-} -- Module : Test.AWS.DirectoryService -- Copyright : (c) 2013-2015 Brendan Hay -- 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 -- ...
fmapfmapfmap/amazonka
amazonka-ds/test/Test/AWS/DirectoryService.hs
mpl-2.0
776
0
5
201
73
50
23
11
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="tr-TR"> <title>Özelleştirilebilir HTML Raporu</title> <maps> <homeID>top</homeID> <map...
veggiespam/zap-extensions
addOns/customreport/src/main/javahelp/org/zaproxy/zap/extension/customreport/resources/help_tr_TR/helpset_tr_TR.hs
apache-2.0
985
79
66
158
419
211
208
-1
-1
module Music.Time.Aligned ( -- * Alignable class Alignable(..), -- * Aligned values Aligned, aligned, realign, renderAligned, renderAlignedVoice, renderAlignedNote, renderAlignedDuration, ) where import qualified Data.Aeson as JSON import Music.T...
music-suite/music-score
src/Music/Time/Aligned.hs
bsd-3-clause
4,034
0
12
815
1,170
640
530
-1
-1
-- Both these functions should successfully simplify -- using the combine-identical-alternatives optimisation module T7360 where import GHC.List as L data Foo = Foo1 | Foo2 | Foo3 !Int fun1 :: Foo -> () {-# NOINLINE fun1 #-} fun1 x = case x of Foo1 -> () Foo2 -> () F...
sdiehl/ghc
testsuite/tests/simplCore/should_compile/T7360.hs
bsd-3-clause
510
0
10
185
135
74
61
15
3
-- | -- Module : Data.ByteString.Lazy.Search -- Copyright : Daniel Fischer -- Chris Kuklewicz -- Licence : BSD3 -- Maintainer : Daniel Fischer <daniel.is.fischer@googlemail.com> -- Stability : Provisional -- Portability : non-portable (BangPatterns) -- -- Fast overlappin...
seereason/stringsearch
Data/ByteString/Lazy/Search.hs
bsd-3-clause
14,566
0
9
3,641
667
502
165
65
1
module Package05 where import GHC.Hs.Types import GHC.Hs.MyTypes import GHC.Hs.Utils
sdiehl/ghc
testsuite/tests/package/package05.hs
bsd-3-clause
85
0
4
9
22
15
7
4
0
{-| Module : Idris.REPL Description : Main function to decide Idris' mode of use. License : BSD3 Maintainer : The Idris Community. -} module Idris.Main ( idrisMain , idris , runMain , runClient -- taken from Idris.REPL. , loadInputs -- taken from Idris.ModeCommon ) where import Idris.AbsSyntax im...
mpkh/Idris-dev
src/Idris/Main.hs
bsd-3-clause
12,005
0
25
4,657
3,270
1,561
1,709
245
28
----------------------------------------------------------------------------- -- | -- Module : Control.Monad.IO.Class -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2001 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : ross@s...
jwiegley/ghc-release
libraries/transformers/Control/Monad/IO/Class.hs
gpl-3.0
1,130
0
8
224
97
65
32
7
0
{-# LANGUAGE FlexibleContexts #-} -- | Users end point handling -- <http://instagram.com/developer/endpoints/users/#> module Instagram.Users ( getUser , SelfFeedParams(..) , getSelfFeed , RecentParams(..) , getRecent , SelfLikedParams(..) , getSelfLiked , UserSearchParams(..) , searchUsers ) where ...
BeautifulDestinations/ig
src/Instagram/Users.hs
bsd-3-clause
3,765
4
12
831
962
529
433
91
1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | Functions to make tagsoup suck less. module TagSoup where import Control.Applicative import Control.Monad.Except import Control.Monad.State import Data.Char import Data.List import Data.Maybe import Data.Time import Text.HTML.TagSoup im...
lwm/haskellnews
src/TagSoup.hs
bsd-3-clause
3,380
0
13
742
1,183
594
589
76
2
module Aws ( -- * Logging LogLevel(..) , Logger , defaultLog -- * Configuration , Configuration(..) , baseConfiguration , dbgConfiguration -- * Transaction runners -- ** Safe runners , aws , awsRef , pureAws , simpleAws -- ** Unsafe runners , unsafeAws , unsafeAwsRef -- ** URI runners , awsUri -- ** Itera...
frms-/aws
Aws.hs
bsd-3-clause
1,241
0
5
190
197
140
57
45
0
---------------------------------------------------------------------------- -- | -- Module : XMonad.Hooks.WorkspaceByPos -- Copyright : (c) Jan Vornberger 2009 -- License : BSD3-style (see LICENSE) -- -- Maintainer : jan.vornberger@informatik.uni-oldenburg.de -- Stability : unstable -- Portability :...
markus1189/xmonad-contrib-710
XMonad/Hooks/WorkspaceByPos.hs
bsd-3-clause
1,812
0
18
356
351
195
156
-1
-1
-- !!! ds008 -- free tyvars on RHSs -- -- these tests involve way-cool TyApps module ShouldCompile where f x = [] g x = (f [],[],[],[]) h x = g (1::Int)
shlevy/ghc
testsuite/tests/deSugar/should_compile/ds008.hs
bsd-3-clause
157
0
7
36
65
37
28
4
1
module System.Console.Xterm.ColorsSpec ( spec ) where import Test.Hspec import System.Console.Xterm.Colors spec :: Spec spec = do -- compare results with table in -- http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html describe "getXtermColor" $ do it "0 is #000000" $ do ...
bacher09/xterm-colors
tests/System/Console/Xterm/ColorsSpec.hs
mit
748
0
14
217
192
94
98
17
1
import System.Process import System.Exit import Control.Applicative import Data.Maybe import BranchParse import StatusParse {- Type aliases -} type Hash = String type Numbers = [String] {- Combining branch and status parsing -} processBranch :: String -> BranchInfo processBranch = either (const noBranchInfo) id . b...
TheAtomicGoose/zsh-git-prompt
src/Main.hs
mit
1,869
6
9
331
651
350
301
43
2
{-# LANGUAGE FlexibleContexts #-} {- | Module : Language.Egison.Primitives Licence : MIT This module provides primitive functions in Egison. -} module Language.Egison.Primitives ( primitiveEnv , primitiveEnvNoIO ) where import Control.Monad.Except import Data.IORef import qualif...
egison/egison
hs-src/Language/Egison/Primitives.hs
mit
5,956
0
20
1,510
1,636
872
764
98
3
module MaitreD where import Data.Time (ZonedTime (..)) data Reservation = Reservation { date :: ZonedTime, quantity :: Int, isAccepted :: Bool } deriving (Show) instance Eq Reservation where x == y = zonedTimeZone (date x) == zonedTimeZone (date y) && zonedTimeToLocalTime (date x) == z...
ploeh/dependency-rejection-samples
Haskell/MaitreD.hs
mit
787
0
15
231
233
120
113
17
2
{-# LANGUAGE OverloadedStrings #-} module Spell.Test where import Control.Arrow (second) import Data.Function (on) import Data.List (groupBy, sortBy) import qualified Data.Text as T import qualified Data.Text.IO as TI import Data.Trie import Spell.Confusion (confusio...
fgrsnau/spell
test/Spell/Test.hs
mit
1,574
0
23
416
464
244
220
37
2
-- Multiple choice -- 1. A value of type [a] is -- a) a list of alphabetic characters -- b) a list of lists -- c) a list whose elements are all of some type 𝑎 *** -- d) a list whose elements are all of different types -- 2. A function of type [[a]] -> [a] could -- a) take a list of strings as an argument *** -- b) ...
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/05_09.hs
mit
8,043
0
11
1,786
930
582
348
-1
-1
{-| Module : Prelude.Betahaxx.Unicode Re-export some basic base-unicode-symbols and add two of my own. -} module Prelude.Unicode.Betahaxx ( (≡), (≢), (≠), (≤), (≥), π, (⋅), ℤ, ℚ, (×), (§) ) where import Prelude.Unicode ((≡), (≢), (≠), (≤), (≥), π, (⋅), ℤ, ℚ) -- |Multiplication sign for multiplication. -- I stil...
betaveros/betahaxx
Prelude/Unicode/Betahaxx.hs
mit
778
0
8
149
197
136
61
10
1
import Eval import Data import Parser import System( getArgs ) main = do -- The name of the file to load is the first arg. [f_name] <- getArgs -- Parse the file. maybe_parsed <- parseProgramFile f_name -- Check if it parsed correctly. case maybe_parsed of Left err -> print err Right parsed -> do -- Set ...
tomjnixon/buzzlang
src/Main.hs
mit
1,500
0
16
322
465
223
242
30
2
module AppTest where import System.Process import System.Directory import System.Exit import System.FilePath import System.IO import Data.String.Utils build_dir = "./dist/build" test_dir = "./test" type ProgName = String type TestName = String runTestCase :: ProgName -> TestName -> String -> IO ExitCode runTestCa...
tjunier/mlgsc
test/AppTest.hs
mit
1,685
2
12
298
484
252
232
37
2
{-# LANGUAGE ViewPatterns #-} module Y2021.M04.D28.Solution where {-- This is interesting >>> Nothing > Just 70 False >>> Nothing < Just 70 True ... huh. So Nothing is ... Just 0? That, for me, isn't good. I don't want something to succeed when I have only partial data. Pesky me. So, we have some functions that...
geophf/1HaskellADay
exercises/HAD/Y2021/M04/D28/Solution.hs
mit
5,142
0
12
978
994
550
444
57
1
{- Number letter counts Problem 17 If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used? NOTE: Do not count spaces o...
feliposz/project-euler-solutions
haskell/euler17.hs
mit
1,559
0
10
528
336
188
148
40
2
{-# LANGUAGE OverloadedStrings #-} module Haskmon.Types.Internals where import Data.Aeson import Data.Aeson.Types import Data.Time.Format import Data.Time.Clock import Control.Monad(mzero) import Haskmon.Resource(getResource) -- {{{ MetaData -- | Metadata that all resources (except Pokedex) have in common data Meta...
bitemyapp/Haskmon
src/Haskmon/Types/Internals.hs
mit
13,316
5
42
6,112
2,696
1,449
1,247
269
1
----------------------------------------------------------------------------- -- -- Module : Drool.VisualConfig -- Copyright : 2012, Tobias Fuchs -- License : MIT -- -- Maintainer : twh.fuchs@gmail.com -- Stability : experimental -- Portability : POSIX -- -- | -- ------------------------------------...
fuchsto/drool
src/Drool/VisualConfig.hs
mit
2,024
0
8
988
155
109
46
21
0
-- | Git utilities. module Stackage.View.Git where import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Resource import Data.Conduit import qualified Data.Conduit.List as CL import Data.Conduit.Process import qualified Data.Conduit.Text as CT ...
fpco/stackage-view
server/Stackage/View/Git.hs
mit
960
0
16
275
245
147
98
24
1
-- -- riot/Riot/Locale.hs -- -- Copyright (c) Tuomo Valkonen 2004-2006. -- -- 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 v...
opqdonut/riot
Riot/Locale.hs
gpl-2.0
706
0
8
119
102
63
39
7
1
module H33 where myGCD :: (Integral i) => i -> i -> i myGCD 0 y = y myGCD x y | x < 0 = myGCD (-x) y | y < 0 = myGCD x (-y) | x > y = myGCD y x | otherwise = myGCD (y `mod` x) x coprime :: (Integral i) => i -> i -> Bool coprime a b = myGCD a b == 1
hsinhuang/codebase
h99/H33.hs
gpl-2.0
269
0
8
92
171
86
85
10
1
import Data.Numbers.Primes import qualified Data.Map as M import Data.List -- 2: {2} -- 3: {3} -- 4: {2^2} -- 5: {5} -- 6: {2, 3} -- 7: {7} -- 8: {2^3} -- 9: {3^2} -- 10: {2, 5} -- 11: {11} -- 12: {2, 3} -- 13: {13} -- 14: {2^2, 7} -- 15: {3, 5} -- 16: {2^4} -- 17: {17} -- 18: {2, 3^2} -- 19: {19} -- 20: {2^2,...
AntoineSavage/haskell
project_euler/p1-50/p5/main.hs
gpl-2.0
955
0
9
250
274
152
122
16
1
-- | -- Module : Language.Go.Parser.Parser -- Copyright : (c) 2011 Andrew Robbins -- License : GPLv3 (see COPYING) -- -- This module provides parsers for the various Go language elements. {- LANGUAGE CPP -} module Language.Go.Parser.Parser ( -- * All-in-one parsers goParse, goParseFileWith, goParseT...
remyoudompheng/hs-language-go
Language/Go/Parser/Parser.hs
gpl-3.0
31,307
0
21
6,829
7,117
3,577
3,540
-1
-1
{-| Module : Main Description : So that it can work as an executable. Copyright : (c) License : GPL-3 Maintainer : njagi@urbanslug.com Stability : experimental Portability : POSIX -} module Main where import Devel import Devel.Args import Options.Applicative import System.Process (rawSystem) import Syste...
bitemyapp/wai-devel
src/Main.hs
gpl-3.0
1,279
0
13
391
263
131
132
26
4
module Classwork where import Data.Monoid newtype Endom a = Endom { appEndom :: a -> a }; instance Monoid (Endom a) where mempty = Endom id Endom f `mappend` Endom g = Endom $ f . g fn = mconcat $ map Endom [(+5), (*3), (^2)] fn' = mconcat $ map (Dual . Endom) [(+5), (*3), (^2)] {- instance (Monoid a) => M...
ItsLastDay/academic_university_2016-2018
subjects/Haskell/7/classwork.hs
gpl-3.0
1,195
0
11
340
587
328
259
29
2
{-# LANGUAGE TemplateHaskell #-} module Main where import Test.QuickCheck import Test.QuickCheck.Property import Test.QuickCheck.All import Control.Monad import Test.Utils.GeometryArbitraries import Test.Utils.GeometryData import GameLogic.Base.Geometry prop_inSegmentBounded _ = inSegment (minBound :: Int, maxBoun...
graninas/The-Amoeba-World
src/Amoeba/Test/GeometryTest.hs
gpl-3.0
2,846
0
12
721
954
494
460
58
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-kms/gen/Network/AWS/KMS/DisableKeyRotation.hs
mpl-2.0
3,264
0
9
675
359
220
139
48
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.AppState.Types.Sum -- Copyright : (c) 2015-2016 Brenda...
rueshyna/gogol
gogol-appstate/gen/Network/Google/AppState/Types/Sum.hs
mpl-2.0
600
0
4
109
29
25
4
8
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Agent/Intents/Patch.hs
mpl-2.0
7,082
0
19
1,627
1,026
597
429
148
1
module Codewars.Kata.DNA where import Codewars.Kata.DNA.Types -- data Base = A | T | G | C type DNA = [Base] change :: Base -> Base change A = T change T = A change G = C change C = G dnaStrand :: DNA -> DNA dnaStrand = (change <$>)
ice1000/OI-codes
codewars/1-100/complementary-dna.hs
agpl-3.0
236
0
5
53
83
49
34
10
1
--Syntax of Nominal Terms extended with atom substitutions module TrmX (Trm(..) , FreshAtms , Rule , Prm , Atm , Var , Fun , Ctx , Ctxs , CtxD , Asb , VSub , TrmCtx , anAtmTrm , aVarTrm , anAbs...
susoDominguez/eNominalTerms-Alpha
TrmX.hs
unlicense
4,751
0
14
1,235
1,279
713
566
93
3
d::Int->Double d 1 = 1.0 d k = d (k-1) * sqrt (1 / (2*(1+cos(pi/3/(2^^(k-1)))))) s::Int->Double s 1 = 2*d 1 s k = (2^(k)) * (d k) --s (k-1) - d (k-1) + 2 * (d k) phi = (1.0+sqrt(5))/2.0
Crazycolorz5/Haskell-Code
Delaunay Fractal.hs
unlicense
187
3
19
42
189
90
99
7
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Kubernetes.V1.EmptyDirVolumeSource where import GHC.Generics import Data.Text import qualified Data.Aeson -- | EmptyDirVolumeSource is tempora...
minhdoboi/deprecated-openshift-haskell-api
kubernetes/lib/Kubernetes/V1/EmptyDirVolumeSource.hs
apache-2.0
821
0
9
108
83
50
33
14
0
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies, RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Types -- Copyright : (c) Simon Ma...
randen/haddock
haddock-api/src/Haddock/Types.hs
bsd-2-clause
22,504
0
13
5,579
4,280
2,436
1,844
427
5
maxp [] = (Nothing, Nothing) maxp (x:[]) = (Just x, Nothing) maxp (x:y:[]) | x > y = (Just x, Just y) | otherwise = (Just y, Just y) maxp (x:xs) = case maxp xs of (Just a, Just b) -> let x' = x + b; y' = a in if x' > y' then (Just x', Just y') else (Just y', Just y') rob = uncurry max . maxp
wangbj/leet
198.hs
bsd-2-clause
306
0
12
84
216
110
106
9
2
upd (r, g, y, b) 'R' = (succ r, g, y, b) upd (r, g, y, b) 'G' = (r, succ g, y, b) upd (r, g, y, b) 'Y' = (r, g, succ y, b) upd (r, g, y, b) 'B' = (r, g, y, succ b) slv (r, g, y, b) [] = r == g && y == b slv (r, g, y, b) (c : cs) = if abs (r' - g') > 1 || abs (y' - b') > 1 then False else slv acc cs...
pbl64k/HackerRank-Contests
2014-10-10-FP/SequenceFullOfColors/sfoc.accepted.hs
bsd-2-clause
522
0
11
184
374
210
164
16
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS -fno-warn-orphans #-} module Dixi.Forms where import Servant.API import Text.Read #ifdef OLDBASE import Control.Applicative #endif import qualified Data.Text as T import Dixi.API instance FromFormU...
liamoc/dixi
Dixi/Forms.hs
bsd-3-clause
1,055
0
13
231
346
183
163
19
0