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 DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.DynamicWorkspaceOrder -- Copyright : (c) Brent Yorgey 2009 -- License : BSD-style (see LICENSE) -- -- Maintainer : <byorgey@gmail.com> -- Stability : expe...
MasseR/xmonadcontrib
XMonad/Actions/DynamicWorkspaceOrder.hs
bsd-3-clause
5,997
0
20
1,150
1,010
560
450
66
2
module Main where import GHC import Scion import MonadUtils ( liftIO ) import qualified StringBuffer as SB import Outputable import HscTypes import Data.Maybe import Control.Monad import System.Environment main = runScion $ do [working_dir, dist_dir] <- io $ getArgs setWorkingDir working_dir liftIO $ print wor...
CristhianMotoche/scion
examples/GetImports.hs
bsd-3-clause
701
0
20
152
211
106
105
23
1
-- | Descripitons of items. module Game.LambdaHack.Common.ItemDescription ( partItemN, partItem, partItemWs, partItemAW, partItemMediumAW, partItemWownW , itemDesc, textAllAE, viewItem ) where import Data.List import Data.Maybe import Data.Text (Text) import qualified Data.Text as T import qualified NLP.Miniutte...
Concomitant/LambdaHack
Game/LambdaHack/Common/ItemDescription.hs
bsd-3-clause
9,060
0
28
3,070
2,696
1,396
1,300
-1
-1
{-# LANGUAGE QuasiQuotes #-} import JSON main :: IO () main = do let twelve = 12::Int; name = "mr_konn" print $ [js| {ident: `twelve, name: `name} |] print $ [js| {ident: `twelve, name `name } |] -- cause a parse error.
nushio3/Paraiso
attic/QuasiQuote/MainJsonSyntaxError.hs
bsd-3-clause
228
0
9
50
61
36
25
7
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Defines tests of STG programs that are based on marshalling a value into -- the STG, forcing a value, and marshalling that value ...
quchen/stg
test/Testsuite/Test/Machine/Evaluate/TestTemplates/MarshalledValue.hs
bsd-3-clause
7,356
0
20
2,101
1,393
755
638
141
12
{-# LANGUAGE CPP, GADTs #-} -- See Note [Deprecations in Hoopl] in Hoopl module {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} module CmmBuildInfoTables ( CAFSet, CAFEnv, cafAnal , doSRTs, TopSRT, emptySRT, isEmptySRT, srtToData ) where #include "HsVersions.h" import Hoopl import Digraph import BlockId ...
snoyberg/ghc
compiler/cmm/CmmBuildInfoTables.hs
bsd-3-clause
14,357
0
19
3,776
3,412
1,784
1,628
216
9
-- This is a quick hack for uploading packages to Hackage. -- See http://hackage.haskell.org/trac/hackage/wiki/CabalUpload module Distribution.Client.Upload (check, upload, report) where import Distribution.Client.Types (Username(..), Password(..),Repo(..),RemoteRepo(..)) import Distribution.Client.HttpUtils ...
enolan/cabal
cabal-install/Distribution/Client/Upload.hs
bsd-3-clause
4,804
0
30
1,264
1,298
660
638
86
3
<?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-SP"> <title>Passive Scan Rules | ZAP Extension</title> <maps> <homeID>top</homeID> <...
thc202/zap-extensions
addOns/pscanrules/src/main/javahelp/org/zaproxy/zap/extension/pscanrules/resources/help_sr_SP/helpset_sr_SP.hs
apache-2.0
979
78
66
160
415
210
205
-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="id-ID"> <title>Menu Online | Eksistensi ZAP</title> <maps> <homeID>top</homeID> <mapref...
thc202/zap-extensions
addOns/onlineMenu/src/main/javahelp/org/zaproxy/zap/extension/onlineMenu/resources/help_id_ID/helpset_id_ID.hs
apache-2.0
978
78
66
159
413
209
204
-1
-1
module RmOneParameter.A1 where import RmOneParameter.D1 sumSq xs ys= sum (map sq xs) + sumSquares xs main = sumSq [1..4]
RefactoringTools/HaRe
test/testdata/RmOneParameter/A1.expected.hs
bsd-3-clause
125
0
8
23
52
27
25
4
1
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : IDE.Command.VCS.SVN -- Copyright : 2007-2011 Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GPL Nothing -- -- Maintainer : maintainer@leksah.org -- Stability : pro...
573/leksah
src/IDE/Command/VCS/SVN.hs
gpl-2.0
2,832
0
17
643
630
359
271
52
3
module Range (prop_rng5, myfoldl) where import Language.Haskell.Liquid.Prelude {-@ invariant {v:Int| v >= 0} @-} range :: Int -> Int -> [Int] range i j = range' (j - i) i j range' :: Int -> Int -> Int -> [Int] range' d i j | i < j = i : (range' (d-1) (i + 1) j) | otherwise = [] sumTo = foldl (+) 0 . r...
abakst/liquidhaskell
tests/pos/range.hs
bsd-3-clause
833
0
10
246
261
139
122
15
2
{-# LANGUAGE OverloadedStrings #-} {- Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) a...
gbataille/pandoc
src/Text/Pandoc/Writers/RST.hs
gpl-2.0
20,497
0
21
5,752
6,381
3,202
3,179
397
28
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} -- | High-level representation of SOACs. When performing -- SOAC-transformations, operating on normal 'Exp' values is somewhat -- of a nuisance, as they can represent terms that are not proper -- SOACs. In contrast, this module exposes a SOAC represent...
diku-dk/futhark
src/Futhark/Analysis/HORep/SOAC.hs
isc
26,861
0
25
6,920
7,311
3,729
3,582
503
5
import Data.Char (toLower, isSpace) palindromePermutation :: String -> Bool palindromePermutation s = length oddLetters <= 1 where cleanString = filter (not . isSpace) $ map toLower s oddLetters = odd cleanString [] odd [] acc = acc odd (x:xs) acc | x `elem` acc = odd xs (filter (/= x) acc) ...
Kiandr/CrackingCodingInterview
Haskell/src/chapter-1/palindrome-permutation.hs
mit
371
0
11
107
155
79
76
8
2
-- | 'Strive.Actions.Clubs' module Strive.Options.Clubs ( GetClubMembersOptions , GetClubActivitiesOptions(..) ) where import Data.Default (Default, def) import Data.Time.Clock (UTCTime) import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds) import Network.HTTP.Types (QueryLike, toQuery) import Strive.Internal.Opt...
tfausak/strive
source/library/Strive/Options/Clubs.hs
mit
1,494
0
13
253
291
173
118
33
0
{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE DataKinds #-} module Text.XML.Pugi.Foreign.Types where import Foreign.ForeignPtr import Foreign.Ptr import qualified Data.ByteString as S data MutableFlag = Mutable | Immutable data NodeKind = Element --...
philopon/pugixml-hs
Text/XML/Pugi/Foreign/Types.hs
mit
1,374
0
10
302
363
217
146
-1
-1
module Constants ( impConsonants , phonemeDistance ) where import ClassyPrelude import Data.Phoneme -- Impossible consonants filter -- True = impossible impConsonants :: Phoneme -> Bool impConsonants c@(Consonant p m h a) -- Silibants are restricted to these Places | p `notElem` [DENTIALVEOLAR, DENTAL, LAMINALAL...
Brightgalrs/con-lang-gen
src/Constants.hs
mit
13,519
0
19
2,513
3,952
2,082
1,870
-1
-1
module Step4 where import Text.Read (readMaybe) -- Подготовка к монадам -- чистые функции легко комбинировать pureFloor :: Double -> Int pureFloor x = floor x pureGt :: Int -> Bool pureGt y = y >= 0 pureShow :: Bool -> String pureShow z = "pureShow => " ++ show z -- all the chain pureTest :: Double -> String pure...
nlinker/haskell-you-could
src/Step4.hs
mit
2,982
0
17
590
667
362
305
46
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module Database.Neo4j.Batch.Node where import Data.String (fromString) import qualified Data.Aeson as J import qualified Data.Text as T import qualified Network.HTTP.Types as HT import qualified Database.Neo4j.Graph as G import Database.Neo4j....
asilvestre/haskell-neo4j-rest-client
src/Database/Neo4j/Batch/Node.hs
mit
2,494
0
10
456
670
368
302
40
1
{-# htermination sequence :: Monad m => [m a] -> m [a] #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_sequence_1.hs
mit
59
0
2
13
3
2
1
1
0
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import System.Exit (ExitCode(..), exitWith) import Sublist (Sublist(Equal, Sublist, Superlist, Unequal), sublist) exitProperly :: IO Counts -> IO () exitProperly m = do counts <- m exitWith $ if failures counts /= 0 || errors counts /= 0 then Ex...
tonyfischetti/exercism
haskell/sublist/sublist_test.hs
mit
2,167
0
12
483
660
335
325
50
2
module Method where import Attribute import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString as B import Data.Word import Data.Binary.Get data Method = Method { m_access_flags :: Word16, m_name_index :: Word16, m_descriptor_index :: Word16, m_attributes :: [Attrib...
cwgreene/javaclassreader
src/Method.hs
mit
753
0
10
162
199
107
92
24
1
-- | A neat idea. The type in this module WriterC is a Contravariant -- Functor which allows a user to easily combine writers in interesting -- fashion with the use of 'contramap'. It's not really necessary, but fun. module BACnet.Writer.WriterC where import BACnet.Writer.Core import BACnet.Writer import BACnet.Pr...
michaelgwelch/bacnet
src/BACnet/Writer/WriterC.hs
mit
1,637
0
8
240
361
198
163
-1
-1
{-# LANGUAGE FlexibleInstances #-} module Test.Data.Raft.Node where import qualified Data.Sequence as Seq import Test.QuickCheck.Instances () import Test.Tasty.QuickCheck import Data.Raft.Entry import Data.Raft.Log import Data.Raft.Node import ...
AndrewRademacher/zotac
test/Test/Data/Raft/Node.hs
mit
2,810
0
13
566
660
350
310
82
2
module AnalysisTests(allAnalysisTests, allModificationCountsTests) where import Data.Map as M import Analysis import TestUtils allAnalysisTests = do allModificationCountsTests allModificationCountsTests = do testFunction modificationCounts modCountsCases modCountsCases = [([], M.empty), ...
dillonhuff/GitVisualizer
test/AnalysisTests.hs
gpl-2.0
431
0
9
79
152
94
58
13
1
module DMARCAggregateReportTest where import Test.Framework (testGroup) import Test.Framework.Providers.HUnit import Test.HUnit import Data.Either (isRight) import Data.String (fromString) import System.Time (CalendarTime, ClockTime(TOD), toUTCTime) import qualified Data.ByteString.Lazy as LazyByteString (fromStrict...
splondike/dmarc-check
src-test/DMARCAggregateReportTest.hs
gpl-2.0
2,763
0
10
622
339
186
153
29
2
{-# LANGUAGE NoMonomorphismRestriction #-} ----------------------------------------------------------------------------- -- | -- Module : -- Copyright : (c) 2013 Boyun Tang -- License : BSD-style -- Maintainer : tangboyun@hotmail.com -- Stability : experimental -- Portability : ghc -- -- -- --------------------------...
tangboyun/miranda
src/MiRanda/Diagram/Icon.hs
gpl-3.0
1,116
0
10
298
272
137
135
24
1
no :: a -> Bool no _ = False
hmemcpy/milewski-ctfp-pdf
src/content/1.5/code/haskell/snippet04.hs
gpl-3.0
28
0
5
8
18
9
9
2
1
module Common.AniTimer ( AniTimer, resetTimer, setTimer, advanceFrames ) where import Control.Monad.State data AniTimer = AniTimer { ttFrameSwap :: Double } deriving (Eq, Show) resetTimer :: AniTimer resetTimer = AniTimer {ttFrameSwap = 0} setTimer :: Double -> AniTimer setTimer delay = AniTimer {ttFrameSwap = de...
CLowcay/CC_Clones
src/Common/AniTimer.hs
gpl-3.0
777
12
14
141
299
163
136
21
3
-- 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/GridData/Fancy/ShadeGeneral.hs
gpl-3.0
1,930
0
10
485
249
145
104
37
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-youtube-reporting/gen/Network/Google/Resource/YouTubeReporting/Jobs/Reports/List.hs
mpl-2.0
7,926
0
23
1,917
1,235
709
526
172
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-codedeploy/gen/Network/AWS/CodeDeploy/CreateDeploymentGroup.hs
mpl-2.0
8,355
0
10
1,607
830
508
322
93
1
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Control.Monad (forM_) import Control.Exception.Base (bracket) -- For IsString / OverloadedStrings import Data.ByteString.Char8 (ByteString, unpack) import Data.ByteString.Lazy.Char8 () import Network.Socket import qualified Network.Arakoon.Client a...
NicolasT/harakoon
bin/demo.hs
lgpl-2.1
2,867
0
20
1,030
863
414
449
68
6
import Test.Hspec import Data.List import Digits digits_sum :: Integral x => x -> x digits_sum x = foldl (+) 0 (digits_list x) -- Tests + result print main = hspec $ do describe "Dummy" $ do it "dummy test" $ do True `shouldBe` True describe "Euler test" $ do it "2^15 digits sum" $...
orbitgray/ProjectEuler
haskell/016.hs
lgpl-3.0
509
0
21
153
183
89
94
15
1
module Util where import Test.QuickCheck halfSize :: (Int -> Gen a) -> Gen a halfSize m = sized $ \s -> resize (s `div` 2) (m s) divSize :: Int -> (Int -> Gen a) -> Gen a divSize d m = sized $ \s -> resize (s `div` d) (m s) coordss :: Int -> Int -> [[Int]] coordss n _ | n < 0 = [[]] coordss 0 d = [replicate d 0] co...
danr/structural-induction
test/Util.hs
lgpl-3.0
403
0
11
99
260
137
123
10
1
module Main where import Control.Concurrent (threadDelay, forkIO) import Control.Monad (liftM, when) import Control.Monad.Trans (liftIO) import qualified Graphics.UI.Gtk as GTK import Graphics.UI.Gtk.Builder (builderNew, builderAddFromFile, builderGetObject) import Data.Board (Board, newBoard, emptyBoard) import Int...
Sventimir/game-of-life
Main.hs
apache-2.0
5,064
0
18
1,473
1,613
811
802
97
5
module DVPMessage where import NetAddress data DVPVec = DVPVec {dvPAddr :: NetAddress, dvpCost :: Int} deriving Show type DVPMsg = [DVPVec]
hdb3/FP-Router
DVPMessage.hs
apache-2.0
141
0
8
22
40
26
14
4
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE UndecidableInstances #-} -- | Primitive Definitions for Compiler-Wide Terms. module Language.K3.Core.Common ( Identifier, Non...
DaMSL/K3
src/Language/K3/Core/Common.hs
apache-2.0
9,734
0
17
2,127
3,169
1,683
1,486
240
3
module Main where import Distribution.Text (display) import Paths_git_sanity (version) import System.Environment import System.Exit import Git.Sanity (analyze) name :: String name = "git-sanity" help :: IO () help = putStrLn $ unlines [ concat ["Usage: ", name, " [check [<revision range>]]" ] , " ...
aloiscochard/git-sanity
src/Main.hs
apache-2.0
1,625
0
15
514
365
197
168
42
7
module FractalFlame.Flam3.Types.Flame where import FractalFlame.Camera.Types.Camera import FractalFlame.Flam3.Types.Xform import FractalFlame.Flam3.Types.Color import FractalFlame.Palette.Types.Palette import FractalFlame.Types.Base import FractalFlame.Types.Size data FlameColors = ColorList [Color] | ColorPalette Pa...
anthezium/fractal_flame_renderer_haskell
FractalFlame/Flam3/Types/Flame.hs
bsd-2-clause
556
0
9
109
128
84
44
17
0
-- http://www.codewars.com/kata/54da539698b8a2ad76000228 module Codewars.Kata.TenMinuteWalk where isValidWalk :: String -> Bool isValidWalk walk = not (null w') && null w'' && f 'n' == f 's' && f 'e' == f 'w' where w' = drop 9 walk (_:w'') = w' f ch = length $ filter (==ch) walk
Bodigrim/katas
src/haskell/6-Take-a-Ten-Minute-Walk.hs
bsd-2-clause
295
0
12
63
115
58
57
6
1
{-# LANGUAGE RecordWildCards #-} ----------------------------------------------------------------------------- -- | -- Module : FFICXX.Generate.Code.Dependency -- Copyright : (c) 2011-2013 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Po...
Gabriel439/fficxx
lib/FFICXX/Generate/Code/Dependency.hs
bsd-2-clause
7,019
0
21
1,748
1,865
994
871
126
3
{-# LANGUAGE OverloadedStrings #-} module HEP.Automation.Model.Server.Type where import Control.Applicative import Data.Text.Encoding as E import Data.UUID import qualified Data.ByteString.Char8 as C import qualified Data.ByteString as B import Yesod.Dispatch import Text.Blaze import HEP.Automation.Model.Type -- impo...
wavewave/model-server
lib/HEP/Automation/Model/Server/Type.hs
bsd-2-clause
637
0
9
90
145
89
56
18
0
{-# OPTIONS_GHC -fno-cse #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main (main) where import Control.Exception (SomeException) import Control.Monad (when) import Control.Monad.CatchIO (try) import Control.Monad.Trans (liftIO) import qualified Data...
noteed/rescoyl
bin/rescoyl.hs
bsd-3-clause
4,318
0
13
870
1,059
551
508
122
1
{- -} import qualified Data.List as List import qualified Data.Ord as Ord import qualified Data.MemoCombinators as Memo import qualified Zora.List as ZList import Data.Maybe import System.Random type Card = String type Square = String type Roll = (Integer, Integer) sentinel_roll :: Roll sentinel_roll = (-1, -1) ...
bgwines/project-euler
src/solved/problem84.hs
bsd-3-clause
4,123
54
14
774
1,563
872
691
124
6
module Main where import qualified MainTools as T (main) import System.Environment (getArgs) main :: IO () main = getArgs >>= \(src : args) -> T.main ("-e" : "main" : [src]) args >>= putStr
YoshikuniJujo/toyhaskell_haskell
src/runtoy.hs
bsd-3-clause
193
0
11
36
81
47
34
6
1
------------------------------------------------------------------------------ -- | A DSL for generating SVG transform strings. ------------------------------------------------------------------------------ {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClass...
Soostone/hs-d3
src/Graphics/HSD3/D3/Style.hs
bsd-3-clause
2,710
0
13
773
676
336
340
63
2
{-# LANGUAGE UndecidableInstances , FlexibleInstances , MultiParamTypeClasses , KindSignatures , IncoherentInstances #-} module Annotation.HDebug where import Control.Applicative import Control.Category import Control.Monad.Trans import Annotation.HAnnotation import Generics.HigherOrder import Prelude hi...
sebastiaanvisser/islay
src/Annotation/HDebug.hs
bsd-3-clause
1,332
0
13
318
547
288
259
-1
-1
{-# LANGUAGE FlexibleContexts #-} -------------------------------------------------------------------------------- -- | -- Module : Network.OpenID.Utils -- Copyright : (c) Trevor Elliott, 2008 -- License : BSD3 -- -- Maintainer : -- Stability : -- Portability : -- module Network.OpenID.Utils ( -- * ...
substack/hsopenid
src/Network/OpenID/Utils.hs
bsd-3-clause
3,423
0
10
704
863
473
390
64
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -- |Pretty instances for some basic Haskell types and for data type models module ZM.Pretty ( module Data.Model.Pretty ,...
tittoassini/typed
src/ZM/Pretty.hs
bsd-3-clause
9,365
0
15
2,479
2,268
1,214
1,054
171
3
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} module Bytecode.Definition where import Bytecode.Instruction import qualified Data.Foldable as Foldable import qualified Data.Traversable as Traversable data Definition symbol = Definition ...
exFalso/lambda
src/lib/Bytecode/Definition.hs
bsd-3-clause
745
0
9
132
132
79
53
16
0
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell [lq| permutations :: ts:[a] -> [[a]] / [(len ts), 1, 0] |] permutations :: [a] -> [[a]] permutations xs0 = xs0 : perms xs0 [] [lq| perms :: ts:[a] -> is:[a] -> [[a]] / [((len ts)+(len is)), 0, (len ts)] |] perms :: [a] -> [a] -> [[a]] perms [] ...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/Permutation.hs
bsd-3-clause
669
0
14
222
280
151
129
13
2
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Undecida...
sonyandy/wart
src/Control/Lens/Union/Generics.hs
bsd-3-clause
3,063
0
13
907
1,330
732
598
76
1
{-# LANGUAGE NoImplicitPrelude #-} module Data.Geodetic( module G ) where import Data.Geodetic.ECEF as G import Data.Geodetic.Ellipsoid as G import Data.Geodetic.EllipsoidReaderT as G import Data.Geodetic.HasDoubles as G import Data.Geodetic.LLH as G import Data.Geodetic.LL as G import Data.Geodetic.Sphere as G imp...
NICTA/coordinate
src/Data/Geodetic.hs
bsd-3-clause
346
0
4
46
77
57
20
11
0
{-# LANGUAGE NamedFieldPuns, OverloadedStrings #-} module MusicPad.Model.Verse where import MusicPad.Env import Prelude () import qualified Prelude as P import MusicPad.Model.Sample mod_verse_at :: Game State -> Int -> (Verse -> Verse) -> IO () mod_verse_at g i f = do with_state g - \_state -> do let verse_i...
nfjinjing/level5
src/MusicPad/Model/Verse.hs
bsd-3-clause
2,568
0
22
550
854
417
437
-1
-1
module App.Views.Posts.New where import Config.Master import Turbinado.View import Turbinado.View.Helpers import Control.Monad.Trans markup :: View XML markup = <div> <h1>New Post </h1> <form action=(getViewDataValue_u "save-url" :: View String) method="post"> Title : ...
abuiles/turbinado-blog
tmp/compiled/App/Views/Posts/New.hs
bsd-3-clause
691
31
20
268
215
110
105
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} module Tests.Hakit.TestHakit where import Test.HUnit import Hakit import qualified Data.Text as T want what got verdict = assertBool (show what ++ "\n" ++ show got) verdict cases1 = [ (["author" .- ["name" .- "Joe", "age" .- 30]], ...
crufter/hakit
tests/hakit/testHakit.hs
bsd-3-clause
4,973
0
18
2,415
1,746
968
778
145
1
{-# LANGUAGE OverloadedStrings #-} module Main where import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.IO as T import Clay hiding (div,filter) import qualified Clay as C import Clay.Property as CP import Clay.Filter as CF import Control.Arrow ((>>>)) import qualified Clay.Stylesheet as CC main :: IO...
kiripon/gh-pages
css/syntax.hs
bsd-3-clause
1,509
0
12
357
511
280
231
50
1
{-# OPTIONS_GHC -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.C.Types -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : ffi@haskell.org -- Stabilit...
alekar/hugs
packages/base/Foreign/C/Types.hs
bsd-3-clause
11,978
14
6
1,984
746
467
279
-1
-1
module Data.Students where import Data.Semester {- | 'Students' represents a group of semester-groups which take part in a lecture -} data Students = Students { semester :: [Semester] , count :: Int } deriving (Show,Eq) instance Num Students where Students a...
spirit-fhs/core
Data/Students.hs
bsd-3-clause
733
0
9
223
290
141
149
16
0
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-} {-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} module Schema where import Database.Persist import Database.Persist.Postgresql import Database.Persist.TH (mkPersist, mkMigrate, p...
keithduncan/chatterbox
src/db/Schema.hs
mit
591
0
7
83
75
47
28
10
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 \section[PatSyn]{@PatSyn@: Pattern synonyms} -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module Eta.BasicTypes.PatSyn ( -- * Main data types PatSyn, mkPatSyn, -- ** Type deconstruction patSynNa...
rahulmutt/ghcvm
compiler/Eta/BasicTypes/PatSyn.hs
bsd-3-clause
12,214
0
14
3,773
1,461
887
574
134
1
-- | -- Module: Data.STM.TCursor -- Copyright: (c) Joseph Adams 2012 -- License: BSD3 -- Maintainer: joeyadams3.14159@gmail.com -- Portability: Requires STM -- -- This module provides an API very similar to "Control.Concurrent.STM.TChan". -- However, unlike 'TChan': -- -- * It is based on "Data.STM.TL...
abailly/kontiki
ring-buffer/src/Data/STM/TCursor.hs
bsd-3-clause
3,874
0
13
849
565
316
249
45
1
{-# LANGUAGE DefaultSignatures, RecordWildCards #-} module Servant.Server.Auth.Token.Persistent.Schema where import Data.Text import Data.Time import Database.Persist.Sql (Key, SqlBackend, ToBackendKey, fromSqlKey, toSqlKey) import Database.Persist.TH import GHC.Generics (Generic) ...
ivan-m/servant-auth-token
servant-auth-token-persistent/src/Servant/Server/Auth/Token/Persistent/Schema.hs
bsd-3-clause
6,866
0
11
1,861
1,043
580
463
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Fix -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2002 -- License : BSD-style (see the file libraries/base/LICENSE) -- Maintainer : libraries@...
kaoskorobase/mescaline
resources/hugs/packages/base/Control/Monad/Fix.hs
gpl-3.0
2,333
8
12
531
350
202
148
24
1
module Journal ( appendEntry , newJournal , removeJournal , viewJournal ) where import Entry import Control.Monad import Control.Monad.IO.Class import Data.Time.LocalTime import System.Console.Haskeline import System.Directory import System.IO import System.IO.Error -- Utility Functions journalF...
dwnusbaum/log
Journal.hs
bsd-2-clause
2,016
0
17
544
631
311
320
48
4
----------------------------------------------------------------------------- -- | -- DEPRECATED: use @Language.Haskell.Interpreter.Unsafe@ instead. ----------------------------------------------------------------------------- module Language.Haskell.Interpreter.GHC.Unsafe {-# DEPRECATED "Import Language.Haskell.Interp...
konn/hint-forked
src/Language/Haskell/Interpreter/GHC/Unsafe.hs
bsd-3-clause
449
0
5
30
31
24
7
5
0
module TestRec where import Prelude hiding (foldl) data L a = N | C { hd :: a , tl :: L a } {-@ data L [llen] a = N | C { hd :: a , tl :: L a } @-} {-@ invariant {v:L a | 0 <= llen v} @-} {-@ measure llen @-} llen :: L a -> Int llen N = 0 llen (C x xs) = 1 + l...
ssaavedra/liquidhaskell
tests/pos/testRec.hs
bsd-3-clause
547
0
9
222
206
108
98
13
2
module Database.Persist.Types ( module Database.Persist.Types.Base , SomePersistField (..) , Update (..) , BackendSpecificUpdate , SelectOpt (..) , Filter (..) , FilterValue (..) , BackendSpecificFilter , Key , Entity (..) ) where import Database.Persist.Types.Base import Da...
creichert/persistent
persistent/Database/Persist/Types.hs
mit
398
0
5
82
89
63
26
14
0
<?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="es-ES"> <title>Common Library</title> <maps> <homeID>commonlib</homeID> <mapref locatio...
thc202/zap-extensions
addOns/commonlib/src/main/javahelp/help_es_ES/helpset_es_ES.hs
apache-2.0
965
77
66
156
407
206
201
-1
-1
{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds #-} class C a where type T (n :: a) instance C a => C b => C (a, b) where type T '(n, m) = (T n, T m) -- but this worked fine: -- -- instance (C a, C b) => C (a, b) where -- type T '(n, m) = (T n, T m)
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T16394.hs
bsd-3-clause
263
5
7
75
71
42
29
-1
-1
{-# LANGUAGE UnboxedTuples #-} module T14740 where x :: ((##)) => () x = ()
shlevy/ghc
testsuite/tests/parser/should_fail/T14740.hs
bsd-3-clause
78
0
6
17
28
18
10
-1
-1
module Deadlock where import Distribution.TestSuite import Lib tests :: IO [Test] tests = return [nullt x | x <- [1 .. 1000]]
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/tests/PackageTests/TestSuiteTests/LibV09/tests/Deadlock.hs
bsd-3-clause
130
0
9
26
51
29
22
5
1
{-# LANGUAGE Arrows #-} module T5022 ( pIterate ) where import Prelude hiding ( init ) returnA :: b -> b returnA = id ------------ newtype State s a = State { unState :: [a] } ------------ pIterate :: a -> [a] pIterate = proc x -> do rec as <- unState -< s let s = State (x:as) return...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/arrows/should_compile/T5022.hs
bsd-3-clause
328
1
15
98
117
67
50
13
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.HTMLHRElement ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.HTMLHRElement #else module Graphics.UI.Gtk.WebKit.DOM.HTMLHRElement #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) ||...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/HTMLHRElement.hs
mit
450
0
5
39
33
26
7
4
0
import Data.Maybe -- If on day 1 we deposit x and on day 2 we deposit y, then the balance is: -- -- Day | Balance -- ---------------------- -- 1 | x -- 2 | x + y -- 3 | 2x + y -- 4 | 3x + 2y -- 5 | 5x + 3y -- ................ -- n | F_n * x + F_{n-1}...
mihaimaruseac/blog-demos
mpmp/6/main.hs
mit
2,006
3
9
525
405
230
175
24
1
{-# LANGUAGE CPP, OverloadedStrings, ForeignFunctionInterface, QuasiQuotes #-} module TankGauge where import JavaScript.Canvas import GHCJS.Foreign import Control.Applicative import Control.Concurrent import GHCJS.Foreign.QQ import Data.Text import Text.Printf newtype Scale = Scale { unScale :: (Int, Int) } deriving...
plow-technologies/shakespeare-dynamic
ghcjs-shakespeare-dynamic/example/TankGauge.hs
mit
5,628
0
16
1,171
1,806
913
893
140
2
module Ch2Probs where {----1----------- *Ch2Prob> (2^3)*4 32 *Ch2Prob> 2^3*4 32 *Ch2Prob> (2^3*4) 32 *Ch2Prob> 2^(3*4) 4096 ------2--------- *Ch2Prob> 2*3 + 4*5 26 *Ch2Prob> 2*(3 + 4)*5 70 *Ch2Prob> (2*3 + 4)*5 50 *Ch2Prob> 2*(3 + 4*5) 46 -------3---------- *Ch2Prob> 2+3*4^5 3074 *Ch2Prob> (2+3*4)^5 537824 *Ch2Prob> ...
HaskellForCats/HaskellForCats
MenaBeginning/Ch002-Ch03/ch2Probs.hs
mit
1,796
0
13
761
225
125
100
12
1
module Main where import Network.IRC.Client.Core import Prelude -- | main function main :: IO () main = defaultMain
cosmo0920/hs-IRC
hs-IRC.hs
mit
117
0
6
19
30
19
11
5
1
import Control.Monad.Writer newtype DiffList a = DiffList {getDiffList :: [a] -> [a]} toDiffList :: [a] -> DiffList a toDiffList xs = DiffList (xs++) fromDiffList :: DiffList a -> [a] fromDiffList (DiffList f) = f [] instance Monoid (DiffList a) where mempty = DiffList (\xs -> [] ++ xs) (Dif...
RAFIRAF/HASKELL
For a Few Monads More/finalCountdown.hs
mit
765
0
11
204
251
134
117
15
1
{-# LANGUAGE LambdaCase, TupleSections, OverloadedStrings #-} {-# LANGUAGE TypeFamilies, FlexibleContexts #-} module HFish.Parser.Parser where import qualified HFish.Parser.Redirect as Redirect import HFish.Parser.Common import HFish.Parser.Gen import HFish.Parser.Glob import Fish.Lang import Fish.Lang.Unit import Te...
xaverdh/hfish-parser
HFish/Parser/Parser.hs
mit
7,962
0
17
2,247
3,210
1,622
1,588
283
16
module Wrapper where import Data.Char import Data.List import Data.Maybe import System.Random import DataTypes import FleetParser data Interface = Interface { iEmptyField :: Field , iEmptyFleet :: Fleet , iExampleFleet :: Fleet , iShootAtCoordinate :: Field -> Coord -> Fleet -> (Field, Int) , iAllShipsSunke...
tdeekens/tda452-code
Lab-4-Submission/Wrapper.hs
mit
3,296
2
22
1,111
1,105
549
556
83
5
{-# LANGUAGE TupleSections, RecordWildCards, TemplateHaskell #-} module Outer.Types where import Data.Data import Data.Functor import Data.List import Data.Foldable (foldlM) import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) import qualified Data.Set as Set import Control.Monad.State import ...
QuickChick/Luck
luck/src/Outer/Types.hs
mit
20,882
0
21
5,313
8,003
4,037
3,966
446
4
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGStyleElement (js_setDisabled, setDisabled, js_getDisabled, getDisabled, js_setType, setType, js_getType, getType, js_setMedia, setMedia, js_getMedia, getMedia, js_setTitle, setTitle, js_g...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGStyleElement.hs
mit
4,181
56
10
602
981
556
425
59
1
module Main where import Hanabi.Client main :: IO () main = startClient
TimoFreiberg/hanabi
app/Main.hs
mit
74
0
6
14
24
14
10
4
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -- | This module implements generation of fractals based on other noise modules. module Graphics.Ninja.Noise.Fractal ( fBm ) where import Graphics.Ninja.Noise.Types -- | Fracta...
fatho/ninja
src/Graphics/Ninja/Noise/Fractal.hs
mit
960
0
18
209
260
139
121
13
1
-- Functions from http://learnyouahaskell.com/starting-out doubleMe x = x*2 doubleUs x y = x*2 + y*2 -- Could also be doubleUs x y = doubleMe x + doubleMe y -- a function that multiplies a number by 2 but only if -- that number is smaller than or equal to 100 doubleSmallNumber x = if x > 100 then x else doubleM...
jeiros/Haskell-Tutorial
functions_page1.hs
mit
1,847
4
12
395
407
231
176
11
2
{- - Find the K'th element of a list. The first element in the list is number - 1. -} elementAt :: [a] -> Int -> a elementAt (x:xs) 1 = x elementAt (x:xs) ind | ind <= 0 = error "Invalid index." | otherwise = elementAt xs (ind-1)
LucianU/99problems
P3.hs
mit
238
0
8
57
86
43
43
5
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} -- |A bridge between the JuicyPixels and colour packages -- will result in a own module later on module JuicySRGB where ...
MaxDaten/yage-contrib
src/JuicySRGB.hs
mit
6,435
0
12
1,558
1,783
950
833
110
1
module Render where
mfpi/q-inqu
tools/asp/Render.hs
mit
21
0
2
4
4
3
1
1
0
import Database.HDBC import Database.HDBC.PostgreSQL import Control.Monad import Text.CSV import DBGrader.Questions import DBGrader.Types import DBGrader.Config import DBGrader.Students main :: IO () main = do -- Print header printLine "name" -- Name of student. "question" -- Question name...
GarrisonJ/DBGrader
GetStudentAnswers.hs
mit
6,523
0
22
2,747
1,320
664
656
105
8
{-# LANGUAGE OverloadedStrings #-} module Network.Wai.Middleware.OAuth2 (login, callback, basicCallback, getJSON, OAuth2, appendQueryParam, QueryParams, CheckState, OAuth2Result, AccessToken) where import Network.Wai import Network.OAuth.OAuth2 import qualified Data.ByteString.Char8 as BSC8 import qualified Data.ByteS...
NerdGGuy/wai-middleware-oauth2
src/Network/Wai/Middleware/OAuth2.hs
mit
3,033
0
13
619
751
399
352
54
1
module Language.PiCalc.Analysis.PetriNet(module PetriNet) where import Data.List(partition) import Data.Map(Map) import qualified Data.Map as Map import Data.Set(Set) import qualified Data.Set as Set -- TODO: add places :: Set pl field for efficiency newtype PN pl = PN { -- rules :: [(Map pl TokenNum, Map pl Tok...
bordaigorl/jamesbound
src/Language/PiCalc/Analysis/PetriNet.hs
gpl-2.0
5,505
0
12
1,387
1,940
987
953
91
6
data MonF a = MEmpty | MAppend a a
hmemcpy/milewski-ctfp-pdf
src/content/3.8/code/haskell/snippet02.hs
gpl-3.0
34
0
6
8
16
9
7
1
0
{-| Copyright : (c) Nathan Bloomfield, 2017 License : GPL-3 Maintainer : nbloomf@gmail.com Stability : experimental This module provides a filter for Hakyll which expands WordPress-style shortcodes. To use it, include the line @>>= applyShortcodes allServices@ in your compiler. -} module Hakyll.Shortcode ( Sho...
nbloomf/hakyll-shortcode
src/Hakyll/Shortcode.hs
gpl-3.0
1,564
0
10
252
251
146
105
32
4
{-# LANGUAGE RankNTypes #-} -- | -- Module : Aura.Utils -- Copyright : (c) Colin Woodbury, 2012 - 2020 -- License : GPL3 -- Maintainer: Colin Woodbury <colin@fosskers.ca> -- -- Utility functions specific to Aura. module Aura.Utils ( -- * Strings Pattern(..) , searchLines -- * Network , urlContents ...
aurapm/aura
aura/lib/Aura/Utils.hs
gpl-3.0
4,489
0
13
1,106
1,698
895
803
93
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-servicemanagement/gen/Network/Google/Resource/ServiceManagement/Services/Enable.hs
mpl-2.0
5,934
0
19
1,473
942
548
394
133
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-cloudprivatecatalogproducer/gen/Network/Google/Resource/CloudPrivateCatalogProducer/Catalogs/Products/Patch.hs
mpl-2.0
6,077
0
17
1,389
859
501
358
127
1
{-# LANGUAGE OverloadedStrings #-} import Data.Monoid ((<>)) import Data.Binary(encode, decode) import Data.Binary.Get (runGet, getWord16be, getWord32le) import Data.Binary.Put (runPut, putWord16be, putWord32le) import Data.IP (fromHostAddress, fromHostAddress6) import Data.ByteString (ByteString) import qualified Da...
scturtle/fun.hs
mylifesocks.hs
unlicense
2,306
0
22
615
746
395
351
49
3