code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Openshift.V1.TLSConfig where
import GHC.Generics
import Data.Text
import qualified Data.Aeson
-- |
data TLSConfig = TLSConfig
{ terminati... | minhdoboi/deprecated-openshift-haskell-api | openshift/lib/Openshift/V1/TLSConfig.hs | apache-2.0 | 1,141 | 0 | 9 | 198 | 130 | 79 | 51 | 19 | 0 |
-- Copyright (c) 2010 - Seweryn Dynerowicz
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agree... | sdynerow/SemiringsLibrary | Policy/AllPolicies.hs | apache-2.0 | 830 | 0 | 4 | 121 | 59 | 40 | 19 | 10 | 0 |
module MultilineTh (multiline) where
import qualified Data.Text as T
import Language.Haskell.TH
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Syntax
import Prelude
multiline :: QuasiQuoter
multiline = QuasiQuoter
{ quoteExp = quoteUnlines
... | quchen/prettyprinter | prettyprinter/app/MultilineTh.hs | bsd-2-clause | 652 | 0 | 11 | 194 | 152 | 88 | 64 | 21 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE Rank2Types #-}
#if __GLASGOW_HASKELL__ >= 800
-- a) THQ works on cross-compilers and unregisterised GHCs
-- b) may make compilation faster as no dynamic loading is ever needed... | sol/aeson | Data/Aeson/Types/Internal.hs | bsd-3-clause | 21,962 | 0 | 14 | 6,009 | 4,560 | 2,546 | 2,014 | 416 | 6 |
import Control.Exception
import Control.Monad
import qualified Data.ByteString.Lazy as BS
import Text.XML.HaXml.ByteStringPP
import Text.XML.HaXml.Parse (xmlParse')
import XmlLibrary
main = mainBenchmark haXmlLibrary
haXmlLibrary = XmlLibrary parse render where
parse fp = readFile fp >>= either fail return . xml... | pepeiborra/xml-bench | src/Haxml.hs | bsd-3-clause | 371 | 0 | 9 | 54 | 106 | 58 | 48 | 10 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Transform.Extract.Common (
BlockKind,
ExtractFunc,
Extractor,
ExtractOptions(..),
runExtractor,
Entry,
entryPath,
scopedEntry,
tellEntry,
getOptions
) where
import Control.Monad.State.Lazy (StateT, evalStateT, gets, modify)
im... | thomaseding/cgs | src/Transform/Extract/Common.hs | bsd-3-clause | 2,235 | 0 | 16 | 490 | 668 | 365 | 303 | 62 | 1 |
module KifuDB.Model.Type
( Player(..)
, Koma(..)
, Masu(..)
, Pos(..)
, Result(..)
, Ban(..)
, Fugou(..)
, showKoma
, getAt
, initBan
, emptyBan
, nextBan
, drawBan
) where
import KifuDB.Model.Type.Internal
| suzuki-shin/kifuDB | src/KifuDB/Model/Type.hs | bsd-3-clause | 266 | 0 | 5 | 91 | 83 | 58 | 25 | 15 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE Trustworthy #-}
#include "lens-common.h"
-----------------------------------------------------------------------------
-- |
-- Module : Data.Set.Lens
-- Copyright : (C) 2012-16 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Ma... | ddssff/lens | src/Data/Set/Lens.hs | bsd-3-clause | 2,050 | 0 | 8 | 386 | 185 | 122 | 63 | 16 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types... | ryantrinkle/reflex-dom | reflex-dom-core/src/Reflex/Dom/Prerender.hs | bsd-3-clause | 13,606 | 1 | 28 | 2,791 | 4,301 | 2,180 | 2,121 | -1 | -1 |
module Websave.Web.AppData
( App (..)
) where
import Data.Pool (Pool)
import Database.PostgreSQL.Simple (Connection)
import Yesod.Static (Static)
data App = App
{ getConnectionPool :: Pool Connection
, getStatic :: Static
}
| dimsmol/websave | src/Websave/Web/AppData.hs | bsd-3-clause | 244 | 0 | 9 | 50 | 71 | 44 | 27 | 8 | 0 |
module Init where
import Configuration
import TodoArguments
import System.Directory
import System.FilePath
import Database.HDBC
import Database.HDBC.Sqlite3
createDatabase :: TodoCommand -> Config -> IO ()
createDatabase initCommand config =
case databaseFile initCommand of
Nothing -> if userLevel initComma... | robertmassaioli/hdo | src/Init.hs | bsd-3-clause | 3,139 | 0 | 13 | 944 | 420 | 205 | 215 | 72 | 3 |
{-|
Module: ScaledImage
Description: Scalable, positionable image widget
Copyright: (c) Greg Hale, 2016
License: BSD3
Maintainer: imalsogreg@gmail.com
Stability: experimental
Portability: GHCJS
This module provides a reflex-dom widget for scaling and positioning images.
A top-level div defaults to the natural size of... | CBMM/petersonfaces | petersonfaces-frontend/src/ScaledImage.hs | bsd-3-clause | 13,182 | 11 | 33 | 3,551 | 3,889 | 2,071 | 1,818 | -1 | -1 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.NV.HalfFloat
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stabilit... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/HalfFloat.hs | bsd-3-clause | 7,369 | 1 | 13 | 636 | 1,814 | 1,031 | 783 | -1 | -1 |
module Main where
import Control.Applicative
import Control.Monad
import System.Exit
import System.IO
import System.Environment
import System.Console.GetOpt
import Data.Maybe
import Text.PrettyPrint.HughesPJ
import Language.MIXAL.Parser
import Language.MIXAL.PP (ppMIXALStmt)
import MIX.Assembler
import MIX.Assembler.... | jtdaugherty/mix-assembler | src/Main.hs | bsd-3-clause | 3,116 | 0 | 21 | 951 | 907 | 449 | 458 | 86 | 4 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE GADT... | rfranek/duckling | Duckling/Numeral/UK/Rules.hs | bsd-3-clause | 10,868 | 0 | 18 | 2,246 | 2,123 | 1,219 | 904 | 216 | 8 |
module ELc.ExecSpec where
import Control.Monad.State
import Language.ELc
import Language.Lc
import Language.Lc.Interpreter.Dynamic
import ELc.Arbitrary ()
import Test.Hspec
import Test.QuickCheck
--------------------------------------------------------------
-- Exec
-----------------------------------------------... | d-dorazio/lc | test/ELc/ExecSpec.hs | bsd-3-clause | 1,399 | 0 | 19 | 293 | 516 | 273 | 243 | 33 | 2 |
{-# LANGUAGE FlexibleContexts #-}
module ParserUtils where
import Data.List
import Data.Char
import Control.Applicative ((<$>))
import Control.Monad
import Text.Parsec.Char
import Text.Parsec.Prim
import Text.Parsec.Combinator
number :: Stream s m Char => ParsecT s u m Int
number = (liftM (foldl' (\z x -> 10 * z ... | ratatosk/traceblade | ParserUtils.hs | bsd-3-clause | 1,084 | 0 | 15 | 217 | 443 | 227 | 216 | 29 | 1 |
{-# LANGUAGE
FlexibleInstances,
GeneralizedNewtypeDeriving,
OverloadedStrings,
QuasiQuotes,
BangPatterns,
NoImplicitPrelude
#-}
module JS where
-- General
import BasePrelude
-- Text
import qualified Data.Text.All as T
import Data.Text.All (Text)
-- Interpolation
import NeatInterpolation
-- Local
import Utils
-... | neongreen/hat | src/JS.hs | bsd-3-clause | 19,911 | 0 | 15 | 4,713 | 3,284 | 1,848 | 1,436 | -1 | -1 |
{-# language ScopedTypeVariables, DataKinds #-}
module RawSqlTest where
import Data.Coerce
import qualified Data.Conduit as C
import qualified Data.Conduit.List as CL
import qualified Data.Text as T
import Init
import Database.Persist.SqlBackend
import PersistTestPetType
import PersistentTestModels
specsWith :: Run... | yesodweb/persistent | persistent-test/src/RawSqlTest.hs | mit | 7,208 | 0 | 18 | 2,589 | 2,394 | 1,180 | 1,214 | -1 | -1 |
import System.Process
import System.Environment
import System.Exit
import Control.Monad
import System.Console.GetOpt
import Data.Char
import BrowserX.Webkit
import BrowserX.Network
import BrowserX.Options
import BrowserX.Parser
-- | 'main' runs the main program
main :: IO ()
main = do
argv <- getArgs
(settings,... | igniting/browser-x | BrowserX.hs | gpl-3.0 | 931 | 0 | 12 | 165 | 301 | 144 | 157 | 28 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeNetworkInterfaces.hs | mpl-2.0 | 10,028 | 0 | 15 | 2,064 | 876 | 562 | 314 | 93 | 1 |
{-# LANGUAGE ScopedTypeVariables, TupleSections, TemplateHaskell #-}
{-|
This module defines the routines necessary to inline member annotation
declarations for the purpose of constructing an initial environment.
Inlining proceeds by extracting the annotations from the AST and representing
them in a form more... | DaMSL/K3 | src/Language/K3/TypeSystem/TypeDecision/AnnotationInlining.hs | apache-2.0 | 12,987 | 0 | 19 | 3,412 | 2,895 | 1,519 | 1,376 | 197 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UndecidableSuperClasses #-}
{-# OPTIONS_GHC -... | k0001/opaleye-sot | src/lib/Tisch/Internal/Fun.hs | bsd-3-clause | 19,618 | 0 | 14 | 3,420 | 5,060 | 2,678 | 2,382 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE LambdaCase #-}
... | cchalmers/optical | src/Optical/Severable.hs | bsd-3-clause | 17,536 | 0 | 15 | 4,513 | 4,779 | 2,565 | 2,214 | 258 | 2 |
--------------------------------------------------------------------------------
-- |
-- Module : System.Taffybar.Widget.DiskIOMonitor
-- Copyright : (c) José A. Romero L.
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : José A. Romero L. <escherdragon@gmail.com>
-- Stability : unstable
-- Portabi... | teleshoes/taffybar | src/System/Taffybar/Widget/DiskIOMonitor.hs | bsd-3-clause | 1,582 | 0 | 10 | 269 | 189 | 113 | 76 | 18 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Stack.Dot (dot
,DotOpts(..)
,resolveDependencies
,printGraph
,pruneGraph
) where
import ... | wskplho/stack | src/Stack/Dot.hs | bsd-3-clause | 8,682 | 0 | 18 | 2,294 | 2,292 | 1,197 | 1,095 | 160 | 3 |
{-# LANGUAGE NumericUnderscores #-}
-- Test for NumericUnderscores extension.
-- See #14473
-- This is a testcase for invalid case of NumericUnderscores.
main :: IO ()
main = do
print [
-- integer
1000000_,
_1000000
]
| sdiehl/ghc | testsuite/tests/parser/should_fail/NumericUnderscoresFail0.hs | bsd-3-clause | 270 | 0 | 8 | 88 | 33 | 19 | 14 | 6 | 1 |
{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving, OverloadedStrings,
Rank2Types, RecordWildCards, TypeFamilies #-}
-- |
-- Module : Data.Attoparsec.Internal.Types
-- Copyright : Bryan O'Sullivan 2007-2014
-- License : BSD3
--
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- ... | DavidAlphaFox/ghc | utils/haddock/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs | bsd-3-clause | 7,311 | 0 | 15 | 1,958 | 1,818 | 1,005 | 813 | 140 | 1 |
{-# LANGUAGE ScopedTypeVariables, ExistentialQuantification, ApplicativeDo #-}
{-# OPTIONS_GHC -foptimal-applicative-do #-}
module Main where
import Control.Applicative
import Text.PrettyPrint as PP
(a:b:c:d:e:f:g:h:_) = map (\c -> doc [c]) ['a'..]
-- This one requires -foptimal-applicative-do to find the best solut... | ezyang/ghc | testsuite/tests/ado/ado-optimal.hs | bsd-3-clause | 1,599 | 0 | 19 | 442 | 796 | 406 | 390 | 50 | 1 |
{-# LANGUAGE DatatypeContexts #-}
module ShouldFail where
import Data.Ratio
data Integral a => P a = P { p :: a }
f :: Integral a => P (Ratio a) -> P (Ratio a)
f x = x { p = p x }
| siddhanathan/ghc | testsuite/tests/typecheck/should_fail/tcfail102.hs | bsd-3-clause | 183 | 0 | 9 | 47 | 86 | 46 | 40 | 6 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTION... | diku-dk/futhark | src/Futhark/Pass/ExtractKernels/DistributeNests.hs | isc | 42,586 | 0 | 23 | 11,273 | 13,195 | 6,533 | 6,662 | -1 | -1 |
module Phone (areaCode, number, prettyPrint) where
import Data.Char
import Control.Arrow
isValid :: String -> String
isValid xs
| n < 10 = "0000000000"
| n == 10 = xs
| n == 11 && first == '1' = ret
| n >= 11 = "0000000000" where
( first , ret ) = ( head &&& tail ) xs
n = length xs
number :: St... | mukeshtiwari/Excercism | haskell/phone-number/Phone.hs | mit | 679 | 0 | 11 | 199 | 266 | 139 | 127 | 21 | 1 |
module ExLint.Example
( getExamples
) where
import ExLint.Plugins (pluginForBlock)
import ExLint.Types
import Data.List (findIndex)
import Data.Maybe (mapMaybe)
import Data.Text (Text)
import qualified Data.Text as T
getExamples :: [Block a] -> [Example]
getExamples = mapMaybe blockToExample
blockToExample... | pbrisbin/ex-lint | src/ExLint/Example.hs | mit | 958 | 0 | 18 | 252 | 322 | 174 | 148 | 25 | 2 |
module Code.Haskellbook.Record where
import Data.List
data OperatingSystem = GnuPlusLinux | OpenBSDPlusNevermindJustBSDStill | Mac | Windows deriving (Eq, Show, Enum)
data ProgrammingLanguage = Haskell | Agda | Idris | PureScript deriving (Eq, Show, Enum)
data Programmer = Programmer { os :: OperatingSyst... | JoshuaGross/haskell-learning-log | Code/Haskellbook/Record.hs | mit | 1,177 | 0 | 12 | 197 | 335 | 196 | 139 | 17 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Symmetry.Verify where
import Symmetry.SymbEx
import Symmetry.IL.AST
import Symmetry.IL.Model (generateModel)
import Symmetry.IL.ConfigInfo
import Symmetry.IL.Model.HaskellModel (printHaskell,printQCFile)
-- import Symmetry.IL.Unfold
-- impo... | gokhankici/symmetry | checker/src/Symmetry/Verify.hs | mit | 7,757 | 0 | 16 | 2,693 | 2,200 | 1,102 | 1,098 | 179 | 2 |
module Data.PTree.Internal (
PTree(..)
, Key
, ChildKey
, Children
) where
import qualified Data.ByteString as S
import qualified Data.IntMap as IM
{--------------------------------------------------------------------
Types
--------------------------------------------------------------------}
... | cpettitt/haskell-ptree | Data/PTree/Internal.hs | mit | 559 | 0 | 9 | 113 | 110 | 69 | 41 | 14 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Rpi (Program, applyRpiMessage, defaultProgram) where
import Control.Lens
import Data.Int
import Data.List
import Data.Maybe
import Data.Text.Lens
import qualified Sound.OSC as OSC
data Program = Program { _lightLevel:: Float
... | ulyssesp/haskell-avsyn | Rpi.hs | mit | 2,049 | 0 | 11 | 403 | 549 | 298 | 251 | 44 | 1 |
module Y2016.M12.D14.Exercise where
import Data.Complex
-- import available via 1HaskellADay git repository
import Data.Matrix
{--
I'm thinking about quantum computation. IBM has released a 5-qubit computer
for public experimentation. So, let's experiment.
One way to go about that is to dive right in, so, yes, if ... | geophf/1HaskellADay | exercises/HAD/Y2016/M12/D14/Exercise.hs | mit | 2,046 | 0 | 7 | 452 | 120 | 75 | 45 | 14 | 1 |
-- | Minimalistic configuration reader using environment variables.
--
-- Based on the 'Maybe' monad, which means that failures are represented by a
-- lonesome 'Nothing'.
module Config.Env.Util
( ConfigReader
, runConfigReader
, env
, env'
, read
, envRead
, envBS
, withDef
, opt
) where
impo... | UlfS/ghmm | src/Config/Env/Util.hs | mit | 2,425 | 0 | 14 | 551 | 484 | 270 | 214 | 41 | 2 |
{-# OPTIONS_GHC -fwarn-unused-matches -fwarn-incomplete-patterns -fwarn-type-defaults #-}
module FrontEnd.Syn.Traverse where
import Control.Monad.Writer
import Util.Std
import qualified Data.Set as Set
import qualified Data.Traversable as T
import FrontEnd.HsSyn
import FrontEnd.SrcLoc
import Name.Name
import Support... | m-alvarez/jhc | src/FrontEnd/Syn/Traverse.hs | mit | 15,438 | 0 | 14 | 4,461 | 5,239 | 2,567 | 2,672 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-|
Module : Evaluator
Description : Types and operations for managing the elaboration context.
Copyright : (c) Michael Lopez, 2017
License : MIT
Maintainer : m-lopez (github)
Stability : unstable
Portability : non-portable
-}
module Evaluator ( evalExpr ) where
import ... | m-lopez/jack | src/Evaluator.hs | mit | 3,015 | 0 | 14 | 760 | 910 | 459 | 451 | 64 | 8 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Handler.RemoteAccess where
import Import
-- |
--
-- Retrieve computer details
-- operationId: getComputer
getComputerApiJsonR :: Handler Value
getComputerApiJsonR = notImplemented
-- |
--
-- Retrieve Jenkins details
-... | cliffano/swaggy-jenkins | clients/haskell-yesod/generated/src/Handler/RemoteAccess.hs | mit | 4,013 | 0 | 7 | 950 | 470 | 288 | 182 | 59 | 1 |
module SchemeSpec.TypesSpec where
import Test.Hspec
import Prelude hiding(lookup)
import Scheme.Types
spec :: Spec
spec = do
describe "Value" $ do
let x = IntVal 42
let y = IntVal 7
let z = LamVal (intern "x") (Val 7) emptyEnv
it "can be displayed" $ do
show x `shouldBe` "42"
show y... | mjdwitt/a-scheme | test/SchemeSpec/TypesSpec.hs | mit | 1,004 | 0 | 19 | 325 | 372 | 177 | 195 | 33 | 1 |
module ProjectEuler.Problem62
( problem
) where
import Control.Arrow
import Data.Function
import Data.List
import Data.Tuple
import Petbox
import qualified Data.Map.Strict as M
import ProjectEuler.Types
problem :: Problem
problem = pureProblem 62 Solved result
-- get a list of (num, num^3 (broken into digits))... | Javran/Project-Euler | src/ProjectEuler/Problem62.hs | mit | 936 | 0 | 13 | 178 | 303 | 177 | 126 | 25 | 1 |
{-# LANGUAGE FlexibleInstances #-}
module Orville.PostgreSQL.Internal.OrvilleState
( OrvilleState,
newOrvilleState,
resetOrvilleState,
orvilleConnectionPool,
orvilleConnectionState,
orvilleErrorDetailLevel,
HasOrvilleState (askOrvilleState, localOrvilleState),
ConnectionState (NotConnecte... | flipstone/orville | orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/OrvilleState.hs | mit | 6,029 | 0 | 10 | 1,117 | 585 | 339 | 246 | 94 | 3 |
{-# LANGUAGE TypeFamilies, DeriveDataTypeable, FlexibleContexts, GADTs #-}
module Main (
main
) where
import Data.Typeable
import qualified Data.Traversable as Traversable
import Control.Applicative
import Control.Monad
import Data.Maybe
import Data.IORef
import System.Mem.Weak
--transformers package:
import Con... | Cedev/monad-computed | Main.hs | mit | 8,992 | 0 | 18 | 2,825 | 2,332 | 1,134 | 1,198 | -1 | -1 |
--带上下文的计算过程 具体例子可以看clojure文件中的例子 将上下文处理的细节封装在内部 让外部的代码保证一致性与简洁性
class Monad m where
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
x >> y = x >>= \_ -> y
--return类似applicative functor中的pure函数 将一个值包裹在最小上下文中
--(>>=)也就是大名鼎鼎的bind函数 用来进行带上下文的计算 bind runs the monad m a, feedi... | zjhmale/monadme | monad/src/monad/haskell/monad.hs | epl-1.0 | 10,169 | 5 | 31 | 2,258 | 3,837 | 2,040 | 1,797 | -1 | -1 |
{- |
Module : $Header$
Description : datastructures for annotations of (Het)CASL.
Copyright : (c) Klaus Luettich, Christian Maeder, and Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
Datastructur... | nevrenato/Hets_Fork | Common/AS_Annotation.der.hs | gpl-2.0 | 9,351 | 4 | 17 | 2,267 | 2,101 | 1,148 | 953 | 147 | 3 |
{- | Module : $Header$
- Description : Implementation of main file for the prover
- Copyright : (c) Georgel Calin & Lutz Schroeder, DFKI Lab Bremen
- License : GPLv2 or higher, see LICENSE.txt
- Maintainer : g.calin@jacobs-university.de
- Stability : provisional
- Portability : portable
-
- ... | nevrenato/Hets_Fork | GMP/Main.hs | gpl-2.0 | 4,431 | 0 | 22 | 1,824 | 748 | 370 | 378 | 74 | 8 |
module Config where
data Config = Config
{ configRulesDir :: String
, configNotifyCMD:: String
, configTCPPortsBase:: Int
, configConnectionTimeout:: Int
}
deriving Show
defaultConfig = Config
{ configRulesDir = "/etc/hproxy/rules.d/"
, configNotifyCMD = "proxynotify"
, configTCPP... | dambaev/hproxyserver | src/Config.hs | gpl-2.0 | 476 | 0 | 8 | 104 | 95 | 58 | 37 | 14 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Estuary.Widgets.View where
import Reflex
import Reflex.Dom hiding (Link)
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Map.Strict as Map
import qualified Data.Text as T
import Control.Monad
import Control.Monad.IO.Class
import Data.Maybe
import TextShow
... | d0kt0r0/estuary | client/src/Estuary/Widgets/View.hs | gpl-3.0 | 5,402 | 0 | 16 | 831 | 1,861 | 947 | 914 | 107 | 1 |
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE BangPatterns, LambdaCase, ApplicativeDo, OverloadedStrings, ScopedTypeVariables, DeriveFunctor, DeriveTraversable, FlexibleInstances, FlexibleContexts #-}
module Main (main) where
import Helpers
import Data.Set as Set (toList)
import TokenAwareParser(ParseRule(..),ParseAtom(..),t... | sjcjoosten/amperspiegel | src/amperspiegel.hs | gpl-3.0 | 18,402 | 0 | 20 | 5,585 | 6,740 | 3,436 | 3,304 | 356 | 36 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
--------------------------------------------------------------------------------
-- |
-- Module: Game
--
-- This is a very simple implementation of the rules of John Conway's
-- Game of Life. It uses `Repa' arrays and... | TikhonJelvis/Reactive-Life | src/Game.hs | gpl-3.0 | 2,529 | 0 | 11 | 582 | 670 | 389 | 281 | 32 | 2 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
-- This file is the source code for the tests. You're not supposed to be here!
module Main where
import Data.Foldable
(
toList,
)
impor... | alexander-b/thug-beginners | lessonA/Tests.hs | gpl-3.0 | 14,467 | 0 | 20 | 3,890 | 5,224 | 2,555 | 2,669 | 314 | 18 |
module Biobase.Fasta.Types where
import Control.DeepSeq
import Control.Lens
import Data.ByteString.Char8 (ByteString)
import Data.Data
import GHC.Generics
-- |
data FHD = FH ByteString | FD ByteString
newtype RawFastaEntry = RawFastaEntry { _rawFastaEntry ∷ ByteString }
deriving (Show,Eq,Ord,Data,Typeable,Gene... | choener/BiobaseFasta | Biobase/Fasta/Types.hs | gpl-3.0 | 1,827 | 0 | 9 | 348 | 285 | 166 | 119 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Parsing(Car, mark, date, model, year, engine, mileage, price, isBroken, isNoDocs, isPushedUp, url,
Engine, capacity, power, typeOfDrive, typeOfFuel, autoTransmission,
Drive (Forward, Backward, WD4),
Fuel (Diesel, Petrol, Gas),
... | NoobsEnslaver/hDromParser | Parsing.hs | gpl-3.0 | 5,633 | 0 | 18 | 1,852 | 1,648 | 875 | 773 | 98 | 6 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 karamellpelle@hotmail.com
--
-- This file is part of grid.
--
-- grid 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 Lice... | karamellpelle/grid | designer/source/Game/Grid/Do.hs | gpl-3.0 | 2,321 | 0 | 14 | 606 | 361 | 202 | 159 | 32 | 2 |
{-# LANGUAGE NoImplicitPrelude, DeriveGeneric, GeneralizedNewtypeDeriving #-}
module Lamdu.Expr.Identifier
( Identifier(..)
) where
import Prelude.Compat
import Control.DeepSeq (NFData(..))
import Control.DeepSeq.Generics (genericRnf)
import Data.Binary (Binary)
import ... | da-x/Algorithm-W-Step-By-Step | Lamdu/Expr/Identifier.hs | gpl-3.0 | 939 | 0 | 8 | 200 | 231 | 138 | 93 | 19 | 0 |
-- Author: Vic Fryzel - edited by: Nicholas Mobbs
-- http://github.com/vicfryzel/xmonad-config
import System.IO
import System.IO.Unsafe (unsafePerformIO)
import Text.Printf (printf)
import XMonad.Util.WindowProperties (getProp32s)
import System.Exit
import XMonad
import XMonad.Config (def)
import XMonad.Hooks.DynamicL... | narakhan/dotfiles | auto_link/xmonad/xmonad/xmonad.hs | agpl-3.0 | 8,467 | 0 | 19 | 1,724 | 1,612 | 968 | 644 | 128 | 2 |
module Linguisticks.Util where
import Data.Maybe ( isNothing, fromJust )
import Text.ParserCombinators.Parsec ( GenParser, many, noneOf, char, (<|>), optionMaybe, eof, runParser )
import Text.Parsec.Prim ( ParsecT )
import Text.Parsec.Error ( ParseError )
import qualified Data.Set as S
type Set = S.Set
sequenceSecond... | jmacmahon/syllabify | Linguisticks/Util.hs | agpl-3.0 | 5,097 | 0 | 16 | 2,213 | 1,570 | 820 | 750 | 97 | 3 |
-- ------------------------------------------------
-- ------------------------------------------------
-- Interface comun a cajas contenedoras de datos --
class Box m where
link :: (a -> m b) -> m a -> m b
pack :: a -> m a
unite :: m (m a) -> m a -- es para definir mas facilmente el... | luchist/Funcional | Box.hs | unlicense | 5,243 | 0 | 13 | 1,775 | 770 | 401 | 369 | 36 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
--really, a better name for this module could be "TransTransactionGraphRelationalExpr", but that name is too long
module ProjectM36.TransGraphRelationalExpression where
import ProjectM36.Base
import ProjectM36.TransactionGraph
import ProjectM36.Er... | agentm/project-m36 | src/lib/ProjectM36/TransGraphRelationalExpression.hs | unlicense | 10,145 | 0 | 16 | 1,264 | 1,898 | 909 | 989 | 152 | 2 |
module Data.FormulaBench (benchs) where
import Data.Formula
import Criterion.Main
benchs :: Benchmark
benchs = bgroup "Data.Formula"
[
]
{-
bench_someFunction :: Benchmark
bench_someFunction = bgroup "someFunction"
[ bench "1" $ nf someFunction 1
, bench "2" $ nf someFunction 2
, bench "100" $ nf someFunct... | jokusi/mso | bench/Data/FormulaBench.hs | apache-2.0 | 408 | 0 | 6 | 74 | 39 | 23 | 16 | 6 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Templates.Resource where
import Data.String (fromString)
import Data.Text.Encoding (decodeUtf8)
import Data.Monoid (mappend, (<>), mconcat)
import Control.Monad (when, liftM3)
import Network.HTTP.Types.Method (methodGet, methodPost, methodPut, methodDelete)
import Lucid
imp... | coursestitch/coursestitch-api | src/Templates/Resource.hs | apache-2.0 | 5,610 | 0 | 19 | 1,216 | 1,764 | 887 | 877 | 101 | 3 |
--
add a b = a + b | chinaran/haskell-study | ch02/add.hs | apache-2.0 | 18 | 0 | 5 | 7 | 16 | 8 | 8 | 1 | 1 |
-- |JavaScript's syntax.
module BrownPLT.TypedJS.Syntax
( Expression(..)
, CaseClause(..)
, ConstrFieldAsgn(..)
, constrBodyStmt
, Statement(..)
, InfixOp(..)
, CatchClause(..)
, VarDecl(..)
, AssignOp(..)
, Id(..)
, PrefixOp(..)
, UnaryAssignOp(..)
, Prop(..)
, ForInit(..)
, ForInInit(..)... | brownplt/strobe-old | src/BrownPLT/TypedJS/Syntax.hs | bsd-2-clause | 5,464 | 0 | 11 | 1,197 | 1,850 | 1,036 | 814 | 130 | 1 |
-- | Basic types.
module NLP.Nerf.Types
( Word
, NE
, Ob
, Lb
) where
import Prelude hiding (Word)
import qualified Data.Text as T
import qualified Data.Named.IOB as IOB
-- | A word.
type Word = T.Text
-- | A named entity.
type NE = T.Text
-- | An observation consist of an index (of list type) and an ac... | kawu/nerf | src/NLP/Nerf/Types.hs | bsd-2-clause | 482 | 0 | 6 | 108 | 98 | 67 | 31 | 12 | 0 |
{-# LANGUAGE OverloadedStrings, UnboxedTuples, CPP #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
-- |
-- Module : Data.Text.Read
-- Copyright : (c) 2010, 2011 Bryan O'Sullivan
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability ... | hvr/text | Data/Text/Read.hs | bsd-2-clause | 7,645 | 0 | 19 | 1,708 | 1,258 | 693 | 565 | 116 | 5 |
module Main where
import AdventOfCode
data Block
= Repeat Int
String
[Block]
| Plain String
deriving (Show)
blockLenA :: Block -> Int
blockLenA (Repeat n s _) = n * length s
blockLenA (Plain s) = length s
blockLenB :: Block -> Int
blockLenB (Repeat n _ bs) = n * sum (blockLenB <$> bs)
bl... | purcell/adventofcode2016 | src/Day9.hs | bsd-3-clause | 915 | 0 | 14 | 259 | 370 | 182 | 188 | 31 | 2 |
-- | This module provides an instance for 'MemoryModel'
module Jat.PState.MemoryModel.Primitive
(
Primitive
)
where
import Jat.JatM
import Jat.PState.Data
import Jat.PState.AbstrValue
import qualified Jat.PState.AbstrDomain as AD
import Jat.PState.Heap
import Jat.PState.Frame
import Jat.PState.Fun
import Jat.PS... | ComputationWithBoundedResources/jat | src/Jat/PState/MemoryModel/Primitive.hs | bsd-3-clause | 3,363 | 0 | 12 | 757 | 1,029 | 529 | 500 | 65 | 5 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
module Language.Whippet.Typecheck.ExprSpec where
import Control.Lens
import Control.Lens.Extras
import Control.Monad.Identity
import Data.Sequence (Seq)
import Data.Text ... | chrisbarrett/whippet | test/Language/Whippet/Typecheck/ExprSpec.hs | bsd-3-clause | 3,970 | 2 | 34 | 1,479 | 914 | 449 | 465 | 78 | 1 |
module Config (config) where
import Dawn
import Mire.Plugin
import Mire.Data.Flow
import qualified Data.Text as T
import qualified Testworld.World
import Pipes
config :: Config
config = Config plugins worlds where
plugins =
[
Plugin "1" plugin,
Plugin "2" plugin2,
Plugin "3" plu... | ellej/mire | example/Config.hs | bsd-3-clause | 2,981 | 0 | 22 | 1,062 | 429 | 235 | 194 | 30 | 3 |
{-# LANGUAGE RecordWildCards, CPP #-}
{-# LANGUAGE RecursiveDo #-}
module Foreign.JavaScript.EventLoop (
eventLoop,
runEval, callEval, debug, onDisconnect,
newHandler, fromJSStablePtr,
) where
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.A... | duplode/threepenny-gui | src/Foreign/JavaScript/EventLoop.hs | bsd-3-clause | 6,472 | 0 | 24 | 2,086 | 1,339 | 671 | 668 | 110 | 5 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[PrelNames]{Definitions of prelude modules and names}
Nota Bene: all Names defined in here should come from the base package
- ModuleNames for prelude modules,
e.g. pREL_BASE_Name :: ModuleName
- Modules for prelude modules
e... | vTurbine/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | 101,220 | 0 | 10 | 22,765 | 15,490 | 8,836 | 6,654 | 1,549 | 2 |
module Module3.Task7 where
import Data.Char
readDigits :: String -> (String, String)
readDigits x = (takeWhile isDigit x, dropWhile isDigit x)
| dstarcev/stepic-haskell | src/Module3/Task7.hs | bsd-3-clause | 145 | 0 | 6 | 22 | 50 | 28 | 22 | 4 | 1 |
-- |
-- Module: Graphics.Chalkboard.Utils
-- Copyright: (c) 2009 The University of Kansas
-- License: BSD3
--
-- Maintainer: Andy Gill <andygill@ku.edu>
-- Stability: unstable
-- Portability: ghc
--
-- This module has some basic, externally visable, definitions.
module Graphics.ChalkBoard.Utils
( -- * Point Utilties... | andygill/chalkboard2 | Graphics/ChalkBoard/Utils.hs | bsd-3-clause | 3,541 | 16 | 14 | 807 | 1,176 | 667 | 509 | 58 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LA... | reflex-frp/reflex-dom | reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs | bsd-3-clause | 127,061 | 122 | 63 | 26,048 | 31,773 | 15,791 | 15,982 | -1 | -1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.Version14
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portable
--
------... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Version14.hs | bsd-3-clause | 22,637 | 0 | 4 | 3,566 | 3,532 | 2,362 | 1,170 | 1,165 | 0 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-}
module BoneDewd.RxPacket where
import Control.Applicative ((<$>))
import Data.Binary.Get
import Data.Bits
import qualified Data.Text as T
import Data.Text.Encoding
import qualified Data.ByteString as B
import Data.Word
import BoneDewd.Types
imp... | dreamcodez/bonedewd | src/BoneDewd/RxPacket.hs | bsd-3-clause | 8,330 | 0 | 19 | 3,109 | 2,058 | 997 | 1,061 | 180 | 12 |
{-# language CPP #-}
-- | = Name
--
-- XR_EXT_debug_utils - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_debug_utils XR_EXT_debug_utils>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 2... | expipiplus1/vulkan | openxr/src/OpenXR/Extensions/XR_EXT_debug_utils.hs | bsd-3-clause | 61,515 | 2 | 17 | 11,783 | 7,608 | 4,424 | 3,184 | -1 | -1 |
{-#LANGUAGE MultiParamTypeClasses #-}
{-#LANGUAGE OverloadedStrings #-}
{-#LANGUAGE ViewPatterns #-}
module Twilio.Recording
( -- * Resource
Recording(..)
, Twilio.Recording.get
) where
import Control.Applicative
import Control.Error.Safe
import Control.Monad
import Control.Monad.Catch
import Data.Aeson
imp... | seagreen/twilio-haskell | src/Twilio/Recording.hs | bsd-3-clause | 1,670 | 0 | 18 | 439 | 390 | 219 | 171 | 64 | 1 |
{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies,
GADTs, TypeOperators, RankNTypes, FlexibleContexts, UndecidableInstances,
FlexibleInstances, ScopedTypeVariables, MultiParamTypeClasses,
OverlappingInstances, TemplateHaskell #-}
module Oxymoron.Environment.Internal where
import Oxymoron.Regi... | jfischoff/oxymoron | src/Oxymoron/Environment/Internal.hs | bsd-3-clause | 4,243 | 19 | 14 | 1,204 | 1,177 | 653 | 524 | 81 | 1 |
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, FlexibleContexts, CPP, DeriveDataTypeable #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.R.Generator
-- Copyright : (c) 2010 David M. Rosenberg
-- License : BSD3
--
-- Maintainer : David Rosen... | rosenbergdm/language-r | src/Language/R/Generator.hs | bsd-3-clause | 8,286 | 0 | 4 | 1,085 | 43 | 35 | 8 | 5 | 0 |
module Control.Error.Util.ExtendedSpec (spec) where
import Control.Error.Util.Extended
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Test.QuickCheck
import Test.QuickCheck.Instances
spec :: TestTree
spec = testGroup "Control.Error.Util.Extended"
[ QC.testProperty "`someFunction` should pass"
s... | athanclark/errors-mtl | test/Control/Error/Util/ExtendedSpec.hs | bsd-3-clause | 407 | 0 | 8 | 59 | 100 | 59 | 41 | 12 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : ForSyDe.Shallow.MoC.Adaptivity
-- Copyright : (c) ForSyDe Group, KTH 2007-2008
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : forsyde-dev@ict.kth.se
-- Stability : experimental
-- Portabi... | forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/Adaptivity.hs | bsd-3-clause | 1,107 | 0 | 10 | 201 | 269 | 150 | 119 | 17 | 1 |
{-# Language RecordWildCards #-}
module SymVerify () where
import SymVector
import SymMap
import SymBoilerPlate
import Language.Haskell.Liquid.Prelude
state0 :: State
state0 = undefined
sched0 :: State -> [Pid]
sched0 state = undefined
check = runState state0 emptyVec emptyVec2D (sched0 state0)
{-@
runState :: sta... | abakst/symmetry | checker/saved-quals/PingBabyVectors.hs | mit | 6,347 | 0 | 21 | 1,562 | 917 | 515 | 402 | 59 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-|
This module implements the constraint set consistency checking routines from
the specification.
-}
module Language.K3.TypeSystem.Consistency
( ConsistencyError(..)
, checkConsistent
, checkClosureConsistent
) where
import Control.Applicative
import Control.Monad
import Data.L... | DaMSL/K3 | src/Language/K3/TypeSystem/Consistency.hs | apache-2.0 | 8,842 | 0 | 23 | 2,314 | 2,109 | 1,102 | 1,007 | 160 | 44 |
-- Mersenne Prime Numbers
import Set
import Primes
import Base
import Data.Char
str2int :: String -> Integer
str2int string = fromBase 10 (map char2int string)
where
char2int char = toInteger $ ord(char) - ord('0')
mersPrimePowersTo n = Set [ e | e <- primesTo n, isPrime (2^e - 1) ]
mersPrimesToPower... | rohitjha/DiMPL | examples/mers.hs | bsd-2-clause | 1,566 | 0 | 19 | 423 | 304 | 147 | 157 | 23 | 3 |
--------------------------------------------------------------------
-- |
-- Module : Flickr.Auth
-- Description : flickr.auth - authentication, flickr-style.
-- Copyright : (c) Sigbjorn Finne, 2008
-- License : BSD3
--
-- Maintainer: Sigbjorn Finne <sof@forkIO.com>
-- Stability : provisional
-- Portability:... | BeautifulDestinations/hs-flickr | Flickr/Auth.hs | bsd-3-clause | 1,515 | 0 | 12 | 233 | 222 | 122 | 100 | 20 | 1 |
module RenameCase1 where
foo x = case (baz x) of
1 -> "a"
_ -> "b"
| mpickering/ghc-exactprint | tests/examples/transform/RenameCase1.hs | bsd-3-clause | 77 | 0 | 7 | 26 | 34 | 18 | 16 | 4 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import Data.Monoid
import Data.Maybe (isJust)
import qualified Data.Text as T
import qualified Data.Text.Template as T
import Test.QuickCheck
import Control.Applicative
genTemplate :: Gen T.Template
genTemplate = oneof [ do t <-... | dicomgrid/tinytemplate | tests/Main.hs | mit | 1,437 | 0 | 15 | 444 | 440 | 222 | 218 | 36 | 1 |
module Main where
import Build_doctests (autogen_dir, deps)
import Control.Applicative
import Control.Monad
import Data.List
import System.Directory
import System.FilePath
import Test.DocTest
main :: IO ()
main = getSources >>= \sources -> doctest $
"-isrc"
: ("-i" ++ autogen_dir)
: "-optP-include"
: ("-opt... | bgamari/linear | tests/doctests.hs | bsd-3-clause | 872 | 0 | 14 | 155 | 298 | 160 | 138 | 25 | 1 |
module Surface
(
Surface(..)
, mkSphere
, mkPlane
)
where
import Core ( UnitVector, Point(..), Ray(..), Transform(..), RayPosition, VectorUnaryOps(..)
, origin, to, neg, toRayPosition, unsafeForceUnitVector, (|.|) )
import Material ( Material )
data Surface = Surface
{ intersection :: R... | stu-smith/rendering-in-haskell | src/experiment05/Surface.hs | mit | 2,128 | 0 | 11 | 669 | 687 | 365 | 322 | -1 | -1 |
{-|
Module : Idris.Elab.Transform
Description : Transformations for elaborate terms.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE PatternGuards #-}
module Idris.Elab.Transform where
import Idris.AbsSyntax
import Idris.ASTUtils
import Idris.DSL
import Idris.Error
import Idris... | tpsinnem/Idris-dev | src/Idris/Elab/Transform.hs | bsd-3-clause | 5,240 | 0 | 19 | 1,456 | 1,559 | 804 | 755 | 101 | 6 |
module Foo where
data Foo = Bar { x :: Int, y :: Bool }
foo a = a{x=2}
bar = Bar{ x = 1, y = False}
foobar = foo (id id bar)
| sdiehl/ghc | testsuite/tests/hiefile/should_compile/hie001.hs | bsd-3-clause | 129 | 0 | 8 | 38 | 76 | 45 | 31 | 5 | 1 |
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
{-# LANGUAGE GADTs, KindSignatures, EmptyCase, LambdaCase #-}
-- Check some GADTs
module EmptyCase004 where
import Data.Kind (Type)
data A :: Type -> Type where
A1 :: A Int
A2 :: A Bool
-- Non-exhaustive: Missing A2
f1 :: A Bool -> a
f1 = \case
-- Non-exhaustive: ... | sdiehl/ghc | testsuite/tests/pmcheck/should_compile/EmptyCase004.hs | bsd-3-clause | 1,041 | 0 | 7 | 248 | 283 | 161 | 122 | -1 | -1 |
{-
(c) Bartosz Nitka, Facebook 2015
Utilities for efficiently and deterministically computing free variables.
-}
{-# LANGUAGE BangPatterns #-}
module FV (
-- * Deterministic free vars computations
FV, InterestingVarFun,
-- * Running the computations
fvVarListVarSet, fvVarList, fvVar... | olsner/ghc | compiler/utils/FV.hs | bsd-3-clause | 6,847 | 0 | 9 | 1,430 | 792 | 478 | 314 | 65 | 1 |
{-# LANGUAGE GADTs #-}
module T9096 where
data Foo a where
MkFoo :: (->) a (Foo a)
| ghc-android/ghc | testsuite/tests/gadt/T9096.hs | bsd-3-clause | 87 | 0 | 8 | 21 | 29 | 18 | 11 | 4 | 0 |
-- | This module implements a compiler pass for inlining functions,
-- then removing those that have become dead.
module Futhark.Optimise.InliningDeadFun
( inlineAndRemoveDeadFunctions
, removeDeadFunctions
)
where
import Control.Monad.Reader
import Control.Monad.Identity
import Data.List
import Data.Loc
impo... | ihc/futhark | src/Futhark/Optimise/InliningDeadFun.hs | isc | 6,617 | 0 | 18 | 1,764 | 1,774 | 918 | 856 | 118 | 4 |
module Home.Controller
( HomeAPI
, rootPath
) where
import App (AppT, AppConfig(..))
import Control.Monad.Reader
import Home.View (showA)
import Servant
import Servant.HTML.Blaze (HTML)
import Text.Blaze.Html5 (Html)
import Users.Api
type HomeAPI = Get '[HTML] Html
rootPath :: Maybe User -> AppT Html
rootPath ... | gust/feature-creature | marketing-site/app/Home/Controller.hs | mit | 387 | 0 | 9 | 63 | 140 | 81 | 59 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.