code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
module Web.Authenticate.SQRL.Client.Types where
import Web.Authenticate.SQRL.Types
import Data.ByteString (ByteString)
import Data.Text (Text)
import Control.Exception (SomeException)
import Data.Maybe (fromMaybe)
import qualified Crypto.Ed25519.Exceptio... | TimLuq/sqrl-auth-client-hs | src/Web/Authenticate/SQRL/Client/Types.hs | Haskell | mit | 2,990 |
module TriggerSpec (spec) where
import Helper
import Trigger
normalize :: String -> [String]
normalize = normalizeErrors . normalizeTiming . normalizeSeed . lines . stripAnsiColors
where
normalizeTiming :: [String] -> [String]
normalizeTiming = mkNormalize "Finished in "
normalizeS... | hspec/sensei | test/TriggerSpec.hs | Haskell | mit | 6,731 |
module Bonlang.Runtime.Bool
( or'
, and'
, negate'
) where
import Bonlang.Lang
import qualified Bonlang.Lang.Bool as B
import qualified Data.Map as M
import Prelude hiding (negate)
booleanOp :: PrimFunc -> BonlangValue
booleanOp f = BonlangClosure { cPar... | charlydagos/bonlang | src/Bonlang/Runtime/Bool.hs | Haskell | mit | 753 |
{-# LANGUAGE TemplateHaskell #-}
module Language.SillyStack.Instructions where
import Control.Lens
import Control.Monad.State
data Thing = TInt Integer
| TInstruction Instruction
deriving (Eq, Ord, Show)
data Instruction = PUSH Thing
| POP
| ADD
... | relrod/sillystack | src/Language/SillyStack/Instructions.hs | Haskell | bsd-2-clause | 858 |
cd ../books
cd ../src
runghc Converter.hs\
--title "Numeric Haskell: A Vector Tutorial" \
--language "en-us" \
--author "hackage" \
--toc "http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Vector_Tutorial" \
--folder "../books"
| thlorenz/WebToInk | scripts/make-numerichaskellvectortutorial.hs | Haskell | bsd-2-clause | 254 |
module Analysis.Types.SortsTests where
import Test.QuickCheck
import Control.Applicative
import Analysis.Types.Sorts
import Control.Applicative()
maxComplexity = 5
allSorts = foldl mkSorts [Ann,Eff] [1..(maxComplexity + 1)]
where
mkSorts s _ = s ++ concatMap (\x -> map (Arr x) s) s
instance Arbitrary Sort whe... | netogallo/polyvariant | test/Analysis/Types/SortsTests.hs | Haskell | bsd-3-clause | 548 |
import Data.Char (chr, ord)
import Common.Utils (if')
import Common.Numbers.Primes (testPrime)
type Mask = [Int]
substitute :: Mask -> Int -> Int
substitute mask d = read (map (\x -> chr (x + ord '0')) (map (\x -> if' (x == -1) d x) mask))
goMask :: Int -> Int -> Int -> Mask -> Int
goMask top dep free mask = if de... | foreverbell/project-euler-solutions | src/51.hs | Haskell | bsd-3-clause | 1,159 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -f... | rimmington/eclogues | eclogues-impl/app/api/Eclogues/Persist.hs | Haskell | bsd-3-clause | 6,281 |
{-# LANGUAGE PostfixOperators #-}
{-# OPTIONS_HADDOCK prune #-}
----------------------------------------------------------------------------
-- |
-- Module : ForSyDe.Atom.ExB
-- Copyright : (c) George Ungureanu, 2015-2017
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : ugeorge@kth.se
-... | forsyde/forsyde-atom | src/ForSyDe/Atom/ExB.hs | Haskell | bsd-3-clause | 8,397 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
module Language.Granule.Syntax.FirstParameter where
import GHC.Generics
class FirstParameter a e | a -> e where... | dorchard/gram_lang | frontend/src/Language/Granule/Syntax/FirstParameter.hs | Haskell | bsd-3-clause | 1,825 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Common
import Database.PostgreSQL.Simple.Copy
import Database.PostgreSQL.Simple.FromField (FromField)
import Database.PostgreSQL.Simple.HStore
import Datab... | tomjaguarpaw/postgresql-simple | test/Main.hs | Haskell | bsd-3-clause | 21,271 |
{-# LANGUAGE Rank2Types #-}
{-|
'Snap.Extension.ConnectionPool' exports the 'MonadConnectionPool' interface
which allows you to use HDBC connections in your application. These
connections are pooled and only created once. The interface's only operation
is 'withConnection'.
'Snap.Extension.ConnectionPool.ConnectionPo... | duairc/snap-extensions | src/Snap/Extension/ConnectionPool.hs | Haskell | bsd-3-clause | 1,280 |
module Data.Iteratee.List.IO (
defaultBufferSize
, enumHandleSize
, enumHandle
, enumFileSize
, enumFile
) where
------------------------------------------------------------------------
-- Imports
------------------------------------------------------------------------
import Data.Iteratee.Base
import Data.Iterate... | tanimoto/iteratee | src/Data/Iteratee/List/IO.hs | Haskell | bsd-3-clause | 1,781 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
{-# LANGUAGE TupleSections #-}
module Ivory.ModelCheck.Ivory2CVC4
-- ( modelCheckMod )
where
import Pre... | GaloisInc/ivory | ivory-model-check/src/Ivory/ModelCheck/Ivory2CVC4.hs | Haskell | bsd-3-clause | 21,486 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-} -- FIXME
module B.Shake.Core.Rule.Internal
( ShakeValue
, Rule(..)
,... | strager/b-shake | B/Shake/Core/Rule/Internal.hs | Haskell | bsd-3-clause | 1,833 |
-- 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. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE GADT... | rfranek/duckling | Duckling/Ordinal/IT/Rules.hs | Haskell | bsd-3-clause | 2,827 |
module ProjectEuler.Problem011 (solution011) where
import Util
takeWhilePN :: Int -> (a -> Bool) -> [a] -> [a]
takeWhilePN _ _ [] = []
takeWhilePN n p (x:xs) | p x = x : takeWhilePN n p xs
| otherwise = take n (x:xs)
triangles :: [Int]
triangles = 1 : map pairSum (zip triangles [2..])
f... | ThermalSpan/haskell-euler | src/ProjectEuler/Problem011.hs | Haskell | bsd-3-clause | 421 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Example.Engine where
import Data.DEVS
import Data.Binary
import Data.Typeable (Typeable)
import Data.Set (Set)
import qualified Data.Set as Set
import qualified Prelude as P
import Numeric.Units.Dimensiona... | alios/lambda-devs | Example/Example/Engine.hs | Haskell | bsd-3-clause | 634 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE ForeignFunctionInterface #-}
-- |
-- Module : Data.Binary.Serialise.CBOR.ByteOrder
-- Copyright : (c) Duncan Coutts 2015
-- License : BSD3-style (see LICENSE.txt)
--
-- Maintainer : duncan@community.haskell.org
-- S... | thoughtpolice/binary-serialise-cbor | Data/Binary/Serialise/CBOR/ByteOrder.hs | Haskell | bsd-3-clause | 6,724 |
module PasswordGenerator (newPasswordBox) where
import Graphics.UI.Gtk
import Crypto.Threefish.Random
import Data.IORef
import System.IO.Unsafe
import Graphics.Rendering.Pango.Font
import Himitsu.PasswordUtils
import PasswordDialogs (passwordBox)
{-# NOINLINE prng #-}
prng :: IORef SkeinGen
prng = unsafePerformIO $ ne... | valderman/himitsu | src/PasswordGenerator.hs | Haskell | bsd-3-clause | 6,212 |
{-# LANGUAGE DeriveDataTypeable
, NoImplicitPrelude
, PackageImports
, UnicodeSyntax
#-}
module Data.LList
( LList
, fromList
, toList
, cons
, (++)
, head
, safeHead
, last
, safeLast
, tail
, safeTail
, init
, null
, length
... | roelvandijk/length-list | src/Data/LList.hs | Haskell | bsd-3-clause | 5,867 |
<?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="si-LK">
<title>TLS Debug | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref l... | veggiespam/zap-extensions | addOns/tlsdebug/src/main/javahelp/org/zaproxy/zap/extension/tlsdebug/resources/help_si_LK/helpset_si_LK.hs | Haskell | apache-2.0 | 971 |
module TimeMaster (timeMaster) where
import ServerMonad
import Control.Concurrent.MVar
import Data.Time.LocalTime
import System.Posix.Env
timeMaster :: TimeMasterVar -> IO ()
timeMaster tmvar
= do (timezone, mv) <- takeMVar tmvar
lt <- getLocalTimeInTimezone timezone
putMVar mv lt
timeMaster tmva... | haskell/ghc-builder | server/TimeMaster.hs | Haskell | bsd-3-clause | 625 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
#ifndef MIN_VERSION_mtl
#define MIN_VERSION_mtl(x,y,z) 0
#endif
-----------------------------------------------------------------------------
-- |
-- Module ... | bitemyapp/machines | src/Data/Machine/Plan.hs | Haskell | bsd-3-clause | 6,013 |
{-# LANGUAGE RecordWildCards #-}
module GHCJS.DOM.JSFFI.PositionError (
module Generated
, PositionErrorCode(..)
, PositionException(..)
, throwPositionException
) where
import Control.Exception (Exception, throwIO)
import Control.Monad.IO.Class (MonadIO(..))
import GHCJS.DOM.JSFFI.Generated.PositionError a... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/PositionError.hs | Haskell | mit | 913 |
module X (foo) where
foo = 10
| itchyny/vim-haskell-indent | test/module/export.out.hs | Haskell | mit | 30 |
{-# OPTIONS_JHC -fno-prelude -fm4 #-}
module Jhc.Inst.Read() where
import Prelude.Text
import Jhc.Basics
import Jhc.Float
import Prelude.Float
import Jhc.Num
import Numeric(showSigned, showInt, readSigned, readDec, showFloat,
readFloat, lexDigits)
-- Reading at the Integer type avoids
-- possible diff... | m-alvarez/jhc | lib/jhc/Jhc/Inst/Read.hs | Haskell | mit | 1,136 |
module Layout.Default where
default (Float,Integer,Double)
foo = 5
| RefactoringTools/HaRe | test/testdata/Layout/Default.hs | Haskell | bsd-3-clause | 70 |
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.STRef.Lazy
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : ... | frantisekfarka/ghc-dsi | libraries/base/Data/STRef/Lazy.hs | Haskell | bsd-3-clause | 1,152 |
-- | This module contains functions that act on factions.
module Game.Cosanostra.Faction
( factionMembers
, effectsFaction
, winners
) where
import Game.Cosanostra.Effect
import Game.Cosanostra.Lenses
import Game.Cosanostra.Types
import Control.Lens
import Data.Maybe
import qualified Data.Set as S
--... | rfw/cosanostra | src/Game/Cosanostra/Faction.hs | Haskell | mit | 2,675 |
{-
Copyright (C) 2015 Braden Walters
This file is licensed under the MIT Expat License. See LICENSE.txt.
-}
{-# LANGUAGE QuasiQuotes #-}
module Output.CPP (outputCpp) where
import Data.List (intersperse, sortBy)
import FollowTable
import Rules
import StartEndTable
import StateTable
import Text.RawString.QQ
outputCp... | meoblast001/lexical-analyser-generator | src/Output/CPP.hs | Haskell | mit | 11,472 |
{-# LANGUAGE TupleSections, OverloadedStrings #-}
module Handler.Home where
import Import
import App.Pieces
import App.UTCTimeP
import Data.Text as T
-- This is a handler function for the GET request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majo... | TimeAttack/time-attack-server | Handler/Home.hs | Haskell | mit | 1,346 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Db.PlaceCategory
( PlaceCategory'(PlaceCategory)
, NewPlaceCategory
, Pla... | benkolera/talk-stacking-your-monads | code-classy/src/Db/PlaceCategory.hs | Haskell | mit | 2,004 |
module Parse
(
totalCents,
purchaseDate,
maybeToEither
) where
import Text.Read as R
import Data.List as DL
import Data.Char (isDigit)
import Data.Time.Calendar
import Data.Time.Format as DF
import Data.Time.Clock
totalCents :: String -> Either String Int
totalCents "" = Left "empty input"
t... | fsvehla/steam-analytics | src/Parse.hs | Haskell | mit | 1,544 |
module Main
( main
)
where
-- doctest
import qualified Test.DocTest as DocTest
main :: IO ()
main =
DocTest.doctest
[ "-isrc"
, "src/AParser.hs"
]
| mauriciofierrom/cis194-homework | homework10/test/examples/Main.hs | Haskell | mit | 170 |
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedLabels #-}
module Examples.Rpc.CalculatorClient (main) where
import qualified Capnp.New as C
import Capnp.Rpc
(ConnConfig(..), fromClient, handleConn, socketTransport)
import Contr... | zenhack/haskell-capnp | examples/lib/Examples/Rpc/CalculatorClient.hs | Haskell | mit | 2,681 |
module Tree.Lists where
import Tree.Types
import Tree.BTree
import Tree.Balanced (insert)
-- IN-order traversal.
-- 1. traverse left. 2. visit root. 3. traverse right.
inOrdList :: BTree a -> [a]
inOrdList = foldTree (\v lRes rRes -> lRes ++ v : rRes) []
-- POST-order traversal.
-- 1. traverse left. 2. traverse r... | marklar/elm-fun | BTree/Tree/Lists.hs | Haskell | mit | 1,169 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds, ConstraintKinds, PolyKinds #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module GrammarGen where
import Generics.SOP
import Random
class Gen a where
gen :: Mon... | vladfi1/hs-misc | GrammarGen.hs | Haskell | mit | 780 |
module Util where
import qualified System.Random.MWC as MWC
import Data.ByteVector (fromByteVector)
import System.IO.Temp (withSystemTempFile)
import Data.ByteString.Lazy.Internal (defaultChunkSize)
import System.IO (hClose)
import Conduit
import Control.Monad.Catch (MonadMask)
import Data.Time (getCurrentTime, diffUT... | snoyberg/bytevector | bench/Util.hs | Haskell | mit | 1,050 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Graphics.Tracy.Color
( -- * Colors
Color (..)
, from256
, Alpha
, blending
-- * Literals
, white
, gray
, black
, red
, green
, blue
, cyan
, magenta
, yell... | pxqr/tracy | src/Graphics/Tracy/Color.hs | Haskell | mit | 1,504 |
{-# LANGUAGE ScopedTypeVariables #-}
module CodeGen where
import Prelude
import Data.List
import qualified Data.Map as HashMap
import qualified LLIR
import LLIR hiding (blockName)
import Text.Printf
data CGContext = CGContext {
-- label, constant string
constStrs :: HashMap.Map String String,
nextConstStrId ::... | Slava/6.035-decaf-compiler | src/CodeGen.hs | Haskell | mit | 25,071 |
{-# LANGUAGE DeriveGeneric, OverloadedStrings #-}
module Pitch.Players.Network
where
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Control.Monad.Writer
import Data.Aeson (ToJSON, toJSON, FromJSON, fromJSON, encode, decode, Value (..), object, (.:), (.=), parseJSON, (.... | benweitzman/Pitch | src/Pitch/Players/Network.hs | Haskell | mit | 8,028 |
{-# LANGUAGE FlexibleInstances #-}
module Model where
import ClassyPrelude.Yesod
import Database.Persist.Quasi
import ModelTypes
import Yesod.Auth.HashDB (HashDBUser(..))
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-... | ahushh/Monaba | monaba/src/Model.hs | Haskell | mit | 603 |
-- Multiples of Ten in a Sequence Which Values Climb Up
-- http://www.codewars.com/kata/561d54055e399e2f62000045/
module Codewars.Kata.ClimbUp where
import Control.Arrow ((&&&))
findMult10SF :: Int -> Integer
findMult10SF = uncurry (+) . ((*3) . (2^) &&& (*9) . (6^)) . (+ (-3)) . (*4)
| gafiatulin/codewars | src/Beta/ClimbUp.hs | Haskell | mit | 289 |
{-
Model of explosion of buried curved charge.
Proposed by L. M. Kotlyar in 1970's
Makes possible the calculations of blast edges given set parameters.
Explosion is modelled as potential flow of ideal liquid.
Encoded by Saphronov Mark a. k. a. hijarian
2011.09
Public Domain
-}
module Model.Functions (
dzdu,
dzdu',... | hijarian/AFCALC | program/src/Model/Functions.hs | Haskell | cc0-1.0 | 8,074 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-- The generic imp... | krapsh/kraps-haskell | src/Spark/Core/Internal/RowGenerics.hs | Haskell | apache-2.0 | 3,263 |
{-# LANGUAGE TypeFamilies, OverloadedLists, FlexibleInstances, FunctionalDependencies, ViewPatterns, MultiParamTypeClasses, UnicodeSyntax, GeneralizedNewtypeDeriving #-}
module Fuzzy.Bool where
import Prelude.Unicode
import Control.Applicative
import Data.Monoid
import GHC.Exts
class Adjunct f u | f → u where
for... | edgarklerks/document-indexer | Fuzzy/Bool.hs | Haskell | bsd-2-clause | 2,977 |
{-# LANGUAGE RankNTypes #-}
module Graphics.GL.Low.Framebuffer (
-- | By default, rendering commands output graphics to the default framebuffer.
-- This includes the color buffer, the depth buffer, and the stencil buffer. It
-- is possible to render to a texture instead. This is important for many
-- techniques. Rende... | sgraf812/lowgl | Graphics/GL/Low/Framebuffer.hs | Haskell | bsd-2-clause | 8,157 |
module Data.CRF.Chain2.Tiers.DP
( table
, flexible2
, flexible3
) where
import qualified Data.Array as A
import Data.Array ((!))
import Data.Ix (range)
table :: A.Ix i => (i, i) -> ((i -> e) -> i -> e) -> A.Array i e
table bounds f = table' where
table' = A.listArray bounds
$ map (f (table' !))
... | kawu/crf-chain2-tiers | src/Data/CRF/Chain2/Tiers/DP.hs | Haskell | bsd-2-clause | 1,339 |
{-|
Module : Database.Relational.FieldType
Description : Definition of FieldType and friends.
Copyright : (c) Alexander Vieth, 2015
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE AutoDeriveTypeable #-}
{-# LANGUAGE TypeFamilies... | avieth/Relational | Database/Relational/FieldType.hs | Haskell | bsd-3-clause | 2,284 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE TemplateHaskell #-}
-- | This module contains operations related to symbolic stack.
module Toy.X86.SymStack
( regSymStack
, atSymStack
, SymStackSpace
, SymStackHolder
, runSymStackHold... | Martoon-00/toy-compiler | src/Toy/X86/SymStack.hs | Haskell | bsd-3-clause | 2,788 |
{-# LANGUAGE TemplateHaskell #-}
module Test.ScopeLookup where
import Language.Haskell.TH
import NotCPP.ScopeLookup
scopeLookupTest = $(do
Just t <- scopeLookup' "True"
return t)
| bmillwood/notcpp | Test/ScopeLookup.hs | Haskell | bsd-3-clause | 186 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE... | haskell-distributed/distributed-process-registry | src/Control/Distributed/Process/Registry.hs | Haskell | bsd-3-clause | 41,815 |
module Diag.Util.Encoding
where
import Data.Char
import Data.Word
import Data.Bits
import Numeric
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString as S
int2Word8 x = fromIntegral x :: Word8
word8ToInt x = fromIntegral x :: Int
encodeInt :: (Integral a, Bits a) => a -> Int... | marcmo/hsDiagnosis | src/Diag/Util/Encoding.hs | Haskell | bsd-3-clause | 1,777 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
module Language.C.CPPPP.Transforms.Chs (mkChs, mkObjChs) where
import Language.C.CPPPP.Transforms.CTypes
import qualified Language.C.Syntax as C
import Language.C.Quote.C
import Data.Loc (SrcLoc)
import Data.List
import Language.Haskell.TH hiding (varP)
import System.IO
m... | mxswd/cpppp | Language/C/CPPPP/Transforms/Chs.hs | Haskell | bsd-3-clause | 2,463 |
{-# OPTIONS -Wall #-}
{-|
Module : Esge.Base
Description : Highlevel basic esge module.
Copyright : (c) Simon Goller, 2015
License : BSD
Maintainer : neosam@posteo.de
Basic required functions in order create a game.
They are higher level and let you for example move Individuals.
Many features are introduc... | neosam/esge | src/Esge/Base.hs | Haskell | bsd-3-clause | 8,528 |
module TestData where
import Data.IntMap as IMap
import Data.Set as Set
data Codegen = C | JS deriving (Show, Eq, Ord)
type Index = Int
data CompatCodegen = ANY | C_CG | NODE_CG | NONE
-- A TestFamily groups tests that share the same theme
data TestFamily = TestFamily {
-- A shorter lowcase name to use in filename... | uuhan/Idris-dev | test/TestData.hs | Haskell | bsd-3-clause | 8,201 |
module HLearn.Data.UnsafeVector
( setptsize
)
where
import Control.DeepSeq
import Control.Monad
import Data.IORef
import Debug.Trace
import qualified Data.Foldable as F
import Data.Primitive
import Data.Primitive.MachDeps
import qualified Data.Vector.Generic as VG
import qualified Data.Vector.Generic.Mutab... | iamkingmaker/HLearn | src/HLearn/Data/UnsafeVector.hs | Haskell | bsd-3-clause | 7,912 |
{-# LANGUAGE QuasiQuotes #-}
module Test0 () where
import LiquidHaskell
[lq| thing :: Int -> x:Int |]
thing = undefined
| spinda/liquidhaskell | benchmarks/gsoc15/neg/test5.hs | Haskell | bsd-3-clause | 124 |
{-# LANGUAGE DoRec, GeneralizedNewtypeDeriving #-}
module Language.Brainfuck.CompileToIA32 (compile) where
import qualified Language.Brainfuck.Syntax as BF
import Language.IA32.Syntax
import Control.Monad.RWS
newtype Compiler a = Compiler { runCompiler :: RWS () [Directive] Label a } deriving (Monad, MonadFix)
... | gergoerdi/brainfuck | language-brainfuck/src/Language/Brainfuck/CompileToIA32.hs | Haskell | bsd-3-clause | 2,123 |
{-# OPTIONS -XDeriveDataTypeable -XCPP #-}
module ShopCart ( shopCart) where
import Data.Typeable
import qualified Data.Vector as V
import Text.Blaze.Html5 as El
import Text.Blaze.Html5.Attributes as At hiding (step)
import Data.Monoid
import Data.String
import Data.Typeable
-- #define ALONE -- to execute it alone, un... | agocorona/MFlow | Demos/ShopCart.hs | Haskell | bsd-3-clause | 2,856 |
{-# OPTIONS -XCPP -#include "comPrim.h" #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Win32.Com.Exception
-- Copyright : (c) 2009, Sigbjorn Finne
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : sof@forkIO.com
--... | HJvT/com | System/Win32/Com/Exception.hs | Haskell | bsd-3-clause | 32,564 |
-- |
-- Module : Crypto.Cipher.Types
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : Stable
-- Portability : Excellent
--
-- symmetric cipher basic types
--
module Crypto.Internal
(
-- * Key type and constructor
KeyError(..)
, Key(..)
, makeKey... | jonathankochems/hs-crypto-cipher | src/Crypto/Internal.hs | Haskell | bsd-3-clause | 1,085 |
-- Copyright © 2010 Greg Weber and Bart Massey
-- [This program is licensed under the "3-clause ('new') BSD License"]
-- Please see the file COPYING in this distribution for license information.
-- | Read a spelling dictionary.
module Text.SpellingSuggest.Dictionary (
defaultDictionary, readDictionary
) where
imp... | gregwebs/haskell-spell-suggest | Text/SpellingSuggest/Dictionary.hs | Haskell | bsd-3-clause | 899 |
module Main where
import Ivory.Tower.Options
import Tower.AADL
import Ivory.Tower.Config
import Tower.AADL.Build.Common
import Tower.AADL.Build.EChronos
import Ivory.BSP.STM32.Config
import BSP.Tests.Platforms
import BSP.Tests.LED.TestApp (app)
main :: IO ()
main = compileTowerAADLForPlatform f p $ do
app tes... | GaloisInc/ivory-tower-stm32 | ivory-bsp-tests/tests/LEDAADLTest.hs | Haskell | bsd-3-clause | 704 |
{-# LANGUAGE OverloadedStrings #-}
import Test.Hspec
import Test.QuickCheck
import Flux
main = hspec $ do
describe "The delegation graph" $
it "Should have size 0 when empty" $ do
graphSize emptyGraph `shouldBe` 0
-- adding and removing a voter is a no-op
-- adding a voter is idempotent
-- ... | timbod7/flux-model | test/Spec.hs | Haskell | bsd-3-clause | 477 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE BangPatterns #-}
module Sky.Parsing.Invertible3.Isomorphism where
import Prelude hiding (id, (.))
import Data.Data (Data)
import Data.Proxy (Proxy(..))
import Control.Category (Category(..))
import Sky.Parsing.Inv... | xicesky/sky-haskell-playground | src/Sky/Parsing/Invertible3/Isomorphism.hs | Haskell | bsd-3-clause | 6,820 |
module WildBind.ForTest
( SampleInput(..),
SampleState(..),
SampleBackState(..),
inputAll,
execAll,
evalStateEmpty,
boundDescs,
boundDescs',
curBoundInputs,
curBoundDescs,
curBoundDesc,
checkBoundInputs,
c... | debug-ito/wild-bind | wild-bind/test/WildBind/ForTest.hs | Haskell | bsd-3-clause | 3,683 |
module GLogger.Client (
initLogger,
cleanLog,
logDebug,
logInfo,
logNotice,
logWarning,
logError,
logCritical,
logAlert,
logEmergency
) where
import qualified System.Log.Logger as SL
import System.Log.Handler.Simple (fileHandler)
import System.Log.Handler (setFormatter)
import System.Log.Formatte... | cernat-catalin/haskellGame | src/GLogger/Client.hs | Haskell | bsd-3-clause | 1,815 |
{-# LANGUAGE ViewPatterns #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.FocusNth
-- Description : Focus the nth window of the current workspace.
-- Copyright : (c) Karsten Schoelzel <kuser@gmx.de>
-- License : BSD
--
-- Maintainer : K... | xmonad/xmonad-contrib | XMonad/Actions/FocusNth.hs | Haskell | bsd-3-clause | 1,920 |
module Language.Haskell.Liquid.Bare.SymSort (
txRefSort
) where
import Control.Applicative ((<$>))
import qualified Data.List as L
import Language.Fixpoint.Misc (errorstar, safeZip, fst3, snd3)
import Language.Fixpoint.Types (meet)
import Language.Haskell.Liquid.Types.RefType (appRTyCon, strengthen)
import La... | abakst/liquidhaskell | src/Language/Haskell/Liquid/Bare/SymSort.hs | Haskell | bsd-3-clause | 2,198 |
{-
Copyright (C) 2012-2017 Kacper Bak, Jimmy Liang, Michal Antkiewicz <http://gsd.uwaterloo.ca>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitatio... | juodaspaulius/clafer | src-cmd/clafer.hs | Haskell | mit | 2,148 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Book
( Book (..)
, Part (..)
, Chapter (..)
, loadBook
) where
import Control.Exception (SomeException, evaluate, handle,
... | wolftune/yesodweb.com | Book.hs | Haskell | bsd-2-clause | 10,973 |
-- print2.hs
module Print2 where
main :: IO ()
main = do
putStrLn "Count to four for me:"
putStr "one, two"
putStr ", three, and"
putStrLn " four!"
| OCExercise/haskellbook-solutions | chapters/chapter03/scratch/print2.hs | Haskell | bsd-2-clause | 169 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Trustworthy #-}
#endif
-- |
-- Copyright : (c) 2010 Simon Meier
--
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Simon Meier <iridcode@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
... | CloudI/CloudI | src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString/Builder/Prim/Internal/Floating.hs | Haskell | mit | 1,783 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Vimus.Command.Help (
Help (..)
, help
, commandShortHelp
, commandHelpText
) where
import Control.Monad
import Data.Maybe
import Data.String
import Language.Haskell.TH
import Language.Haske... | haasn/vimus | src/Vimus/Command/Help.hs | Haskell | mit | 1,881 |
module Control.Search.Combinator.Let (let', set') where
import Control.Search.Language
import Control.Search.GeneratorInfo
import Control.Search.Generator
import Control.Search.Stat
stmPrefixLoop stm super = super { tryH = \i -> (stm i) @>>>@ (tryE super) i, startTryH = \i -> (stm i) @>>>@ (startTryH super) i, toStri... | neothemachine/monadiccp | src/Control/Search/Combinator/Let.hs | Haskell | bsd-3-clause | 1,680 |
{-|
Module : CSH.Eval.Cacheable.Make
Description : Cacheable Actions to Create Objects
Copyright : Stephen Demos, Matt Gambogi, Travis Whitaker, Computer Science House 2015
License : MIT
Maintainer : pvals@csh.rit.edu
Stability : Provisional
Portability : POSIX
CSH.Eval.Cacheable.Make defines 'Cacheable'... | TravisWhitaker/csh-eval | src/CSH/Eval/Cacheable/Make.hs | Haskell | mit | 14,290 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="el-GR">
<title>Port Scan | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref l... | veggiespam/zap-extensions | addOns/zest/src/main/javahelp/org/zaproxy/zap/extension/zest/resources/help_el_GR/helpset_el_GR.hs | Haskell | apache-2.0 | 996 |
{-# LANGUAGE PatternGuards, ExistentialQuantification, CPP #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Idris.Core.Execute (execute) where
import Idris.AbsSyntax
import Idris.AbsSyntaxTree
import IRTS.Lang(FDesc(..), FType(..))
import Idris.Primitives(Prim(..), primitives)
import Idris.Core.TT
import Id... | TimRichter/Idris-dev | src/Idris/Core/Execute.hs | Haskell | bsd-3-clause | 30,115 |
{-# LANGUAGE RecordWildCards #-}
module Network.Wai.Middleware.RequestLogger.JSON (formatAsJSON) where
import qualified Blaze.ByteString.Builder as BB
import Data.Aeson
import Data.CaseInsensitive (original)
import Data.Monoid ((<>))
import qualified Data.ByteString.Char8 as S8
import Data.IP
import qualified Data.Te... | rgrinberg/wai | wai-extra/Network/Wai/Middleware/RequestLogger/JSON.hs | Haskell | mit | 3,346 |
-- Copyright (c) 2014-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is distributed under the terms of a BSD license,
-- found in the LICENSE file. An additional grant of patent rights can
-- be found in the PATENTS file.
{-# LANGUAGE CPP #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGU... | hiteshsuthar/Haxl | Haxl/Core/DataCache.hs | Haskell | bsd-3-clause | 3,612 |
module ConstructorIn1 where
data MyBTree a
= Empty | T a (MyBTree a) (MyBTree a) deriving Show
buildtree :: Ord a => [a] -> MyBTree a
buildtree [] = Empty
buildtree ((x : xs)) = insert x (buildtree xs)
insert :: Ord a => a -> (MyBTree a) -> MyBTree a
insert val Empty = T val Empty Empty
insert val tree@(T t... | mpickering/HaRe | old/testing/renaming/ConstructorIn1_AstOut.hs | Haskell | bsd-3-clause | 487 |
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -O #-}
module T12944 () where
class AdditiveGroup v where
(^+^) :: v -> v -> v
negateV :: v -> v
(^-^) :: v -> v -> v
v ^-^ v' = v ^+^ negateV v'
class AdditiveGroup v => VectorSpace v where
type Scalar v :: *
(*^) :: Scalar v -> v -> v
data Poly1 a = Poly1 ... | ezyang/ghc | testsuite/tests/deSugar/should_compile/T12944.hs | Haskell | bsd-3-clause | 1,147 |
module Complex(Complex((:+)), realPart, imagPart, conjugate, mkPolar,
cis, polar, magnitude, phase) where
--import Prelude
infix 6 :+
data (RealFloat a) => Complex a = !a :+ !a deriving (Eq,Read,Show)
realPart, imagPart :: (RealFloat a) => Complex a -> a
realPart (x:+y) = x
imagPart (x:+y)... | forste/haReFork | tools/base/tests/HaskellLibraries/Complex.hs | Haskell | bsd-3-clause | 3,383 |
{-# LANGUAGE GADTs #-}
-- It's not clear whether this one should succeed or fail,
-- Arguably it should succeed because the type refinement on
-- T1 should make (y::Int). Currently, though, it fails.
module ShouldFail where
data T a where
T1 :: Int -> T Int
f :: (T a, a) -> Int
f ~(T1 x, y) = x+y
| olsner/ghc | testsuite/tests/gadt/lazypatok.hs | Haskell | bsd-3-clause | 306 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.HTMLBaseFontElement
(js_setColor, setColor, js_getColor, getColor, js_setFace, setFace,
js_getFace, getFace, js_setSize, setSize, js_getSize, getSize,
HTMLBaseFontElement, castToHTMLBaseFont... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/HTMLBaseFontElement.hs | Haskell | mit | 3,387 |
-- Word a9n (abbreviation)
-- http://www.codewars.com/kata/5375f921003bf62192000746/
module A9n where
import Data.Char (isLetter)
import Data.List (groupBy)
import Data.Function (on)
abbreviate :: String -> String
abbreviate = concatMap (\w -> if isLetter . head $ w then f w else w) . groupBy ((==) `on` isLetter)
... | gafiatulin/codewars | src/6 kyu/A9n.hs | Haskell | mit | 422 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid
import Web.Scotty
import qualified Data.Text.Lazy as T
import Data.Text.Lazy.Encoding (decodeUtf8)
import qualified Views.Index
import Text.Blaze.Html.Renderer.Text
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static
blaze = html . rend... | Pholey/place-puppy | Placepuppy/Main.hs | Haskell | mit | 680 |
{-# LANGUAGE BangPatterns, DeriveDataTypeable #-}
import System.Console.CmdArgs
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy as L
import Data.NGH.Alignments
import Data.NGH.Formats.Sam
import Data.Void
import Data.Conduit
import Data.Maybe
impo... | luispedro/NGH | bin/sam-filter.hs | Haskell | mit | 1,832 |
{-# LANGUAGE OverloadedStrings #-}
-- | Data structures needed for interfacing with the Websocket
-- Gateway
module Network.Discord.Types.Gateway where
import Control.Monad (mzero)
import System.Info
import Data.Aeson
import Data.Aeson.Types
import Network.WebSockets
import Network.Discord.Types.Prelude... | jano017/Discord.hs | src/Network/Discord/Types/Gateway.hs | Haskell | mit | 3,325 |
{-# LANGUAGE ViewPatterns #-}
module Unison.Util.Set where
import Data.Set
symmetricDifference :: Ord a => Set a -> Set a -> Set a
symmetricDifference a b = (a `difference` b) `union` (b `difference` a)
mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b
mapMaybe f s = fromList [ r | (f -> Just r) <- toLi... | unisonweb/platform | unison-core/src/Unison/Util/Set.hs | Haskell | mit | 327 |
{-# LANGUAGE RecordWildCards #-}
module Processor.Sprockell where
{-------------------------------------------------------------
|
| SPROCKELL: Simple PROCessor in hasKELL :-)
|
| j.kuper@utwente.nl
| October 14, 2012
|
-------------------------------------------------------------}
{---------------------------------... | thomasbrus/imperia | src/Processor/Sprockell.hs | Haskell | mit | 5,676 |
factors n = [x | x <- [1..n], n `mod` x == 0]
perfects :: Int -> [Int]
perfects n = [x | x <- [1..n], isPerfect x]
where isPerfect n' = sum (factors n') - n' == n'
-- using filter but not so good
perfects' :: Int -> [Int]
perfects' n = [x | x <- [1..n], isPerfect x]
where isPerfect n' = sum (filter (/= n') (f... | fabioyamate/programming-in-haskell | ch05/ex04.hs | Haskell | mit | 749 |
module Session where
import Data.IntMap (adjust)
import PeaCoq
isAlive :: SessionState -> Bool
isAlive (SessionState alive _) = alive
markStale :: SessionState -> SessionState
markStale (SessionState _ hs) = SessionState False hs
touchSession :: SessionState -> SessionState
touchSession (SessionState _ hs) = Sessi... | Ptival/peacoq-server | lib/Session.hs | Haskell | mit | 542 |
import Churro.Interpreter
import System.Environment
import System.IO
{-
Opens a file and interprets the Churro code.
-}
main :: IO ()
main =
do{ args <- getArgs
; case args of
x:xs ->
do{ handle <- openFile x ReadMode
; code <- hGetContents handle
... | TheLastBanana/Churro | Main.hs | Haskell | mit | 475 |
module Main where
import Prelude ()
import Common
import Blas
import qualified C
import qualified Fortran as F
mapFst f (x, y) = (f x, y)
convRet config (Just t) = (F.typeMap config t, F.returnConventionMap config t)
convRet _ Nothing = (C.Void, F.ReturnValue)
convIntent F.In = C.Const
convIntent _ = id
co... | Rufflewind/blas-shim | Main.hs | Haskell | mit | 2,975 |
xs <- get
get >>= (\xs -> put (result : xs))
State (\s -> (s,s)) >>= (\xs -> put (result:xs))
State (\s -> (s,s)) >>= (\xs -> State (\_ -> ((), (result:xs))))
f = (\s -> (s,s))
g = (\xs -> State (\_ -> ((), (result:xs))))
State $ (\s -> let (a,s') = (\s -> (s,s)) s in runState (g a) s'
a ~ s
s' ~ s
reduces to:... | JustinUnger/haskell-book | ch23/foo.hs | Haskell | mit | 585 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGFEDisplacementMapElement
(pattern SVG_CHANNEL_UNKNOWN, pattern SVG_CHANNEL_R,
pattern SVG_CHANNEL_G, pattern SVG_CHANNEL_B,
pattern SVG_CHANNEL_A, js_getIn1, getIn1, js_getIn2, getIn2,
... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGFEDisplacementMapElement.hs | Haskell | mit | 4,146 |
module GrabBag where
-- Question 3a
addOneIfOdd n = case odd n of
True -> f n
False -> n
where f = (\n -> n + 1) -- could also do (+1) and get rid of the function
-- Question 3b
addFive = \x -> \y -> (if x > y then y else x) + 5
-- Question 3c
mflip f x y = f y x
| rasheedja/HaskellFromFirstPrinciples | Chapter7/grabBag.hs | Haskell | mit | 273 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.