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 |
|---|---|---|---|---|---|
-----------------------------------------------------------------------------
-- |
-- Module : Application.HXournal.Type.Event
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
-------------... | wavewave/hxournal | lib/Application/HXournal/Type/Event.hs | Haskell | bsd-2-clause | 4,348 |
{-| Implementation of cluster-wide logic.
This module holds all pure cluster-logic; I\/O related functionality
goes into the /Main/ module for the individual binaries.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or withou... | ganeti-github-testing/ganeti-test-1 | src/Ganeti/HTools/Cluster.hs | Haskell | bsd-2-clause | 80,090 |
import CircUtils.QacgBool
import Test.QuickCheck
import Text.Printf
main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests
exp1 = Xor $ map V ["a","b","c"]
exp2 = Xor [And (map V ["e","f","g"]), V "a"]
exp3 = And [exp1,exp2]
exp4 = Xor [exp3,exp1]
exp5 = And [exp3,exp4]
prop_simp exp a = if length a < 7 then True... | aparent/qacg | src/QACG/CircUtils/QacgBoolTest.hs | Haskell | bsd-3-clause | 1,005 |
{-# LANGUAGE TupleSections, TypeFamilies, FlexibleContexts, PackageImports #-}
module TestPusher (XmlPusher(..), Zero(..), One(..), Two(..), testPusher) where
import Control.Monad
import Control.Concurrent
import Data.Maybe
import Data.Pipe
import Data.Pipe.ByteString
import System.IO
import Text.XML.Pipe
import Xml... | YoshikuniJujo/forest | subprojects/xml-push/TestPusher.hs | Haskell | bsd-3-clause | 693 |
{-# LANGUAGE OverloadedStrings #-}
module Main ( main ) where
import Control.Applicative
import Data.Monoid
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Options.Applicative hiding ( (&) )
import System.FilePath
import Text.LaTeX.Base as Tex
import Foreign.Inference.Interface
data Opts = ... | travitch/iiglue | tools/IITableOutput.hs | Haskell | bsd-3-clause | 9,446 |
module Day11 where
import Data.List
import Control.Applicative
{- Day 11: Corporate Policy -}
input :: String
input = "cqjxjnds"
inc :: Char -> (Bool, String) -> (Bool, String)
inc x (carry, xs)
| not carry = (False, x:xs)
| x == 'z' = (True, 'a':xs)
| x `elem` "iol" = (False,... | Rydgel/advent-of-code | src/Day11.hs | Haskell | bsd-3-clause | 1,013 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Sequent.Check
( CheckT
, Check
, evalCheck
, evalCheckT
, liftEnv) where
import Control.Applicative ... | matthieubulte/sequent | src/Sequent/Check.hs | Haskell | bsd-3-clause | 2,638 |
module Options.TypesSpec (main, spec) where
import Options.Types
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Instances
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "someFunction" $ do
it "should work fine" $ do
property someFunction
someFunction :: Bool -> Bool ->... | athanclark/optionz | test/Options/TypesSpec.hs | Haskell | bsd-3-clause | 357 |
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Rank2Types #-... | esengie/algebraic-checker | src/NHorn/LaCarte.hs | Haskell | bsd-3-clause | 2,453 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
-- | Functions for traversing the comment AST and analyzing the nodes it contains.
--
-- To start traversing the comment AST, use 'Clang.Cursor.getParsedComment' to
-- retrieve the comment from an AST node that may be associated with one (for
-- exampl... | ony/LibClang | src/Clang/Comment.hs | Haskell | bsd-3-clause | 4,775 |
{-# OPTIONS_GHC -cpp #-}
module Code28_Tupling where
(□) :: [a] -> [a] -> [a]
xs □ ys = mix xs (ys, reverse ys)
mix :: [a] -> ([a],[a]) -> [a]
mix [] (ys,_) = ys
mix (x:xs) (ys,sy) = ys ++ [x] ++ mix xs (sy,ys)
boxall :: [[a]] -> [a]
boxall = foldr (□) []
op ... | sampou-org/pfad | Code/Code28_Tupling.hs | Haskell | bsd-3-clause | 1,039 |
{-# LANGUAGE OverloadedStrings #-}
module Module ( Module(..)
, listModules
) where
import Data.Text (Text)
import Xml
data Codepool = Core | Community | Local deriving (Show)
data Module = Module { moduleCodePool :: Codepool
, moduleNameSpace :: String
... | dxtr/hagento | src/Magento/Module.hs | Haskell | bsd-3-clause | 589 |
{-# LANGUAGE TypeOperators #-}
module World (
World(..),FinalColor,Color, Object(..), Shape (..),calcNormal,
Light(..),cmul,colRound,cadd,convertColtoFCol
-- Creation functions
-- Standard Array functions
,vUp
,vDown
,vForward
,vBackward
,vRight
,vLeft
-- Color conviniece functions
,t2c
--
-- | World Construction... | axhav/AFPLAB3 | World.hs | Haskell | bsd-3-clause | 7,124 |
module Main where
incdInts :: [Integer]
incdInts = map (+1) [1..]
main :: IO ()
main = do
print (incdInts !! 1000)
print (incdInts !! 9001)
print (incdInts !! 90010)
print (incdInts !! 9001000)
print (incdInts !! 9501000)
print (incdInts !! 9901000)
| chengzh2008/hpffp | src/ch28-BasicLibraries/largeCAF1.hs | Haskell | bsd-3-clause | 264 |
----------------------------------------------------------------------------
-- |
-- Module : Source2
-- Copyright : (c) Sergey Vinokurov 2018
-- License : BSD3-style (see LICENSE)
-- Maintainer : serg.foo@gmail.com
----------------------------------------------------------------------------
module Sou... | sergv/tags-server | test-data/0016reexport_of_missing_module/Source2.hs | Haskell | bsd-3-clause | 379 |
module Twelve where
import Data.Char
sumJSON :: String -> Int
sumJSON [] = 0
sumJSON (x:xs)
| isDigit x = plus (read [x]) xs
| x == '-' = minus 0 xs
| otherwise = sumJSON xs
plus :: Int -> String -> Int
plus = applyOp (+)
minus :: Int -> String -> Int
minus = applyOp (-)
applyOp :: (Int -> Int ->... | purcell/adventofcodeteam | app/Twelve.hs | Haskell | bsd-3-clause | 558 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Types where
import Data.Aeson
import GHC.Generics
data SSHHost = SSHHost{host :: String, remoteport :: Integer} deriving (Show, Generic, FromJSON, T... | pwestling/hmonit | src/Types.hs | Haskell | bsd-3-clause | 638 |
-- Copyright (c) 2014 Contributors as noted in the AUTHORS file
--
-- 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 3 of the License, or
-- (at your option) any later version.
-... | cjdibbs/ardunio | examples/UART.hs | Haskell | bsd-3-clause | 1,070 |
module Option
( buildOption
) where
import CommandLineOption (CommandLineOption)
import qualified CommandLineOption
import qualified Git
import Types
import Control.Applicative
import Data.Char (toUpper)
import Data.Maybe (catMaybes, fromJust,... | fujimura/chi | src/Option.hs | Haskell | bsd-3-clause | 2,146 |
{-# LANGUAGE OverloadedStrings #-}
module Test.Helper
(
module Test.Hspec.Monadic,
module Test.Hspec.Expectations
) where
import Test.Hspec.Monadic
import Test.Hspec.HUnit()
import Test.Hspec.Expectations
| fujimura/persistent-hspec-example | Test/Helper.hs | Haskell | bsd-3-clause | 214 |
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, StaticPointers, RankNTypes, GADTs, ConstraintKinds, FlexibleContexts, TypeApplications, ScopedTypeVariables, FlexibleInstances #-}
module QueryArrow.Remote.NoTranslation.Server where
import QueryArrow.DB.DB
import QueryArrow.DB.NoTranslation
import QueryArrow.DB.Resul... | xu-hao/QueryArrow | QueryArrow-db-remote/src/QueryArrow/Remote/NoTranslation/Server.hs | Haskell | bsd-3-clause | 3,533 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2006
--
-- The purpose of this module is to transform an HsExpr into a CoreExpr which
-- when evaluated, returns a (Meta.Q Meta.Exp) computation analogous to the
-- input HsExpr. We do... | jstolarek/ghc | compiler/deSugar/DsMeta.hs | Haskell | bsd-3-clause | 119,075 |
#!/usr/bin/env runhaskell
import Prelude hiding (print)
import System.Directory
import System.FilePath
import Data.List
import Data.Either
import Control.Monad
import System.Environment.UTF8
import System.IO.UTF8
import System.IO (stderr, stdin, stdout)
import Language.Haskell.Exts.Annotated.ExactPrint
import HPath.... | solidsnack/hpath | Main.hs | Haskell | bsd-3-clause | 2,594 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-------------------... | getyourguide/fbthrift | thrift/compiler/test/fixtures/includes/gen-hs/MyService.hs | Haskell | apache-2.0 | 14,518 |
{-# LANGUAGE TypeFamilies #-}
-- | Perlin noise implemented in Zeldspar.
-- TODO: PNG/BMP sink, to write pretty pictures to disk.
import qualified Prelude
import Zeldspar
import Zeldspar.Parallel
-- * Image settings; too large imgWidth, imgHeight or imgOctaves may cause you
-- to run out of stack space. Even when ... | kmate/zeldspar | examples/noise.hs | Haskell | bsd-3-clause | 6,270 |
{-# LANGUAGE CPP, ScopedTypeVariables #-}
module Main where
import Control.Applicative ((<$>))
import Control.Exception
import Data.List (isPrefixOf)
import qualified Data.Int as Int
import GHC.Int
import Ros.Internal.Msg.SrvInfo
import Ros.Internal.RosBinary
import Ros.Service (callService)
import Ros.Service.ServiceT... | acowley/roshask | Tests/ServiceClientTests/ServiceClientTest.hs | Haskell | bsd-3-clause | 5,169 |
{-# LANGUAGE RecordWildCards #-}
import Control.Applicative
import Control.Exception
import Control.Monad
import Control.Monad.Trans.Resource (runResourceT)
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy.Char8 as L8
import Data.List
import Data.Maybe
import Distribution.PackageDescr... | mathhun/stack | etc/scripts/release.hs | Haskell | bsd-3-clause | 28,060 |
module B (idd) where
idd :: Int
idd = 100000242418429
| sdiehl/ghc | testsuite/tests/ghci/caf_crash/B.hs | Haskell | bsd-3-clause | 56 |
{-@ LIQUID "--notermination" @-}
{-# OPTIONS_GHC -cpp -fglasgow-exts #-}
-- #prune
-- |
-- Module : Data.ByteString.Char8
-- Copyright : (c) Don Stewart 2006
-- License : BSD-style
--
-- Maintainer : dons@cse.unsw.edu.au
-- Stability : experimental
-- Portability : portable
--
-- Manipulate 'ByteString... | mightymoose/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Char8.hs | Haskell | bsd-3-clause | 43,150 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, BangPatterns, NoImplicitPrelude,
NondecreasingIndentation, MagicHash #-}
module GHC.IO.Encoding.CodePage(
#if defined(mingw32_HOST_OS)
codePageEncoding, mkCodePageEncoding,
localeEncoding, mkLocaleEncoding
#endi... | ezyang/ghc | libraries/base/GHC/IO/Encoding/CodePage.hs | Haskell | bsd-3-clause | 6,233 |
module F6 where
f6f = \h -> \x -> h x 0
f6t = \y -> \z -> y + z
f6 = f6f f6t 3 | siddhanathan/ghc | testsuite/tests/arityanal/f6.hs | Haskell | bsd-3-clause | 84 |
module UnitTests.Distribution.Client.Sandbox (
tests
) where
import Distribution.Client.Sandbox (withSandboxBinDirOnSearchPath)
import Test.Tasty
import Test.Tasty.HUnit
import System.FilePath (getSearchPath, (</>))
tests :: [TestTree]
tests = [ testCase "sandboxBinDirOnSearchPath" sandboxBinDirOnSe... | enolan/cabal | cabal-install/tests/UnitTests/Distribution/Client/Sandbox.hs | Haskell | bsd-3-clause | 843 |
import Data.Ix
import Data.Int
main = print (index (minBound::Int16,maxBound) maxBound)
| beni55/ghcjs | test/pkg/base/ix001.hs | Haskell | mit | 89 |
module RankN where
| vladfi1/hs-misc | RankN.hs | Haskell | mit | 23 |
solve :: Double -> Double
solve x = 1 + x + (x^2/2) + (x^3/6) + (x^4/24) + (x^5/120) + (x^6/720) + (x^7/5040) + (x^8/40320) + (x^9/362880) -- + (x^10/3628800)-- Insert your code here --
main :: IO ()
main = getContents >>= mapM_ print. map solve. map (read::String->Double). tail. words
| JsWatt/Free-Parking | hacker_rank/functional_programming/introduction/evaluating_e^x.hs | Haskell | mit | 288 |
module Typing.Subtyping
( (<:)
, (\/)
, (/\)
, (//)
, (\\)
) where
import Typing.Types
import Typing.Substitution
import Data.List (intersect, union)
import Data.Maybe (fromJust)
import qualified Data.List ((\\))
(<:) :: Type -> Type -> Bool
-- S-Refl
t <: u | t == u = True
-- S-Top
_ <: Top = True
-... | tadeuzagallo/verve-lang | src/Typing/Subtyping.hs | Haskell | mit | 3,789 |
-- | The DSL for creating a grammar/tokenizer definition for 'Text.Tokenify.tokenizer'
module Text.Tokenify.DSL where
import Prelude hiding (concat, any)
import qualified Text.Tokenify.Response as Response
import qualified Text.Tokenify.Regex as Regex
import Text.Tokenify.Regex (Regex)
import Text.Tokenify.Types
-... | AKST/tokenify | src/Text/Tokenify/DSL.hs | Haskell | mit | 2,233 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverlappingInstances #-}
module Main where
import Prelude hiding (writeFile)
import Data.Map (empty)
import Text.XML
import Text.XML.Generic
import GHC.Gen... | jhedev/xml-conduit-generics | examples/Users.hs | Haskell | mit | 1,022 |
module Input where
import Data.Vector (Vector)
import qualified Data.Vector as V
import DailyChart
type Input = Vector Double
type SixDailyCharts = (DailyChart, DailyChart, DailyChart, DailyChart, DailyChart, DailyChart)
fromDailyCharts :: SixDailyCharts -> (Bool, Input)
fromDailyCharts (d1,d2,d3,d4,d5,d6) = (answ... | cohei/stock-value-prediction | Input.hs | Haskell | mit | 650 |
--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/HPT.hs | Haskell | mit | 7,452 |
{-# LANGUAGE OverloadedStrings #-}
module Y2018.M06.D05.Exercise where
{--
Another day, another data structure.
We have a smart-tagging algorithm that saves its results to JSON. We want to
take those results in store them in a database. But before we do that, we need
to parse the JSON into Haskell structures because... | geophf/1HaskellADay | exercises/HAD/Y2018/M06/D05/Exercise.hs | Haskell | mit | 2,113 |
import Test.Hspec
-- Problem 16
-- Drop every N'th element from a list.
dropEvery :: Eq a => [a] -> Int -> [a]
dropEvery ls n = get' ls n n
where
get' [] _ _ = []
get' (_:xs) t 1 = get' xs t t
get' (x:xs) t i = x : get' xs t (i-1)
main :: IO()
main = hspec $
describe "99-exercises.16 = Drop every ... | baldore/haskell-99-exercises | 16.hs | Haskell | mit | 451 |
{-# LANGUAGE RecordWildCards #-}
import Data.Char (isSpace)
import Data.Foldable (for_)
import Data.Function (on)
import Test.Hspec (Spec, describe, it, shouldBe, shouldMatchList)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import CryptoSquare (encode)
main :: IO ()
mai... | exercism/xhaskell | exercises/practice/crypto-square/test/Tests.hs | Haskell | mit | 2,412 |
module Y2016.M07.D19.Solution where
{--
A Trigon, also known in some circles as a 'triangle,' is a three-SIDED shape.
Trigons are have several interesting characteristics. A trigon also defines a
plane (in which it lies), and a set of trigons can be rendered efficiently these
days to represent, e.g. characters in 3 di... | geophf/1HaskellADay | exercises/HAD/Y2016/M07/D19/Solution.hs | Haskell | mit | 1,792 |
import Prelude hiding ((++),concat)
-- just for kicks & gigs
(++) :: [a] -> [a] -> [a]
[] ++ ys = ys
(x:xs) ++ ys = x : (xs ++ ys)
concat :: [[a]] -> [a]
concat [] = []
concat (xs:xss) = xs ++ concat xss
test = concat [["a","b"],["c","d"],["e","f"]]
| calebgregory/fp101x | wk3/concat.hs | Haskell | mit | 271 |
module MyLen where
myLen :: [a] -> Int
myLen (_:xs) = 1 + myLen xs
myLen [] = 0
| lpenz/realworldhaskell-exercises | ch03/MyLen.hs | Haskell | mit | 86 |
-- WeIrD StRiNg CaSe
-- http://www.codewars.com/kata/52b757663a95b11b3d00062d/train/haskell
module WeIrDStRiNgCaSe where
import Data.Char(toLower, toUpper)
toWeirdCase :: String -> String
toWeirdCase = unwords . map (zipWith ($) (cycle [toUpper, toLower])) . words
| gafiatulin/codewars | src/6 kyu/WeIrDStRiNgCaSe.hs | Haskell | mit | 268 |
module Vacivity.FOV.ShadowCast(
calcFOV
) where
import Prelude hiding (any, all, foldl, concat)
import Control.Applicative ((<$>))
import Data.Foldable hiding (toList)
import qualified Data.Set as Set
import qualified Antiqua.Data.Array2d as A2D
import Antiqua.Common
import Vacivity.FOV.Common
import Vacivity.Uti... | olive/vacivity | src/Vacivity/FOV/ShadowCast.hs | Haskell | mit | 3,298 |
{-
******************************************************************************
* JSHOP *
* *
* Module: AST *
*... | nbrunt/JSHOP | src/old/ver2/AST.hs | Haskell | mit | 13,397 |
module Chapter17 where
import Data.List (elemIndex)
added :: Maybe Integer
added = (+3) <$> (lookup 3 $ zip [1, 2, 3] [4, 5, 6])
y :: Maybe Integer
y = lookup 3 $ zip [1, 2, 3] [4, 5, 6]
z :: Maybe Integer
z = lookup 2 $ zip [1, 2, 3] [4, 5, 6]
tupled :: Maybe (Integer, Integer)
tupled = (,) <$> y <*> z
x' :: May... | prt2121/haskell-practice | ch6-11-17-25/src/Chapter17.hs | Haskell | apache-2.0 | 689 |
{-# LANGUAGE ScopedTypeVariables #-}
module Kernel.GPU.Hogbom ( cleanPrepare, cleanKernel ) where
import Control.Monad
import Data.Word
import Foreign.Marshal.Alloc
import Foreign.Storable ( sizeOf, peek )
import Foreign.C.Types
import Data
import Kernel.GPU.Common as CUDA
import Vector
type Peak = (Int, Int, Doubl... | SKA-ScienceDataProcessor/RC | MS4/dna-programs/Kernel/GPU/Hogbom.hs | Haskell | apache-2.0 | 4,411 |
module Main where
import Network.Libre.TLS.FFI.Internal
main = putStrLn "hello"
| cartazio/libressl-hs | tests/hunit.hs | Haskell | bsd-2-clause | 81 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QMatrix.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:31
Warning : this file is machine generated - do not m... | uduki/hsQt | Qtc/Core/QMatrix.hs | Haskell | bsd-2-clause | 13,057 |
{-# LANGUAGE RecordWildCards #-}
module NLP.Nerf2.Delta.Ref
( delta
, delta'
) where
import Data.List (foldl')
import NLP.Nerf2.Types
import NLP.Nerf2.Forest.Set
import NLP.Nerf2.Forest.Phi
import qualified NLP.Nerf2.Env as Env
delta :: Env.InSent e => e -> N -> Pos -> LogReal
delta env x i = sumForests env $ fores... | kawu/nerf-proto | src/NLP/Nerf2/Delta/Ref.hs | Haskell | bsd-2-clause | 548 |
{-# LANGUAGE DataKinds,UnboxedTuples,MagicHash,TemplateHaskell,RankNTypes,TupleSections #-}
module HLearn.Data.SpaceTree.Algorithms.NearestNeighbor
(
-- * data types
Neighbor (..)
, ValidNeighbor (..)
, NeighborList (..)
, nlSingleton
, getknnL
, nlMaxDist
, Param_k
, _k
... | ehlemur/HLearn | src/HLearn/Data/SpaceTree/Algorithms/NearestNeighbor.hs | Haskell | bsd-3-clause | 13,421 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ExistentialQuantification #-}
module TestModule where
-- Product
data MyProd = MyProd Bool Int
type MyProdAlias = MyProd
-- Strict product
data MyStrict = MyStrict !Bool !Int
-- Polymorphic
data MyPoly a = MyPoly a
type MyPolyAlias = MyPoly Int
-- R... | norm2782/DGG | examples/testmodule.hs | Haskell | bsd-3-clause | 1,083 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeSy... | UCSD-PL/RefScript | src/Language/Rsc/Pretty/Types.hs | Haskell | bsd-3-clause | 7,069 |
{-|
Module : Control.Lens.Extra
Description : Extra utility functions for working with lenses.
Copyright : (c) Henry J. Wylde, 2016
License : BSD3
Maintainer : public@hjwylde.com
Extra utility functions for working with lenses.
-}
{-# LANGUAGE Rank2Types #-}
module Control.Lens.Extra (
module Contro... | hjwylde/werewolf | src/Control/Lens/Extra.hs | Haskell | bsd-3-clause | 1,491 |
module ETCS.SDM.Intern where
import Control.Lens hiding ((*~), _2)
import ETCS.SDM.Helper
import ETCS.SDM.Types
import Numeric.Units.Dimensional.TF.Prelude
import Prelude ()
validConvertion :: (HasConvertingBreaki... | open-etcs/openetcs-sdm | src/ETCS/SDM/Intern.hs | Haskell | bsd-3-clause | 6,268 |
{- Data/Singletons/Util.hs
(c) Richard Eisenberg 2012
eir@cis.upenn.edu
This file contains helper functions internal to the singletons package.
Users of the package should not need to consult this file.
-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Data.Singletons.Util where
import Language.Haskell.TH
i... | jonsterling/singletons | Data/Singletons/Util.hs | Haskell | bsd-3-clause | 5,340 |
module Data.Minecraft.Snapshot15w40b
( module Data.Minecraft.Snapshot15w40b.Protocol
, module Data.Minecraft.Snapshot15w40b.Version
) where
import Data.Minecraft.Snapshot15w40b.Protocol
import Data.Minecraft.Snapshot15w40b.Version
| oldmanmike/hs-minecraft-protocol | src/Data/Minecraft/Snapshot15w40b.hs | Haskell | bsd-3-clause | 238 |
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, TypeFamilies, DeriveDataTypeable #-}
module Web.Scotty.Internal.Types where
import Blaze.ByteString.Builder (Builder)
import Control.Applicative
import qualified Control.Exception as E
imp... | beni55/scotty | Web/Scotty/Internal/Types.hs | Haskell | bsd-3-clause | 7,087 |
-----------------------------------------------------------------------------
--
-- Machine-dependent assembly language
--
-- (c) The University of Glasgow 1993-2004
--
-----------------------------------------------------------------------------
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a... | nomeata/ghc | compiler/nativeGen/SPARC/Instr.hs | Haskell | bsd-3-clause | 15,521 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Jenkins where
import Control.Lens hiding (deep) -- lens
import Control.Monad.IO.Class
import Control.Monad.Trans.Control
import Data.Aeson.Lens -- lens-aeson
import Data.Map (empty)
i... | wayofthepie/riverd | src/lib/Jenkins.hs | Haskell | bsd-3-clause | 3,688 |
-----------------------------------------------------------------------------
-- |
-- Module : A
-- Copyright : (c) 2008 - 2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
--
-- An example type representation.
-----------------------------------------------------------... | spl/emgm | tests/A.hs | Haskell | bsd-3-clause | 5,933 |
{-# OPTIONS -fno-warn-unused-imports #-}
#include "HsConfigure.h"
-- #hide
module Data.Time.Calendar.Days
(
-- * Days
Day(..),addDays,diffDays
) where
import Control.DeepSeq
import Data.Ix
import Data.Typeable
#if LANGUAGE_Rank2Types
import Data.Data
#endif
-- | The Modified Julian Day is a standard count of ... | bergmark/time | lib/Data/Time/Calendar/Days.hs | Haskell | bsd-3-clause | 2,031 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module HW05 where
import Data.ByteString.Lazy (ByteString)
import Data.Map.Strict (Map)
import System.Environment (getArgs)
import Data.Word8 (Word8)
import Data.List
import Data.Ord
import Data.Maybe
import qualified Data.ByteString.Lazy a... | ImsungChoi/haskell-test | src/HW05.hs | Haskell | bsd-3-clause | 4,930 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveFunctor #-}
module FreshNames where
import Prelude hiding ((<))
newtype PolyFreshNames a = FreshNames { unFreshNames :: a }
deriving (Show, Eq, Ord, Functor)
type FreshNames = PolyFreshNames In... | kajigor/uKanren_transformations | src/FreshNames.hs | Haskell | bsd-3-clause | 723 |
-- |
-- Module : Database.Monarch
-- Copyright : 2013 Noriyuki OHKAWA
-- License : BSD3
--
-- Maintainer : n.ohkawa@gmail.com
-- Stability : experimental
-- Portability : unknown
--
-- Provide TokyoTyrant monadic access interface.
--
module Database.Monarch
(
Monarch, MonarchT
, Connection, ... | notogawa/monarch | src/Database/Monarch.hs | Haskell | bsd-3-clause | 617 |
{-# LANGUAGE TemplateHaskell #-}
-- | Generate AST types, functions and instances for tuples.
module Database.DSH.Frontend.TupleTypes
( -- * Generate tuple types, functions and instances
mkQAInstances
, mkTAInstances
, mkTupleConstructors
, mkTupleAccessors
, mkTupElemType
, mkTupElemCom... | ulricha/dsh | src/Database/DSH/Frontend/TupleTypes.hs | Haskell | bsd-3-clause | 20,752 |
import Control.Monad.Logger
import Data.ByteString.Char8 (pack)
import Meadowstalk.Application
import Network.Wai.Handler.Warp
import System.Environment
-------------------------------------------------------------------------------
main :: IO ()
main = do
port <- read <$> getEnv "PORT"
connstr <- pack <$> get... | HalfWayMan/meadowstalk | src/Main.hs | Haskell | bsd-3-clause | 415 |
module System.Console.Haskeline.Prefs(
Prefs(..),
defaultPrefs,
readPrefs,
CompletionType(..),
BellStyle(..),
EditMode(..),
HistoryDuplicates(..),
... | judah/haskeline | System/Console/Haskeline/Prefs.hs | Haskell | bsd-3-clause | 5,774 |
{-# LANGUAGE FlexibleContexts #-}
module Stencil2 where
import Control.Monad
import Control.Exception
import System.Random.MWC
import Data.Array.Unboxed hiding (Array)
import Data.Array.Accelerate hiding (round, min, max, fromIntegral)
import qualified Data.Array.IArray as IArray
stencil2D2 :: Fl... | wilbowma/accelerate | accelerate-examples/tests/primitives/Stencil2.hs | Haskell | bsd-3-clause | 2,440 |
-- -----------------------------------------------------------------------------
--
-- CharSet.hs, part of Alex
--
-- (c) Chris Dornan 1995-2000, Simon Marlow 2003
--
-- An abstract CharSet type for Alex. To begin with we'll use Alex's
-- original definition of sets as functions, then later will
-- transition to some... | beni55/alex | src/CharSet.hs | Haskell | bsd-3-clause | 5,261 |
{-# OPTIONS_GHC -fno-implicit-prelude -#include "HsBase.h" #-}
#undef DEBUG_DUMP
-----------------------------------------------------------------------------
-- |
-- Module : GHC.IO
-- Copyright : (c) The University of Glasgow, 1992-2001
-- License : see libraries/base/LICENSE
--
-- Maintainer : lib... | FranklinChen/hugs98-plus-Sep2006 | packages/base/GHC/IO.hs | Haskell | bsd-3-clause | 31,744 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RankNTypes #-}
module Diagrams.Backend.OpenGL.TwoD.Attributes
( GLRenderM, GLRenderState (..), withStyleState , initialGLRenderState)
where
-- General Haskell
import Control.Mo... | bergey/diagrams-opengl | src/Diagrams/Backend/OpenGL/TwoD/Attributes.hs | Haskell | bsd-3-clause | 3,142 |
{-# Language RankNTypes, ViewPatterns, PatternSynonyms, TypeOperators, ScopedTypeVariables,
KindSignatures, PolyKinds, DataKinds, TypeFamilies, TypeInType, GADTs #-}
module T14552 where
import Data.Kind
import Data.Proxy
data family Sing a
type a --> b = (a, b) -> Type
type family F (f::a --> b) (x::a... | shlevy/ghc | testsuite/tests/patsyn/should_fail/T14552.hs | Haskell | bsd-3-clause | 1,019 |
module FFI
(module Fay.FFI)
where
import Fay.FFI
| fpco/fay-base | src/FFI.hs | Haskell | bsd-3-clause | 54 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Test suite for GHCi like applications including both GHCi and Intero.
module Stack.GhciSpec where
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Map as M
import qualified Data.Set as S
import ... | AndreasPK/stack | src/test/Stack/GhciSpec.hs | Haskell | bsd-3-clause | 8,765 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-
Created : 2015 Aug 26 (Wed) 11:56:37 by Harold Carr.
Last Modified : 2015 Sep 12 (Sat) 11:39:39 by Harold Carr.
-}
module Msg where
import Data.Aeson (FromJSON, ToJSON)
import GHC.Generics
type Name = String
type Msg... | splodingsocks/utah-haskell | infrastructure/src/Msg.hs | Haskell | apache-2.0 | 464 |
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE PolyKinds, ExplicitForAll #-}
module SAKS_015 where
import Data.Kind (Type)
type T :: forall k -> k -> Type
data T (k :: Type) (a :: k)
| sdiehl/ghc | testsuite/tests/saks/should_compile/saks015.hs | Haskell | bsd-3-clause | 194 |
<?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="pt-BR">
<title>All In One Notes Add-On</title>
<maps>
<homeID>top</homeID>
<mapref loca... | thc202/zap-extensions | addOns/allinonenotes/src/main/javahelp/org/zaproxy/zap/extension/allinonenotes/resources/help_pt_BR/helpset_pt_BR.hs | Haskell | apache-2.0 | 968 |
{-# OPTIONS -fno-warn-redundant-constraints #-}
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, StandaloneDeriving, FlexibleInstances #-}
-- Test #2856
module T2856 where
import Data.Ratio
----------------------
class C a where
data D a
instance C Bool where
newtype D Bool = DInt Int deriving (Eq, S... | sdiehl/ghc | testsuite/tests/deriving/should_compile/T2856.hs | Haskell | bsd-3-clause | 761 |
module WhereIn7 where
--A definition can be demoted to the local 'where' binding of a friend declaration,
--if it is only used by this friend declaration.
--Demoting a definition narrows down the scope of the definition.
--In this example, demote the top level 'sq' to 'sumSquares'
--This example also aims to test the... | kmate/HaRe | test/testdata/Demote/WhereIn7.hs | Haskell | bsd-3-clause | 472 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
module Distribution.Types.ComponentLocalBuildInfo (
ComponentLocalBuildInfo(..),
componentIsIndefinite,
maybeComponentInstantiatedWith,
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.ModuleName
import Distribution.... | mydaum/cabal | Cabal/Distribution/Types/ComponentLocalBuildInfo.hs | Haskell | bsd-3-clause | 5,430 |
{-# LANGUAGE CPP #-}
#include "MachDeps.h"
module Main where
import Data.Bits
#if WORD_SIZE_IN_BITS != 64 && WORD_SIZE_IN_BITS != 32
# error unsupported WORD_SIZE_IN_BITS config
#endif
-- a negative integer the size of GMP_LIMB_BITS*2
negativeBigInteger :: Integer
negativeBigInteger = 1 - (1 `shiftL` (64 * 2))
ma... | ezyang/ghc | testsuite/tests/numeric/should_run/T12136.hs | Haskell | bsd-3-clause | 406 |
module Geometry.SpatialHash where
import Algebra.Vector as V
import Data.List as List
import Data.List.Extensions as ListExt
import Data.Map as Map
import Data.Ratio as Ratio
import Data.Ratio.Extensions as RatioExt
import Data.Tuple.Extensions as TupleExt
import Geometry.AABB as AABB
type SpatialHash a = (Map Vector ... | stevedonnelly/haskell | code/Geometry/SpatialHash.hs | Haskell | mit | 1,967 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Warning! This module is considered internal and may have breaking changes
module Routes.TH.Types
( -- * Data types
Resource (..)
, ResourceTree (..)
, Piece (..)
, Dispatch (..)
, CheckOverlap
, FlatResource (..)
--... | ajnsit/snap-routes | src/Routes/TH/Types.hs | Haskell | mit | 3,114 |
module Lambency.Shader.Var where
--------------------------------------------------------------------------------
import Lambency.Shader.Base
import Linear
--------------------------------------------------------------------------------
matrix2Ty :: ShaderVarTy (M22 Float)
matrix2Ty = ShaderVarTy Matrix2Ty
matrix3T... | Mokosha/Lambency | lib/Lambency/Shader/Var.hs | Haskell | mit | 1,299 |
module Physie.List(
maximumByNeighbors
, boolToList
) where
import Control.Lens (view, _2)
import Data.Function (on)
import Data.List (maximumBy)
maximumByNeighbors :: Ord a => (a -> a -> Ordering) -> [a] -> (a,a,a)
maximumByNeighbors f ls = let cls = cycle ls
... | pmiddend/physie | src/Physie/List.hs | Haskell | mit | 469 |
import Utils
nNumbers nDig = 9 * 10^(nDig-1)
lens = map nNumbers [1..]
relativeShifts = zipWith (*) lens [1..]
absoluteShifts = zip [1..] $ scanl (+) 0 relativeShifts
nthDigit n = digit
--nthDigit n = (nDigits, shift, numberShift, nAsDigits, digitShift, digit)
where (nDigits, shift) = last $ takeWhile (\(a... | arekfu/project_euler | p0040/p0040.hs | Haskell | mit | 696 |
{-# LANGUAGE RankNTypes #-}
{- |
Module : Orville.PostgreSQL.Connection
Copyright : Flipstone Technology Partners 2016-2021
License : MIT
-}
module Orville.PostgreSQL.Connection
( Connection,
Pool,
ConnectionUsedAfterCloseError,
ConnectionError,
SqlExecutionError (..),
NoticeReporting (Enabl... | flipstone/orville | orville-postgresql-libpq/src/Orville/PostgreSQL/Connection.hs | Haskell | mit | 11,198 |
{-
Copyright (c) 2008, 2013
Russell O'Connor
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 limitation the rights
to use, copy, modify, merge, publish, dist... | haasn/colour | Data/Colour/SDTV625.hs | Haskell | mit | 3,037 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
-- | This module creates a class for automating the construction and
-- destruction of JSON objects
module JSON where
import Haste
import Haste.Graphics.Canvas
import Haste.JSON
import Prelude hiding (head, tail, init, last, read, (!!))
import ... | rprospero/PhotoAlign | JSON.hs | Haskell | mit | 1,880 |
-- Double all integers in a list.
module Double where
double :: [Integer] -> [Integer]
double [] = []
double (integer : remainingIntegers)
= (2 * integer) : double remainingIntegers
{- GHCi>
double []
double [1]
double [1, 1]
-}
-- []
-- [2]
-- [2, 2]
| pascal-knodel/haskell-craft | Examples/· Recursion/· Primitive Recursion/Lists/Double.hs | Haskell | mit | 266 |
-- Core.hs: The core λ calculus of simpl.
-- Copyright 2014 Jack Pugmire
--
-- 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... | jepugs/simpl | Simpl/Core.hs | Haskell | apache-2.0 | 1,932 |
{- |
Module : Bio.Motions.Utils.Geometry
Description : Utility geometry functions.
License : Apache
Stability : experimental
Portability : unportable
-}
{-# LANGUAGE RecordWildCards #-}
module Bio.Motions.Utils.Geometry where
import Control.Monad
import Control.Applicative
import Data.Maybe
import Linear
t... | Motions/motions | src/Bio/Motions/Utils/Geometry.hs | Haskell | apache-2.0 | 6,405 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger (logStd... | svdberg/yesod-milk | Application.hs | Haskell | bsd-2-clause | 3,427 |
module Main where
import System.Console.CmdArgs
import Network.HTTP.Neon.ProgType
import Network.HTTP.Neon.Command
main :: IO ()
main = do
putStrLn "hneon"
param <- cmdArgs mode
commandLineProcess param | wavewave/hneon | exe/hneon.hs | Haskell | bsd-2-clause | 214 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -fno-warn-implicit-prelude #-}
module Paths_ChatServer (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
i... | mcdonndi/ChatServer | dist/dist-sandbox-a117d482/build/ChatServer/autogen/Paths_ChatServer.hs | Haskell | bsd-3-clause | 2,170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.