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
EmptyDataDecls
, TypeFamilies
, FlexibleContexts
, FlexibleInstances
, ScopedTypeVariables
#-}
module HFlint.Internal.Flint
( Flint(..)
)
where
import Foreign.Ptr ( Ptr )
class Flint a where
data CFlint a :: *
newFlint :: IO a
withFlint :: a
-> (Ptr (CFlint a) -> I... | martinra/hflint | src/HFlint/Internal/Flint.hs | gpl-3.0 | 794 | 0 | 13 | 254 | 249 | 130 | 119 | 28 | 0 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE DeriveGeneric #-}
module Test.QuickFuzz.Gen.Code.C where
import Data.Default
import Language.C
import Test.QuickCheck
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.Stat... | elopez/QuickFuzz | src/Test/QuickFuzz/Gen/Code/C.hs | gpl-3.0 | 848 | 0 | 10 | 122 | 184 | 119 | 65 | 26 | 1 |
module YCbCr (YCbCr, toYcbcr, fromYcbcr, y, cb, cr, r, g, b) where
import Codec.Picture (Pixel8)
import Pixel
type YCbCr = (Double, Double, Double)
type ConvFactors = (Double, Double, Double)
y :: RGB8 -> Double
y rgb = 0.299 * r' + 0.587 * g' + 0.114 * b'
where (r', g', b') = fromIntegral' rgb
cb :: RGB8 -> Dou... | mikolajsacha/HaskellPics | ycbcr.hs | gpl-3.0 | 872 | 0 | 10 | 203 | 458 | 256 | 202 | 24 | 1 |
module Stack where
class Stack stack where
empty :: stack a
isEmpty :: stack a -> Bool
consS :: a -> stack a -> stack a
headS :: stack a -> a
tailS :: stack a -> stack a
instance Stack [] where
empty = []
isEmpty [] = True
isEmpty (_:_) = False
consS x xs = x:xs
headS [] = error "empty stack"
... | ggarlic/fp-data-structures | src/Stack.hs | gpl-3.0 | 1,817 | 0 | 11 | 504 | 836 | 417 | 419 | 57 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Web.Scotty
import Control.Monad.IO.Class
import Data.Monoid
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static
import Network.Wai.Parse
import Text.B... | igniting/file-server | Main.hs | gpl-3.0 | 1,849 | 0 | 22 | 732 | 481 | 256 | 225 | 36 | 1 |
module Note
( Letter(..) , Octave , Accidental , Halves , Dots -- Elements of a note
, Note -- the Note type
, letter, octave, accidental, halves, dots -- accessors for a note
, makeNote -- constructor
, durAsNum -- view duration as a number
, Duration(..), Location(..), Pitch(..) -- comparisons
, (@-@), (#-#), (~-~) -... | yousufmsoliman/music | Source (Haskell)/Note.hs | gpl-3.0 | 6,003 | 0 | 17 | 1,315 | 2,925 | 1,599 | 1,326 | 122 | 2 |
module Game.Toliman.Graphical.UI.Widgets where
import Data.Functor ((<$>))
import qualified Data.Map.Strict as Map
import qualified Data.RTree.Strict as RTree
import Game.Toliman.Internal.Sodium
import Game.Toliman.Internal.Lens
import Game.Toliman.Graphical.UI.Types
createWidget :: (Widget a) => UIState' -> (Widge... | duncanburke/toliman-graphical | src-lib/Game/Toliman/Graphical/UI/Widgets.hs | mpl-2.0 | 427 | 0 | 10 | 52 | 133 | 83 | 50 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/Resource/AndroidManagement/Enterprises/Devices/IssueCommand.hs | mpl-2.0 | 5,672 | 0 | 16 | 1,215 | 782 | 458 | 324 | 113 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
func
:: forall a
. ()
=> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
func
:: ()
=> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
| lspitzner/brittany | data/Test330.hs | agpl-3.0 | 309 | 0 | 7 | 36 | 33 | 20 | 13 | 10 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
import Monad
import Functor
import Maybe
import Either
import NonEmpty
import Semigroup
import Monoid
import Applicative
import Base
import GHC.Base hiding (Functor, Maybe, Monad, fmap, return, (>>=))
import Data.Fixed
import GHC.Num
import GHC.Real
import GHC.Float hiding ((**))
imp... | seckcoder/lang-learn | haskell/lambda-calculus/src/test.hs | unlicense | 4,050 | 0 | 16 | 899 | 1,819 | 942 | 877 | 103 | 2 |
#!/usr/bin/env runghc
dot(x1,y1)(x2,y2)=x1*x2+y1*y2
cross(x1,y1)(x2,y2)=x1*y2-x2*y1
upperArg(x,y)=y>0 || y==0 && x>0
cmpArg l r=compare(upperArg r,0)(upperArg l,cross l r)
| jasy/alglib | Haskell/Vector2D.hs | unlicense | 172 | 0 | 9 | 16 | 142 | 76 | 66 | 4 | 1 |
module Git.Command.PrunePacked (run) where
run :: [String] -> IO ()
run args = return () | wereHamster/yag | Git/Command/PrunePacked.hs | unlicense | 89 | 0 | 7 | 15 | 42 | 23 | 19 | 3 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.HTTP.Types (status200, status404)
import Network.Wai.Handler.Warp (run)
import Data.ByteString.Lazy.Char8
import Text.Proton.Template
consoleLog :: String -> IO ()
consoleLog msg = Prelude.putStrLn msg
application :: Templates -> Application
ap... | jasonrbriggs/proton | haskell/examples/BasicWebExample.hs | apache-2.0 | 1,148 | 0 | 13 | 257 | 318 | 158 | 160 | 32 | 2 |
module Miscellaneous.A280521 (a280521) where
import HelperSequences.A066628 (a066628)
a280521 :: Integer -> Integer
a280521 n = go n 0 where
go 0 counter = counter
go k counter = go (a066628 $ k + 1) $ counter + 1
| peterokagey/haskellOEIS | src/Miscellaneous/A280521.hs | apache-2.0 | 219 | 0 | 12 | 43 | 87 | 46 | 41 | 6 | 2 |
import System.Random.Shuffle
| ccqpein/Arithmetic-Exercises | Shuffle-an-Array/SAA.hs | apache-2.0 | 40 | 0 | 4 | 13 | 7 | 4 | 3 | 1 | 0 |
solveRPN :: String -> Float
solveRPN = head . foldl parseItem [] . words
parseItem :: (Num a, Read a, Floating a) => [a] -> String -> [a]
parseItem (x:y:xs) "*" = x*y :xs
parseItem (x:y:xs) "/" = y/x :xs -- x=0
parseItem (x:y:xs) "+" = x+y :xs
parseItem (x:y:xs) "-" = y-x :xs
parseItem (x:y:xs) "^" = y**x :xs -- y=0
... | paulbarbu/haskell-ground | rpn.hs | apache-2.0 | 391 | 0 | 8 | 79 | 262 | 137 | 125 | 10 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QDir.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:32
Warning : this file is machine generated - do not modi... | uduki/hsQt | Qtc/Core/QDir.hs | bsd-2-clause | 23,360 | 0 | 17 | 4,152 | 8,012 | 4,142 | 3,870 | -1 | -1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QActionGroup.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:14
Warning : this file is machine generated - do ... | keera-studios/hsQt | Qtc/Gui/QActionGroup.hs | bsd-2-clause | 12,769 | 0 | 14 | 2,081 | 4,018 | 2,039 | 1,979 | -1 | -1 |
-- |
-- Module: Control.Wire.Time
-- Copyright: (c) 2013 Ertugrul Soeylemez
-- License: BSD3
-- Maintainer: Ertugrul Soeylemez <es@ertes.de>
module Control.Wire.Time
( -- * Time wires
time,
timeF,
timeFrom
)
where
import Control.Wire.Core
import Control.Wire.Session
-- | Local ... | abbradar/netwire | Control/Wire/Time.hs | bsd-3-clause | 781 | 0 | 12 | 206 | 207 | 116 | 91 | 16 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
module Main (main) where
import Control.Concurrent (ThreadId, forkIO, threadDelay)
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TVar (newTVar, readTVar, writeTVar)
import Control.... | nschoe/hpt | src/Dispatcher.hs | bsd-3-clause | 11,144 | 0 | 35 | 4,521 | 1,982 | 979 | 1,003 | 169 | 10 |
----------------------------------------------------------------------------
-- |
-- Module : ModuleWithExplicitExport
-- Copyright : (c) Sergey Vinokurov 2015
-- License : BSD3-style (see LICENSE)
-- Maintainer : serg.foo@gmail.com
-----------------------------------------------------------------------... | sergv/tags-server | test-data/0002export_lists/ModuleWithExplicitExport.hs | bsd-3-clause | 482 | 0 | 8 | 84 | 55 | 38 | 17 | 7 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
-- | Mutually recursive data types.
module Ray.Types where
import Ray.Imports
import Ray.Util
import Control.Monad.Reader
import Data.Array
import Dat... | bergey/panther | src/Ray/Types.hs | bsd-3-clause | 5,097 | 0 | 12 | 1,102 | 1,072 | 590 | 482 | 151 | 1 |
module Intel.ArBB.Literal where
import Data.Int
import Data.Word
import Intel.ArBB.Data.Int
data Literal = LitInt Int
| LitInt8 Int8
| LitInt16 Int16
| LitInt32 Int32
| LitInt64 Int64
| LitWord Word
| LitWord8 Word8
... | svenssonjoel/EmbArBB | Intel/ArBB/Literal.hs | bsd-3-clause | 620 | 0 | 6 | 301 | 114 | 69 | 45 | 20 | 0 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- Copied from http://hackage.haskell.org/package/regex-tdfa-1.2.0/docs/src/Text-Regex-TDFA-ByteString.html#compile
-- and modified to suit my needs. Many thanks to Chris Kuklewicz.
module Ebitor.Rope.Regex
( Regex
, CompOption
, ExecOption
, compile
, compile... | benekastah/ebitor | src/Ebitor/Rope/Regex.hs | bsd-3-clause | 5,623 | 0 | 21 | 1,503 | 1,746 | 962 | 784 | 133 | 3 |
{-# LANGUAGE RecordWildCards, ScopedTypeVariables #-}
module Codex.Lib.Network.TCP.Server (
TCPServer,
TCPConnection,
runTCPServer,
destroyTCPServer,
buildTCPServer
) where
import Prelude hiding (catch)
import Network
import System.IO
import Control.Monad
import Control.Exception as E
import Control.Concurrent
im... | adarqui/Codex | src/Codex/Lib/Network/TCP/Server.hs | bsd-3-clause | 2,212 | 0 | 16 | 423 | 804 | 424 | 380 | 68 | 2 |
-- | Read templates in Hakyll's native format
--
module Hakyll.Web.Template.Read.Hakyll
( readTemplate
) where
import Data.List (isPrefixOf)
import Data.Char (isAlphaNum)
import Hakyll.Web.Template.Internal
-- | Construct a @Template@ from a string.
--
readTemplate :: String -> Template
readTemplate = Templa... | sol/hakyll | src/Hakyll/Web/Template/Read/Hakyll.hs | bsd-3-clause | 1,113 | 0 | 14 | 335 | 311 | 164 | 147 | 23 | 4 |
module Lasca.JIT (
runJIT,
withOptimizedModule
) where
import Data.Int
import Data.Word
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as LT
import qualified Data.Text.IO as TIO
import System.IO
import Foreign.Ptr
import Foreign.C.String
import ... | nau/lasca-compiler | src/lib/Lasca/JIT.hs | bsd-3-clause | 3,764 | 0 | 24 | 1,102 | 882 | 464 | 418 | 78 | 1 |
{-
Copyright (c) 2013, Genome Research Limited
Author: Nicholas Clarke <nicholas.clarke@sanger.ac.uk>
-- Creates a new version of a template.
hg-version <oldname> [<newname>]
- If <newname> not set, increment a version number
- Get repo
- cvmfs_server transaction repo
- Copy newname to oldname
- Copy config file to t... | wtsi-hgi/hgc-tools | hgc-version.hs | bsd-3-clause | 8,537 | 0 | 16 | 2,335 | 2,172 | 1,161 | 1,011 | 168 | 4 |
module Angular.Ng.Compile where
import FFI
import JQuery
import Angular.Ng.RootScope
import Angular.Ng.Controller
import Angular.Module
type DirectiveName = String
type Directive = [DirectiveDefinitionConf] -> Fay DirectiveDefinition
type Linking = (NgScope -> JQuery -> Attrs -> Fay())
type Compiling =... | faylang/fay-angular | src/Angular/Ng/Compile.hs | bsd-3-clause | 3,811 | 0 | 13 | 1,021 | 977 | 503 | 474 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import System.Environment (getArgs)
import PCD.Conversion (asciiToBinary)
import PCD.Data (projectBinaryFields)
data Args = Args { _inputFile :: FilePath
, _outputFile :: FilePath
, _justXyz :: Bool }
parseArgs :: [Strin... | acowley/pcd-loader | src/executable/Main.hs | bsd-3-clause | 788 | 0 | 9 | 183 | 257 | 138 | 119 | 19 | 2 |
-- | Complex Type: @boundsType@ <http://www.topografix.com/GPX/1/1/#type_boundsType>
module Data.Geo.GPX.Type.Bounds(
Bounds
, bounds
) where
import Data.Geo.GPX.Type.Latitude
import Data.Geo.GPX.Type.Longitude
import Data.Geo.GPX.Lens.MinlatL
import Data.Geo.GPX.Lens.MaxlatL
import Data.Geo.GPX.Lens.MinlonL
import ... | tonymorris/geo-gpx | src/Data/Geo/GPX/Type/Bounds.hs | bsd-3-clause | 1,790 | 0 | 12 | 320 | 580 | 347 | 233 | 40 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Snap.Snaplet.Sass (
Sass
, initSass
, sassServe
) where
------------------------------------------------------------------------------
import Control.Monad
import Control.Monad.Reader
imp... | lukerandall/snaplet-sass | src/Snap/Snaplet/Sass.hs | bsd-3-clause | 3,525 | 0 | 18 | 1,018 | 907 | 464 | 443 | 73 | 4 |
module Data.OBO.Document where
-- OBO data type definitions.
type Header = String
type Name = String
type Tag = String
type Value = String
type TagValues = [(Tag, Value)]
data Document =
Document {
docHeader :: TagValues
, docStanzas :: [Stanza]
} deriving (Eq, Ord, Show)
data Stanza =
... | sebastiaanvisser/islay | src/Data/OBO/Document.hs | bsd-3-clause | 404 | 0 | 9 | 108 | 122 | 76 | 46 | 16 | 0 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, RankNTypes #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.ST
-- Copyright : (c) The University of Glasgow, 1992-2002
-- License : see libra... | jstolarek/ghc | libraries/base/GHC/ST.hs | bsd-3-clause | 5,028 | 0 | 16 | 1,273 | 792 | 448 | 344 | 54 | 1 |
{-# LANGUAGE PackageImports #-}
module GHC.IO.Encoding (module M) where
import "base" GHC.IO.Encoding as M
| silkapp/base-noprelude | src/GHC/IO/Encoding.hs | bsd-3-clause | 112 | 0 | 4 | 18 | 23 | 17 | 6 | 3 | 0 |
--------------------------------------------------------------------------------
-- |
-- Module : Generics.EMGM.Functions.Everywhere
-- Copyright : (c) 2008, 2009 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
-- Stability : experimental
-- Portability : non-portable
... | spl/emgm | src/Generics/EMGM/Functions/Everywhere.hs | bsd-3-clause | 9,994 | 0 | 10 | 1,915 | 1,450 | 827 | 623 | 72 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE... | 23Skidoo/snap | src/Snap/Snaplet/HeistNoClass.hs | bsd-3-clause | 17,187 | 0 | 14 | 4,065 | 3,357 | 1,743 | 1,614 | 273 | 2 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{- BlockId module should probably go away completely, being superseded by Label -}
module GHC.Cmm.BlockId
( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet
, newBlockId
, blockLbl, infoTblLbl
) where
import Gh... | sdiehl/ghc | compiler/GHC/Cmm/BlockId.hs | bsd-3-clause | 1,351 | 0 | 9 | 201 | 183 | 106 | 77 | 23 | 1 |
module Spring13.Week1.CreditCard
(toDigits
,toDigitsRev
,doubleEveryOther
,sumDigits
,validate)
where
main :: IO ()
main = do
print $ toDigits 1234
print $ toDigitsRev 1234
print $ toDigits 0
print $ toDigits (-17)
toDigits :: Integer -> [Integer]
toDigits n
| n > 0 = toDigits (n `div` 10) ++ [n... | bibaijin/cis194 | src/Spring13/Week1/CreditCard.hs | bsd-3-clause | 816 | 0 | 11 | 185 | 357 | 187 | 170 | 29 | 1 |
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
module Mud.RollbackSpec where
import System.Exit
import System.Posix.Process
import Mud.Config (defaultConfig)
import Mud.History
import Mud.Rollback
import SpecHelpers
spec :: Spec
spec = do
let parseConfigFiles = \case
"project" -> [defaultConfig "/etc/... | thoferon/mud | tests/Mud/RollbackSpec.hs | bsd-3-clause | 1,353 | 0 | 20 | 362 | 320 | 172 | 148 | -1 | -1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE... | 23Skidoo/heist | src/Heist/Internal/Types.hs | bsd-3-clause | 9,038 | 0 | 14 | 1,747 | 1,562 | 840 | 722 | 110 | 1 |
module Main where
import ABS
(n_div:x:main_ret:i:f:n:obj:reminder:res:the_end) = [0..]
main_ :: Method
main_ [] this wb k =
Assign n (Val (I 2000)) $
Assign x (Sync primality_test [n]) $
k
primality_test :: Method
primality_test [pn] this wb k =
Assign i (Val (I 1)) $
Assign n (Val (I pn)) $
While (ILT... | abstools/abs-haskell-formal | benchmarks/3_primality_test_parallel/progs/2000.hs | bsd-3-clause | 846 | 0 | 18 | 222 | 506 | 256 | 250 | 30 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
module Main where
import Control.Comonad ... | jwiegley/hnix | main/Main.hs | bsd-3-clause | 8,777 | 0 | 31 | 3,258 | 2,535 | 1,296 | 1,239 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Database.PostgreSQL.Simple
import DataTypes
import JsonInstances ()
import TenantApi
import Validations
import Web.Spock
import Web.Spock.Config
import qualified Data.Text ... | vacationlabs/haskell-webapps | SpockOpaleye/app/Main.hs | mit | 1,348 | 0 | 22 | 430 | 317 | 162 | 155 | 39 | 4 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Pos.Explorer.Socket.Util
( EventName (..)
, emit
, emitJSON
, emitTo
, emitJSONTo
, on_
, on
, runPeriodically
, regroupBySnd... | input-output-hk/pos-haskell-prototype | explorer/src/Pos/Explorer/Socket/Util.hs | mit | 3,191 | 0 | 16 | 800 | 974 | 528 | 446 | -1 | -1 |
--
--
--
------------------
-- Exercise 10.10.
------------------
--
--
--
module E'10'10 where
import E'10''9 ( iter )
import Test.QuickCheck.Modifiers ( Positive(..) )
import Test.QuickCheck ( quickCheck )
power2 :: Integer -> Integer
power2 exponent
| exponent < 0 = error "Negative exponent."
| otherwise ... | pascal-knodel/haskell-craft | _/links/E'10'10.hs | mit | 571 | 0 | 8 | 119 | 156 | 87 | 69 | 13 | 1 |
{-# LANGUAGE NoImplicitPrelude, DeriveFunctor, RankNTypes #-}
module Lamdu.Sugar.Names.CPS
( CPS(..)
) where
import Prelude.Compat
data CPS m a = CPS { runCPS :: forall r. m r -> m (a, r) }
deriving (Functor)
instance Functor m => Applicative (CPS m) where
pure x = CPS $ fmap ((,) x)
CPS cpsf <*>... | da-x/lamdu | Lamdu/Sugar/Names/CPS.hs | gpl-3.0 | 422 | 0 | 12 | 123 | 178 | 97 | 81 | 11 | 0 |
{-# LANGUAGE OverloadedStrings #-}
-- Module : Test.AWS.DynamoDBStreams
-- 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-dynamodb-streams/test/Test/AWS/DynamoDBStreams.hs | mpl-2.0 | 772 | 0 | 5 | 201 | 73 | 50 | 23 | 11 | 1 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
module Handler.Labels
( getLabelsR
, postLabelsR
, postNewLabelR
, LTree (..)
, getLTree
) where
import Wiki
import Control.Monad (unless)
import Data.Aeson (json, Value (..))
import Data.Text.Encoding (encodeUtf8)
import Data.Att... | snoyberg/yesodwiki | Handler/Labels.hs | bsd-2-clause | 2,687 | 0 | 15 | 714 | 948 | 484 | 464 | 71 | 5 |
module Settings.Flavours.GhcInGhci (ghcInGhciFlavour) where
import Expression
import Flavour
import {-# SOURCE #-} Settings.Default
import Settings.Flavours.Common
-- Please update doc/flavours.md when changing this file.
ghcInGhciFlavour :: Flavour
ghcInGhciFlavour = defaultFlavour
{ name = "ghc-in-ghci"
... | sdiehl/ghc | hadrian/src/Settings/Flavours/GhcInGhci.hs | bsd-3-clause | 1,012 | 0 | 11 | 235 | 194 | 115 | 79 | 20 | 1 |
-- |
-- Module : Crypto.Hash.MD5
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- Module containing the binding functions to work with the
-- MD5 cryptographic hash.
--
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE... | vincenthz/cryptonite | Crypto/Hash/MD5.hs | bsd-3-clause | 1,645 | 0 | 13 | 381 | 346 | 190 | 156 | 31 | 0 |
{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, UnboxedTuples #-}
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2005-2007
--
-- Running statements interactively
--
-- -------------------------------------------------------------------------... | spacekitteh/smcghc | compiler/main/InteractiveEval.hs | bsd-3-clause | 41,737 | 13 | 34 | 11,896 | 8,995 | 4,601 | 4,394 | 2 | 0 |
{-# LANGUAGE OverlappingInstances, TypeSynonymInstances #-}
-- |
-- Module : Data.BERT.Parser
-- Copyright : (c) marius a. eriksen 2009
--
-- License : BSD3
-- Maintainer : marius@monkey.org
-- Stability : experimental
-- Portability : GHC
--
-- Parse (simple) BERTs.
module Data.BERT.Parser
( parseTer... | mariusae/bert | Data/BERT/Parser.hs | bsd-3-clause | 2,257 | 0 | 24 | 558 | 614 | 342 | 272 | -1 | -1 |
module Distribution.Server.Features.PackageContents (
PackageContentsFeature,
PackageContentsResource(..),
initPackageContentsFeature
) where
import Distribution.Server.Framework
import Distribution.Server.Features.Check
import Distribution.Server.Features.Core
import Distribution.Server.Packages.Types
... | isomorphism/hackage2 | Distribution/Server/Features/PackageContents.hs | bsd-3-clause | 4,954 | 0 | 17 | 893 | 1,034 | 568 | 466 | 66 | 2 |
module Code.Check where
-- $Id$
import Code.Type
import Autolib.ToDoc
import Autolib.Set
import Autolib.FiniteMap
import qualified Autolib.Reporter.Checker as C
import qualified Autolib.Reporter.Set
import Autolib.Reporter
import Data.List
import Control.Monad
istotal :: ( ToDoc b, ToDoc a, Ord a )
=> Set ... | florianpilz/autotool | src/Code/Check.hs | gpl-2.0 | 1,261 | 10 | 23 | 391 | 490 | 247 | 243 | 37 | 1 |
import System.Environment
import System.IO
import Data.List.Split hiding (oneOf)
import Text.ParserCombinators.Parsec
import Control.Monad
import Data.ByteString.Lazy.Char8 as BS hiding (filter,last,zip,head,drop,reverse,concat)
import Control.Applicative hiding ((<|>), many)
import Text.Printf
{--
divsen(Open usp Tuk... | ShellShoccar-jpn/Open-usp-Tukubai | COMMANDS.HS/divsen.hs | mit | 3,554 | 0 | 12 | 883 | 922 | 480 | 442 | 51 | 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="ru-RU">
<title>Список каталогов v1.0 </title>
<maps>
<homeID>directorylistv1</homeID>
<... | thc202/zap-extensions | addOns/directorylistv1/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs | apache-2.0 | 1,026 | 78 | 66 | 158 | 494 | 248 | 246 | -1 | -1 |
module HAD.Y2014.M03.D14.Exercise where
-- $setup
-- >>> import Control.Applicative
-- >>> let s2 = ([id,(+1)] <*>) . pure
-- | groupByStraights Group elements in a list by "straights"
-- i.e: consecutive elements are grouped together.
--
-- Examples:
--
-- >>> groupByStraights [1,2,5,6,8]
-- [[1,2],[5,6],[8]]
--
--... | 1HaskellADay/1HAD | exercises/HAD/Y2014/M03/D14/Exercise.hs | mit | 539 | 0 | 4 | 81 | 32 | 28 | 4 | 2 | 1 |
{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses #-}
module ExTy where
class Show (layout a) => LayoutClass layout a where
data Layout a = forall l. Layout (l a)
readsLayout :: Layout a -> String -> Layout a
readsLayout (Layout l) s = Layout (asTypeOf undefined l)
type Size = Int
data Step s a = S s a... | mightymoose/liquidhaskell | tests/pos/extype.hs | bsd-3-clause | 593 | 0 | 9 | 187 | 206 | 109 | 97 | -1 | -1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, Rank2Types, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Data
-- Copyright : (c) The University of Glasgow, CWI 2001--2004
-- License : BSD-style (see the file libraries/base/LICE... | beni55/haste-compiler | libraries/ghc-7.8/base/Data/Data.hs | bsd-3-clause | 44,901 | 0 | 24 | 11,749 | 9,245 | 4,992 | 4,253 | 644 | 7 |
module PackageTests.BuildDeps.InternalLibrary2.Check where
import qualified Data.ByteString.Char8 as C
import PackageTests.PackageTester
import System.FilePath
import Test.Tasty.HUnit
suite :: SuiteConfig -> Assertion
suite config = do
let spec = PackageSpec
{ directory = "PackageTests" </> "BuildDep... | trskop/cabal | Cabal/tests/PackageTests/BuildDeps/InternalLibrary2/Check.hs | bsd-3-clause | 1,161 | 0 | 14 | 273 | 293 | 151 | 142 | 24 | 1 |
{-# htermination readHex :: String -> [(Int,String)] #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_readHex_1.hs | mit | 57 | 0 | 2 | 8 | 3 | 2 | 1 | 1 | 0 |
----------------------------------------------------------------
--
-- | Compilation
-- Monad and combinators for quickly assembling simple
-- compilers.
--
-- @Control\/Compilation\/Fresh.hs@
--
-- State extension class and combinators for implementations
-- of a state that support generation of fresh (i.e., u... | lapets/compilation | Control/Compilation/Fresh.hs | mit | 2,007 | 0 | 12 | 401 | 443 | 235 | 208 | 38 | 0 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
module Circuit.Builder.Internals where
import Circuit
import Control.Monad.State.Strict
import Control.Monad.Identity
import Lens.Micro.Platform
import qualified Data.Map.Strict as M
import qualified Data.IntMap.Strict as IM
import qualified Data.IntSet ... | spaceships/circuit-synthesis | src/Circuit/Builder/Internals.hs | mit | 4,959 | 0 | 12 | 1,164 | 1,950 | 942 | 1,008 | -1 | -1 |
{- arch-tag: Generic Server Support
Copyright (c) 2004-2011 John Goerzen <jgoerzen@complete.org>
All rights reserved.
For license and copyright information, see the file LICENSE
-}
{- |
Module : Network.SocketServer
Copyright : Copyright (C) 2004-2011 John Goerzen
License : BSD3
Maintainer : Joh... | haskellbr/missingh | missingh-all/src/Network/SocketServer.hs | mit | 7,507 | 0 | 12 | 2,760 | 931 | 501 | 430 | 94 | 2 |
module Main where
--
-- BASE LANGUAGE
-- The base language includes integers, addition, and subtraction.
--
--
-- EXTENDED LANGUAGE
-- The extended language includes the base language plus factorial, log (base
-- e), multiplication, and division.
--
-------------------------------------------------------------------... | erisco/extensible-ast | example02/main.hs | mit | 9,150 | 0 | 19 | 2,062 | 1,119 | 653 | 466 | 84 | 2 |
{-# LANGUAGE ScopedTypeVariables, Safe #-}
module Data.Generics.Record (
RecordT,
isRecord,
recordT,
fields,
emptyRecord,
recordStructure) where
import Data.Data
import Data.Maybe
import Control.Monad (guard)
-- | A phantom type used to parameterize functions based on records.
-- This let's us avoid passing... | jozefg/reified-records | src/Data/Generics/Record.hs | mit | 1,792 | 0 | 12 | 382 | 427 | 234 | 193 | 27 | 1 |
import System.Random
import Control.Monad(when)
main = do
g <- getStdGen
guess g
guess :: StdGen -> IO ()
guess gen = do
putStrLn "What number from 1 to 10 am I thinking of?"
numberString <- getLine
--let number = (fst . head $ reads numberString) :: Int
let number = reads numberString :: [(Int,Stri... | RAFIRAF/HASKELL | IO/guessNumber2.hs | mit | 610 | 0 | 14 | 161 | 197 | 99 | 98 | 17 | 2 |
{-# LANGUAGE OverloadedStrings, BangPatterns #-}
module CSV_Transport where
import Data.Time
import Data.Csv
import Prelude hiding (FilePath)
import DatabaseTransport
import Control.Applicative
import Control.Concurrent.Spawn
import Filesystem ()
import Filesystem.Path (FilePath)
import Debug.Trace
import Control.Mon... | smurphy8/dbTransport | CSV_Transport.hs | mit | 4,009 | 5 | 17 | 835 | 1,268 | 658 | 610 | 81 | 2 |
module Philed.Data.SemigroupExtras where
import Data.Function
import Data.Semigroup
import Philed.Data.Pos
import Prelude hiding (pred)
-- | Recursive definitions of natural number multiplication
multiplyP1 :: Semigroup m => P -> m -> m
multiplyP1 SZ x = x
multiplyP1 (S p) x = x <> multiplyP1 p x
multiply1 :: (In... | Chattered/PhilEdCommon | Philed/Data/SemigroupExtras.hs | mit | 462 | 0 | 7 | 86 | 167 | 91 | 76 | 12 | 1 |
{-# LANGUAGE CPP, NoImplicitPrelude #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,12,0))
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeInType #-}
#endif
module Prelude.Compat (
#if MIN_VERSION_base(4,12,0)
modul... | haskell-compat/base-compat | base-compat/src/Prelude/Compat.hs | mit | 4,365 | 0 | 9 | 870 | 319 | 221 | 98 | 289 | 1 |
--
--
--
------------------
-- Exercise 12.42.
------------------
--
--
--
module E'12'42 where
| pascal-knodel/haskell-craft | _/links/E'12'42.hs | mit | 106 | 0 | 2 | 24 | 13 | 12 | 1 | 1 | 0 |
-- Reverse a list.
module Reverse where
import Prelude hiding (reverse)
reverse :: [t] -> [t]
reverse list
= reverse' list []
where
reverse' :: [t] -> [t] -> [t]
reverse' [] listAccumulator = listAccumulator
reverse' (item : remainingItems) listAccumulator = reverse' remainingItems $! (item : listAc... | pascal-knodel/haskell-craft | Examples/· Recursion/· Tail Recursion/Lists/Reverse.hs | mit | 413 | 0 | 9 | 93 | 115 | 66 | 49 | 8 | 2 |
module MonadPlus
()where
import Control.Monad
lookupM :: (MonadPlus m, Eq a) => a -> [(a, b)] -> m b
lookupM _ [] = mzero
lookupM k ((x,y):xys)
| x == k = return y `mplus` lookupM k xys
| otherwise = lookupM k xys
x `zeroMod` n = guard ((x `mod` n) == 0) >> return x
| Numberartificial/workflow | snipets/src/RealWordHaskell/Ch15/MonadPlus.hs | mit | 282 | 0 | 10 | 72 | 164 | 87 | 77 | 9 | 1 |
{-# LANGUAGE CPP #-}
{- |
Module : $Header$
Description : utility functions that can't be found in the libraries
Copyright : (c) Klaus Luettich, Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
Uti... | nevrenato/HetsAlloy | Common/Utils.hs | gpl-2.0 | 15,344 | 0 | 20 | 4,100 | 4,174 | 2,202 | 1,972 | 273 | 4 |
module Weeder where
import Control.Applicative
import Control.Monad
import Data.Maybe
import Data.List
import AST
import Util
type WeedError = Maybe String
-- Takes a filename and CompilationUnit and returns Just an error message if invalid and Nothing if valid
weed :: String -> CompilationUnit -> WeedError
weed fi... | yangsiwei880813/CS644 | src/Weeder.hs | gpl-2.0 | 9,296 | 0 | 13 | 1,674 | 2,735 | 1,364 | 1,371 | 142 | 5 |
module Game where
import Graphics.Gloss
import Graphics.Gloss.Interface.IO.Game
import Graphics.Gloss.Data.ViewPort
import Player
import Enemies
import Background
data Direction = North | East | South | West
data GameState = Game { player :: Player, enemyList :: [Enemy], backgroundList :: [Background] , wdown :: Bo... | ThomasBDev/Iron-Rat | src/Game.hs | gpl-2.0 | 3,878 | 0 | 10 | 1,152 | 907 | 514 | 393 | 61 | 1 |
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-}
module Algebraic2.Instance where
import Expression.Op
import qualified Autolib.TES.Binu as B
import Autolib.TES.Identifier
import Data.Typeable
import Autolib.ToDoc
import Autolib.Reader
import Autolib.Set
import Autolib.FiniteMap
data Ops a => Type c a =
... | Erdwolf/autotool-bonn | src/Algebraic2/Instance.hs | gpl-2.0 | 624 | 2 | 11 | 134 | 160 | 96 | 64 | 19 | 0 |
{-# LANGUAGE DeriveDataTypeable, CPP, MultiParamTypeClasses,
FlexibleContexts, ScopedTypeVariables #-}
{-
Copyright (C) 2006-2014 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 Sof... | nickbart1980/pandoc | src/Text/Pandoc/Shared.hs | gpl-2.0 | 27,889 | 0 | 20 | 8,440 | 7,528 | 3,930 | 3,598 | 490 | 15 |
{- Chapter 9 :: The countdown problem -}
data Op = Add | Sub | Mul | Div
instance Show Op where
show Add = "+"
show Sub = "-"
show Mul = "*"
show Div = "/"
-- valid function to decide if the application of
-- an operation to two positive natural numbers
-- gives another positive natural number.
{-
... | rad1al/hutton_exercises | notes_ch09.hs | gpl-2.0 | 5,722 | 0 | 10 | 1,594 | 1,569 | 836 | 733 | 81 | 1 |
--
-- (C) 2011-14 Nicola Bonelli <nicola@pfq.io>
--
-- 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... | pandaychen/PFQ | user/pfq-omatic/pfq-omatic.hs | gpl-2.0 | 4,571 | 0 | 17 | 1,023 | 1,082 | 553 | 529 | 89 | 3 |
module Main (main) where
import Control.Monad
import Data.IORef
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
import System.Random
import Data
import Display
import Piece
import Scene
import Stats
gameArea :: Area
gameArea = Area 10 20
main = do
getArgsAndInitialize
initialDisplayMode $= [DoubleB... | pavelfatin/haskell-blocks | src/Main.hs | gpl-3.0 | 2,212 | 0 | 13 | 461 | 659 | 323 | 336 | 65 | 2 |
module Main where
import HMail.Types
import HMail.Init
import HMail.Main (hmailMain)
import Control.Applicative
import Control.Monad
import qualified Data.Foldable as F
import Text.Read (readMaybe)
import Options.Applicative as OA
import Options.Applicative.Builder as OB
-- import Options.Applicative.Help.Types (Par... | xaverdh/hmail | Main.hs | gpl-3.0 | 2,503 | 0 | 13 | 491 | 710 | 359 | 351 | 57 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Codec.Compression.GZip
import Control.Applicative
import Control.Lens
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Maybe
import qualified Data.ByteString.... | wavewave/lhc-analysis-collection | heavyhiggs/firstcut.hs | gpl-3.0 | 8,502 | 0 | 24 | 2,629 | 2,556 | 1,393 | 1,163 | 156 | 4 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 karamellpelle@hotmail.com
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the Lice... | karamellpelle/grid | designer/source/Game/Grid/Output/Draw.hs | gpl-3.0 | 2,671 | 0 | 14 | 753 | 281 | 154 | 127 | 24 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Types (
Id, unId, mkId', randomId, HasId(..),
NodeInfo(..),
-- * Locations
HasLocation(..), Location, mkLocation, toLocation,
unLocation, rightOf,
LocDistance, unDistance, locDist, absLocDist, scaleDist, locMove,
-- * state aware serialization
ToStateJSON(... | waldheinz/ads | src/lib/Types.hs | gpl-3.0 | 5,543 | 0 | 15 | 1,181 | 1,754 | 944 | 810 | 113 | 3 |
{-# LANGUAGE RecursiveDo, OverloadedStrings #-}
module Estuary.Widgets.Tempo where
import Reflex
import Reflex.Dom
import Control.Monad.Trans
import Text.Read
import Data.Text
import Data.Time
import Data.Map
import Sound.MusicW.AudioContext
import Data.Text (Text)
import qualified Data.Text as T
import TextShow
im... | d0kt0r0/estuary | client/src/Estuary/Widgets/Tempo.hs | gpl-3.0 | 6,912 | 0 | 21 | 1,301 | 2,346 | 1,167 | 1,179 | 133 | 1 |
import Test.Tasty
import qualified Granada.Tests.Parser as Parser
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [properties, unitTests]
properties :: TestTree
properties = testGroup "Properties" [Parser.propTests]
unitTests :: TestTree
unitTests = testGroup "Unit Test... | adolfosilva/granada | tests/Main.hs | gpl-3.0 | 343 | 0 | 7 | 57 | 94 | 53 | 41 | 10 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-serviceusage/gen/Network/Google/Resource/ServiceUsage/Services/Get.hs | mpl-2.0 | 4,549 | 0 | 15 | 1,063 | 700 | 410 | 290 | 100 | 1 |
module Handler.SupplierActions where
import Import
import Handler.Common
import qualified Data.Text as T
import Text.Blaze
getSupplierActionsR :: SupplierId -> Handler Html
getSupplierActionsR sId = do
mSup <- runDB $ get sId
case mSup of
Just sup ->
defaultLayout $
$(widgetFile "supplierActions... | Mic92/yammat | Handler/SupplierActions.hs | agpl-3.0 | 4,742 | 0 | 18 | 1,743 | 686 | 334 | 352 | -1 | -1 |
--Zaoqilc
--Copyright (C) 2017 Zaoqi
--This program is free software: you can redistribute it and/or modify
--it under the terms of the GNU Affero General Public License as published
--by the Free Software Foundation, either version 3 of the License, or
--(at your option) any later version.
--This program is... | zaoqi/zaoqilc | featuring/Data/Atom.hs | agpl-3.0 | 868 | 0 | 6 | 164 | 43 | 32 | 11 | 6 | 0 |
{-
Habit of Fate, a game to incentivize habit formation.
Copyright (C) 2017 Gregory Crosswhite
This program is free software: you can redistribute it and/or modify
it under version 3 of the terms of the GNU Affero General Public License.
This program is distributed in the hope that it will be usef... | gcross/habit-of-fate | sources/library/HabitOfFate/Server/Actions/Results.hs | agpl-3.0 | 3,102 | 0 | 15 | 614 | 669 | 355 | 314 | 64 | 5 |
import Data.List
import qualified Data.Set as S
import Debug.Trace
import Data.Maybe
isPrime = ((==1).length.primeFactors)
primes = 2 : filter ((==1) . length . primeFactors) [3,5..]
primeFactors n = factor n primes
where
factor n (p:ps)
| p*p > n = [n]
| n `mod` p == 0 = p : factor (n... | jdavidberger/project-euler | prob131.hs | lgpl-3.0 | 1,281 | 3 | 13 | 403 | 505 | 267 | 238 | 30 | 2 |
module Network.Haskoin.Transaction.Builder
( Coin(..)
, buildTx
, buildAddrTx
, SigInput(..)
, signTx
, signInput
, mergeTxs
, verifyStdTx
, verifyStdInput
, guessTxSize
, chooseCoins
, chooseCoinsSink
, chooseMSCoins
, chooseMSCoinsSink
, getFee
, getMSFee
) where
import Control.Arrow (first)
import Control.Monad (mz... | tphyahoo/haskoin | haskoin-core/Network/Haskoin/Transaction/Builder.hs | unlicense | 18,390 | 0 | 23 | 5,297 | 4,792 | 2,510 | 2,282 | 303 | 7 |
-- | To represent a version map,
-- that is, which version numbers exist for each package.
module VersionFile.Types where
import Distribution.Package (PackageName)
import Distribution.Version (Version)
-- A simple association list. Profile before you optimize :)
type VersionMap = [(PackageName, [Version])]
restri... | gelisam/cabal-rangefinder | src/VersionFile/Types.hs | unlicense | 485 | 0 | 7 | 83 | 107 | 65 | 42 | 8 | 1 |
import Data.List (group, permutations)
data Tree = Branch [Tree] | Leaf deriving (Eq, Show)
type Forest = [Tree]
type Harvestable = Forest
type OldGrowth = Forest
type Lumberyard = (Harvestable, OldGrowth)
type Partition = [Int]
type Composition = [Int]
fromParenthesis :: String -> Tree
-- fromParenthesis "" = ... | peterokagey/haskellOEIS | src/Sandbox/Greta/TreeFunction.hs | apache-2.0 | 3,606 | 1 | 14 | 669 | 1,403 | 743 | 660 | 67 | 4 |
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE NamedFieldPuns #-}
{-|
Module: Crypto.Spake2
Description: Implementation of SPAKE2 key exchange protocol
Say that you and someone else share a secret password, and you want to use
this password to arrange some secure channel of communication. You want:
* to know tha... | jml/haskell-spake2 | src/Crypto/Spake2.hs | apache-2.0 | 16,069 | 0 | 18 | 3,339 | 2,181 | 1,201 | 980 | 175 | 3 |
{-# LANGUAGE GeneralizedNewtypeDeriving, CPP, UnboxedTuples, RecordWildCards, MultiParamTypeClasses, FlexibleContexts, NamedFieldPuns, MagicHash, OverloadedStrings #-}
module Codec.JVM.ASM.Code.Instr where
import Control.Monad.IO.Class
import Control.Monad.State
import Control.Monad.Reader
import Data.ByteString (Byte... | rahulmutt/codec-jvm | src/Codec/JVM/ASM/Code/Instr.hs | apache-2.0 | 19,326 | 0 | 21 | 4,868 | 6,254 | 3,263 | 2,991 | 457 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Prelude
import Data.Maybe (isNothing, catMaybes, fromMaybe)
import Text.Read (readMaybe)
import Haste.Ajax (ajaxRequest, Method(POST), noParams)
import FormEngine.JQuery (ready, errorIO)
import qualified Questionnaire
import FormEngine.FormData (FormData)
i... | DataStewardshipPortal/ds-wizard | src/Main.hs | apache-2.0 | 1,253 | 0 | 15 | 225 | 286 | 153 | 133 | 29 | 2 |
-- |
-- Module : Data.Packer.IEEE754
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- fully rewritten to use primops.
--
-- original implementation based on IEEE-754 parsing, lifted from the cereal package by Christian Mari... | erikd/hs-packer | Data/Packer/IEEE754.hs | bsd-2-clause | 2,197 | 0 | 17 | 586 | 511 | 270 | 241 | 47 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.