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 Streamer.HTTPClient where
import Streamer.Util (maybeRead)
import Network.URI (parseURI)
import Network.Stream (Result)
import Network.HTTP.Headers ( replaceHeader
, HeaderName(HdrIfNoneMatch, HdrETag... | adizere/nifty-tree | src/Streamer/HTTPClient.hs | Haskell | mit | 3,306 |
{-****************************************************************************
* Hamster Balls *
* Purpose: Rendering code for lasers *
* Author: David, Harley, Alex, Matt *
* ... | harley/hamball | src/Laser.hs | Haskell | mit | 1,589 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Hecate.Orphans () where
import Data.Text.Arbitrary ()
import Test.QuickCheck (Arbitrary (..))
import Hecate.Data (Description (..), Identity (..), Metadata (..), Plaintext (..))
instance Arbitrary Description where
arbitrary ... | henrytill/hecate | tests/Hecate/Orphans.hs | Haskell | apache-2.0 | 813 |
-- How many polynomials of degree k in Z_n[x] that are 0 under every evaluation map?
-- coefficientList generates polynomials of degree k.
coefficientList :: Int -> Int -> [[Int]]
coefficientList n k = recurse k $ map (:[]) [1..n-1] where
recurse 0 ls = ls
recurse c ls = recurse (c - 1) [a : as | a <- [0..n-1], as... | peterokagey/haskellOEIS | src/Sandbox/NonzeroZeroPolynomials.hs | Haskell | apache-2.0 | 2,579 |
{-# LANGUAGE PatternSynonyms #-}
{-
Copyright 2020 The CodeWorld Authors. All rights reserved.
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-... | google/codeworld | codeworld-api/src/CodeWorld.hs | Haskell | apache-2.0 | 2,225 |
{- Ray.hs
- Ray type
-
- Timothy A. Chagnon
- CS 636 - Spring 2009
-}
module Ray where
import Math
import Material
data Ray = Ray Vec3f Vec3f
deriving Show
-- t Normal Material
data Intersection = Inx RealT Vec3f Material
deriving (Show, Eq)
instance Ord Intersection where
... | tchagnon/cs636-raytracer | a5/Ray.hs | Haskell | apache-2.0 | 456 |
{-# LANGUAGE DeriveGeneric, DeriveFunctor, DeriveFoldable #-}
{- © Utrecht University (Department of Information and Computing Sciences) -}
module Domain.Scenarios.Globals where
import GHC.Generics
import Data.Binary
import qualified Data.Map as M
import Data.Maybe
import qualified Domain.Scenarios.DomainData as DD... | UURAGE/ScenarioReasoner | src/Domain/Scenarios/Globals.hs | Haskell | apache-2.0 | 3,785 |
module HelperSequences.A116416Spec (main, spec) where
import Test.Hspec
import HelperSequences.A116416 (a116416)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A116416" $
it "correctly computes the first 20 elements" $
take 20 (map a116416 [0..]) `shouldBe` expectedValue where
expectedValue... | peterokagey/haskellOEIS | test/HelperSequences/A116416Spec.hs | Haskell | apache-2.0 | 370 |
{-# LANGUAGE TypeFamilies, FlexibleInstances, FlexibleContexts,
DeriveDataTypeable, StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : HEP.Automation.MadGraph.Model.AxiGluon
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License ... | wavewave/madgraph-auto-model | src/HEP/Automation/MadGraph/Model/AxiGluon.hs | Haskell | bsd-2-clause | 3,581 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
-- |
--
-- OAuth2 plugin for http://spotify.com
--
module Yesod.Auth.OAuth2.Spotify
( oauth2Spotify
, module Yesod.Auth.OAuth2
) where
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative ((<$>), (<*>), pure)
#endif
import Control.Monad (mzero)
i... | jasonzoladz/yesod-auth-oauth2 | Yesod/Auth/OAuth2/Spotify.hs | Haskell | bsd-2-clause | 3,386 |
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE Rank2Types #-}
module Orbits.Units
( au
, solarMass
, simLength
, simTime
, simMass
, simVelocity
, simEnergy
, gravitationalConstant
, simGravitationalConstant
, day
, year
, inUnit
, fromUnit
) where
import Prelude ()... | bjoeris/orbits-haskell-tensorflow | src/Orbits/Units.hs | Haskell | bsd-3-clause | 2,214 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module IOStreams where
import Control.Exception
import Data.ByteString (ByteString)
import Data.Char (isSpace)
import qualified Data.Text as Text
import System.IO.Streams (InputStream, O... | fujimura/functional-stream-processing-meetup-sample | src/IOStreams.hs | Haskell | bsd-3-clause | 696 |
module PackageTests.BuildCompilerFlags.BuildTypeCustom.Suite ( test ) where
import PackageTests.BuildCompilerFlags.Util
import qualified PackageTests.PackageTester as PT
import System.FilePath ((</>))
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit... | plumlife/cabal | cabal-install/tests/PackageTests/BuildCompilerFlags/BuildTypeCustom/Suite.hs | Haskell | bsd-3-clause | 3,269 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
--
-- RegTypes.hs --- ADC register types
--
-- Copyright (C) 2015, Galois, Inc.
-- All Rights Reserved.
--
module Ivory.BSP.STM32.Peripheral.ADC.RegTypes where
import Ivory.Language
[ivor... | GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/Peripheral/ADC/RegTypes.hs | Haskell | bsd-3-clause | 444 |
module Fibon.Run.Config (
Fibon.ConfigMonad.append
, Fibon.ConfigMonad.setTimeout
, Fibon.ConfigMonad.done
, Fibon.ConfigMonad.collectExtraStatsFrom
, Fibon.ConfigMonad.noExtraStats
, Fibon.ConfigMonad.useGhcDir
, Fibon.ConfigMonad.useGhcInPlaceDir
, Fibon.ConfigMonad.getEnv
, Fibon.ConfigMonad.useR... | dmpots/fibon | tools/fibon-run/Fibon/Run/Config.hs | Haskell | bsd-3-clause | 2,420 |
{-# LANGUAGE Safe, TypeFamilies #-}
module Data.Logic.Pair (
Pair,
-- *Construction
pair, pair',
-- *Deconstruction
left, right,
-- *Utilities
swap
) where
import Control.Monad.Predicate
import Data.Logic.Atom
import Data.Logic.Term
import Data.Logic.Var
import Control.Applicative ((<$... | YellPika/tlogic | src/Data/Logic/Pair.hs | Haskell | bsd-3-clause | 1,601 |
{-# LANGUAGE GADTs, DisambiguateRecordFields #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
module CmmProcPoint
( ProcPointSet, Status(..)
, callProcPoints, minimalProcPointSet
, splitAtProcPoints, procPointAnalysis
, attachContInfoTables
)
where
import Prelude hiding (last, unzip, succ, ... | nomeata/ghc | compiler/cmm/CmmProcPoint.hs | Haskell | bsd-3-clause | 18,571 |
{-# LANGUAGE ExistentialQuantification #-}
-- |Defines the network API required for a Tor implementation to run.
module Tor.NetworkStack(
TorNetworkStack(..)
, SomeNetworkStack(..)
, toBackend
, recvAll
, recvLine
)
where
import qualified Data.ByteString as S
import qu... | GaloisInc/haskell-tor | src/Tor/NetworkStack.hs | Haskell | bsd-3-clause | 2,487 |
-- |Standardizes the language specification of submitted tests.
module CS173.NormalizeSubmissions
( standardizeLang
) where
-- |Removes leading whitespace and PLT Scheme comments from the string.
pltWs :: String -> String
pltWs [] = []
pltWs (';':rest) = pltWs $ pltWsLine rest
pltWs ('#':'|':rest) = pltWs $ pltWs... | jesboat/173tourney | server-src/CS173/NormalizeSubmissions.hs | Haskell | bsd-3-clause | 1,224 |
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-|
Module : Numeric.AERN.IVP.Examples.Hybrid.Simple
Description : simple examples of hybrid system IVPs
Copyright : (c) Michal Konecny
License... | michalkonecny/aern | aern-ivp/src/Numeric/AERN/IVP/Examples/Hybrid/Simple.hs | Haskell | bsd-3-clause | 130,512 |
import Language.KansasLava.Trace
import Language.KansasLava.VCD
import Control.Applicative
import System.Environment
vcdDiff :: Trace -> Trace -> String
vcdDiff (Trace c1 i1 o1 p1) (Trace _ i2 o2 p2) = toVCD t
where t = Trace c1 (mergeMaps i1 i2) (mergeMaps o1 o2) (mergeMaps p1 p2)
mergeMaps m1 m2 = [ (... | andygill/kansas-lava | tests/Diff.hs | Haskell | bsd-3-clause | 1,140 |
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Hasmin.Types.BgSize
-- Copyright : (c) 2017 Cristian Adrián Ontivero
-- License : BSD3
-- Stability : experimental
-- Portability : non-portable
--
-----------------------------... | contivero/hasmin | src/Hasmin/Types/BgSize.hs | Haskell | bsd-3-clause | 2,662 |
module Prototype where
| plow-technologies/template-service | src/Prototype.hs | Haskell | bsd-3-clause | 24 |
-- |
module VK.App.AppSettings where
import VK.API
appId :: Integer
appId = 5082615
appScope :: [AuthPermissions]
appScope = [Audio, Status]
| eryx67/vk-api-example | src/VK/App/AppSettings.hs | Haskell | bsd-3-clause | 155 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DataKinds, KindSignatures,GADTs,
TypeOperators,
FlexibleInstances,
ScopedTypeVariables #-}
module Data.Union (
Union (..),
inject, project, wrap, unwrap,
push, pop,
swap, rotate,
conceal
) where
... | seagull-kamome/haskell-toybox | Data/Union.hs | Haskell | bsd-3-clause | 1,798 |
{-# OPTIONS_GHC -Wall #-}
module Main where
import Graphics.Rendering.Chart hiding (c)
import Graphics.Rendering.Chart.Gtk
import Data.Accessor
import Text.Printf
import Design.Config
import Design.WorkingConfig
import Aero.Drag.WettedArea
import Aero.Drag.Upsweep
import Aero.Drag.FormAndFrictional
main :: IO ()
ma... | ghorn/conceptual-design | ParasiticSummary.hs | Haskell | bsd-3-clause | 3,282 |
-- 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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Quantity.MN.Corpus
( corpus
) where
import Data.String
i... | facebookincubator/duckling | Duckling/Quantity/MN/Corpus.hs | Haskell | bsd-3-clause | 1,472 |
import Control.Applicative
data List a = Empty | Cons a (List a)
instance Functor List where
-- fmap :: (a -> b) -> [a] -> [b]
fmap f Empty = Empty
fmap f (Cons a b) = Cons (f a) (fmap f b)
instance Applicative List where
--pure :: a -> [a]
pure a = Cons a Empty
-- (<*>) :: [a -> b] -> [a] -> [b]
_ <*> Empt... | gahara/parsers-for-dummies | test2.hs | Haskell | bsd-3-clause | 725 |
{-|
Module: FRP.Timeless.Framework.UI.Scene
Copyright: (c) 2015 Rongcui Dong
License: BSD3
Maintainer: Rongcui Dong <karl_1702@188.com>
-}
module FRP.Timeless.Framework.UI.Scene
where
import FRP.Timeless
import FRP.Timeless.Framework.UI.Events
newtype Scene = Scene {
sceneBox :: forall m s. Monad ... | carldong/timeless-SDL | src/FRP/Timeless/Framework/UI/Scene.hs | Haskell | bsd-3-clause | 351 |
module Main where
import Ivory.Tower.Config
import Ivory.OS.FreeRTOS.Tower.STM32
import LDrive.Platforms
import LDrive.Tests.ADCMulti (app)
main :: IO ()
main = compileTowerSTM32FreeRTOS testplatform_stm32 p $
app (stm32config_clock . testplatform_stm32)
testplatform_adcs
testplatfor... | sorki/odrive | test/ADCMultiTest.hs | Haskell | bsd-3-clause | 441 |
{-# LANGUAGE ScopedTypeVariables #-}
module Network.HaskellNet.SMTP
( -- * Types
Command(..)
, Response(..)
, SMTPConnection
-- * Establishing Connection
, connectSMTPPort
, connectSMTP
, connectStream
-- * Operation to a Connection
, sendCommand
, closeSMTP
-- * ... | danchoi/imapget | src/Network/HaskellNet/SMTP.hs | Haskell | bsd-3-clause | 9,059 |
{-# LANGUAGE ExplicitForAll #-}
-- | This game mode lets you manage your own input. Pressing ESC will not abort the program.
-- You also don't get automatic pan and zoom controls like with `displayInWindow`.
module Graphics.Gloss.Interface.IO.Game
( module Graphics.Gloss.Data.Display
, module Graphic... | gscalzo/HaskellTheHardWay | gloss-try/gloss-master/gloss/Graphics/Gloss/Interface/IO/Game.hs | Haskell | mit | 1,743 |
<?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="tr-TR">
<title>Aktif Tarama Kuralları - Blpha | ZAP Uzantısı</title>
<maps>
<homeID>top</ho... | veggiespam/zap-extensions | addOns/simpleexample/src/main/javahelp/org/zaproxy/zap/extension/simpleexample/resources/help_tr_TR/helpset_tr_TR.hs | Haskell | apache-2.0 | 1,001 |
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE CPP #-}
#include "fusion-phases.h"
-- | PR instance for tuples.
module Data.Array.Parallel.PArray.PData.Tuple4
( PData(..), PDatas(..)
, zip4PD)
where
import Data.Array.Parallel.Pretty
import Data.Array.Parallel.PArray.PData.Base
import Data.Array.Parallel.P... | mainland/dph | dph-lifted-vseg/Data/Array/Parallel/PArray/PData/Tuple4.hs | Haskell | bsd-3-clause | 9,606 |
-------------------------------------------------------------------------
--
-- Haskell: The Craft of Functional Programming, 3e
-- Simon Thompson
-- (c) Addison-Wesley, 1996-2011.
--
-- Case study: Parsing expressions
--
-- Note that this is not a monadic approach to parsing.
--
--------------------... | c089/haskell-craft3e | ParsingBasics.hs | Haskell | mit | 4,456 |
-------------------------------------------------------------------------------
-- |
-- Module : System.Hardware.Haskino.ShallowDeepPlugin.RepPushPass
-- Copyright : (c) University of Kansas
-- License : BSD3
-- Stability : experimental
--
-- Rep Push Pass
-- This pass is used to transform shallow expr... | ku-fpg/kansas-amber | System/Hardware/Haskino/ShallowDeepPlugin/RepPushPass.hs | Haskell | bsd-3-clause | 13,617 |
{-# LANGUAGE CPP #-}
module RnSplice (
rnTopSpliceDecls,
rnSpliceType, rnSpliceExpr, rnSplicePat, rnSpliceDecl,
rnBracket,
checkThLocalName
#ifdef GHCI
, traceSplice, SpliceInfo(..)
#endif
) where
#include "HsVersions.h"
import Name
import NameSet
import HsSyn
import RdrName... | tjakway/ghcjvm | compiler/rename/RnSplice.hs | Haskell | bsd-3-clause | 32,074 |
module Main (main) where
import qualified Distribution.ModuleName as ModuleName
import Distribution.PackageDescription
import Distribution.PackageDescription.Check hiding (doesFileExist)
import Distribution.PackageDescription.Configuration
import Distribution.PackageDescription.Parse
import Distribution.System
import... | ekmett/ghc | utils/ghc-cabal/Main.hs | Haskell | bsd-3-clause | 23,298 |
-- |
-- Module : $Header$
-- Copyright : (c) 2013-2015 Galois, Inc.
-- License : BSD3
-- Maintainer : cryptol@galois.com
-- Stability : provisional
-- Portability : portable
{-# LANGUAGE Safe #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances, Flexi... | iblumenfeld/cryptol | src/Cryptol/TypeCheck/TypeMap.hs | Haskell | bsd-3-clause | 5,626 |
<?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="fa-IR">
<title>Custom Payloads Add-on</title>
<maps>
<homeID>custompayloads</homeID>
<m... | thc202/zap-extensions | addOns/custompayloads/src/main/javahelp/org/zaproxy/zap/extension/custompayloads/resources/help_fa_IR/helpset_fa_IR.hs | Haskell | apache-2.0 | 978 |
{-# LANGUAGE CPP #-}
module CmmType
( CmmType -- Abstract
, b8, b16, b32, b64, b128, b256, b512, f32, f64, bWord, bHalfWord, gcWord
, cInt, cLong
, cmmBits, cmmFloat
, typeWidth, cmmEqType, cmmEqType_ignoring_ptrhood
, isFloatType, isGcPtrType, isWord32, isWord64, isFloat64, isFloat32
, ... | oldmanmike/ghc | compiler/cmm/CmmType.hs | Haskell | bsd-3-clause | 15,086 |
module RecordIn4 where
data S = S1 { x :: Int } | S2 { x :: Int } deriving Show
{- map2 xs = map (\y -> y {x = 1}) xs -}
map2 xs = (case ((\ y -> y {x = 1}), xs) of
(f, []) -> []
(f, (x : xs)) -> (f x) : (map f xs))
| SAdams601/HaRe | old/testing/generativeFold/RecordIn4.hs | Haskell | bsd-3-clause | 251 |
module Renaming.C1 where
import Renaming.D1
instance SameOrNot Double where
isSame a b = a ==b
isNotSame a b = a /=b
myFringe:: Tree a -> [a]
myFringe (Leaf x ) = [x]
myFringe (Branch left right) = myFringe left
| mpickering/HaRe | test/testdata/Renaming/C1.hs | Haskell | bsd-3-clause | 229 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
-- Test the LANGUAGE pragma
module ShouldCompile where
#if 1
foreign import ccall "foo" foo :: Int -> IO Int
#endif
| wxwxwwxxx/ghc | testsuite/tests/parser/should_compile/read039.hs | Haskell | bsd-3-clause | 164 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
-- !!! One method class from Sergey Mechveliani
-- showed up problematic newtype dict rep.
module Main where
import Data.Ratio
class MBConvertible a b where cm :: a -> b -> Maybe b
c :: MBConvertible a b => a -> b -> b
c a b =... | urbanslug/ghc | testsuite/tests/typecheck/should_run/tcrun003.hs | Haskell | bsd-3-clause | 902 |
{-|
Module: Flaw.UI.DefaultStyle.Data
Description: Embedded data for default style.
License: MIT
-}
{-# LANGUAGE TemplateHaskell #-}
module Flaw.UI.DefaultStyle.Data
( loadFontData
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Flaw.Build
loadFontData :: IO B.B... | quyse/flaw | flaw-ui-default-style-data/Flaw/UI/DefaultStyle/Data.hs | Haskell | mit | 409 |
{-# htermination (fromIntegral :: MyInt -> Float) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Float = Float MyInt MyInt ;
data Integer = Integer MyInt ;
data MyInt = Pos Nat | Neg Nat ;
data Nat = Succ Nat | Zero ;
primIntToFloat :: MyInt -> Float;
... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/fromIntegral_2.hs | Haskell | mit | 729 |
{-# LANGUAGE TemplateHaskell
, TypeFamilies
, OverloadedStrings #-}
module FirewallModel (
Rule(..)
, View(..)
) where
import Generics.BiGUL.TH
import GHC.Generics
import Data.Aeson
data View = View {
rules :: [Rule]
} deriving (Show, Eq)
data Rule = Rule {
ruleID :: String
, securityGroupRefFrom :: S... | prl-tokyo/MAPE-knowledge-base | Haskell/views/FirewallModel.hs | Haskell | mit | 1,572 |
-- Caffeine Script
-- http://www.codewars.com/kata/5434283682b0fdb0420000e6
module Codewars.Kata.Caffeine where
caffeineBuzz :: Integer -> String
caffeineBuzz n | n `mod` 12 == 0 = "CoffeeScript"
| n `mod` 6 == 0 = "JavaScript"
| n `mod` 3 == 0 = "Java"
| otherwise = "mo... | gafiatulin/codewars | src/7 kyu/Caffeine.hs | Haskell | mit | 334 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ViewPatterns #-}
module Snipcheck where
import Control.Monad
import Control.Exception
import Control.Monad.IO.Class
import Data.Char (isSpace)
import Data.List (dropWhileEnd)
import Data.Maybe
import System.Process(readCreateProcess, shell)
import Text.Pandoc (Block(..))
im... | nmattia/snipcheck | src/Snipcheck.hs | Haskell | mit | 4,018 |
import Avus.Scan
import Criterion.Types
import Criterion.Main
noopProcessData :: FilePath -> IO ()
noopProcessData fp = processData (Just fp) (Just "null") $
processVuln (\_ b -> return b) -- noop update functions
(\_ t -> return t)
(\_ e -> return e)
main :: IO ()
main = defaultMainWit... | srenatus/avus | benchmark/AvusBenchmark.hs | Haskell | mit | 576 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Control.Applicative ((<|>))
import Text.Trifecta
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BC
import Data.FileEmbed (embedFile)
input :: ByteString
input = $(embedFile "input.txt")
data I... | genos/online_problems | advent_of_code_2016/day9/src/Main.hs | Haskell | mit | 2,172 |
{-# LANGUAGE LambdaCase, NamedFieldPuns, OverloadedStrings #-}
module Main (main) where
import Devil.Config
import Devil.Daemons
import Options.Applicative
import qualified Data.Text as T
import qualified Devil.Log as Log
data Params = Params {
configFile :: String
} deriving (Show,... | EXio4/devil | src/Main.hs | Haskell | mit | 961 |
{-# LANGUAGE QuasiQuotes #-}
module Minesweeper where
import Prelude hiding (map, zipWith)
import Data.Maybe (fromJust)
import qualified Data.Vector as V
import Data.Array.Repa as R hiding ((++))
import Data.Array.Repa.Repr.Vector
import Data.Array.Repa.Stencil
import ... | sdemos/minesweeper | src/Minesweeper.hs | Haskell | mit | 5,242 |
sumtorial :: Integer -> Integer
sumtorial 0 = 0
sumtorial n = n + sumtorial (n - 1)
| martindavid/code-sandbox | haskell/exercises/exercise1.hs | Haskell | mit | 84 |
module Main where
import Test.Framework (defaultMain)
import Language.Swift.Tests (tests)
main :: IO ()
main = defaultMain
[ tests
]
| CodaFi/language-swift | tests/Tests.hs | Haskell | mit | 144 |
module Reader where
import Control.Applicative ((<$>), (<*>))
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Language
import Text.ParserCombinators.Parsec.Token
import LispData
import Numbers
-- | parses lisp code from a string and returns either the code an error message
reader :: String... | orion-42/my-lisp | Reader.hs | Haskell | mit | 2,630 |
{-# LANGUAGE DeriveDataTypeable #-}
module Base.CLI (ProgramOptions(..), Action(..), usage, newCommands, standard, module System.Console.CmdArgs) where
import System.Console.CmdArgs
import Base.Common
data Action = Format | ListCommands
deriving (Show, Typeable, Data)
instance Default Action where
def = Forma... | spockz/lhs2texhl | src/Base/CLI.hs | Haskell | mit | 1,973 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.SVGFESpotLightElement (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.SVGFESpotLightElement
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/SVGFESpotLightElement.hs | Haskell | mit | 376 |
module GraphDB.Util.Prelude.TH
(
module Exports,
purify,
tryToReify,
isInstance',
isProperInstance',
)
where
import GraphDB.Util.Prelude hiding (Fixity)
import Language.Haskell.TH as Exports
import Language.Haskell.TH.Syntax as Exports
import THInstanceReification as Exports
purify :: Q a -> a
purify = un... | nikita-volkov/graph-db | library/GraphDB/Util/Prelude/TH.hs | Haskell | mit | 686 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Server.Main where
import System.Directory
import qualified Text.Blaze.Html.Renderer.Text as H
import Text.Pandoc
import System.FilePath
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.... | lierdakil/markco | server/src/Server/Main.hs | Haskell | mit | 7,255 |
{-# LANGUAGE OverloadedStrings #-}
module HailsRock.Views where
import Prelude hiding (div, span, head, id)
import Data.Maybe (isJust, fromJust)
import qualified Data.ByteString.Lazy.Char8 as L8
import qualified Data.Text as T
import Text.Blaze.Html5 hiding (Tag, map)
import Text.Blaze.Html5.Attributes hiding ( la... | scslab/hails | examples/hails-rock/HailsRock/Views.hs | Haskell | mit | 4,365 |
findKey :: (Eq k) => k -> [(k, v)] -> Maybe v
findKey _ [] = Nothing
findKey key ((k, v):xs)
| key == k = Just v
| otherwise = findKey key xs
findKey' :: (Eq k) => k -> [(k, v)] -> Maybe v
findKey' _ [] = Nothing
findKey' key ((k, v):xs) = case key == k of
True -> Just v
... | EricYT/Haskell | src/chapter-3-2.hs | Haskell | apache-2.0 | 366 |
module FractalFlame.Variation.Types.VTransform where
import FractalFlame.Point.Types.CartesianPoint
import FractalFlame.Variation.Types.VarP
-- | Variation function (use FractalFlame.Variation.runVariation to build a VarP parameter)
type VTransform = VarP -> CartesianPoint
| anthezium/fractal_flame_renderer_haskell | FractalFlame/Variation/Types/VTransform.hs | Haskell | bsd-2-clause | 277 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
module Data.Interface.Module.Entity where
import Data.Interface.Change
import Data.Interface.Name
import Data.Interface.Type
import Data.Interface.Type.Diff
-- | A top-level exported entity in a module, without a name.
d... | cdxr/haskell-interface | src/Data/Interface/Module/Entity.hs | Haskell | bsd-3-clause | 4,273 |
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-|
The 'Message' is a single displayed event in a Channel. All Messages
have a date/time, and messages that represent ... | matterhorn-chat/matterhorn | src/Matterhorn/Types/Messages.hs | Haskell | bsd-3-clause | 28,203 |
module Seventeen where
import Data.List
permute :: Int -> [Int] -> [Int] -> [[Int]]
permute goal tried []
| goal == sum tried = [tried]
| otherwise = []
permute goal tried remaining
| goal == sum tried = [tried]
| otherwise = concatMap (permute2 goal tried) (sublists remaining)
permute2 :: Int -> [... | purcell/adventofcodeteam | app/Seventeen.hs | Haskell | bsd-3-clause | 705 |
{-# language CPP #-}
-- | = Name
--
-- VK_AMD_shader_core_properties2 - device extension
--
-- == VK_AMD_shader_core_properties2
--
-- [__Name String__]
-- @VK_AMD_shader_core_properties2@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 228
--
-- [__Revision__]
-- ... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_AMD_shader_core_properties2.hs | Haskell | bsd-3-clause | 9,673 |
module Text.Highlighter.Lexer (runLexer) where
import Control.Monad.Except (ExceptT, runExceptT, throwError, catchError)
import Control.Monad.State (State, gets, modify, evalState)
import Text.Regex.PCRE.Light hiding (compile)
import Text.Regex.PCRE.Light.Char8 (compile)
import qualified Data.ByteString as BS
import D... | chemist/highlighter | src/Text/Highlighter/Lexer.hs | Haskell | bsd-3-clause | 4,808 |
module Problem15 where
--
-- Problem 15: Lattice paths
--
-- Starting in the top left corner of a 2×2 grid, and only being able to move to
-- the right and down, there are exactly 6 routes to the bottom right corner.
--
-- https://projecteuler.net/project/images/p015.gif
--
-- Paths: (R=Right, D=Down)
--
-- R R D D
--... | c0deaddict/project-euler | src/Part1/Problem15.hs | Haskell | bsd-3-clause | 469 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- |
-- Module : Simulation.Aivika.Experiment.Base.InfoView
-- Copyright : Copyright (c) 2012-2017, David Sorokin <david.sorokin@gmail.com>
-- License : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability : experimental
-- Tested with: GHC 8.0.1
--... | dsorokin/aivika-experiment | Simulation/Aivika/Experiment/Base/InfoView.hs | Haskell | bsd-3-clause | 6,535 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Jade.TopLevel ( getNetsWithName
, connectWiresWithSameSigName
, dependencyOrder
, explodeConnect
, getAllIndexesWithName
, getAllSigNames
... | drhodes/jade2hdl | src/Jade/TopLevel.hs | Haskell | bsd-3-clause | 15,284 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
------------------------------------------------------------------------------
import Control.Monad.Trans
import Data.ByteString (ByteString... | Soostone/snaplet-persistent | example/Site.hs | Haskell | bsd-3-clause | 2,261 |
{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Lex
-- Copyright : Ben Gamari 2015-2019
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This module contains a simple lexer supporting quoted ... | sopvop/cabal | Cabal/Distribution/Lex.hs | Haskell | bsd-3-clause | 1,409 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
data StackItem a where
Snum :: forall a. Fractional a => a -> StackItem a
Sop :: OpDesc -> StackItem a
deriving instance Show a => Show (StackItem a)
-- AZ added to test Trac #10399
data MaybeDefault v whe... | mpickering/ghc-exactprint | tests/examples/ghc710/GADTContext.hs | Haskell | bsd-3-clause | 481 |
module Matterhorn.Events.ShowHelp where
import Prelude ()
import Matterhorn.Prelude
import Brick
import qualified Graphics.Vty as Vty
import Matterhorn.Constants
import Matterhorn.Events.Keybindings
import Matterhorn.Types
onEventShowHelp :: Vty.Event -> ... | matterhorn-chat/matterhorn | src/Matterhorn/Events/ShowHelp.hs | Haskell | bsd-3-clause | 1,447 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.SrcDist
-- Copyright : Simon Marlow 2004
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This handles the @sdist@ command. The module exports a... | sopvop/cabal | Cabal/Distribution/Simple/SrcDist.hs | Haskell | bsd-3-clause | 19,745 |
{-# LANGUAGE Rank2Types #-}
module Examples
( tests
) where
import Control.Applicative ((<$>))
import Control.Monad (forM)
import Data.Bits (shiftL)
import Data.List (isPrefixOf, sort)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (Assertion, assert... | jaspervdj/dcpu16-hs | tests/Examples.hs | Haskell | bsd-3-clause | 2,482 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GADTs #-}
module Oracle.DiffOracle where
import Data.Maybe
import Data.Tuple (swap)
import Debug.Trace
import Control.Monad.Reader
import qualified Data.IntMap as M
import qualified Data.Set as S
impor... | nazrhom/vcs-clojure | src/Oracle/DiffOracle.hs | Haskell | bsd-3-clause | 8,201 |
{-# LANGUAGE
DeriveFunctor
, FlexibleInstances
, ScopedTypeVariables
#-}
module Data.Trie.Pseudo where
import Prelude hiding (foldl, foldr, foldr1, lookup,
map)
import Data.Foldable hiding (all)
import Da... | athanclark/pseudo-trie | src/Data/Trie/Pseudo.hs | Haskell | bsd-3-clause | 8,552 |
-- | Test utility functions
module Test.Util(utilsTests) where
import Test.Tasty
import Test.Tasty.HUnit
import Language.Haskell.Ghcid.Util
utilsTests :: TestTree
utilsTests = testGroup "Utility tests"
[dropPrefixTests
,chunksOfWordTests
]
dropPrefixTests :: TestTree
dropPrefixTests = testGroup "dropPre... | JPMoresmau/ghcid | src/Test/Util.hs | Haskell | bsd-3-clause | 904 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module TauSigma.ADEV
( Statistic(..)
, Options
, options
, main
) where
import Control.Monad.Primitive (PrimMonad)
import Control.Monad.Trans
imp... | sacundim/tau-sigma | src/TauSigma/ADEV.hs | Haskell | bsd-3-clause | 3,151 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
module Network.Wai.Handler.Warp.Run where
#if __GLASGOW_HA... | erikd/wai | warp/Network/Wai/Handler/Warp/Run.hs | Haskell | mit | 20,199 |
-- Copyright (c) 1998-1999 Chris Okasaki.
-- See COPYRIGHT file for terms and conditions.
module RandList
{-# DEPRECATED "This module is unmaintained, and will disappear soon" #-}
(
-- type
Seq, -- instance of Sequence, Functor, Monad, MonadPlus
-- sequence operations
empty,single,cons,snoc,app... | FranklinChen/hugs98-plus-Sep2006 | fptools/hslibs/data/edison/Seq/RandList.hs | Haskell | bsd-3-clause | 12,098 |
{-#LANGUAGE NoImplicitPrelude #-}
{-#LANGUAGE LambdaCase #-}
{-#LANGUAGE ScopedTypeVariables #-}
{-#LANGUAGE OverloadedStrings #-}
module Web.Sprinkles.Cache.Memcached
where
import Web.Sprinkles.Prelude
import Web.Sprinkles.Cache
import Data.Time.Clock.POSIX
import qualified Data.HashMap.Strict as HashMap
import Data.... | tdammers/templar | src/Web/Sprinkles/Cache/Memcached.hs | Haskell | bsd-3-clause | 1,249 |
{-
(c) The AQUA Project, Glasgow University, 1993-1998
\section[Simplify]{The main module of the simplifier}
-}
{-# LANGUAGE CPP #-}
module Simplify ( simplTopBinds, simplExpr, simplRules ) where
#include "HsVersions.h"
import DynFlags
import SimplMonad
import Type hiding ( substTy, substTyVar, extendTvSubst,... | tjakway/ghcjvm | compiler/simplCore/Simplify.hs | Haskell | bsd-3-clause | 124,411 |
{-# LANGUAGE OverloadedStrings #-}
module Distribution.Parsec.ConfVar (parseConditionConfVar) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Compat.Parsec (integral)
import Distribution.Parsec.Class (Parsec (..... | mydaum/cabal | Cabal/Distribution/Parsec/ConfVar.hs | Haskell | bsd-3-clause | 5,766 |
module One where
import qualified Two
resource = "This is the sub-plugin of (" ++ Two.resource ++ ")"
| abuiles/turbinado-blog | tmp/dependencies/hs-plugins-1.3.1/testsuite/hier/hier3/One.hs | Haskell | bsd-3-clause | 106 |
{-# LANGUAGE PolyKinds #-}
module T16456 where
data T p = MkT
foo :: T Int
foo = _
| sdiehl/ghc | testsuite/tests/typecheck/should_fail/T16456.hs | Haskell | bsd-3-clause | 85 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[NameEnv]{@NameEnv@: name environments}
-}
{-# LANGUAGE CPP #-}
module NameEnv (
-- * Var, Id and TyVar environments (maps)
NameEnv,
-- ** Manipulating these environments
mkNameEnv,... | tjakway/ghcjvm | compiler/basicTypes/NameEnv.hs | Haskell | bsd-3-clause | 4,708 |
<?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="zh-CN">
<title>Groovy Support</title>
<maps>
<homeID>top</homeID>
<mapref location="map... | thc202/zap-extensions | addOns/groovy/src/main/javahelp/org/zaproxy/zap/extension/groovy/resources/help_zh_CN/helpset_zh_CN.hs | Haskell | apache-2.0 | 959 |
module MultiParamIn3 where
fromMaybe :: (Maybe a) -> a
fromMaybe (Just x) = x
fromMaybe Nothing = error "fromMaybe: Nothing"
f :: (Maybe Int) -> [Int] -> (Either Int b) -> Int
f Nothing y@[] (Left a) = (hd y) + a
f Nothing y@(b_1 : b_2) (Left a) = (hd y) + a
f (Just x) y@[] (Right b) = (hd y) + (fromMaybe x)
f (J... | kmate/HaRe | old/testing/introPattern/MultiParamIn3AST.hs | Haskell | bsd-3-clause | 495 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude, ExistentialQuantification #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Exception
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base... | olsner/ghc | libraries/base/Control/Exception.hs | Haskell | bsd-3-clause | 14,104 |
{-# LANGUAGE CPP #-}
module Examples.Commands where
import Data.List
import Options.Applicative
#if __GLASGOW_HASKELL__ <= 702
import Data.Monoid
(<>) :: Monoid a => a -> a -> a
(<>) = mappend
#endif
data Sample
= Hello [String]
| Goodbye
deriving Show
hello :: Parser Sample
hello = Hello <$> many (argument s... | begriffs/optparse-applicative | tests/Examples/Commands.hs | Haskell | bsd-3-clause | 833 |
module ShouldCompile where
-- I bet this test is a mistake! From the layout it
-- looks as if 'test' takes three args, the latter two
-- of higher rank. But the parens around these args are
-- missing, so it parses as
-- test :: [a]
-- -> forall a. Ord a
-- => [b]
-- -> forall c. Nu... | spacekitteh/smcghc | testsuite/tests/haddock/should_compile_noflag_haddock/haddockC027.hs | Haskell | bsd-3-clause | 599 |
{-# OPTIONS_GHC -fwarn-incomplete-patterns -fwarn-overlapping-patterns #-}
{-# LANGUAGE GADTs #-}
module T2006 where
data Expr a vs where
EPrim :: String -> a -> Expr a vs
EVar :: Expr a (a,vs)
interpret :: Expr a () -> a
interpret (EPrim _ a) = a
-- interpret EVar = error "unreachable"
| olsner/ghc | testsuite/tests/pmcheck/should_compile/T2006.hs | Haskell | bsd-3-clause | 305 |
module ShouldCompile where
x@_ = x
| ryantm/ghc | testsuite/tests/deSugar/should_compile/ds-wildcard.hs | Haskell | bsd-3-clause | 36 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, MagicHash, UnboxedTuples, NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Float.RealFracMethods
-- Copyright : (c) Daniel Fischer 2010
-- License : see libr... | tolysz/prepare-ghcjs | spec-lts8/base/GHC/Float/RealFracMethods.hs | Haskell | bsd-3-clause | 11,762 |
-- | Geometric functions concerning angles. If not otherwise specified, all angles are in radians.
module Graphics.Gloss.Geometry.Angle
( degToRad
, radToDeg
, normaliseAngle )
where
-- | Convert degrees to radians
{-# INLINE degToRad #-}
degToRad :: Float -> Float
degToRad d = d * pi / 180
-- | Convert radians t... | gscalzo/HaskellTheHardWay | gloss-try/gloss-master/gloss/Graphics/Gloss/Geometry/Angle.hs | Haskell | mit | 665 |
module Y2018.M02.D21.Solution where
{--
More P99 fun with lists from:
http://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/
P28 (**) Sorting a list of lists according to length of sublists
a) We suppose that a list (InList) contains elements that are lists themselves.
The objective is to sort th... | geophf/1HaskellADay | exercises/HAD/Y2018/M02/D21/Solution.hs | Haskell | mit | 3,700 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.