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 CPP #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSect... | Blaisorblade/stack | src/Stack/Types/Config.hs | bsd-3-clause | 70,030 | 0 | 24 | 16,536 | 13,419 | 7,229 | 6,190 | -1 | -1 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
import Control.Applicative
import Language.Haskell.Liquid.Prelude
data LL a = N | C { head :: a, tail :: (LL a) }
[lq| data LL [llen] a = N | C { head :: a, tail :: (LL a) } |]
[lq| measure llen :: (LL a) -> Int
llen(N) = 0
llen(C x xs) = 1 + (llen x... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/data2.hs | bsd-3-clause | 668 | 0 | 10 | 188 | 180 | 103 | 77 | 13 | 1 |
module Main where
import Control.Lens((*~))
import Lib
import Graphics.Gloss
import Graphics.Gloss.Interface.IO.Game
import System.Exit(exitSuccess)
main :: IO ()
main = playIO
(InWindow windowTitle (screenX, screenY) (0, 0))
white
24
params
(return . toPicture . fractal)
eventHandler
(const return)
--... | sholland1/mandelbrot | app/Main.hs | bsd-3-clause | 1,407 | 0 | 10 | 265 | 481 | 258 | 223 | -1 | -1 |
module Main where
import Language.UHC.JScript.Assorted (alert)
import Language.UHC.JScript.Types (fromJS)
import Language.UHC.JScript.ECMA.String (JSString)
foreign import jscript "window.location.href"
windowHref :: JSString
main :: IO ()
main = alert (fromJS windowHref)
| norm2782/JCU | resources/static/hjs/testcases/alert.hs | bsd-3-clause | 279 | 1 | 7 | 34 | 73 | 45 | 28 | -1 | -1 |
module Main where
import Test.DocTest
main :: IO ()
main = doctest [ "-XOverloadedStrings"
, "-package=appar"
, "-package=byteorder"
, "-package=network"
, "Data/IP.hs"
, "Data/IP/RouteTable.hs"]
| kazu-yamamoto/iproute | test/doctests.hs | bsd-3-clause | 273 | 0 | 6 | 101 | 45 | 27 | 18 | 9 | 1 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleContexts,FlexibleInstances,
PatternSignatures, PatternGuards, RankNTypes, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.C.Analysis.TravMonad
-- Copyright... | acowley/language-c | src/Language/C/Analysis/TravMonad.hs | bsd-3-clause | 19,613 | 0 | 16 | 4,637 | 5,375 | 2,780 | 2,595 | 311 | 7 |
{-# LANGUAGE DeriveDataTypeable #-}
module LazyCrossCheck.NEList where
import Data.Typeable
data NEList a
= NENil a
| NECons a (NEList a)
deriving (Eq, Ord, Show, Read, Typeable)
neSnoc :: NEList a -> a -> NEList a
neSnoc xs a = go xs
where
go (NECons p ps) = NECons p (go ps)
go (NENil p) = NECons p ... | TristanAllwood/lazyCrossCheck | LazyCrossCheck/NEList.hs | bsd-3-clause | 331 | 0 | 9 | 79 | 144 | 74 | 70 | 11 | 2 |
module Iptables.Types.Arbitrary where
import Control.Applicative
import Data.Bits
import qualified Data.Set as Set
import Data.Word
import Iptables.Types
import Test.QuickCheck
instance Arbitrary Iptables where
arbitrary = do
userFilterChainsNum <- choose (0,4)
let uniqueChains :: [Chain] -> Bool
... | etarasov/iptables-helpers | src/Iptables/Types/Arbitrary.hs | bsd-3-clause | 9,647 | 0 | 16 | 4,274 | 2,194 | 1,108 | 1,086 | 211 | 2 |
module StateGame where
import Control.Monad.State
-- Example use of State monad
-- Passes a string of dictionary {a,b,c}
-- Game is to produce a number from the string.
-- By default the game is off, a C toggles the
-- game on and off. A 'a' gives +1 and a b gives -1.
-- E.g
-- 'ab' = 0
-- ... | dterei/Scraps | haskell/StateGame.hs | bsd-3-clause | 890 | 0 | 15 | 355 | 210 | 112 | 98 | 15 | 5 |
module Main (main) where
import Control.Monad (forM_)
import Data.List (isSuffixOf)
import System.Directory.PathWalk (pathWalkInterruptible, WalkStatus(..))
import System.Environment (getArgs)
main :: IO ()
main = do
rawArgs <- getArgs
let args = if rawArgs == [] then ["."] else rawArgs
forM_ args $ \arg -> do
... | chadaustin/pathwalk | examples/stoprecursing/Main.hs | mit | 597 | 0 | 19 | 148 | 205 | 107 | 98 | 18 | 3 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Buildsome.Meddling
( ThirdPartyMeddlingError(..), assertFileMTime, assertSameMTime
) where
import Prelude.Compat hiding (FilePath)
import Control.Monad
import Data.Typeable (Typeable)
import Lib.FileDesc (fileStatDescOfStat)
import Lib.... | sinelaw/buildsome | src/Buildsome/Meddling.hs | gpl-2.0 | 1,655 | 0 | 13 | 272 | 446 | 232 | 214 | 35 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Bot.Data.Config (getConfig) where
import qualified Data.ByteString as BS
import System.Directory (doesFileExist)
import Bot.Types (Config)
import Control.Exception (catch)
import Data.Yaml
import System.IO.Error
fallbackConfig :: FilePath
fallbackConfig = "config.yaml"
-- F... | urbanslug/nairobi-bot | src/Bot/Data/Config.hs | gpl-3.0 | 2,031 | 0 | 14 | 814 | 348 | 179 | 169 | 40 | 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-codedeploy/gen/Network/AWS/CodeDeploy/DeleteDeploymentGroup.hs | mpl-2.0 | 5,738 | 0 | 13 | 1,184 | 681 | 407 | 274 | 92 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-elb/gen/Network/AWS/ELB/DescribeLoadBalancerAttributes.hs | mpl-2.0 | 4,836 | 0 | 13 | 900 | 546 | 328 | 218 | 74 | 1 |
-- {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
-- Check that "->" is an instance of Eval
module ShouldSucceed where
instance Show (a->b) where
show _ = error "attempt to show function"
instance (Eq b) => Eq (a -> b) where
(==) f g = error "attempt to compare functions"
-- Since Eval... | rahulmutt/ghcvm | tests/suite/typecheck/compile/tc088.hs | bsd-3-clause | 791 | 0 | 9 | 336 | 257 | 131 | 126 | 13 | 0 |
module Main (main) where
main :: IO ()
main = putStrLn "Test suite not yet implemented."
| byteally/webapi | webapi-reflex-dom/test/Main.hs | bsd-3-clause | 90 | 0 | 6 | 17 | 27 | 15 | 12 | 3 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, PatternGuards #-}
{- Implements a proof state, some primitive tactics for manipulating
proofs, and some high level commands for introducing new theorems,
evaluation/checking inside the proof system, etc. --}
module Idris.Core.ProofState(ProofState(..), newP... | jeremy-w/Idris-dev | src/Idris/Core/ProofState.hs | bsd-3-clause | 50,394 | 0 | 32 | 19,901 | 18,858 | 9,580 | 9,278 | 954 | 34 |
{-# OPTIONS -fglasgow-exts #-}
module ShouldCompile where
f v = (\ (x :: forall a. a->a) -> x) id 'c'
| hvr/jhc | regress/tests/1_typecheck/2_pass/ghc/tc150.hs | mit | 104 | 0 | 11 | 22 | 42 | 24 | 18 | -1 | -1 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module T11401 where
import Data.Kind (Type)
newtype Value a = Value a
newtype CodeGen r a = CodeGen a
bind :: CodeGen r a -> (a -> CodeGen r b) -> CodeGen r b
bind (CodeGen a) k = k a
class
(f ~ CalledFunction... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/T11401.hs | bsd-3-clause | 1,126 | 0 | 10 | 264 | 479 | 250 | 229 | -1 | -1 |
{-# LANGUAGE Safe #-}
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Bifunctor
-- Copyright : (C) 2008-2014 Edward Kmett,
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : pr... | snoyberg/ghc | libraries/base/Data/Bifunctor.hs | bsd-3-clause | 2,993 | 0 | 10 | 717 | 805 | 467 | 338 | 33 | 0 |
module Dicom.StorageSOP.SCP where
| danplubell/dicom-network | library/Dicom/StorageSOP/SCP.hs | mit | 35 | 0 | 3 | 4 | 7 | 5 | 2 | 1 | 0 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Xonix | Keyboard/XoKeyboard.hs | mit | 2,851 | 25 | 15 | 626 | 743 | 432 | 311 | 31 | 3 |
module Hive.Coord where
import Data.Ix
newtype OffsetCoord = OffsetCoord (Int, Int) deriving (Eq, Show, Ord, Ix)
newtype AxialCoord = AxialCoord (Int, Int) deriving (Eq, Show, Ord, Ix)
newtype CubeCoord = CubeCoord (Int, Int, Int) deriving (Eq, Show, Ord)
(<+>) :: AxialCoord -> AxialCoord -> AxialCoord
(Axi... | bananu7/Hive | Hive/Coord.hs | mit | 2,059 | 0 | 17 | 788 | 745 | 416 | 329 | 47 | 2 |
module Handler.LogOut where
import Import
getLogOutR :: Handler Html
getLogOutR = do
deleteSession "_ID"
redirect HomeR
| cirquit/HaskellPie | HaskellPie/Handler/LogOut.hs | mit | 130 | 0 | 7 | 26 | 34 | 17 | 17 | 6 | 1 |
module Main where
import Test.DocTest
main :: IO ()
main = doctest ["Data/Time/Pretty.hs"]
| fpco/pretty-time | test/doctests.hs | mit | 93 | 0 | 6 | 15 | 30 | 17 | 13 | 4 | 1 |
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
-- | Reexports "Data.Functor.Sum.Compat"
-- from a globally unique namespace.
module Data.Functor.Sum.Compat.Repl (
module Data.Functor.Sum.Compat
) where
import "this" Data.Functor.Sum.Compat
| haskell-compat/base-compat | base-compat/src/Data/Functor/Sum/Compat/Repl.hs | mit | 296 | 0 | 5 | 31 | 31 | 24 | 7 | 5 | 0 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Hacking | codeJam/2009/welcome/welcome.hs | mit | 1,849 | 1 | 12 | 412 | 554 | 299 | 255 | 29 | 2 |
module Dianoga.Build.Compass where
import Development.Shake
compass :: [FilePath] -> Action ()
compass = cmd ("bundle exec compass compile" :: String)
| iand675/dianoga | src/Dianoga/Build/Compass.hs | mit | 153 | 0 | 7 | 22 | 43 | 25 | 18 | 4 | 1 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.MediaStreamTrack (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.MediaStreamTrack
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.MediaStre... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/MediaStreamTrack.hs | mit | 341 | 0 | 5 | 33 | 31 | 24 | 7 | 4 | 0 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGPatternElement
(js_getPatternUnits, getPatternUnits, js_getPatternContentUnits,
getPatternContentUnits, js_getPatternTransform,
getPatternTransform, js_getX, getX, js_getY, getY, js_getWi... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGPatternElement.hs | mit | 4,522 | 42 | 11 | 708 | 941 | 532 | 409 | 73 | 1 |
import Distribution.Simple
import Distribution.System
import Distribution.Simple.Program.Run
import Distribution.Verbosity
--try and find the correct file ending for the shared librar
fileEnding Windows = "dll"
fileEnding OSX = "dylib"
fileEnding Ghcjs = error "you need to handle this a tad differently"
fileEnding _ =... | JakeEhrlich/BlackMagic | Setup.hs | mit | 1,591 | 2 | 14 | 369 | 252 | 137 | 115 | 29 | 2 |
{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module KMC.Frontend.Commands where
import KMC.Frontend
import KMC.Frontend.Options
import KMC.Backtracking
import KMC.Determinization (sstFromFST)
import KMC.Kleenex.Actions
import KMC.Kleenex.Desugaring as DS
... | diku-kmc/repg | src/KMC/Frontend/Commands.hs | mit | 16,215 | 0 | 23 | 5,104 | 4,738 | 2,388 | 2,350 | 350 | 16 |
{-# OPTIONS #-}
-- ----------------------------------------------------------------------------
{- |
Module : Holumbus.Query.Processor
Copyright : Copyright (C) 2007, 2008 Timo B. Huebel
License : MIT
Maintainer : Timo B. Huebel (tbh@holumbus.org)
Stability : experimental
Portability: portable
... | ichistmeinname/holumbus | src/Holumbus/Query/Processor.hs | mit | 13,933 | 16 | 18 | 3,203 | 3,588 | 1,831 | 1,757 | 185 | 4 |
-- |Inter module contins internal functions used for block allocation
module Haskollider.Integer where
import Data.Bits
log2Floor :: Int -> Int
log2Floor x = recurRes x 0
where recurRes argX res = if shiftX > 0 then recurRes shiftX (res + 1) else res
where shiftX = (shiftR argX 1)
log2Ceil :: Int -> Int
log2Ceil... | ChadMcKinney/Haskollider | src/Haskollider/Integer.hs | gpl-2.0 | 560 | 2 | 11 | 113 | 202 | 113 | 89 | 11 | 2 |
{-|
Module : Network.Gopher.Util
Stability : experimental
Portability : POSIX
Helper utilities used within the library and the server which also could be useful for other application code.
-}
{-# LANGUAGE OverloadedStrings #-}
module Network.Gopher.Util (
-- * Security
sanitizePath
, sanitizeIfNotUrl
... | sternenseemann/spacecookie | src/Network/Gopher/Util.hs | gpl-3.0 | 2,918 | 0 | 13 | 593 | 609 | 341 | 268 | 59 | 2 |
{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, ConstraintKinds #-}
module Carnap.Languages.DefiniteDescription.Util where
import Carnap.Core.Data.Classes
import Carnap.Core.Unification.Unification
import Carnap.Core.Data.Types
import Carnap.Core.Dat... | gleachkr/Carnap | Carnap/src/Carnap/Languages/DefiniteDescription/Util.hs | gpl-3.0 | 3,003 | 0 | 25 | 951 | 824 | 424 | 400 | 46 | 5 |
{-# LANGUAGE OverloadedStrings #-}
module Jinzamomi.Driver.Krkr.TJS2IR (
compileStmt,
compileExpr
) where
import Language.KAG
import Language.TJS
import Control.Monad.State
import qualified Data.Text as T
import qualified Jinzamomi.Driver.IR as IR
import Data.Maybe (maybeToList, fromMaybe)
type Compile = State En... | ledyba/Jinzamomi | src/Jinzamomi/Driver/Krkr/TJS2IR.hs | gpl-3.0 | 14,481 | 0 | 26 | 3,219 | 5,849 | 2,878 | 2,971 | 309 | 7 |
-- | This wire specifies timeout behavior and arranges message queueing for carrying
-- out asynchronous operations within the context of a wire.
asyncWire :: Time -- Allotted time.
-> Wire (Maybe b) m (Maybe a) (Maybe b) -- Async operation.
-> (Maybe b, StrategyWire m a (Maybe b)) -- Response and wire to switch ... | frobnitzem/hack9p | src/Network/Plan9/Experimental.hs | gpl-3.0 | 1,581 | 49 | 12 | 391 | 516 | 278 | 238 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
module Main where
import qualified Data.Vector.Unboxed as VU
import Data.List
import Options.Applicative
import Prelude
import Hammer.MicroGraph
import Hammer.VTK
import Hammer.VoxBox
import Hammer.VoxConn
import ... | lostbean/Hammer | profile/Main.hs | gpl-3.0 | 8,991 | 0 | 19 | 2,335 | 6,853 | 4,386 | 2,467 | 201 | 5 |
-- | Interfaz gráfica de Fun.
module GUI.Gui where
import Graphics.UI.Gtk hiding (get)
import qualified Graphics.UI.Gtk as G
import Control.Lens
import Control.Monad
import Control.Monad.Trans.RWS
import Data.Text (pack)
import Data.Reference
import Data.Maybe
import GUI.File
import GUI.GState
import GUI.SymbolList... | alexgadea/fun-gui | GUI/Gui.hs | gpl-3.0 | 10,151 | 0 | 17 | 3,294 | 2,116 | 973 | 1,143 | 168 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Hoodle.ModelAction.Layer
-- Copyright : (c) 2011-2013 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
---------------------... | wavewave/hoodle-core | src/Hoodle/ModelAction/Layer.hs | gpl-3.0 | 1,901 | 0 | 16 | 411 | 441 | 232 | 209 | 34 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Interface for JSON-RPC.
module Network.JSONRPC.Interface
( -- * Establish JSON-RPC context
JSONRPCT
, runJSONRPCT
-... | xenog/json-rpc | src/Network/JSONRPC/Interface.hs | unlicense | 14,277 | 0 | 24 | 5,201 | 3,676 | 1,795 | 1,881 | 301 | 16 |
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE LambdaCase #-}
-- |General stuff on which other modules depend.
module Types.World where
import Data.Default
import qualifi... | jtapolczai/wumpus | Types/World.hs | apache-2.0 | 12,050 | 0 | 25 | 2,758 | 2,593 | 1,420 | 1,173 | 211 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QNetworkInterface.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:36
Warning : this file is machine generated ... | uduki/hsQt | Qtc/Enums/Network/QNetworkInterface.hs | bsd-2-clause | 4,811 | 0 | 18 | 1,025 | 1,244 | 630 | 614 | 118 | 1 |
module Main where
import Gen
main :: IO ()
main = do
putStrLn "start"
jetpackGen
putStrLn "end"
| rvion/ride | jetpack-gen/app/Main.hs | bsd-3-clause | 114 | 0 | 7 | 35 | 37 | 18 | 19 | 7 | 1 |
module Sexy.Data.Basics (
const
, asTypeOf
, asTypeIn
, asAppliedTo
, undefined
, (.:)
, fst
, snd
, flip
, const2
, module X
) where
import Prelude as X (seq, error)
(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
(.:) f g x y = f (g x y)
fst :: (a,b) -> a
fst (x,_) = x
snd :: (a,b) -> b... | DanBurton/sexy | src/Sexy/Data/Basics.hs | bsd-3-clause | 677 | 0 | 9 | 206 | 368 | 209 | 159 | 33 | 1 |
{-# LANGUAGE CPP, OverloadedStrings, FlexibleContexts #-}
module GitYrp
( gitDashYrpMain
, getCoverLetterFilename
, cutOffBlurb
)
where
import qualified Data.Ini as DI
import qualified Data.Foldable as DF
import qualified Data.String.Utils as DSU
import qualified Data.Text ... | yaccz/git-yrp | src/GitYrp/GitYrp.hs | bsd-3-clause | 9,909 | 1 | 18 | 3,136 | 2,930 | 1,457 | 1,473 | 259 | 3 |
-- |The 'Environment' constrains the movement of the rover.
-- It consists of the 'Plateau' and the other rovers.
module Environment
(
Plateau(),PlateauOrError,PlateauError(..),mkPlateau,plateauRight,plateauTop,outside,
Environment(..),mkEmptyEnvironment,addRover,
ObstacleType(..),obstacleAt... | garethrowlands/marsrover | src/Environment.hs | bsd-3-clause | 2,874 | 0 | 11 | 579 | 552 | 312 | 240 | 42 | 1 |
-- | Parse command lines with /options/ that might take multiple
-- /option arguments/.
--
-- I built this library could not find anything that would readily
-- parse command lines where the /options/ took more than one
-- /option argument/. For example, for the @tail@ command on GNU systems, the
-- @--lines@ /option/ ... | massysett/multiarg | lib/Multiarg.hs | bsd-3-clause | 1,567 | 0 | 5 | 266 | 60 | 49 | 11 | 7 | 0 |
{-# LANGUAGE KindSignatures, LambdaCase, NamedFieldPuns, RecordWildCards,
TemplateHaskell, TupleSections #-}
module Test.Game.Ur where
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Internal.Property as HIP
import qualified Hedgehog.Range as Range
import qua... | taksuyu/game-of-ur | tests/Test/Game/Ur.hs | bsd-3-clause | 10,093 | 0 | 21 | 3,115 | 1,727 | 955 | 772 | 115 | 2 |
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
module Zabt.Internal.Term where
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromMaybe)
import Zabt.Internal.Index
import Zab... | tel/hs-zabt | src/Zabt/Internal/Term.hs | bsd-3-clause | 3,514 | 0 | 18 | 846 | 1,359 | 686 | 673 | 64 | 4 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Type where
import Data.Aeson (ToJSON (..), FromJSON (..), object, (.=), withObject, (.:))
import Data.Text (Text)
import Database.Bolt (Record, Value (..), RecordValue (..), Node (..), at)
data Movie = Movie { _id :: Int
... | tschacht/4e-poc | src/Type.hs | bsd-3-clause | 4,296 | 0 | 13 | 1,677 | 1,320 | 717 | 603 | 85 | 1 |
{-
(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 #-}
module TcMType (
TcTyVar, TcKind, TcType, TcTauType, TcThetaType, TcTyVarSet,
-... | gcampax/ghc | compiler/typecheck/TcMType.hs | bsd-3-clause | 39,028 | 10 | 21 | 11,140 | 7,439 | 3,869 | 3,570 | -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.Dimensions.RO
( allDimensions
) where
import Duckling.Dimensions.Types
allDimensions :: [Se... | facebookincubator/duckling | Duckling/Dimensions/RO.hs | bsd-3-clause | 493 | 0 | 6 | 100 | 87 | 50 | 37 | 13 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles
-- Copyright : (c) Sven Panne 2002-2005
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- Stability : ... | FranklinChen/hugs98-plus-Sep2006 | packages/OpenGL/Graphics/Rendering/OpenGL/GL/PixelRectangles.hs | bsd-3-clause | 1,643 | 0 | 5 | 137 | 177 | 142 | 35 | 17 | 0 |
{-# LANGUAGE UnicodeSyntax #-}
-----------------------------------------------------------------------------------------------------------------------
-- |
-- Module : Massive.Database.MongoDB
-- Copyright : (C) 2012 Massive T... | HalfWayMan/mt-mongodb | src/Massive/Database/MongoDB.hs | bsd-3-clause | 1,538 | 0 | 5 | 438 | 140 | 105 | 35 | 17 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
--
-- Regs.hs --- Flash peripheral registers
--
-- Copyright (C) 2014, Galois, Inc.
-- All Rights Reserved.
--
module Ivory.BSP.STM32.Peripheral.Flash.Regs where
import Ivory.Language
-- ... | GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/Peripheral/Flash/Regs.hs | bsd-3-clause | 2,511 | 0 | 4 | 699 | 73 | 57 | 16 | 12 | 0 |
{-# LANGUAGE TemplateHaskell #-}
-- |
-- Module: Database.PostgreSQL.Store.Utilities
-- Copyright: (c) Ole Krüger 2016
-- License: BSD3
-- Maintainer: Ole Krüger <ole@vprsm.de>
module Database.PostgreSQL.Store.Utilities (
showByteString,
readByteString,
buildByteString,
liftByteString
) where
import ... | vapourismo/pg-store | src/Database/PostgreSQL/Store/Utilities.hs | bsd-3-clause | 1,342 | 16 | 8 | 315 | 283 | 176 | 107 | 29 | 3 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANG... | sjakobi/stack | src/Stack/Types/StackT.hs | bsd-3-clause | 14,366 | 0 | 24 | 4,393 | 3,143 | 1,604 | 1,539 | 309 | 7 |
module Graphics.Gnuplot.Frame.Option (
-- hide Cons constructor
T,
custom,
title,
grid,
size,
key,
border,
pm3d,
view,
xRange,
yRange,
zRange,
xLabel,
yLabel,
zLabel,
xTicks,
yTicks,
zTicks,
xData,
yData,
zData,
xFormat,
yFormat,
zFormat,... | wavewave/gnuplot | src/Graphics/Gnuplot/Frame/Option.hs | bsd-3-clause | 390 | 0 | 4 | 126 | 94 | 64 | 30 | 27 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-swf/gen/Network/AWS/SWF/GetWorkflowExecutionHistory.hs | mpl-2.0 | 8,416 | 0 | 12 | 1,655 | 917 | 552 | 365 | 96 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for Network Queries.
-}
{-
Copyright (C) 2013 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. Redi... | bitemyapp/ganeti | test/hs/Test/Ganeti/Query/Network.hs | bsd-2-clause | 3,306 | 0 | 13 | 528 | 415 | 226 | 189 | 40 | 1 |
{-# OPTIONS_GHC -Wwarn #-}
{-# LANGUAGE BangPatterns #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Interface.LexParseRn
-- Copyright : (c) Isaac Dupree 2009,
-- Mateusz Kowalczyk 2013
-- License : BSD-like
--
-- Maintainer ... | jgm/haddock | src/Haddock/Interface/LexParseRn.hs | bsd-2-clause | 5,249 | 0 | 22 | 1,324 | 1,420 | 705 | 715 | 105 | 25 |
--------------------------------------------------------------------
-- |
-- Copyright : (c) Dan Doel 2014
-- License : BSD2
-- Maintainer: Dan Doel <dan.doel@gmail.com>
-- Stability : experimental
-- Portability: non-portable
--------------------------------------------------------------------
module Ermine.Bu... | PipocaQuemada/ermine | src/Ermine/Builtin/Head.hs | bsd-2-clause | 681 | 0 | 6 | 103 | 147 | 88 | 59 | 13 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
-- A class for monads with mutable references
module Control.Monad.Adaptive.Ref where
import Control.Monad.ST
import Data.IORef
import Data.STRef
class EqRef r where
eqRef :: r a -> r a -> Bool
class (EqRef r, Functor m, Monad m) => Ref m r | m -> r... | Blaisorblade/Haskell-Adaptive | Control/Monad/Adaptive/Ref.hs | bsd-3-clause | 782 | 0 | 10 | 179 | 305 | 161 | 144 | 23 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StrictData #-}
module Duffer.Pack.Streaming (separatePackFile) where
import Data.Attoparsec.ByteString (takeByteString)
import Data.ByteString (ByteString, append, length)
import Codec.Compression.Zlib (CompressionLevel)
import Control.Arrow ... | vaibhavsagar/duffer.hs | duffer-streaming/src/Duffer/Pack/Streaming.hs | bsd-3-clause | 3,825 | 0 | 18 | 977 | 1,103 | 598 | 505 | 69 | 3 |
-----------------------------------------------------------------------------
-- |
-- License : BSD-3-Clause
-- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi>
--
-- The pull requests API as documented at
-- <http://developer.github.com/v3/pulls/>.
module GitHub.Endpoints.PullRequests (
pullRequestsForR,
... | jwiegley/github | src/GitHub/Endpoints/PullRequests.hs | bsd-3-clause | 4,483 | 0 | 11 | 777 | 959 | 501 | 458 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.CSL
-- Copyright : (c) Andrea Rossato
-- License : BSD-style (see LICENSE)
--
-- Maintainer : Andrea Rossato <andrea.rossato@unitn.it>
-- Stability : unstable
-- Port... | jgm/pandoc-citeproc | src/Text/CSL.hs | bsd-3-clause | 4,423 | 0 | 5 | 983 | 276 | 223 | 53 | 36 | 0 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE UndecidableInstances #-}
module NanoML.Monad where
import Control.Monad.Except
import Control... | ucsd-progsys/nanomaly | src/NanoML/Monad.hs | bsd-3-clause | 4,204 | 0 | 18 | 1,011 | 1,150 | 636 | 514 | 95 | 2 |
--------------------------------------------------------------------------------
-- Module : Data.Bitmap.IO.File
-- Version : 0.0.2
-- License : BSD3
-- Copyright : (c) 2009-2010 Balazs Komuves
-- Author : Balazs Komuves
-- Maintainer : bkomuves (plus) hackage (at) gmail (dot) com
-- Stability :... | ownclo/jpeg-on-steroids | vendor/Haskell/bitmap-0.0.2/Data/Bitmap/IO/File.hs | bsd-3-clause | 4,913 | 0 | 18 | 974 | 1,094 | 561 | 533 | 87 | 2 |
module Code.Check where
-- $Id$
import Code.Type
import ToDoc
import Sets
import Data.FiniteMap
import Data.List
import Control.Monad
import qualified Reporter.Checker as C
import qualified Reporter.Subset
istotal :: ( Ord a )
=> Set a
-> Code a b
-> Reporter ()
istotal xs code = do
inform $ f... | Erdwolf/autotool-bonn | src/Code/Prefix.hs | gpl-2.0 | 970 | 8 | 19 | 279 | 369 | 186 | 183 | 33 | 1 |
-- |
-- Module : $Header$
-- Copyright : (c) 2013-2015 Galois, Inc.
-- License : BSD3
-- Maintainer : cryptol@galois.com
-- Stability : provisional
-- Portability : portable
--
-- This module contains types used during type inference.
{-# LANGUAGE Safe #-}
{-# LANGUAGE FlexibleInstances, FlexibleCo... | iblumenfeld/cryptol | src/Cryptol/TypeCheck/InferTypes.hs | bsd-3-clause | 19,772 | 0 | 19 | 6,554 | 4,769 | 2,393 | 2,376 | 389 | 4 |
module Qualified1 where
import qualified Control.Parallel.Strategies as CP
fib n
| n <= 1 = 1
| otherwise = n1_2 + n2_2 + 1
where
n1 = fib (n-1)
n2 = fib (n-2)
(n1_2, n2_2)
=
CP.runEval
(do n1_2 <- CP.rpar n1
n2_2 <... | RefactoringTools/HaRe | old/testing/introThreshold/Qualified1.hs | bsd-3-clause | 396 | 0 | 13 | 186 | 144 | 74 | 70 | 14 | 1 |
module FreeAndDeclared.Declare1 where
import qualified Data.Generics as G
toplevel :: Integer -> Integer
toplevel x = c * x
c,d :: Integer
c = 7
d = 9
-- Pattern bind
tup :: (Int, Int)
h :: Int
t :: Int
tup@(h,t) = head $ zip [1..10] [3..15]
data D = A | B String | C
-- Retrieve the String from a B
unD (B y) = y... | RefactoringTools/HaRe | test/testdata/FreeAndDeclared/Declare1.hs | bsd-3-clause | 564 | 5 | 8 | 126 | 199 | 118 | 81 | 19 | 1 |
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Array.Storable.Safe
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- ... | szatkus/haste-compiler | libraries/ghc-7.8/array/Data/Array/Storable/Safe.hs | bsd-3-clause | 1,665 | 0 | 5 | 327 | 75 | 63 | 12 | 8 | 0 |
module T7937 where
-- Without this operator definition, a precedence parsing error is reported.
-- Perhaps the default precedence is being assumed for the unknown operator?
-- That seems wrong, since there's no way to know what the precedence will be when
-- the operator is defined as the programmer intended.
foo = 3... | urbanslug/ghc | testsuite/tests/rename/should_fail/T7937.hs | bsd-3-clause | 338 | 0 | 7 | 64 | 25 | 16 | 9 | -1 | -1 |
{-# LANGUAGE PatternSynonyms #-}
{-| virtual key constants.
this module declares only `patterns`.
see:
* <https://developer.apple.com/library/mac/documentation/Carbon/Reference/QuartzEventServicesRef/>
* line 236 of
</System/Library/Frameworks/IOKit.framework/Versions/A/Headers/hidsystem/IOLLEvent.h>
* line 196 of... | sboosali/workflow-osx | workflow-osx/sources/Workflow/OSX/Constants.hs | mit | 16,998 | 0 | 6 | 5,573 | 2,208 | 1,202 | 1,006 | 285 | 0 |
{-# OPTIONS_GHC -F -pgmF htfpp #-}
module TestLabyrinth.Move.Common where
import Labyrinth
import Control.Lens
import Control.Monad.State
import TestLabyrinth.Common
import Test.Framework
import qualified Test.HUnit as HU
assertMoveUpdates :: Labyrinth -> PlayerId -> Move -> MoveResult -> State Labyrinth () -> HU... | koterpillar/labyrinth | testsuite/TestLabyrinth/Move/Common.hs | mit | 737 | 0 | 11 | 122 | 187 | 99 | 88 | 17 | 1 |
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
--
-- Module : EventProbability.NaiveBayes
-- Description : An interface for /Naive Bayes/.
-- License : MIT
--
-- An interface for /Naive Bayes/.
--
module EventProbability.NaiveBayes ( NaiveBayesCondProb(..) ) where
import EventProbability
import Data.List... | fehu/min-dat--naive-bayes | src/EventProbability/NaiveBayes.hs | mit | 1,660 | 0 | 15 | 503 | 267 | 150 | 117 | -1 | -1 |
{-# LANGUAGE DeriveFunctor, StandaloneDeriving #-}
import Euterpea
deriving instance Functor Primitive
deriving instance Functor Music
main = do putStrLn "Cumparsita by Rodriegez"
play cumparsita
putStrLn "Rachmaninoff prelude C# minor"
play rachmaninoff_prelude
cumparsita = tempo (66/... | danbst/pianissimo | euter-exmple.hs | mit | 3,691 | 2 | 24 | 1,877 | 1,523 | 765 | 758 | 122 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module API.User where
import API.Pagination
import User
import Util.JWT
import Util.Crypto
import Data.Int
import Data.Text
import Servant.API
type GetAll = QueryParam "offset" Int64
:> Get '[JSON] (Headers '[H... | benweitzman/PhoBuddies-Servant | src/API/User.hs | mit | 1,237 | 0 | 20 | 405 | 273 | 143 | 130 | 27 | 0 |
module My.Fuse
( fuseStart
, fuseCreate
) where
import My.Google
import My.Data
import My.Serialize
import My.Crypt
import My.Exception
import qualified My.Uploader as U
import Data.IORef
import Control.Applicative
import Control.Monad
import Control.Monad.Catch
import Control.Monad.Trans
import Control.Monad.T... | CindyLinz/GCryptDrive | src/My/Fuse.hs | mit | 19,705 | 5 | 69 | 7,736 | 5,296 | 2,558 | 2,738 | -1 | -1 |
module CodeGen.Paramable where
data NutleyParam = IntParam Int
| ListParam [NutleyParam]
| StringParam String
| CharParam Char
deriving (Eq)
instance Show NutleyParam where
show (IntParam i) = show i
show (ListParam ls) = show ls
show (StringP... | jvictor0/JoSQL | CodeGen/Paramable.hs | mit | 1,092 | 0 | 9 | 281 | 338 | 173 | 165 | 26 | 0 |
{-# LANGUAGE OverloadedLists, OverloadedStrings #-}
module Smutt.HTTP.Server.Request.Reader (
readHTTP
) where
import Control.Monad.Except
import Smutt.HTTP.Method as Method
import Smutt.HTTP.Version as Version
import Smutt.HTTP.Header as Header
import Smutt.HTTP.Header.Reader as Header
import Smutt.HTTP.Heade... | black0range/Smutt | src/Smutt/HTTP/Server/Request/Reader.hs | mit | 6,075 | 0 | 15 | 1,043 | 1,492 | 781 | 711 | 93 | 5 |
fn :: Integer -> Integer
fn 0 = 0
fn 1 = 1
fn n = fn(n - 1) + fn(n -2)
| violetkz/haskell_learning | fn.hs | gpl-2.0 | 77 | 0 | 8 | 27 | 58 | 29 | 29 | 4 | 1 |
{-# LANGUAGE CPP, TupleSections #-}
module Main where
import Control.Applicative ((<$>), (<|>))
import qualified Control.Exception as E
import Control.Exception.Extensible (throwIO)
import Control.Monad (unless, when, (>=>))
import ... | konn/pandoc-japanese-docx | pandoc-japanese.hs | gpl-2.0 | 61,041 | 0 | 25 | 28,692 | 11,548 | 6,248 | 5,300 | -1 | -1 |
module P24AnagramSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck ((==>))
import P24Anagram (isAnagram,mergeSort)
import Data.List (sort)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "isAnagram" $ do
it "identifies a word as an anagram of itself"... | ciderpunx/57-exercises-for-programmers | test/P24AnagramSpec.hs | gpl-3.0 | 2,713 | 0 | 17 | 730 | 773 | 403 | 370 | 48 | 1 |
f :: Bool -> Bool
f = undefined | hmemcpy/milewski-ctfp-pdf | src/content/1.2/code/haskell/snippet04.hs | gpl-3.0 | 31 | 0 | 5 | 7 | 15 | 8 | 7 | 2 | 1 |
module Demo where
{- Ìîíîìîðôíàÿ ôóíêöèÿ: -}
mono :: Char -> Char
mono x = x
{- ×àñòè÷íîå îãðàíè÷åíèå ïîëèìîðôèçìà ôóíêöèè -}
{- Ôóíêöèÿ ìîíîìîðôíà 1 àðãóìåíòó è ïîëèìîðôíà ïî 2 -}
semiMono :: Char -> a -> Char
semiMono x y = x
| devtype-blogspot-com/Haskell-Examples | Mono/Demo.hs | gpl-3.0 | 230 | 0 | 6 | 46 | 47 | 27 | 20 | 5 | 1 |
module Teb.Git where
import System.IO
import System.Process
import Teb.Types
import Teb.Utils
import Data.Text (Text (..), split, pack, unpack)
gitCheckout :: String -> String -> IO [String]
gitCheckout cwd branch = gitRunner cwd ["checkout",branch]
gitClone :: String -> RemoteLocator -> Maybe String -> IO [String]... | ignesco/teb-h | Teb/Git.hs | gpl-3.0 | 1,344 | 0 | 13 | 264 | 553 | 289 | 264 | 29 | 2 |
{-# LANGUAGE BangPatterns #-}
{-
Copyright 2012 - 2020 Colin Woodbury <colin@fosskers.ca>
This file is part of Aura.
Aura 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 License, or
(at... | aurapm/aura | aura/exec/Aura/Settings/Runtime.hs | gpl-3.0 | 3,999 | 0 | 25 | 1,060 | 926 | 481 | 445 | -1 | -1 |
module Main where
-- import qualified Serverless.AWSLambda as AWS (main)
import qualified Server.Spock as Spock (startServer)
main :: IO ()
main = Spock.startServer 8080 | jpotecki/AmexMobileBackend | app/Main.hs | gpl-3.0 | 171 | 0 | 6 | 25 | 38 | 23 | 15 | 4 | 1 |
-- | OO in Haskell.
--
-- Taken from http://www.well-typed.com/blog/2018/03/oop-in-haskell/
module PwFix.Inheritance where
import Data.Function (fix)
data Counter = Counter
{ tick :: Counter
, display :: Int
}
mkCounter :: (Int -> Counter) -> Int -> Counter
mkCounter self n = Counter
{ ... | capitanbatata/sandbox | pw-fix/src/PwFix/Inheritance.hs | gpl-3.0 | 881 | 0 | 9 | 230 | 215 | 121 | 94 | 16 | 1 |
{-# LANGUAGE TemplateHaskell #-}
import Prime
{- Because the generated list is a list of literal integers, GHC -Wall needs
us to specify that `primeList` is a `List` of `Integer`s.
`doPrimeQ` will be executed before the final compiling and its result inserted.
For the rest of the program, primeList is the lit... | Zigazou/CompileTimeCalculation | src/Main.hs | gpl-3.0 | 835 | 0 | 7 | 153 | 51 | 28 | 23 | 6 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/InitiateMultipartUpload.hs | mpl-2.0 | 8,068 | 0 | 11 | 1,632 | 777 | 479 | 298 | 83 | 1 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable #-}
--------------------------------------------------------------------------------
{-| Module : Controls
Copyright : (c) Daan Leijen 2003
(c) Shelarcy (shelarcy@gmail.com) 2006
License : wx... | thielema/wxhaskell | wx/src/Graphics/UI/WX/Controls.hs | lgpl-2.1 | 48,470 | 0 | 20 | 10,594 | 10,172 | 5,211 | 4,961 | 676 | 6 |
module Identity where
foldr' :: (a -> b -> b) -> b -> [a] -> b
foldr' _ z [] = z
foldr' f z (x:xs) = f x (foldr' f z xs)
flatten :: [[a]] -> [a]
flatten = foldr (++) []
-- [1] ++ [2] ++ [3]
flt0 = flatten [[1],[2],[3]]
flatMap :: (a -> [b]) -> [a] -> [b]
flatMap g = foldr (\x acc -> g x ++ acc) []
-- [2] ++ [4... | haroldcarr/learn-haskell-coq-ml-etc | haskell/book/2019-Program_Design_by_Calculation-Oliveira/2015-05-LambdaConf/Identity.hs | unlicense | 1,378 | 0 | 11 | 677 | 688 | 386 | 302 | 24 | 1 |
import Data.Monoid (Monoid, mempty, mappend, Sum(..), getSum)
import Data.Semigroup (Semigroup, (<>))
import Test.QuickCheck (Arbitrary,
arbitrary,
elements,
Gen,
quickCheck)
-- Monoid exercises
-- Semigroup and Monoid te... | dmvianna/haskellbook | src/Ch15Ex-Monoid.hs | unlicense | 8,274 | 0 | 11 | 2,101 | 3,220 | 1,645 | 1,575 | 181 | 4 |
data NestedList a = Elem a | List [NestedList a]
myFlatten :: NestedList b -> [b]
myFlatten (Elem a) = [a]
myFlatten (List (a:x)) = myFlatten a ++ myFlatten (List x)
myFlatten (List []) = []
| plilja/h99 | p7.hs | apache-2.0 | 192 | 0 | 9 | 37 | 109 | 56 | 53 | 5 | 1 |
-- | Higher-level DB functionality.
module Pos.DB.DB
( initNodeDBs
, gsAdoptedBVDataDefault
) where
import Universum
import Pos.Chain.Block (genesisBlock0, headerHash)
import Pos.Chain.Genesis as Genesis (Config (..), configBlockVersionData)
import Pos.Cha... | input-output-hk/cardano-sl | lib/src/Pos/DB/DB.hs | apache-2.0 | 1,526 | 0 | 11 | 354 | 287 | 165 | 122 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.