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 OverloadedStrings #-}
--------------------------------------------------------------------
-- |
-- Module : Utils.Katt.Upload
--
-- Upload submodule providing submissions of solutions and parsing of results.
--
-- A submission is done by including all recursively found files and filtering
-- using a file ... | davnils/katt | katt-lib/src/Utils/Katt/Upload.hs | Haskell | bsd-3-clause | 9,827 |
module IOFunc
( ioPrimitives
) where
import Control.Applicative ((<$>))
import Control.Monad.Trans
import Env (bindVars)
import Eval (apply, eval)
import Lib (liftThrows)
import Parser (readE... | cheng81/schemish | src/IOFunc.hs | Haskell | bsd-3-clause | 2,435 |
{-# LANGUAGE TemplateHaskell #-}
module Polycephaly.TH (
units
) where
import Test.Tasty
import Test.Tasty.HUnit
import Language.Haskell.TH
import Language.Haskell.TH.Alpha ( areExpAEq )
import Language.Haskell.Polycephaly.TH
units = units_mkFlagDC
units_mkFlagDC =
... | jkarni/polycephalous-instances | tests/Polycephaly/TH.hs | Haskell | bsd-3-clause | 676 |
{-------------------------------------------------------------------------------
MorphGrammar.Hofm.Transf.TTransf
Transformation function represented as a tree of replacement operators
Jan Snajder <jan.snajder@fer.hr>
(c) 2009 TakeLab
University of Zagreb
Faculty of Electrical Engineering and Computing
--------... | jsnajder/hofm | src/MorphGrammar/Hofm/Transf/TTransf.hs | Haskell | bsd-3-clause | 3,477 |
-----------------------------------------------------------
-- |
-- Module : Database.HaskellDB.Sql.Print
-- Copyright : Daan Leijen (c) 1999, daan@cs.uu.nl
-- HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net
-- License : BSD-style
--
-- Maintainer : haskelldb-users@lists.source... | m4dc4p/haskelldb | src/Database/HaskellDB/Sql/Print.hs | Haskell | bsd-3-clause | 6,411 |
module Generator (
generateSource
) where
import Control.Monad hiding (join)
import Control.Monad.State hiding (join)
import Data.Char
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S
import Data.String.Utils
import Data.Tuple
import Module
import Parser
import Registry
import Text.Pri... | polarina/opengl-wrangler | gen/Generator.hs | Haskell | bsd-3-clause | 18,888 |
{-# LANGUAGE NoImplicitPrelude #-}
module Protocol.ROC.PointTypes.PointType12 where
import Data.Binary.Get (getWord8,Get)
import Data.Word (Word8)
import Prelude (($),
return,
Bool,
Eq,
R... | plow-technologies/roc-translator | src/Protocol/ROC/PointTypes/PointType12.hs | Haskell | bsd-3-clause | 2,116 |
module Main where
import System.Environment (getArgs)
import Network.Factual.API
import Data.Factual.Query.SchemaQuery
import Data.Factual.Response
main :: IO()
main = do
args <- getArgs
let oauthKey = head args
let oauthSecret = last args
let options = Options { token = generateToken oauthKey oauthSecret, ti... | rudyl313/factual-haskell-driver | examples/SchemaExample.hs | Haskell | bsd-3-clause | 549 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Config (Config(..), ConfigReader(..), Domain, get) where
import System.Environment as Sys
import Control.Monad.IO.Class
(MonadIO)
import Control.Monad.Reader
(MonadReader, ReaderT)
type Domain
... | svanderbleek/media-server | src/Config.hs | Haskell | bsd-3-clause | 660 |
module Main where
import Safe.Length (safeLength)
import Data.Proxy (Proxy(..))
main :: IO ()
main = print $ safeLength (Proxy :: Proxy (Char, Char)) ('a', 'b')
| stepcut/safe-length | example/GoodTuple.hs | Haskell | bsd-3-clause | 164 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Ivory.ModelCheck.CVC4 where
import Prelude ()
import Prelude.Compat hiding (exp)
#if !MIN_VERSION_base(4... | GaloisInc/ivory | ivory-model-check/src/Ivory/ModelCheck/CVC4.hs | Haskell | bsd-3-clause | 11,972 |
{-# LANGUAGE Safe #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module
Control.Arrow.Machine.Misc.Discrete
(
-- * Discrete type
-- $type
T(),
updates,
... | as-capabl/machinecell | src/Control/Arrow/Machine/Misc/Discrete.hs | Haskell | bsd-3-clause | 5,610 |
module Generics.GPAH.Date.Base where
import Control.DeepSeq
import Data.Monoid
import qualified Data.Map as M
data Analysis = Analysis {
yearUpdatesToSyb :: M.Map Int Int
, yearUpdatesToUpl :: M.Map Int Int
, yearNewToSyb :: M.Map Int Int
, yearNewToU... | bezirg/gpah | src/Generics/GPAH/Date/Base.hs | Haskell | bsd-3-clause | 1,716 |
module Input
( AppInput
, parseWinInput
, mousePos
, lbp
, lbpPos
, lbDown
, rbp
, rbpPos
, rbDown
, quitEvent
) where
import Data.Maybe
import FRP.Yampa
import Linear (V2(..))
import Linear.Affine (Point(..))
import qualified SDL
... | pyrtsa/yampa-demos-template | src/Input.hs | Haskell | bsd-3-clause | 3,210 |
{-# LANGUAGE OverloadedStrings #-}
module Yahoofinance
( getHistoricalData
, HistoricalQuote (..)
, QuoteMap
, buildHistoricalDataQuery
, QuoteSymbol
) where
import Control.Applicative
import Data.Aeson
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Lazy.Char8 as ... | vimster/stocker | src/Yahoofinance.hs | Haskell | bsd-3-clause | 4,259 |
{-# LANGUAGE TupleSections #-}
module GenoEquiv (uniformEquivMat,allEquivMats,uniformList,linearCombMats) where
import Common
import Prelude hiding (replicate, map, foldl1, zipWith, map, concat, reverse, length, head, map, concatMap, (++), zipWith)
import Data.List.Stream as DL
import Numeric.Container as NC
import D... | cglazner/ibd_stitch | src/GenoEquiv.hs | Haskell | bsd-3-clause | 1,735 |
{-# language FlexibleInstances, ScopedTypeVariables #-}
module LibSpec where
import qualified Data.Vector as V
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import Lib
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Numerical functions" $ do
-- it "works" $
-- ... | ocramz/test-ru-stream-regression | test/LibSpec.hs | Haskell | bsd-3-clause | 1,380 |
{-# LANGUAGE ConstraintKinds, CPP, DeriveDataTypeable, FlexibleContexts, OverloadedStrings #-}
module Facebook.Graph
( getObject
, getObjectRec
, postObject
, postForm
, postFormVideo
, deleteForm
, deleteObject
, searchObjects
, (#=)
, SimpleType(..)
, Place(..)
, Locati... | BeautifulDestinations/fb | src/Facebook/Graph.hs | Haskell | bsd-3-clause | 13,935 |
module Utils where
import System.Directory (doesFileExist)
import System.Environment (getEnv)
import System.FilePath ((</>))
import System.IO.Error (tryIOError)
import qualified Paths_elm_server as This
-- |The absolute path to a data file
getDataFile :: FilePath -> IO FilePath
getDataFile name = do
path <- This.ge... | alisheikh/elm-server | server/Utils.hs | Haskell | bsd-3-clause | 1,467 |
module Idris.Unlit(unlit) where
import Idris.Core.TT
import Data.Char
unlit :: FilePath -> String -> TC String
unlit f s = do let s' = map ulLine (lines s)
check f 1 s'
return $ unlines (map snd s')
data LineType = Prog | Blank | Comm
ulLine :: String -> (LineType, String)
ulLine ('>':... | ctford/Idris-Elba-dev | src/Idris/Unlit.hs | Haskell | bsd-3-clause | 998 |
module Main where
import Suck
import Spew
import System.Environment
-- maximally naive approach to command line input
main :: IO ()
main = do
[input] <- getArgs
if input == "load-model"
then suckDefaultsToFile
else spew (read input) >>= putStrLn
| rudyardrichter/sokal | main.hs | Haskell | mit | 272 |
-- |
-- Lens are immensely useful for working with state but I don't want
-- to pull in full Kmettoverse for small set of combinators.
--
-- Here we redefine all necessary combinators. Full compatibility with
-- lens is maintained.
{-# LANGUAGE RankNTypes #-}
module DNA.Lens where
import Control.Applicative
import Con... | SKA-ScienceDataProcessor/RC | MS3/lib/DNA/Lens.hs | Haskell | apache-2.0 | 1,731 |
-- | Re-export the common parts of the server framework.
--
module Distribution.Server.Framework (
module Happstack.Server.Routing,
module Happstack.Server.Response,
module Happstack.Server.RqData,
module Happstack.Server.FileServe,
module Happstack.Server.Error,
module Happstack.Server.Monads,... | haskell-infra/hackage-server | Distribution/Server/Framework.hs | Haskell | bsd-3-clause | 2,380 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
import Prelude ()
import Prelude.Compat
import Data.Text (Text, pack)
import Data.Text.IO as T (putStrLn)
import qualified GitHub.Endpoints.Users.Followers as GitHub
main :: IO ()
main = do
possibleUsers <- GitHub.usersFollowing "mike... | jwiegley/github | samples/Users/Followers/Example.hs | Haskell | bsd-3-clause | 576 |
module CodeGen.Header(generateHeader) where
import Control.Arrow ((&&&))
import Data.List (partition)
import CodeGen.Typeclasses
import CodeGen.CCodeNames
import CodeGen.Function
import CodeGen.Type ()
import CCode.Main
import CCode.PrettyCCode ()
import qualified AST.AST as A
import qualified Identifiers as ID
imp... | Paow/encore | src/back/CodeGen/Header.hs | Haskell | bsd-3-clause | 11,851 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE PatternGuards #-}
-- |
-- Module : Data.Array.Accelerate.CUDA.FullList
-- Copyright : [2008..2014] Manuel M T Chakravarty, Gabriele Keller
-- [2009..2014] Trevor L. McDonell
-- License : BSD3
--
-- Maintainer : Trevor L. McDonell <tmcdonell@cse.unsw.... | kumasento/accelerate-cuda | Data/Array/Accelerate/CUDA/FullList.hs | Haskell | bsd-3-clause | 3,283 |
{-# LANGUAGE RebindableSyntax,NoImplicitPrelude,OverloadedLists #-}
import SubHask
import SubHask.Algebra.HMatrix
import HLearn.History
import HLearn.History.DisplayMethods
import HLearn.Optimization.Common
import HLearn.Optimization.GradientDescent
-- import HLearn.Optimization.StochasticGradientDescent
import HLear... | ehlemur/HLearn | examples/optimization/optimization.hs | Haskell | bsd-3-clause | 2,194 |
{-# LANGUAGE TemplateHaskell, TypeSynonymInstances, FlexibleInstances,
MultiParamTypeClasses, TypeOperators, FlexibleContexts , RankNTypes,
GADTs, ScopedTypeVariables, EmptyDataDecls, ConstraintKinds #-}
module Data.Comp.Multi.Variables_Test where
import Data.Comp.Multi.Variables
import Data.Comp.Multi.Derive
import... | spacekitteh/compdata | testsuite/tests/Data/Comp/Multi/Variables_Test.hs | Haskell | bsd-3-clause | 3,379 |
{-# LANGUAGE RankNTypes #-}
module Util.UnionFindST(
Element,
T,
UF(),
find,
fromElement,
getElements,
getUnique,
getW,
liftST,
new,
new_,
putW,
runUF,
union,
union_,
updateW
) where
import Control.Monad.Reader
import Control.Monad.ST
import Data.STRe... | hvr/jhc | src/Util/UnionFindST.hs | Haskell | mit | 3,389 |
<?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="it-IT">
<title>AMF Support</title>
<maps>
<homeID>amf</homeID>
<mapref location="map.jh... | kingthorin/zap-extensions | addOns/amf/src/main/javahelp/help_it_IT/helpset_it_IT.hs | Haskell | apache-2.0 | 956 |
module Where1 where
f3 x
= (ls, rs)
where
ls = x + 1
rs = x - 1
f1 :: Int -> Int
f1 x = ls where ls = x + 1
f2 :: Int -> Int
f2 x = rs where rs = x - 1
| kmate/HaRe | old/testing/merging/Where1AST.hs | Haskell | bsd-3-clause | 179 |
<?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>Active Scan Rules - Blpha | ZAP Extension</title>
<maps>
<homeID>top</homeID... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/wavsepRpt/resources/help_si_LK/helpset_si_LK.hs | Haskell | apache-2.0 | 987 |
{-# LANGUAGE NoImplicitPrelude, PatternSynonyms #-}
{-# OPTIONS_GHC -Wall #-}
module Test where
x :: ()
x = ()
pattern Point2 :: () -> () -> ((), ())
pattern Point2 x y = (x, y)
pattern Point :: () -> () -> ((), ())
pattern Point{x1, y1} = (x1, y1)
| snoyberg/ghc | testsuite/tests/patsyn/should_compile/T12615.hs | Haskell | bsd-3-clause | 252 |
{-# LANGUAGE MultiParamTypeClasses, PolyKinds #-}
{-# OPTIONS_GHC -fprint-explicit-kinds #-}
module TidyClassKinds where
import Data.Proxy
class Poly a b
type ProxySyn = Proxy
instance Poly ProxySyn ProxySyn
-- output should really talk about k1 and k2, not about k and k!
| olsner/ghc | testsuite/tests/polykinds/TidyClassKinds.hs | Haskell | bsd-3-clause | 280 |
module Bio.VCF.Parser.Helpers
( tabOrSpace
, isTab
, isSpace
, notTabOrSpace
, isNumber
, isFloatNumber
, isBase
, isBaseOrDeletion
, endOfLine
) where
import Data.Word (Word8)
tabOrSpace :: Word8 -> Bool
tabOrSpace c = isTab c || isSpace c
isTab :: Word8 -> Bool
isTab c = c == 9
isSpace :: Word8 -> Bool
isSpace c ... | juanpaucar/vcf | src/Bio/VCF/Parser/Helpers.hs | Haskell | mit | 1,017 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGLineElement
(js_getX1, getX1, js_getY1, getY1, js_getX2, getX2, js_getY2,
getY2, SVGLineElement, castToSVGLineElement, gTypeSVGLineElement)
where
import Prelude ((.), (==), (>>=), return, ... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGLineElement.hs | Haskell | mit | 2,562 |
-----------------------------------------------------------------------------
-- |
-- Module : Writer.Data
-- License : MIT (see the LICENSE file)
-- Maintainer : Felix Klein (klein@react.uni-saarland.de)
--
-- Common data used by the writer module.
--
------------------------------------------------------... | reactive-systems/syfco | src/lib/Writer/Data.hs | Haskell | mit | 5,441 |
{-# LANGUAGE OverloadedStrings #-}
module Config.EnvSpec
( main
, spec
) where
import Test.Hspec
import Test.QuickCheck.Instances ()
import System.Environment
import qualified Data.Map as M
import Servant.Client
import Config
-- -----... | UlfS/ghmm | test/Config/EnvSpec.hs | Haskell | mit | 1,730 |
{-# htermination scanl :: (a -> b -> a) -> a -> [b] -> [a] #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_scanl_1.hs | Haskell | mit | 63 |
module Universe.Objects.Shape (
Shape(..)
) where
import Measures
data Shape d = Spherical (MeasuredVal d Distance)
| ShapeTODO -- TODO
| fehu/hgt | core-universe/src/Universe/Objects/Shape.hs | Haskell | mit | 156 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveGeneric #-}
module Bot.NetHack.ScreenPattern
( ScreenPattern()
, Match(..)
, Detailed(..)
, match
, regex
, limitRows
, debugPattern )
where
import Data.Data
import Data.Foldable
import qualified Data.Set as S
im... | Noeda/adeonbot | bot/src/Bot/NetHack/ScreenPattern.hs | Haskell | mit | 3,804 |
-- | "GHC.Generics"-based 'Test.QuickCheck.arbitrary' generators.
--
-- = Basic usage
--
-- @
-- {-\# LANGUAGE DeriveGeneric \#-}
--
-- data Foo = A | B | C -- some generic data type
-- deriving 'GHC.Generics.Generic'
-- @
--
-- Derive instances of 'Test.QuickCheck.Arbitrary'.
--
-- @
-- instance Arbitrary Foo where... | Lysxia/generic-random | src/Generic/Random.hs | Haskell | mit | 6,844 |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
import Test.Hspec
import Yage.Prelude hiding (group)
import Yage.Math
import Yage.Lens hiding (elements)
import qualified Data.Vector as V
import Data.Vinyl.Instances ()
import Yage.Formats.Obj
import Yage.Fo... | MaxDaten/yage | test/ObjParsingTest.hs | Haskell | mit | 9,674 |
module Question where
-- https://mail.haskell.org/pipermail/beginners/2017-November/017921.html
notThe :: String -> Maybe String
notThe word
| word == "the" = Nothing
| otherwise = Just word
replaceThe :: String -> String
replaceThe word = go $ words word
where
go [] = ""
go (x:xs) =
... | brodyberg/Notes | csv/csv1/src/Question.hs | Haskell | mit | 721 |
{-# LANGUAGE OverloadedStrings #-}
module ZoomHub.Web.Types.OpenSeadragonTileSource
( OpenSeadragonTileSource,
fromDeepZoomImage,
)
where
import Data.Aeson (ToJSON, object, toJSON, (.=))
import qualified Data.Text as T
import System.FilePath (dropExtension)
import ZoomHub.API.Types.DeepZoomImage
( DeepZoomI... | zoomhub/zoomhub | src/ZoomHub/Web/Types/OpenSeadragonTileSource.hs | Haskell | mit | 1,300 |
{-# LANGUAGE OverloadedStrings, ExtendedDefaultRules #-}
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Monadic (assert, monadicIO)
import Data.Functor
import Control.Monad
import Database.Bicod
import Database.MongoDB
--newtype Alpha = Alpha { runAplha :: [Char] } deriving (Eq, Show)
--instance Ar... | teamon/bicod | test/Spec.hs | Haskell | mit | 1,954 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverlappingInstances #-}
module System.Console.Questioner
(
Question(..)
, ChoiceEvent
, charToChoiceEvent
, listPrompt
, checkboxPrompt
, module System.Cons... | yamadapc/stack-run | unix/System/Console/Questioner.hs | Haskell | mit | 10,300 |
{-
Copyright 2014 huwei04@hotmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | wehu/hw | src/Resolver.hs | Haskell | apache-2.0 | 6,752 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Kubernetes.V1.Lifecycle where
import GHC.Generics
import Kubernetes.V1.Handler
import qualified Data.Aeson
-- | Lifecycle describes actions th... | minhdoboi/deprecated-openshift-haskell-api | kubernetes/lib/Kubernetes/V1/Lifecycle.hs | Haskell | apache-2.0 | 1,539 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Openshift.V1.GitBuildSource where
import GHC.Generics
import Data.Text
import qualified Data.Aeson
-- |
data GitBuildSource = GitBuildSource
... | minhdoboi/deprecated-openshift-haskell-api | openshift/lib/Openshift/V1/GitBuildSource.hs | Haskell | apache-2.0 | 838 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- | DAG-based model for morphosyntactic tagging.
module NLP.Concraft.Polish.DAGSeg
(
-- * Types
Tag
-- ** Simplification
, simplify4gsr
, complexify4gsr
, simplify4dmb
-- ** Model
, C.Concraft
, C.saveModel
... | kawu/concraft-pl | src/NLP/Concraft/Polish/DAGSeg.hs | Haskell | bsd-2-clause | 21,133 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
module Devel
( devel
) where
import qualified Distribution.Simple.Utils as D
import qualified Distribution.Verbosity as D
imp... | chreekat/yesod | yesod/Devel.hs | Haskell | bsd-2-clause | 7,176 |
{-# LANGUAGE DeriveDataTypeable #-}
module Data.Text.Punycode.Decode (PunycodeDecodeException (..), decode) where
import Control.Exception.Base
import qualified Data.ByteString as BS
import Data.Char
import Data.Serialize hiding (decode)
import qualified Data.Text as T
import D... | litherum/punycode | Data/Text/Punycode/Decode.hs | Haskell | bsd-2-clause | 3,681 |
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Numeric.SpecFunctions.Internal
-- Copyright : (c) 2009, 2011, 2012 Bryan O'Sullivan
-- License : BSD3
--
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : portable
--
-- Internal module... | bos/math-functions | Numeric/SpecFunctions/Internal.hs | Haskell | bsd-2-clause | 46,384 |
{-# LANGUAGE TupleSections, OverloadedStrings, ScopedTypeVariables #-}
module Handler.Home where
import Import
import qualified Data.Conduit as C
import qualified Data.Conduit.List as CL
import qualified Data.Text as T
import Data.Time.Clock
import Database.Persist.GenericSql.Raw
import Database.Persist.Store
import ... | tanakh/hackage-mirror | Handler/Home.hs | Haskell | bsd-2-clause | 2,562 |
-- |
-- Module : Enterprise.FizzBuzz
-- Copyright : (c) 2013 Josh Hawkins & Mike Bethany
--
-- License : BSD-style
-- Maintainer : josh@josh.com
-- Stability : experimental
-- Portability : GHC
--
-- Putting some Fizz and Buzz in your numbers!
module Enterprise.FizzBuzz
(
functionToPad1,
func... | JHawk/enterpriseFizzBuzz | src/Enterprise/FizzBuzz.hs | Haskell | bsd-3-clause | 1,666 |
module Printer where
{-|
>>> :{
let callback name = do
putStrLn $ "Hello. Yes, this is " ++ name
>>> :}
>>> printer "Dog" callback
Dog says:
Hello. Yes, this is Dog
-}
printer :: String -> (String -> IO ()) -> IO ()
printer name callBack = putStrLn $ name ++ " says:"
| pfcuttle/twentyfour-2013 | src/doctest/Printer.hs | Haskell | bsd-3-clause | 282 |
module Paths (tests) where
import Data.Monoid
import PathFinder.Core
import PathFinder.Types
import Control.Lens (preview, _Just)
import Test.Tasty
import Test.Tasty.Hspec
import qualified Data.Map as Map
tests :: TestTree
tests = testGroup "tests"
[ te... | markus1189/pathfinder | tests/Paths.hs | Haskell | bsd-3-clause | 1,665 |
{-# Language DeriveFunctor #-}
module Spell where
import Control.Monad.Free
-- | 10 is the magic number for everything
data CastType
= Beam
| BlastRadius
| Target
deriving (Show)
data Element
= Earth -- knocked down, no movement
| Wind -- slowed, half action points
| Water -- frozen, skip turn
| Fir... | aspidites/functional | src/Spell.hs | Haskell | bsd-3-clause | 1,563 |
{-# LANGUAGE CPP #-}
{-# OPTIONS -fno-warn-missing-signatures #-}
-- | Sequential implementation of the segmented array API defined in
-- @dph-prim-interface@.
--
-- There is a parallel implementation in @dph-prim-par@,
-- so you probably want that instead.
-- The API is defined in @DPH_Header.h@ and @DPH_I... | mainland/dph | dph-prim-seq/Data/Array/Parallel/Unlifted.hs | Haskell | bsd-3-clause | 9,060 |
{-# LANGUAGE OverloadedStrings #-}
module Handler.Index where
import qualified Data.Text as T
import Snap.Snaplet
import Heist
import Snap.Snaplet.Heist
import Snap.Snaplet.Auth
import State.Site
import Splice.Site
import Application
indexHandler :: AppHandler ()
indexHandler = do
mu <- with auth currentUser
s... | dbp/positionsites | src/Handler/Index.hs | Haskell | bsd-3-clause | 518 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCas... | supermario/stack | src/Stack/Setup.hs | Haskell | bsd-3-clause | 64,606 |
module ListUtils where
import Graphics.Vty.Widgets.All
import Control.Applicative ((<$>))
import Control.Monad (liftM, void)
import Data.Maybe (catMaybes, fromMaybe)
import Data.List (find)
-- | List helper
-- Replaces an item in a Vty Widget List at a given position. If the index is
-- `Nothing`, the item will be ad... | angerman/HInvoice | ListUtils.hs | Haskell | bsd-3-clause | 2,214 |
-- | This module allows for the 'promote' function to be imported
-- correctly from different QuickCheck versions. QuickCheck 2.6 used
-- Test.QuickCheck.Gen.promote; QuickCheck 2.7 uses
-- Test.QuickCheck.Gen.Unsafe.promote. For use with old versions of
-- QuickCheck, Cabal will import a different version of this mo... | massysett/barecheck | lib/Barecheck/Promote.hs | Haskell | bsd-3-clause | 449 |
import qualified Network.HTTP as HTTP
import Data.List.Split (splitOn)
import Data.List (isInfixOf, sortBy, reverse, foldl')
import Data.Char (toLower)
import qualified Data.Map as Map
import Options.Applicative
import Data.Semigroup ((<>))
data Args = Args
{ fname :: String
, addr :: String
, numwords ... | dgtony/hckrnewsparser | src/main.hs | Haskell | bsd-3-clause | 2,878 |
module Main where
import System.Environment
import qualified Lib
main :: IO ()
main =
getArgs
>>= (\[x, y] -> Lib.buildTree 0 x y)
>>= print
| koulakis/FiletreeAnalyser | app/Main.hs | Haskell | bsd-3-clause | 163 |
-- Utility for adding the Fibon directory for a new benchmark
module Main (main) where
import Control.Monad
import Data.Char as Char
import Data.List
import Distribution.Package
import Distribution.PackageDescription
import Distribution.PackageDescription.Configuration
import Distribution.PackageDescription.Parse
imp... | dmpots/fibon | tools/fibon-init/Main.hs | Haskell | bsd-3-clause | 3,817 |
{-# LANGUAGE PatternGuards #-}
module Idris.Elab.Clause where
import Idris.AbsSyntax
import Idris.ASTUtils
import Idris.DSL
import Idris.Error
import Idris.Delaborate
import Idris.Imports
import Idris.ElabTerm
import Idris.Coverage
import Idris.DataOpts
import Idris.Providers
import Idris.Primitives
import Idris.Inlin... | andyarvanitis/Idris-dev | src/Idris/Elab/Clause.hs | Haskell | bsd-3-clause | 44,724 |
{-# LANGUAGE CPP, ScopedTypeVariables #-}
{-# LANGUAGE GADTs #-}
module Llvm.Pass.Mem2Reg (mem2reg) where
import Compiler.Hoopl
import Llvm.Hir.Data
import qualified Data.Map as Dm
import qualified Data.Set as Ds
import Control.Monad
import Llvm.Pass.Rewriter (rwNode,nodeToGraph)
import Prelude hiding(lookup)
#ifdef D... | mlite/hLLVM | src/Llvm/Pass/Mem2Reg.hs | Haskell | bsd-3-clause | 4,577 |
{-# LANGUAGE OverloadedStrings, RankNTypes, RecordWildCards,
ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-missing-signatures
-fno-warn-unused-binds #-}
module UnitTests (testWith) where
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO, killThread)
import ... | Feeniks/wreq | tests/UnitTests.hs | Haskell | bsd-3-clause | 15,911 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module VSim.Data.TInt where
import Data.Int
import Data.Bits
import Foreign.Storable
import Text.Printf
newtype TInt = TInt { tintToInt32 :: Int32 }
deriving (Eq, Ord, Num, Enum, Real, Integral, Storable, Bounded, Bits, PrintfArg)
instance Show TInt where
showsPrec... | ierton/vsim | src/VSim/Data/TInt.hs | Haskell | bsd-3-clause | 516 |
-- | doctest utilities
module Flat.Instances.Test (
tst,
tstBits,
asList,
flatBits,
allBits,
prettyShow,
module Data.Word,
) where
import Data.Word
import Flat.Bits (
asBytes,
bits,
paddedBits,
)
import Flat.Class (Flat (..))
import Flat.Run (
flat,
unflat,
)
import Fl... | tittoassini/flat | src/Flat/Instances/Test.hs | Haskell | bsd-3-clause | 1,146 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.BitVectors.Polynomials
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Implementation of polynomial arithmetic
-----------------... | Copilot-Language/sbv-for-copilot | Data/SBV/Tools/Polynomial.hs | Haskell | bsd-3-clause | 11,405 |
-- |
-- Module : Foundation.Parser
-- License : BSD-style
-- Maintainer : Haskell Foundation
-- Stability : experimental
-- Portability : portable
--
-- The current implementation is mainly, if not copy/pasted, inspired from
-- `memory`'s Parser.
--
-- Foundation Parser makes use of the Foundation's @Collec... | vincenthz/hs-foundation | foundation/Foundation/Parser.hs | Haskell | bsd-3-clause | 19,244 |
{-# LANGUAGE BangPatterns, CPP, GeneralizedNewtypeDeriving, OverloadedStrings,
Rank2Types, RecordWildCards, TypeFamilies #-}
-- |
-- Module : Data.Attoparsec.Internal.Types
-- Copyright : Bryan O'Sullivan 2007-2015
-- License : BSD3
--
-- Maintainer : bos@serpentine.com
-- Stability : experimenta... | beni55/attoparsec | Data/Attoparsec/Internal/Types.hs | Haskell | bsd-3-clause | 8,092 |
module ListQual (boo) where
{-@ qualif BadAppend(v:[a], xs:[a], ys:[a]): len v = len xs + len ys @-}
append [] ys = ys
append (x:xs) ys = x : append xs ys
{-@ boo :: {v:[Int] | len v = 2} @-}
boo :: [Int]
boo = append [1] [2]
| ssaavedra/liquidhaskell | tests/pos/listqual.hs | Haskell | bsd-3-clause | 233 |
{-|
Module : IRTS.DumpBC
Description : Serialise Idris to its IBC format.
License : BSD3
Maintainer : The Idris Community.
-}
module IRTS.DumpBC where
import Idris.Core.TT
import IRTS.Bytecode
import IRTS.Simplified
import Data.List
interMap :: [a] -> [b] -> (a -> [b]) -> [b]
interMap xs y f = concat (int... | kojiromike/Idris-dev | src/IRTS/DumpBC.hs | Haskell | bsd-3-clause | 3,256 |
module String where
main = putStrLn str where str = "hello, world"
| kmate/HaRe | old/testing/introNewDef/String_AstOut.hs | Haskell | bsd-3-clause | 68 |
-- We can use Template Haskell (TH) to generate instances of the
-- FromJSON and ToJSON classes automatically. This is the fastest way
-- to add JSON support for a type.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson (decode, encode)
import Data.Aeson.TH (deriveJSON, defaultOp... | plaprade/aeson | examples/TemplateHaskell.hs | Haskell | bsd-3-clause | 716 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
{-# LANGUAGE TypeFamilies, EmptyDataDecls, GADTs #-}
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}
module Main where
import qualified Database.Redis as R
import Database.Persist
import Database.Persist.Redis
import Database.Persis... | jasonzoladz/persistent | persistent-redis/tests/basic-test.hs | Haskell | mit | 1,385 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. Th... | chjp2046/fbthrift | thrift/lib/hs/Thrift.hs | Haskell | apache-2.0 | 3,765 |
module T5664 where
import Foreign
import Foreign.C
data D = D
newtype I = I CInt
foreign import ccall "dynamic"
mkFun1 :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
foreign import ccall "dynamic"
mkFun2 :: FunPtr (I -> IO ()) -> CInt -> IO ()
foreign import ccall "dynamic"
mkFun3 :: FunPtr (D -> IO ()) -> CInt ... | urbanslug/ghc | testsuite/tests/ffi/should_fail/T5664.hs | Haskell | bsd-3-clause | 569 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module Unison.Codebase.Editor.SlurpResult where
import Unison.Prelude
import Unison.Codebase.Editor.SlurpComponent (SlurpComponent(..))
import Unison.Name ( Name )
import Unison.Parser (... | unisonweb/platform | parser-typechecker/src/Unison/Codebase/Editor/SlurpResult.hs | Haskell | mit | 15,671 |
-- Copyright 2015 Ian D. Bollinger
--
-- Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-- http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT
-- or http://opensource.org/licenses/MIT>, at your option. This file may not be
-- copied, modified, or distributed except according t... | ianbollinger/nomegen | cli/Nomegen/CLI.hs | Haskell | mit | 2,723 |
{-# LANGUAGE OverloadedStrings #-}
module Unison.Test.TypeParser where
import Test.Tasty
import Unison.Parser (Result(..))
import Unison.Parsers (parseType)
import Unison.Type (Type)
import qualified Unison.Type as T
-- import Test.Tasty.SmallCheck as SC
-... | nightscape/platform | shared/tests/Unison/Test/TypeParser.hs | Haskell | mit | 1,605 |
--The MIT License (MIT)
--
--Copyright (c) 2016-2017 Steffen Michels (mail@steffen-michels.de)
--
--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 limita... | SteffenMichels/IHPMC | src/Interval.hs | Haskell | mit | 7,929 |
{-# LANGUAGE InstanceSigs #-}
{-# OPTIONS
-Wall
-Wno-missing-signatures
-Wno-type-defaults
#-}
module Main where
import Data.Semigroup
-- Сегодня у нас аппликативные функторы
{-
class Functor f => Applicative f where
pure :: a -> f a
(<*>) :: f (a -> b) -> f a -> f b
-- Т.е. внутри функтора не пр... | aquatir/remember_java_api | code-sample-haskell/typed_fp_basics_cource/06_applicative/code.hs | Haskell | mit | 2,593 |
--------------------------------------------------------------------------------
-- | Data types for logging
{-# LANGUAGE OverloadedStrings #-}
module Web.SocketIO.Types.Log (Log(..), Serializable(..)) where
--------------------------------------------------------------------------------
import System.Console.ANSI
im... | banacorn/socket.io-haskell | Web/SocketIO/Types/Log.hs | Haskell | mit | 1,282 |
{-# LANGUAGE EmptyDataDecls,
FlexibleContexts,
GADTs,
GeneralizedNewtypeDeriving,
MultiParamTypeClasses,
OverloadedStrings,
QuasiQuotes,
TemplateHaskell,
TypeFamilies #-}
module Scarlet.Ent... | rhwlo/Scarlet | src/Scarlet/Entry.hs | Haskell | mit | 764 |
#!/usr/bin/env runhaskell
import Control.Monad (void)
import System.Libnotify
main :: IO ()
main = void $ withNotifications Nothing $
do new "Same title" "line 1" "" $
do addHint (HintString "append" "allowed")
removeHints
render
new "Same title" "l... | supki/libnotify | tests/remove-hints-test.hs | Haskell | mit | 442 |
{-# LANGUAGE OverloadedStrings #-}
module Typecrawl.Platforms (typepad, wpLeMonde, blogger)
where
import Text.HTML.Scalpel ((@:), hasClass, (//))
import Typecrawl.Types
-- Should work with any basic typepad
typepad :: PlatformParseInstructions
typepad = Ppis ("span" @: [hasClass "pager-right"] // "a")
... | Raveline/typecrawl | lib/Typecrawl/Platforms.hs | Haskell | mit | 1,339 |
module DoesItCompile where
-- Question 1
bigNum = (^) 5 $ 10
wahoo = (^) bigNum $ 10
-- Question 2
x = print
y = print "woohoo!"
z = x "hello world"
-- Question 3
a = (+)
b = 5
c = a b 10
d = a c 200
-- Question 4
a4 = 12 + b4
b4 = 10000 * c4
c4 = 10
| rasheedja/HaskellFromFirstPrinciples | Chapter5/doesItCompile.hs | Haskell | mit | 255 |
-- | Type and functions for terms: the objects of first-order logic.
module Faun.Term where
import Data.Set (Set)
import qualified Data.Set as Set
import Data.List (foldl')
import qualified Data.Text as T
import Data.Monoid ((<>), mconcat)
import qualified Faun.Text as FT
import Faun.ShowTxt
-- | A term represents an... | PhDP/Sphinx-AI | Faun/Term.hs | Haskell | mit | 4,609 |
-- | A generalization of LIO's core components to work for any monad, instead of just IO.
module LMonad (module LMonad) where
import LMonad.TCB as LMonad (
Label (..)
, LMonad (..)
, LMonadT
, runLMonad
, runLMonadWith
, lLift
, getCurrentLabel
, getClearance
... | jprider63/LMonad | src/LMonad.hs | Haskell | mit | 744 |
-- Copyright (c) 2010 - Seweryn Dynerowicz
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agree... | sdynerow/Semirings-Library | haskell/PathInformations/Paths.hs | Haskell | apache-2.0 | 1,741 |
{-# LANGUAGE OverloadedStrings #-}
{-
Created : 2015 Aug 26 (Wed) 11:56:37 by Harold Carr.
Last Modified : 2015 Sep 17 (Thu) 15:44:26 by Harold Carr.
-}
module Service.UserEndpoint
( ueMain
)
where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (decode, encode)
import ... | haroldcarr/utah-haskell | future/src/Service/UserEndpoint.hs | Haskell | apache-2.0 | 1,826 |
-- http://www.codewars.com/kata/541c8630095125aba6000c00
module DigitalRoot where
digitalRoot :: Integral a => a -> a
digitalRoot n = if n < 10
then n
else (digitalRoot . sum . map (`mod`10) . takeWhile (>0) . iterate (`div`10)) n | Bodigrim/katas | src/haskell/6-Sum-of-Digits--Digital-Root.hs | Haskell | bsd-2-clause | 235 |
{-# LANGUAGE PackageImports #-}
module GHC.IO.Encoding.UTF16 (module M) where
import "base" GHC.IO.Encoding.UTF16 as M
| silkapp/base-noprelude | src/GHC/IO/Encoding/UTF16.hs | Haskell | bsd-3-clause | 124 |
{-#LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent.HEP as HEP
import Control.Concurrent
import Control.Concurrent.HEP.Syslog
import System.IO
import Control.Monad.Trans
import Control.Monad.Trans.Either
import Control.Monad
import Network.AMQP as AMQP
imp... | dambaev/wbinfomq | src/wbinfomq.hs | Haskell | bsd-3-clause | 5,632 |
--------------------------------------------------------------------------------
-- | Wraps pandocs bibiliography handling
--
-- In order to add a bibliography, you will need a bibliography file (e.g.
-- @.bib@) and a CSL file (@.csl@). Both need to be compiled with their
-- respective compilers ('biblioCompiler' and '... | bergmark/hakyll | src/Hakyll/Web/Pandoc/Biblio.hs | Haskell | bsd-3-clause | 3,797 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.