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 RankNTypes #-} module Main where import Test.Framework (defaultMain) ------------------------------------------------------------------------------ import qualified Data.HashTable.Test.Common as Common import qualified Data.HashTable.ST.Basic as B import qualified Data.HashTable.ST.Cuckoo as C import qua...
cornell-pl/HsAdapton
weak-hashtables/test/suite/TestSuite.hs
Haskell
bsd-3-clause
1,086
module Web.Routes.Site where import Data.ByteString import Data.Monoid import Data.Text (Text) import Web.Routes.Base (decodePathInfo, encodePathInfo) {-| A site groups together the three functions necesary to make an application: * A function to convert from the URL type to path segments. * A function to convert ...
shockkolate/web-routes
Web/Routes/Site.hs
Haskell
bsd-3-clause
2,569
module Main where import Test.QuickCheck import Data.List mult :: Int -> Int -> Int -> Int mult x y z = x*y*z prop_mult x y z = (x * y * z) == mult x y z prop_factorial_monotone (Positive x) = factorial x <= (factorial x+1) newtype SmallIntList = SmallIntList [Int] deriving (Eq,Show) instance Arbitrary SmallInt...
chadbrewbaker/combinat
tests/Check.hs
Haskell
bsd-3-clause
599
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, TupleSections, GeneralizedNewtypeDeriving, DeriveTraversable #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| JSON utility functions. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and...
grnet/snf-ganeti
src/Ganeti/JSON.hs
Haskell
bsd-2-clause
20,109
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 \section[DataCon]{@DataCon@: Data Constructors} -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module DataCon ( -- * Main data types DataCon, DataConRep(..), SrcStrictness(..), SrcUnpackedness(..), ...
AlexanderPankiv/ghc
compiler/basicTypes/DataCon.hs
Haskell
bsd-3-clause
51,933
{-# LANGUAGE BangPatterns #-} module Randomish ( randomishInts , randomishDoubles) where import Data.Word import Data.Vector.Unboxed (Vector) import qualified Data.Vector.Unboxed.Mutable as MV import qualified Data.Vector.Unboxed as V import qualified Data.Vector.Generic as G -- | Use the "minimal standard"...
agremm/Matryoshka
examples/lib/Randomish.hs
Haskell
bsd-3-clause
2,267
{-# LANGUAGE StandaloneKindSignatures #-} module SAKS_Fail007 where import Data.Kind (Type) type May a :: Type data May a = Nay | Yay a
sdiehl/ghc
testsuite/tests/saks/should_fail/saks_fail007.hs
Haskell
bsd-3-clause
139
module HN.Blaze (module Text.Blaze.Extra ,module Text.Blaze.Html5 ,module Text.Blaze.Html5.Attributes ,module Text.Blaze.Renderer.Text ,module Text.Blaze.Linkify ,module Text.Blaze.Pagination ,module Text.Blaze.Bootstrap ) where import Text.Blaze.Extra import Text.Blaze.Html5 hiding (output,map,i,t...
jwaldmann/haskellnews
src/HN/Blaze.hs
Haskell
bsd-3-clause
547
{-# LANGUAGE MagicHash #-} {-# OPTIONS_GHC -Werror #-} -- Trac #2806 module Foo where import GHC.Base foo :: Int foo = 3 where (I# _x) = 4
hvr/jhc
regress/tests/1_typecheck/4_fail/ghc/T2806.hs
Haskell
mit
149
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ConstraintKinds #-} -- | Tag a Binary instance with the stack version number to ensure we're -- reading a compatible format. module Data.Binary.VersionTagged ( ta...
phadej/stack
src/Data/Binary/VersionTagged.hs
Haskell
bsd-3-clause
3,108
{-# LANGUAGE ScopedTypeVariables #-} module BinaryDerive where import Data.Generics import Data.List deriveM :: (Typeable a, Data a) => a -> IO () deriveM (a :: a) = mapM_ putStrLn . lines $ derive (undefined :: a) derive :: (Typeable a, Data a) => a -> String derive x = "instance " ++ context ++ "Binary " ++...
ezyang/binary
tools/derive/BinaryDerive.hs
Haskell
bsd-3-clause
2,273
{-# Language TemplateHaskell #-} {-# Language DisambiguateRecordFields #-} module T12130 where import T12130a hiding (Block) b = $(block)
olsner/ghc
testsuite/tests/th/T12130.hs
Haskell
bsd-3-clause
141
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {- | Module : Database.Couch.Explicit.Design Description : Design Document-oriented requests to CouchDB, with explicit parameters Copyright : Copyright (c) 2015, Michael Alan Dorman License : MIT Mainta...
mdorman/couch-simple
src/lib/Database/Couch/Explicit/Design.hs
Haskell
mit
8,043
{-# LANGUAGE BangPatterns #-} module Feitoria.Types where import Codec.MIME.Type import qualified Data.ByteString as B import Data.Time import Data.Word import Foreign.Ptr import qualified Data.Text as T import qualified Data.Vector as V --data MMapTable = MMapTable { -- mmapTblHeader :: !TableHead...
MadSciGuys/feitoria
src/Feitoria/Types.hs
Haskell
mit
1,412
{-# htermination addToFM_C :: (Ord a, Ord k) => (b -> b -> b) -> FiniteMap (Either a k) b -> (Either a k) -> b -> FiniteMap (Either a k) b #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_addToFM_C_10.hs
Haskell
mit
160
module EntityWrapper.Schema ( module EntityWrapper.Schema , module EntityWrapper.Schema.Virus ) where import qualified Database.Orville.PostgreSQL as O import EntityWrapper.Schema.Virus schema :: O.SchemaDefinition schema = [O.Table virusTable]
flipstone/orville
orville-postgresql/test/EntityWrapper/Schema.hs
Haskell
mit
254
module Typing.Util where import Typing.Env import Typing.Kinds import {-# SOURCE #-} Typing.Stmt import Typing.Substitution import Typing.Subtyping import Typing.TypeError import Typing.Types import Util.Error import Absyn.Base import Absyn.Meta import qualified Absyn.Untyped as U import qualified Absyn.Typed as T ...
tadeuzagallo/verve-lang
src/Typing/Util.hs
Haskell
mit
3,258
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Game.Implement.Card -- Copyright : (c) 2017 Christopher A. Gorski -- License : MIT -- Maintainer : Christopher A. Gorski <cgorski@cgorski.org> -- -- The Game.Implement.Card module provides fundamental operations for...
cgorski/general-games
src/Game/Implement/Card.hs
Haskell
mit
8,909
import qualified Data.Hash.MD5 as MD5 md5snum str x = MD5.md5s $ MD5.Str $ str ++ show x firstSixZeros str x | take 6 (md5snum str x) == "000000" = x | otherwise = -1 main = do let word_part = "iwrupvqb" print $ head [firstSixZeros word_part x | x <- [0..], firstSixZeros word_part x > 0]
RatanRSur/advent-of-haskell
day4/part2.hs
Haskell
mit
309
module Problem2 ( secondToLastElem ) where secondToLastElem :: [a] -> a secondToLastElem x = last (init x)
chanind/haskell-99-problems
Problem2.hs
Haskell
mit
107
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} module Y2018.M05.D25.Solution where import Control.Arrow ((&&&)) import Control.Concurrent (threadDelay) import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as BL import Database.PostgreSQL.Simple import Database.PostgreSQL.Simple....
geophf/1HaskellADay
exercises/HAD/Y2018/M05/D25/Solution.hs
Haskell
mit
5,075
module Main where import Lib import Text.Printf n = 100::Integer main :: IO () main = do printf "Square of sum minus sum of squares = %d\n" (squareSum n - sumSquares n)
JohnL4/ProjectEuler
Haskell/Problem006/app/Main.hs
Haskell
mit
174
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} module Chatwork.V0.Api ( module Chatwork.V0.ChatworkConfig , module Chatwork.V0.Type , module Chatwork.V0.Message , login , loadChat , loadRoom , readChat , getUpdate , sendChat , getRoomInfo ) where import Network.HTTP.Conduit import Network.H...
totem3/cwhs
src/Chatwork/V0/Api.hs
Haskell
mit
7,809
{-# LANGUAGE RecordWildCards #-} module StructuralIsomorphism.Declarations ( -- * Types Constructor(..), DataType(..), -- * Map from Template Haskell to these simpler types constructor, dataType ) where import Language.Haskell.TH.Syntax data Constructor = Constructor { conName :: !Name ...
antalsz/hs-to-coq
structural-isomorphism-plugin/src/StructuralIsomorphism/Declarations.hs
Haskell
mit
1,795
module HelperSequences.A006519Spec (main, spec) where import Test.Hspec import HelperSequences.A006519 (a006519) main :: IO () main = hspec spec spec :: Spec spec = describe "A006519" $ it "correctly computes the first 20 elements" $ take 20 (map a006519 [1..]) `shouldBe` expectedValue where expectedValue...
peterokagey/haskellOEIS
test/HelperSequences/A006519Spec.hs
Haskell
apache-2.0
366
{-# LANGUAGE PackageImports #-} import "ministeam" Application (getApplicationDev) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort) import Control.Concurrent (forkIO) import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDel...
XxNocturnxX/ministeam
devel.hs
Haskell
bsd-2-clause
703
module Foundation ( App (..) , Route (..) , AppMessage (..) , resourcesApp , Handler , Widget , Form , maybeAuth , requireAuth , module Settings , module Model ) where import Prelude import Yesod import Yesod.Static import Yesod.Auth import Yesod.Auth.BrowserId import Ye...
jgenso/comunidadhaskell.org
Foundation.hs
Haskell
bsd-2-clause
6,083
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGraphicsPathItem_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:25 Warning : this file is machine generate...
keera-studios/hsQt
Qtc/Gui/QGraphicsPathItem_h.hs
Haskell
bsd-2-clause
98,043
module Frontend.Val(Val(..), TVal(TVal), WithVal(..)) where import qualified Data.Map as M import Name import Frontend.NS import Frontend.Expr import Frontend.Type -- Value data Val = BoolVal Bool | IntVal Integer | StructVal (M.Map Ident TVal) ...
termite2/tsl
Frontend/Val.hs
Haskell
bsd-3-clause
1,399
import Data.Foldable (foldMap, foldr) import Data.Monoid import Data.Maybe newtype Min a = Min { getMin :: Maybe a } deriving (Eq, Ord, Show) newtype Max a = Max { getMax :: Maybe a } deriving (Eq, Ord, Show) instance Ord a => Monoid (Min a) where mempty = Min Nothing Min (Nothing) `mappend` y = y x `mappend` Mi...
chengzh2008/hpffp
src/ch20-Foldable/foldable.hs
Haskell
bsd-3-clause
2,460
{-# LANGUAGE RankNTypes #-} {-| Generic equal temperament pitch. Use the type-level numbers to construct an temperement dividing the octave in any number of equal-sized steps. Common cases such as 6, 12 and 24 are provided for convenience. -} module Music.Pitch.Equal ( -- * Equal temperament Equal, toEq...
music-suite/music-pitch
src/Music/Pitch/Equal.hs
Haskell
bsd-3-clause
3,792
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} #endif #if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Data.Set.Base -- Copyri...
ekmett/containers
Data/Set/Base.hs
Haskell
bsd-3-clause
54,658
{-# OPTIONS_GHC -F -pgmF inch #-} {-# LANGUAGE RankNTypes, GADTs, KindSignatures, ScopedTypeVariables, NPlusKPatterns #-} module MergeSort where import Vectors comp f g x = f (g x) data DTree :: * -> Integer -> * where Empty :: DTree a 0 Leaf :: a -> DTree a 1 Even :: forall a (n :: In...
adamgundry/inch
examples/MergeSort.hs
Haskell
bsd-3-clause
2,457
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module GithubWebhook.Types.Events.PushEvent ( PushEvent(..) ) where import qualified Data.Text as T import qualified Data.Aeson as A import qualified Data.Aeson.TH as A import qualified GithubWebhook.Types.SmallUser as SmallUser import qualified GithubW...
bgwines/hueue
src/GithubWebhook/Types/Events/PushEvent.hs
Haskell
bsd-3-clause
997
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.TransformFeedback2 -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portab...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/TransformFeedback2.hs
Haskell
bsd-3-clause
1,062
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- | Description: Unique identifiers for internal an external use. module Retcon.Identifier ( -- * Configuration names EntityName(..), SourceName(..), -- * Unique identifiers InternalID, ForeignID, ForeignKey(..), Interna...
anchor/retcon
lib/Retcon/Identifier.hs
Haskell
bsd-3-clause
3,539
----------------------------------------------------------------------------- -- | -- Module : Graphics.X11.Xlib -- Copyright : (c) Alastair Reid, 1999-2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability...
FranklinChen/hugs98-plus-Sep2006
packages/X11/Graphics/X11/Xlib.hs
Haskell
bsd-3-clause
3,374
{-# LANGUAGE OverloadedStrings #-} -- | High level functions for downloading files. module Control.Shell.Download ( URI , fetch, fetchBytes , fetchFile , fetchTags, fetchXML, fetchFeed ) where import Data.ByteString as BS (ByteString, writeFile) import Data.ByteString.UTF8 as BS import Data.ByteString.Lazy as...
valderman/shellmate
shellmate-extras/Control/Shell/Download.hs
Haskell
bsd-3-clause
2,534
module QACG.CircGen.Bit.Toffoli ( tof ,tofMatchedD1 ,leftTof ,rightTof ) where import QACG.CircUtils.CircuitState import Control.Exception(assert) tof :: String -> String -> String -> CircuitState () tof a b c = do consts <- getConst 4 assert (length consts == 4) $ applyTof a b c consts ...
aparent/qacg
src/QACG/CircGen/Bit/Toffoli.hs
Haskell
bsd-3-clause
2,226
#!/usr/bin/env stack -- stack --install-ghc runghc --package=shake --package=extra --package=zip-archive --package=mime-types --package=http-types --package=http-conduit --package=text --package=conduit-combinators --package=conduit --package=case-insensitive --package=aeson --package=zlib --package tar {-# OPTIONS_GHC...
robstewart57/stack
etc/scripts/release.hs
Haskell
bsd-3-clause
28,996
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE DeriveFunctor #-} ----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.ReadP -- Copyright : (c) The University of...
spacekitteh/smcghc
libraries/base/Text/ParserCombinators/ReadP.hs
Haskell
bsd-3-clause
14,899
-- | -- Type classes and built-in implementation for primitive Haskell types -- module Ntha.Z3.Class ( -- ** Types whose values are encodable to Z3 internal AST Z3Encoded(..), -- ** Types representable as Z3 Sort -- XXX: Unsound now -- XXX: Too flexible, can be used to encode Type ADT Z3Sorted...
zjhmale/Ntha
src/Ntha/Z3/Class.hs
Haskell
bsd-3-clause
7,015
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module System.EtCetera.LxcSpec where import Control.Monad.Trans (liftIO) import Data.List (intercalate) import System.EtCetera.Internal (Optional(..)) import System.EtCetera.Lxc.Internal (Ar...
paluh/et-cetera
test/System/EtCetera/LxcSpec.hs
Haskell
bsd-3-clause
6,700
#! /usr/bin/env stack -- stack runghc module Advent.Day8 where import Advent import Data.Char (chr) import Numeric (readHex) unencode ('"':s) = _unencode s where _unencode ('\\':'"':s) = '"':_unencode s _unencode ('\\':'\\':s) = '\\':_unencode s _unencode ('\\':'x':a:b:s) = (chr $ (fst . head) parses):...
cpennington/adventofcode
src/Advent/Day8.hs
Haskell
bsd-3-clause
1,084
{-# LANGUAGE TypeSynonymInstances #-} module CarbonCopy.MailHeaders ( Header(..), StrHeader, HeaderMatcher, extractHeaders, msg_id_hdr, from_hdr, in_reply_to_hdr ) where import Prelude as P import Data.Char import Data.ByteString.Char8 as BStr hiding (concatMap, takeWhile) import Text.P...
jdevelop/carboncopy
CarbonCopy/MailHeaders.hs
Haskell
bsd-3-clause
1,110
{-# LANGUAGE PatternGuards, TypeSynonymInstances, TypeFamilies, FlexibleInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Berp.Compile.Compile -- Copyright : (c) 2010 Bernie Pope -- License : BSD-style -- Maintainer : florbitous@gmail.com -- Stabil...
bjpop/berp
libs/src/Berp/Compile/Compile.hs
Haskell
bsd-3-clause
35,150
{-# LANGUAGE OverloadedStrings #-} {- This file is part of the Haskell package cassava-streams. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at git://pmade.com/cassava-streams/LICENSE. No part of cassava-streams package, including this file, may be c...
pjones/cassava-streams
src/System/IO/Streams/Csv/Tutorial.hs
Haskell
bsd-3-clause
5,484
{-# LANGUAGE GADTs #-} {- | * Parse 'String' into @['Node']@. * Parse macro definitions in @['Node']@ giving a @'Context'@ and an @'Program' 'RenderI'@. Only macro definition in the current level is parsed. * @'IO' a@. -} module Text.Velocity.Example where import Control.Error import T...
edom/velocity
Text/Velocity/Example.hs
Haskell
bsd-3-clause
891
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE CPP #-} -- #define DEBUG {-| Module : AERN2.PPoly.MinMax Description : PPoly pointwise min and max Copyright : (c) Michal Konecny, Eike Neumann License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portabi...
michalkonecny/aern2
aern2-fun-univariate/src/AERN2/PPoly/MinMax.hs
Haskell
bsd-3-clause
3,049
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} module Language.Haskell.Liquid.Bare.GhcSpec ( GhcSpec(..) , makeGhcSpec ) where import CoreSyn hiding (Expr) import HscTypes import Id impo...
rolph-recto/liquidhaskell
src/Language/Haskell/Liquid/Bare/GhcSpec.hs
Haskell
bsd-3-clause
13,679
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE TypeFamilies #-} module Physics.Falling3d.Transform3d ( Transform3d ) where import Control.Monad(liftM) import qualified Data.Vector.Generic as G import qualified Data.Vector.Generic.Mutable as M import Data.Vector.Unb...
sebcrozet/falling3d
Physics/Falling3d/Transform3d.hs
Haskell
bsd-3-clause
3,759
module Data.Astro.TypesTest ( tests , testDecimalDegrees , testDecimalHours ) where import Test.Framework (testGroup) import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.HUnit import Test.HUnit.Approx import Test.QuickCheck import Data.Ratio ((%)) import...
Alexander-Ignatyev/astro
test/Data/Astro/TypesTest.hs
Haskell
bsd-3-clause
9,736
module Foreign.Storable.OrphansSpec (main, spec) where import Test.Hspec import Data.Complex import Data.Orphans () import Data.Ratio import Foreign.Storable main :: IO () main = hspec spec spec :: Spec spec = do describe "Storable Complex instance" $ do it "has twice the sizeOf its realPart" $ do sizeOf...
phadej/base-orphans
test/Foreign/Storable/OrphansSpec.hs
Haskell
mit
781
{-# LANGUAGE OverloadedStrings #-} module Foreign.JavaScript.V8.ContextSpec (main, spec) where import Test.Hspec import Data.String.Builder (build) import Control.Monad (replicateM_) import Control.Exception (bracket) import Foreign.JavaScript.V8 import For...
sol/v8
test/Foreign/JavaScript/V8/ContextSpec.hs
Haskell
mit
3,307
{-# LANGUAGE OverloadedStrings #-} module Dashdo.Rdash (rdash, charts, controls, defaultSidebar, Sidebar(..)) where import Dashdo.Types import Lucid import Lucid.Bootstrap3 import qualified Lucid.Rdash as RD import qualified Data.Text as T import qualified Data.Text.Lazy as TL import Data.Text hiding (map, interspers...
diffusionkinetics/open
dashdo/src/Dashdo/Rdash.hs
Haskell
mit
3,346
<?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="az-AZ"> <title>Code Dx | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref loc...
veggiespam/zap-extensions
addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_az_AZ/helpset_az_AZ.hs
Haskell
apache-2.0
969
{-# LANGUAGE RankNTypes, FlexibleContexts #-} {-| Implementation of functions specific to configuration management. -} {- Copyright (C) 2013, 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a...
bitemyapp/ganeti
src/Ganeti/WConfd/ConfigWriter.hs
Haskell
bsd-2-clause
8,861
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Generate.Index (toHtml, getInfo, getPkg) where import Control.Monad import Control.Monad.Except (ExceptT, liftIO, runExceptT, throwError) import Data.Aeson as Json import qualified Data.ByteString.Lazy.UTF8 as BSU8 import qualified Data.List as List i...
rehno-lindeque/elm-reactor
src/backend/Generate/Index.hs
Haskell
bsd-3-clause
4,630
{- (c) The University of Glasgow, 1994-2006 Core pass to saturate constructors and PrimOps -} {-# LANGUAGE BangPatterns, CPP #-} module CorePrep ( corePrepPgm, corePrepExpr, cvtLitInteger, lookupMkIntegerName, lookupIntegerSDataConName ) where #include "HsVersions.h" import OccurAnal import HscType...
snoyberg/ghc
compiler/coreSyn/CorePrep.hs
Haskell
bsd-3-clause
57,558
-- | -- Module: Data.Aeson.Types -- Copyright: (c) 2011-2016 Bryan O'Sullivan -- (c) 2011 MailRank, Inc. -- License: BSD3 -- Maintainer: Bryan O'Sullivan <bos@serpentine.com> -- Stability: experimental -- Portability: portable -- -- Types for working with JSON data. module Data.Aeson.Types ...
tolysz/prepare-ghcjs
spec-lts8/aeson/Data/Aeson/Types.hs
Haskell
bsd-3-clause
2,392
module B1 (myFringe)where import D1 hiding (sumSquares) import qualified D1 instance SameOrNot Float where isSame a b = a ==b isNotSame a b = a /=b myFringe:: Tree a -> [a] myFringe (Leaf x ) = [x] myFringe (Branch left right) = myFringe right sumSquares (x:xs)= x^2 + sumSquares xs sumSquares [] =0
kmate/HaRe
old/testing/renaming/B1.hs
Haskell
bsd-3-clause
320
module WhereIn3 where sumSquares x y = (sq_1 pow x) + (sq_1 pow y) where pow = 2 sq_1 pow 0 = 0 sq_1 pow z = z ^ pow anotherFun 0 y = sq y sq x = x ^ 2
kmate/HaRe
old/testing/liftOneLevel/WhereIn3_AstOut.hs
Haskell
bsd-3-clause
163
{-# LANGUAGE CPP #-} module GHCi.Signals (installSignalHandlers) where import Control.Concurrent import Control.Exception import System.Mem.Weak ( deRefWeak ) #ifndef mingw32_HOST_OS import System.Posix.Signals #endif #if defined(mingw32_HOST_OS) import GHC.ConsoleHandler #endif -- | Install standard signal handle...
tolysz/prepare-ghcjs
spec-lts8/ghci/GHCi/Signals.hs
Haskell
bsd-3-clause
1,393
{-# LANGUAGE UndecidableInstances, OverlappingInstances, Rank2Types, KindSignatures, EmptyDataDecls, MultiParamTypeClasses, CPP #-} {- (C) 2004--2005 Ralf Laemmel, Simon D. Foster This module approximates Data.Generics.Basics. -} module T1735_Help.Basics ( module Data.Typeable, module T1735_...
siddhanathan/ghc
testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs
Haskell
bsd-3-clause
13,203
module Geometria.Cuboide ( volume , area ) where volume :: Float -> Float -> Float -> Float volume a b c = areaRetangulo a b * c area :: Float -> Float -> Float -> Float area a b c = areaRetangulo a b * 2 + areaRetangulo a c * 2 + areaRetangulo c b * 2 areaRetangulo :: Float -> Float -> Float areaRetangulo a b...
tonussi/freezing-dubstep
proj1/Cuboide.hs
Haskell
mit
329
{-# LANGUAGE DeriveFunctor #-} module Test.Smoke.Types.Results where import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Test.Smoke.Paths import Test.Smoke.Types.Assert import Test.Smoke.Types.Base import Test.Smoke.Types.Errors import Test.Smoke.Types.Plans import Test.Smoke.Types.Tests clas...
SamirTalwar/Smoke
src/lib/Test/Smoke/Types/Results.hs
Haskell
mit
1,689
module AddStuff where addStuff :: Integer -> Integer -> Integer addStuff a b = a + b + 5 addTen = addStuff 5 fifteen = addTen 5 main :: IO () main = do let x = addStuff 10 15 y = addTen 100 z = fifteen putStrLn "=== Calculations ===" putStr "addStuff 10 15: " print x putStr "addTen 100 ...
Lyapunov/haskell-programming-from-first-principles
chapter_5/addstuff.hs
Haskell
mit
408
module Yesod.Auth.WeiXin.Utils where import ClassyPrelude import Yesod import Control.Monad.Except hiding (replicateM) import Data.List ((!!)) import Network.Wai (rawQueryString) import System.Random (randomIO) imp...
txkaduo/yesod-auth-wx
Yesod/Auth/WeiXin/Utils.hs
Haskell
mit
6,525
{------------------------------------------------------------------------------ uPuppet: Catalog rendering in JSON ------------------------------------------------------------------------------} module UPuppet.ShowJSON ( showJSON ) where import UPuppet.CState import UPuppet.Catalog import UPuppet.AST import Data...
dcspaul/uPuppet
Src/UPuppet/ShowJSON.hs
Haskell
mit
2,224
module Pattern1 where data Bool = False | True not True = False not False = True
Lemmih/haskell-tc
tests/Pattern1.hs
Haskell
mit
83
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Hpack.Render.Dsl ( -- * AST Element (..) , Value (..) -- * Render , RenderSettings (..) , CommaStyle (..) , defaultRenderSettings , Alignment (..) , Nesting , render -- * Utils , sortFieldsBy #ifdef TEST , Line...
haskell-tinc/hpack
src/Hpack/Render/Dsl.hs
Haskell
mit
4,314
module Storage.Distributed where
axman6/HaskellMR
src/Storage/Distributed.hs
Haskell
mit
34
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Tup...
MaxDaten/yage-geometry
src/Yage/Geometry.hs
Haskell
mit
7,237
-- | pontarius core module Main where
Philonous/pontarius-core
src/Main.hs
Haskell
mit
39
{-# LANGUAGE QuasiQuotes #-} module Main where import Text.Parsec import Control.Monad (when) import Data.Maybe (fromJust, listToMaybe, catMaybes) import System.Environment (getArgs) import System.Console.Docopt import System.IO (stderr, hPutStrLn) import System.IO.Unsafe (unsafePerformIO) {-import Data.Maybe (isJust...
balachia/CriticMarkup.hs
CriticMarkup.hs
Haskell
mit
5,862
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module CustomContentsDialog where import Data.Maybe (isJust, fromJust) import Data.List import Control.Applicative import Graphics.UI.Gtk import Control.Lens hiding (set) import Data.Either import SettingsWindowData import GtkViewModel import FrameRend...
emmanueltouzery/imprint
src/CustomContentsDialog.hs
Haskell
mit
6,301
import TwoPhase import Control.Applicative import System.Directory import System.Environment import System.Exit import System.FilePath import System.IO main :: IO () main = do args <- getArgs path <- case args of [] -> (</> ".tseven") <$> getHomeDirectory p : _ -> return p createDirectoryIfMiss...
Lysxia/twentyseven
exec-src/tstables.hs
Haskell
mit
755
-- -- Euler published the remarkable quadratic formula: -- -- n^2 + n + 41 -- -- It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. -- However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when -- n = 41, 41² + 41 + 41 is clearly divisib...
stu-smith/project-euler-haskell
Euler-027.hs
Haskell
mit
1,440
{-# LANGUAGE OverloadedStrings #-} module HepMC.Units ( Units, unitMomentum, unitLength , parserUnits ) where import Control.Lens import HepMC.Parse data UnitMomentum = MEV | GEV deriving (Eq, Ord, Show) data UnitLength = MM | CM deriving (Eq, Ord, Show) type Units = (UnitMomentum, UnitLen...
cspollard/HHepMC
src/HepMC/Units.hs
Haskell
apache-2.0
720
-- do can have explicit semi colons f x = do x x; x
metaborg/jsglr
org.spoofax.jsglr/tests-offside/terms/doaitse/layout10.hs
Haskell
apache-2.0
60
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Kubernetes.V1.SecurityContext where import GHC.Generics import Kubernetes.V1.Capabilities import Kubernetes.V1.SELinuxOptions import qualified ...
minhdoboi/deprecated-openshift-haskell-api
kubernetes/lib/Kubernetes/V1/SecurityContext.hs
Haskell
apache-2.0
2,187
module Kernel.KernelMonad where import Kernel.Term import Kernel.Env import Control.Applicative import Control.Monad.Reader import Control.Monad.Error data KernelError = TypeError String [(LocalEnv, Term)] | FatalError String instance Error KernelError where strMsg = FatalError {- instance Show K...
kik/ToyPr
src/Kernel/KernelMonad.hs
Haskell
apache-2.0
1,156
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QDragMoveEvent.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:20 Warning : this file is machine generated - d...
keera-studios/hsQt
Qtc/Gui/QDragMoveEvent.hs
Haskell
bsd-2-clause
8,638
{-| Converts a configuration state into a Ssconf map. As TemplateHaskell require that splices be defined in a separate module, we combine all the TemplateHaskell functionality that HTools needs in this module (except the one for unittests). -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution a...
leshchevds/ganeti
src/Ganeti/WConfd/Ssconf.hs
Haskell
bsd-2-clause
6,530
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, OverloadedStrings, TypeSynonymInstances #-} {-# LANGUAGE ImpredicativeTypes #-} {- Forth target code generator for MSP430. Code generation is done by instantiating the Primitive type class which results from a cross compilation. -} module Language.Forth.Ta...
hth313/hthforth
src/Language/Forth/Target/MSP430.hs
Haskell
bsd-2-clause
5,836
{-# LANGUAGE TypeOperators, DeriveDataTypeable, FlexibleInstances #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Paskell.Expr where import Data.Generics import Data.List import Control.Monad import Control.Monad.State.Lazy import Control.Monad.Error import Data.IORef data EvalS = ES { va...
glutamate/paskell
Paskell/Expr.hs
Haskell
bsd-3-clause
2,115
{-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE FlexibleContexts #-} module Network.Xmpp.Tls where import Control.Applicative ((<$>)) import qualified Control.Exception.Lifted as Ex import ...
Philonous/pontarius-xmpp
source/Network/Xmpp/Tls.hs
Haskell
bsd-3-clause
8,390
-- 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. module Duckling.D...
rfranek/duckling
Duckling/Dimensions/UK.hs
Haskell
bsd-3-clause
484
{-# LANGUAGE QuasiQuotes #-} import DBus.QuasiQuoter import DBus import Data.Int import qualified Data.Map as Map import Data.Maybe import Data.Word import Test.QuickCheck import Text.Printf main :: IO () main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests prop_simple x y = show (x + y) == [dbus| i i -> s |] f x...
pcapriotti/dbus-qq
tests/Tests.hs
Haskell
bsd-3-clause
2,113
{-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Fling where import Control.Arrow (second, (&&&)) import Data.List (sort, groupBy) import Data.Function (on) import Data.Tree (Tree(..), Forest, drawForest) -- Example puzzles example0 :: Game exa...
MedeaMelana/FlingSolver
Fling.hs
Haskell
bsd-3-clause
4,844
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-| Module : Numeric.AERN.Poly.IntPoly.Evaluation Description...
michalkonecny/aern
aern-poly/src/Numeric/AERN/Poly/IntPoly/Evaluation.hs
Haskell
bsd-3-clause
37,815
-- Author: Lee Ehudin -- Contains the entry point for the text editor module Controller.Runner (hasked) where import Controller.EventHandler (handleEvents) import Model.Buffer (newBuffer, newBufferFromFile, writeBufferToFile, getScreen, getCursorPos) import View.Curses (updateText, getScreenSize,...
percivalgambit/hasked
src/Controller/Runner.hs
Haskell
bsd-3-clause
903
module Control.Pipe.Zip ( controllable, controllable_, zip, zip_, ProducerControl(..), ZipControl(..), ) where import qualified Control.Exception as E import Control.Monad import Control.Pipe import Control.Pipe.Coroutine import Control.Pipe.Exception import Prelude hiding (zip) data ProducerControl r ...
pcapriotti/pipes-extra
Control/Pipe/Zip.hs
Haskell
bsd-3-clause
2,433
module Main where import PScheme.Repl import PScheme.Reader import PScheme.Eval (exceptT, defaultEnv, runEval, eval) import System.IO import System.Environment (getArgs) import System.Exit (exitFailure) import Control.Monad (forM_) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Except import Contro...
lkitching/PScheme
app/Main.hs
Haskell
bsd-3-clause
1,848
{-| Module : Control.Monad.Fork Description : Multithreading within monad transformer stacks Copyright : (c) Andrew Melnick 2016 License : BSD3 Maintainer : Andrew Melnick Stability : experimental Portability : portable Lifting the concept of forking a new thread into common monad transformers Monads in...
meln5674/monad-fork2
Control/Monad/Fork.hs
Haskell
bsd-3-clause
7,555
{-| Makes @Closure@ (see "AST") an instance of @Translatable@ (see "CodeGen.Typeclasses") -} module CodeGen.Closure ( translateClosure, varSubFromTypeVars, ) where import CodeGen.Type import CodeGen.Typeclasses import CodeGen.Expr () import CodeGen.Trace (traceVariable) import CodeGen.CCodeNames import CodeGen.Cla...
Paow/encore
src/back/CodeGen/Closure.hs
Haskell
bsd-3-clause
5,274
{-# LANGUAGE OverloadedStrings #-} module Websave.Web.Data ( getData ) where import Control.Monad (join) import Data.ByteString (ByteString) import Network.Wai (queryString) import Yesod.Core (MonadHandler, getRequest, reqWaiRequest) -- TODO move to YesodTools -- TODO process POST data as well getData :: MonadHan...
dimsmol/websave
src/Websave/Web/Data.hs
Haskell
bsd-3-clause
427
-------------------------------------------------------------------------- -- | -- Module: Harpy -- Copyright: (c) 2006-2015 Martin Grabmueller and Dirk Kleeblatt -- License: BSD3 -- -- Maintainer: martin@grabmueller.de -- Stability: provisional -- Portability: portable -- -- Harpy is a library for run-t...
mgrabmueller/harpy
Harpy.hs
Haskell
bsd-3-clause
799
module LinAlg where import ListNumSyntax import Data.Number.IReal import Data.Number.IReal.FoldB import Data.Ratio import Data.List import Data.Bits type Vector a = [a] type Matrix a = [Vector a] -- Ad hoc choice of precision restriction prec0 x = prec 200 x -- Multiplication --------------------------------------...
sydow/ireal
applications/LinAlg.hs
Haskell
bsd-3-clause
7,044
module Messages where import qualified Sound.OSC as SO import qualified System.MIDI as SM data DX200Msg = OSCMsg SO.Message | MidiMsg SM.MidiMessage deriving (Show)
rumblesan/dx200-programmer
src/Messages.hs
Haskell
bsd-3-clause
170