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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
module Disemvowel where
import Data.Char
disemvowel :: String -> String
disemvowel = filter isConsonant
where isConsonant letter = not . elem (toLower letter) $ "aeiou"
| jlevitt/haskell-katas | disemvowel.hs | apache-2.0 | 177 | 0 | 11 | 33 | 53 | 28 | 25 | 5 | 1 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_HADDOCK hide #-}
-- |
-- Handling of message for CH interpreter
--
-- Following messages must... | SKA-ScienceDataProcessor/RC | MS5/dna/core/DNA/Interpreter/Message.hs | apache-2.0 | 13,127 | 57 | 28 | 4,346 | 2,672 | 1,323 | 1,349 | -1 | -1 |
{-| Implementation of cluster-wide logic.
This module holds all pure cluster-logic; I\/O related functionality
goes into the /Main/ module for the individual binaries.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or withou... | apyrgio/snf-ganeti | src/Ganeti/HTools/Cluster.hs | bsd-2-clause | 75,658 | 0 | 23 | 23,698 | 16,291 | 8,853 | 7,438 | 1,219 | 8 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module LendingClub.Listing
( Listing (..)
, Offer (..)
, Credit (..)
, Grade (..)
, SubGrade (..)
, Purpose (..)
) where
import Control.Applicative
import Control... | WraithM/lendingclub | src/LendingClub/Listing.hs | bsd-3-clause | 5,507 | 0 | 28 | 1,784 | 1,172 | 659 | 513 | 201 | 1 |
{-|
Module : Data.OrgMode.Parse.Attoparsec.Util.ParseLinesTill
Copyright : © 2017 Parnell Springmeyer
License : All Rights Reserved
Maintainer : Parnell Springmeyer <parnell@digitalmentat.com>
Stability : stable
Attoparsec utilities
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVar... | digitalmentat/orgmode-parse | src/Data/OrgMode/Parse/Attoparsec/Util/ParseLinesTill.hs | bsd-3-clause | 4,212 | 0 | 22 | 1,071 | 1,036 | 562 | 474 | 69 | 2 |
module Distribution.Nixpkgs.Haskell.FromCabal.License ( fromCabalLicense ) where
import Distribution.Nixpkgs.License
import Distribution.License ( License(..) )
import Data.Version
-- TODO: Programatically strip trailing zeros from license version numbers.
fromCabalLicense :: Distribution.License.License -> Distribu... | bennofs/cabal2nix | src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs | bsd-3-clause | 2,669 | 0 | 12 | 697 | 668 | 339 | 329 | 30 | 1 |
module JDec.Class.Parse.ParseBytecode (
deserializeBytecode
) where
import JDec.Bytecode.Raw.Instruction(Instruction(..))
import JDec.Class.Raw.ConstantPoolIndex (ConstantPoolIndex(ConstantPoolIndex))
import JDec.Bytecode.Raw.ArrayType(ArrayType(..))
import Data.Binary.Get(Get, isEmpty, getWord8, skip, getWord16be, ... | rel-eng/jdec | src/JDec/Class/Parse/ParseBytecode.hs | bsd-3-clause | 18,304 | 0 | 24 | 5,948 | 6,333 | 3,338 | 2,995 | 431 | 222 |
module DebugHook where
import Foreign
import Foreign.C
import Graphics.GL.Core33
import Graphics.GL.KHR.DebugCore
import Graphics.GL.Types
import Text.Printf
installDebugHook :: IO ()
installDebugHook
| gl_KHR_debug =
do cb <- makeGLDEBUGPROC glCallback
glDebugMessageCallback cb nullPtr
glEnable G... | ocharles/SSAO-example | src/DebugHook.hs | bsd-3-clause | 1,917 | 0 | 13 | 620 | 355 | 179 | 176 | 55 | 18 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Tools
(
-- * I/O tools
loadOffset,
loadToken,
saveOffset,
-- * Log tool
putLog,
-- * Control flow
untilRight,
-- * Utilities
tshow
) where
import Control.Exception (Exception, IOException, ... | MCL1303/TaskBot | lib/Tools.hs | bsd-3-clause | 2,003 | 0 | 12 | 544 | 573 | 310 | 263 | 56 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
module Scheduler.Arrow
( runJobs
, getQueue
, setQueue
, moveJobUpK
, moveJobDownK
, removeJobK
) where
import qualified Scheduler as S
import Control.Arrow
import ClassyPrelud... | limaner2002/EPC-tools | scheduler-ui/src/Scheduler/Arrow.hs | bsd-3-clause | 2,832 | 2 | 23 | 588 | 1,148 | 562 | 586 | 71 | 2 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE... | haskell-distributed/distributed-process-fsm | src/Control/Distributed/Process/FSM/Internal/Types.hs | bsd-3-clause | 13,867 | 0 | 20 | 4,226 | 4,072 | 2,135 | 1,937 | 272 | 7 |
-- Advent of Code
---- Day 23: Opening the Turing Lock
module AOC2015.Day23 where
import Data.List
import Data.Maybe
-- | Give registers symbolic names for type safety.
data Regi = RegA | RegB
-- | State of the machine.
data State = State { rA, rB, pc :: Int }
deriving Show
-- | Execute an ALU instruction.
updat... | bitrauser/aoc | src/AOC2015/Day23.hs | bsd-3-clause | 2,735 | 0 | 11 | 668 | 976 | 501 | 475 | 64 | 3 |
module Vectorise.Env (
Scope(..),
-- * Local Environments
LocalEnv(..),
emptyLocalEnv,
-- * Global Environments
GlobalEnv(..),
initGlobalEnv,
extendImportedVarsEnv,
extendFamEnv,
setPAFunsEnv,
setPRFunsEnv,
modVectInfo
) where
import HscTypes
import InstEnv
import FamInstEnv
import CoreSyn
im... | GaloisInc/halvm-ghc | compiler/vectorise/Vectorise/Env.hs | bsd-3-clause | 9,335 | 0 | 14 | 2,811 | 1,245 | 732 | 513 | 117 | 1 |
{-
Author: Wishnu Prasetya
Copyright 2011 Utrecht University
The use of this sofware is free under the Modified BSD License.
-}
{- |
This module provides a type representing application-events which
are to be read from a log, and:
* a parser to read from semi-compressed raw log.
* X... | aelyasov/Haslog | src/Eu/Fittest/Logging/XML/AppEvent.hs | bsd-3-clause | 8,516 | 0 | 16 | 2,864 | 1,506 | 821 | 685 | 144 | 4 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
--------------------------------------------------------------------------------
-- |
-- Module : Database.EventStore.Internal.Logger
-- Copyright : (C) 2017 Yorick Laupa
-- License : (see the file LICENSE)
--
-- Maintainer : Yorick Laupa <yo.eight@g... | YoEight/eventstore | Database/EventStore/Internal/Logger.hs | bsd-3-clause | 2,880 | 0 | 13 | 429 | 560 | 312 | 248 | 52 | 2 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude
, ExistentialQuantification
, MagicHash
, RecordWildCards
, PatternSynonyms
#-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC... | shlevy/ghc | libraries/base/GHC/Exception.hs | bsd-3-clause | 8,913 | 2 | 13 | 1,567 | 1,035 | 573 | 462 | 101 | 2 |
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-matches -fno-warn-name-shadowing -fno-warn-missing-signatures #-}
{-# LANGUAGE FlexibleInstances, ConstraintKinds, ExistentialQuantification, GADTs, RankNTypes, MultiParamTypeClasses #-}
{-# LANGUAGE ImpredicativeTypes, RankNTypes, UndecidableInstances, Flexibl... | lingxiao/CIS700 | depricated/CountMinSketch2.hs | bsd-3-clause | 4,252 | 0 | 13 | 1,049 | 789 | 455 | 334 | 54 | 2 |
{-# LANGUAGE ExplicitNamespaces #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.List.Singletons
-- Copyright : (C) 2013-2014 Richard Eisenberg, Jan Stolarek
-- License : BSD-style (see LICENSE)
-- Maintainer : Ryan Scott
-- Stability : experime... | goldfirere/singletons | singletons-base/src/Data/List/Singletons.hs | bsd-3-clause | 10,049 | 0 | 6 | 1,643 | 2,130 | 1,449 | 681 | -1 | -1 |
import qualified Zora.List as ZList
import qualified Zora.Math as ZMath
is_circular_prime :: Integer -> Bool
is_circular_prime
= all ZMath.prime
. map read
. ZList.cycles
. show
num_small_circular_primes :: Integer
num_small_circular_primes
= ZList.count is_circular_prime
. takeWhile (< 1000000)
$ ZMath.prime... | bgwines/project-euler | src/solved/problem35.hs | bsd-3-clause | 391 | 8 | 8 | 62 | 123 | 60 | 63 | 16 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{- |
Module : Web.RBB.Crawler.MetaCombiner
Description : Contract a list of meta data into a single value type
Copyright : (c) Sebastian Witte
License : BSD3
Maintainer : woozletoff@gmail.com
Stability : experimental
-}
module Web.RBB.Crawler.MetaCombiner
where
... | saep/repo-based-blog | library/Web/RBB/Crawler/MetaCombiner.hs | bsd-3-clause | 2,462 | 0 | 15 | 722 | 632 | 325 | 307 | 49 | 2 |
module HasOffers.API.Affiliate.AdManager
where
import Data.Text
import GHC.Generics
import Data.Aeson
import Control.Applicative
import Network.HTTP.Client
import qualified Data.ByteString.Char8 as BS
import HasOffers.API.Common
--------------------------------------------------------------------------------
... | kelecorix/api-hasoffers | src/HasOffers/API/Affiliate/AdManager.hs | bsd-3-clause | 2,605 | 0 | 8 | 825 | 628 | 306 | 322 | 69 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Aurora.HealthCheckConfig where
import Control.Applicative (empty)
import Text.PrettyPrint.Leijen (Pretty(..), integer)
import Aurora.Optional (Optional)
import Aurora.Pretty (recordDoc)
data HealthCheckConfig = HealthCheckConfig
{ init... | Gabriel439/Haskell-Aurora-Library | src/Aurora/HealthCheckConfig.hs | bsd-3-clause | 1,245 | 0 | 9 | 305 | 235 | 138 | 97 | 25 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Db where
import GHC.Generics (Generic)
import Control.Monad.IO.Class
import Database.MySQL.Simple
import Database.MySQL.Simple.QueryResults
import Database.MySQL.Simple.QueryParams
import Data.Pool(Pool, withResource)
import Data.String.Utils
im... | DNNX/trurl | devrepo/scotty-mysql/src/Db.hs | bsd-3-clause | 3,144 | 0 | 11 | 633 | 854 | 453 | 401 | 51 | 1 |
{-# OPTIONS_GHC -Wall #-}
module Main where
import Vis
( display
, VisObject(..)
, red
, blue
, Options(..)
, defaultOpts
)
import Physics.Learn.Visual.VisTools
( curveObject
, displayVectorField
)
import Physics.Learn.Position
( Position
, cart
)
import Physics.Lea... | walck/learn-physics | examples/src/eFieldLine3D.hs | bsd-3-clause | 1,035 | 0 | 11 | 229 | 361 | 205 | 156 | 34 | 1 |
module HelpersTest (suite) where
import Helpers
import Model
import Data.List (intercalate)
import Test.QuickCheck
import Test.QuickCheck.Modifiers
import Test.Tasty
import Test.Tasty.QuickCheck as QC
instance Eq Caster where
c1 == c2 = casterPseudo c1 == casterPseudo c2
genCasterName :: Gen Name
genCasterName ... | ptitfred/ftv-vods | test/HelpersTest.hs | bsd-3-clause | 1,095 | 0 | 9 | 180 | 313 | 167 | 146 | 28 | 1 |
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# LANGUAGE RecordWildCards #-}
import Data.Foldable (for_)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import Scrabble (scoreLetter, scoreWord)
main :: IO ()
main = hspecWith defaultConfi... | vaibhav276/exercism_haskell | scrabble-score/test/Tests.hs | mit | 2,580 | 0 | 13 | 1,145 | 521 | 310 | 211 | 54 | 1 |
--file:L ch-1/WC.hs
--lines beginning with -- are comments
main = interact wordCount
where wordCount input = show (length (lines input))++"\n"
| soumyadsanyal/99 | real.hs | gpl-2.0 | 146 | 0 | 10 | 23 | 40 | 20 | 20 | 2 | 1 |
{-# LANGUAGE TemplateHaskell, StandaloneDeriving,
GeneralizedNewtypeDeriving #-}
{-| Implementation of the Ganeti logging functionality.
This currently lacks the following (FIXME):
- log file reopening
Note that this requires the hslogger library version 1.1 and above.
-}
{-
Copyright (C) 2011, 2012... | mbakke/ganeti | src/Ganeti/Logging.hs | bsd-2-clause | 6,965 | 0 | 12 | 1,581 | 1,400 | 756 | 644 | 119 | 4 |
{-
Copyright (C) 2009 Ivan Lazar Miljenovic <Ivan.Miljenovic@gmail.com>
This file is part of SourceGraph.
SourceGraph is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your ... | Baranowski/SourceGraph | Analyse/Imports.hs | gpl-3.0 | 5,566 | 0 | 13 | 1,646 | 1,087 | 560 | 527 | 91 | 1 |
{-# LANGUAGE BangPatterns, CPP, NondecreasingIndentation, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
-- NB: we specifically ignore deprecations. GHC 7.6 marks the .QSem module as
-- deprecated, although it became un-deprecated later. As a result, using 7.6
-- as your bootstrap compiler ... | siddhanathan/ghc | compiler/main/GhcMake.hs | bsd-3-clause | 88,937 | 0 | 35 | 28,445 | 14,843 | 7,580 | 7,263 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}
module T10810 where
$([d| data Foo = (:!) |])
| ezyang/ghc | testsuite/tests/th/T10810.hs | bsd-3-clause | 135 | 0 | 6 | 20 | 17 | 12 | 5 | 4 | 0 |
{-# LANGUAGE ExistentialQuantification #-}
-- Trac #3176
module Foo where
data ES = forall a. Show a => ES {unES:: a}
smallPrintES f t = show $ unES $ f t
| urbanslug/ghc | testsuite/tests/typecheck/should_fail/T3176.hs | bsd-3-clause | 160 | 0 | 8 | 36 | 54 | 30 | 24 | 4 | 1 |
-- Test gcd
main :: IO ()
main = do
test gcd ([ -42, 0, 105 ] :: [Int])
test gcd ([-12193263111263526900, -42, 0, 105, 1234567890 ] :: [Integer])
test :: (Show a, Integral a) => (a -> a -> a) -> [a] -> IO ()
test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a... | urbanslug/ghc | testsuite/tests/numeric/should_run/arith013.hs | bsd-3-clause | 339 | 0 | 10 | 118 | 195 | 105 | 90 | 6 | 1 |
{-# LANGUAGE OverloadedStrings, LambdaCase,
RecordWildCards, OverloadedLists,
FlexibleContexts, NoMonomorphismRestriction #-}
module Language.Rowling.Evaluator.Builtins (builtins) where
import qualified Prelude as P
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as ... | thinkpad20/rowling | src/Language/Rowling/Evaluator/Builtins.hs | mit | 3,602 | 0 | 19 | 945 | 1,267 | 676 | 591 | 82 | 7 |
{-# LANGUAGE Haskell2010 #-}
{-# OPTIONS -Wall #-}
-- |
-- Module : Foreign.Java.Utils
-- Copyright : (c) Julian Fleischer 2013
-- License : MIT (See LICENSE file in cabal package)
--
-- Maintainer : julian.fleischer@fu-berlin.de
-- Stability : provisional
-- Portability : portable (Haskell2010)
--... | fehu/haskell-java-bridge-fork | src/Foreign/Java/Utils.hs | mit | 6,089 | 0 | 14 | 2,305 | 926 | 549 | 377 | 123 | 2 |
module Kafka.Callbacks
( errorCallback
, logCallback
, statsCallback
, Callback
)
where
import Data.ByteString (ByteString)
import Kafka.Internal.RdKafka (rdKafkaConfSetErrorCb, rdKafkaConfSetLogCb, rdKafkaConfSetStatsCb)
import Kafka.Internal.Setup (getRdKafkaConf, Callback(..))
import Kafka.Types (KafkaError(..), Ka... | haskell-works/kafka-client | src/Kafka/Callbacks.hs | mit | 1,965 | 0 | 11 | 299 | 332 | 192 | 140 | 21 | 1 |
import System.IO
import System.Directory
import Cosine_tfidf(query_documents, appendStr, removeDir, tf_idf, similarity)
import System.Environment
main :: IO ()
main = do
args <- getArgs
d <- getDirectoryContents (args!!0)
f <- mapM readFile(map (appendStr (args!!0)) (removeDir d))
print("PRINTING THE TFIDF")
mapM... | shachi04/HaskellTextAnalysis | CallFunctions.hs | mit | 513 | 2 | 14 | 74 | 196 | 96 | 100 | 16 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- | Legacy types from Keter version 0.4. Retained to keep backwards
-- compatibility in config file format.
module Keter.Types.V04 where
import Control.Applicative
import Data.Aeson
import Data.Bool
import Data.Conduit.Network (Ho... | snoyberg/keter | Keter/Types/V04.hs | mit | 5,650 | 0 | 29 | 1,791 | 1,259 | 688 | 571 | 128 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE CPP #-}
module Data.ByteString.Read.Class
( ReadFractional(..)
, Radix(..)
, Source(..)
) where
import Data.Word
import... | philopon/bytestring-read | src/Data/ByteString/Read/Class.hs | mit | 4,268 | 0 | 12 | 987 | 1,090 | 590 | 500 | -1 | -1 |
module Worksheet where
bindExp :: Integer -> String
bindExp x = let y = 5 in
"the integer was: " ++ show x
++ " and y was: " ++ show y
-- bindExp1 :: Integer -> String
-- bindExp1 x = let y = 5 in
-- let z = y + x in -- ++ "the integer was: "
-- ++ show x ++ " and... | raventid/coursera_learning | haskell/chapter7/worksheet.hs | mit | 2,464 | 0 | 10 | 815 | 727 | 389 | 338 | 57 | 3 |
{-|
Module : PostgREST.Middleware
Description : Sets the PostgreSQL GUCs, role, search_path and pre-request function. Validates JWT.
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module PostgREST.Middleware where
import qualified Data.Aeson ... | diogob/postgrest | src/PostgREST/Middleware.hs | mit | 2,710 | 0 | 18 | 612 | 625 | 342 | 283 | 47 | 4 |
module Main where
import qualified Database.Zookeeper as ZK
import qualified Data.ByteString.Char8 as C8
main = do
let quorumZk = "10.77.1.2:2181"
timeoutInMs = 5000
watcher = Nothing
clientId = Nothing
path = "/test1"
pathChild = "... | slon1024/haskell_zookeeper | Zookeeper.hs | mit | 2,010 | 0 | 13 | 691 | 632 | 306 | 326 | 43 | 3 |
module REST where
| IreneKnapp/direct-web-bugs | Haskell/REST.hs | mit | 18 | 0 | 2 | 3 | 4 | 3 | 1 | 1 | 0 |
module Step6 where
import Control.Monad
import Text.Read
sumMaybe :: Maybe Int
sumMaybe =
readMaybe "12" >>= \a ->
readMaybe "23" >>= \b ->
readMaybe "34" >>= \c ->
return (a + b + c)
-----------------------
-- синтаксический сахар
-----------------------
sumMaybe2 :: Maybe Int
sumMaybe2 = do
a... | nlinker/haskell-you-could | src/Step6.hs | mit | 649 | 0 | 14 | 153 | 260 | 131 | 129 | 25 | 1 |
module Language.R.Cmd.Linux (
getRscriptPath
) where
import Control.Monad (filterM, (=<<))
import System.Environment (getEnv)
import System.FilePath
import System.Directory
getRscriptPath :: IO [FilePath]
getRscriptPath = findExecutables "Rscript"
| tsbattman/Raskell | src/Language/R/Cmd/Linux.hs | mit | 258 | 0 | 6 | 35 | 67 | 41 | 26 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Data.Monoid (mconcat)
import Safe
import HSPoker.Card
main = scotty 3000 $ do
get "/hand/:cards_str" $ do
cards <- param "cards_str"
json $ cardsFromString cards
>>= hand
>>= return . ( fmap showCard ) . unHand
get "/handRa... | wouteroostervld/hspoker | bin/Main.hs | mit | 850 | 0 | 16 | 263 | 233 | 107 | 126 | 28 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
module Language.Core.Prelude where
import Language.Core.ADT
import Language.Core.DSL
{-
preludeDefs :: CoreProgram
preludeDefs = [
("I", ["x"], EVar "x")
, ("K", ["x", "y"], EVar "x")
, ("K1", ["x", "y"], EVar "y")
, ("S", ["f", "g", "x"], [... | notcome/ImplFP | src/Language/Core/Prelude.hs | mit | 452 | 0 | 4 | 87 | 22 | 16 | 6 | 5 | 0 |
module Ocram.Query.Test
-- exports {{{1
(
tests
) where
-- import {{{1
import Ocram.Query
import Ocram.Test.Lib (enumTestGroup, enrich)
import Test.Framework (testGroup, Test)
import Test.HUnit ((@=?))
import Data.Maybe (isJust)
import Language.C.Syntax.AST
tests :: Test
tests = -- {{{1
testGroup "Query" [funDefT... | copton/ocram | ocram/src/Ocram/Query/Test.hs | gpl-2.0 | 1,357 | 2 | 14 | 266 | 401 | 225 | 176 | 34 | 1 |
class Y a where
g :: a -> Char
class Y d => X d where
f :: d -> Int
instance Y Int where
g x = primChr (f x)
instance X Int where
f x = x + 1
instance Y Char where
g = id
instance X Char where
f = primOrd
instance X g => X [g] where
f [] = 0
f (x:xs) = f x + f xs
instance Y g => ... | Helium4Haskell/helium | test/typeClasses/ClassInstance11.hs | gpl-3.0 | 767 | 0 | 12 | 269 | 487 | 244 | 243 | 29 | 1 |
{-# LANGUAGE TypeFamilies #-}
module Security.ThreeLevels (Low, Medium, High, low, medium) where
import Security.Lattice
data Low = L
data Medium = M
data High = H
type instance (LEQ Low Low) = ()
type instance (LEQ Low Medium) = ()
type instance (LEQ Low High) = ()
type instance (LEQ Medium Medium) = ()
type ... | mdipirro/haskell-secure-types | app/Security/ThreeLevels.hs | gpl-3.0 | 511 | 0 | 6 | 104 | 198 | 113 | 85 | 18 | 1 |
module TruthTable.Impl ( buildTable
, showTable
, printTable ) where
import Data.List (intercalate, transpose)
import qualified Data.Map as Map
import TruthTable.WFF
type TruthTable = [Map.Map WFF Bool]
alignTable :: [[String]] -> [[String]]
alignTable = transpose . (map align) . transpose
where... | adamschoenemann/truth-table | src/TruthTable/Impl.hs | gpl-3.0 | 1,680 | 0 | 14 | 481 | 801 | 421 | 380 | 43 | 2 |
{-|
A general query system for matching things (accounts, postings,
transactions..) by various criteria, and a SimpleTextParser for query expressions.
-}
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, ViewPatterns #-}
module Hledger.Query (
-- * Query and QueryOpt
Query(..),
QueryOpt(..),
-- * parsing... | ony/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | 36,464 | 0 | 17 | 8,477 | 10,785 | 5,616 | 5,169 | 550 | 23 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.WebSecurityScanner.Types
-- Copyright : (c) 2015-2016 ... | brendanhay/gogol | gogol-websecurityscanner/gen/Network/Google/WebSecurityScanner/Types.hs | mpl-2.0 | 5,836 | 0 | 7 | 1,491 | 653 | 455 | 198 | 177 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Versions/Update.hs | mpl-2.0 | 5,206 | 0 | 18 | 1,200 | 623 | 368 | 255 | 104 | 1 |
-- "Dao/Certainty.hs" Creates a newtype of Real-number that behaves as a
-- certainty value for a neuron in a neural network.
--
-- Copyright (C) 2008-2015 Ramin Honary.
--
-- Dao 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 ... | printedheart/Dao | src/Dao/Certainty.hs | agpl-3.0 | 17,145 | 0 | 20 | 2,986 | 2,617 | 1,453 | 1,164 | 134 | 5 |
-- | Basic types used in GIR parsing.
module Data.GI.GIR.BasicTypes
( Name(..)
, Transfer(..)
, Alias(..)
, Type(..)
, BasicType(..)
) where
import Data.Text (Text)
-- | Name for a symbol in the GIR file.
data Name = Name { namespace :: Text, name :: Text }
deriving (Eq, Ord, Show)
-- | T... | ford-prefect/haskell-gi | lib/Data/GI/GIR/BasicTypes.hs | lgpl-2.1 | 2,533 | 0 | 8 | 1,099 | 348 | 230 | 118 | 51 | 0 |
module GHC.Vacuum.ClosureType.V704 ( ClosureType(..) ) where
data ClosureType
= INVALID_OBJECT
| CONSTR
| CONSTR_1_0
| CONSTR_0_1
| CONSTR_2_0
| CONSTR_1_1
| CONSTR_0_2
| CONSTR_STATIC
| CONSTR_NOCAF_STATIC
| FUN
| FUN_1_0
| FUN_0_1
| FUN_2_0
| FUN_1_1
| FUN_0_2
| FUN_STATIC
| THUNK
... | thoughtpolice/vacuum | src/GHC/Vacuum/ClosureType/V704.hs | lgpl-3.0 | 4,319 | 0 | 9 | 1,030 | 1,247 | 658 | 589 | 191 | 0 |
module Jaek.SegmentOlaps (
removeOlaps
)
where
import Jaek.Base
import qualified Data.Map as M
-- | given a list of segments @(start, duration)@, return a list of
-- non-overlapping segments, also @(start, duration)@.
removeOlaps :: [(SampleCount,Duration)] -> [(SampleCount,Duration)]
removeOlaps =
(fmap . fmap)... | JohnLato/jaek | src/Jaek/SegmentOlaps.hs | lgpl-3.0 | 1,391 | 0 | 12 | 316 | 474 | 255 | 219 | 27 | 3 |
-- Copyright 2020 Google LLC
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in ... | google/hrepl | hrepl/tests/Forwarding3.hs | apache-2.0 | 685 | 0 | 5 | 116 | 41 | 29 | 12 | 3 | 1 |
module VSelect where
import CLaSH.Prelude
topEntity :: Vec 8 Int -> Vec 4 Int
topEntity x = select d1 d2 d4 x
testInput :: Signal (Vec 8 Int )
testInput = signal (iterateI (+1) 1)
expectedOutput :: Signal (Vec 4 Int) -> Signal Bool
expectedOutput = outputVerifier ((2:>4:>6:>8:>Nil):>Nil)
| ggreif/clash-compiler | tests/shouldwork/Vector/VSelect.hs | bsd-2-clause | 293 | 0 | 12 | 52 | 138 | 71 | 67 | -1 | -1 |
{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module : Application.HXournal.Coroutine.Draw
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- P... | wavewave/hxournal | lib/Application/HXournal/Coroutine/Draw.hs | bsd-2-clause | 6,702 | 0 | 21 | 1,831 | 1,427 | 709 | 718 | 122 | 3 |
module Exercises where
-- Exercise 0 --
f0 :: (a -> Bool) -> (a -> b) -> [a] -> [b]
f0 p f xs = [f x | x <- xs, p x]
f0' :: (a -> Bool) -> (a -> b) -> [a] -> [b]
f0' p f xs = map f (filter p xs)
-- Exercise 1 --
myAllA :: (a -> Bool) -> [a] -> Bool
myAllA p xs = and (map p xs)
myAllB :: (a -> Bool) -> [a] -> Bool... | paulkeene/FP101x | chapter06/Exercises.hs | bsd-3-clause | 4,059 | 0 | 12 | 1,125 | 2,154 | 1,174 | 980 | 90 | 2 |
module Hive
( module Hive.Action
, module Hive.Board
, module Hive.Bug
, module Hive.Error
, module Hive.Game
, module Hive.Monad
, module Hive.Player
, module Hive.Tile
) where
import Hive.Action
import Hive.Board
import Hive.Bug
import Hive.Error
import Hive.Game
import Hive.Monad
import Hive.Playe... | mitchellwrosen/hive | hive/src/Hive.hs | bsd-3-clause | 339 | 0 | 5 | 63 | 94 | 60 | 34 | 17 | 0 |
-- -----------------------------------------------------------------------------
-- Copyright 2010, Eric Wong.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of s... | manyoo/Morakot | Handler.hs | bsd-3-clause | 6,879 | 0 | 16 | 1,562 | 1,211 | 646 | 565 | 84 | 3 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module ZM.Type.Bits8 where
import ZM.Type.Bit
import Flat
import Data.Model
data Bits8 =
Bits8
{ bit0 :: Bit
, bit1 :: Bit
, bit2 :: Bit
, bit3 :: Bit
, bit4 :: Bit
, bit5 :: Bit
, bit6... | tittoassini/typed | src/ZM/Type/Bits8.hs | bsd-3-clause | 411 | 0 | 8 | 153 | 107 | 67 | 40 | 17 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import System.IO
import Pipes as P
import Pipes.HTTP
import Pipes.Parse
import Pipes.ByteString as PB
import Pipes.Binary
import Data.Binary.Get
downloadRedditExample :: IO ()
downloadReddit... | johntyree/rio-hs | Main.hs | bsd-3-clause | 1,514 | 0 | 14 | 378 | 522 | 269 | 253 | 44 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveGeneric, DeriveDataTypeable, NoMonomorphismRestriction, TemplateHaskell #-}
module Types where
import Data.Word
import qualified Data.ByteString as BS
import Data.Data
import Data.Typeable
import Foreign
import Foreign.C.Types
import Foreign.Storable
import qualified Data.... | jfischoff/opengl-eval | src/OpenGL/Evaluator/Old.hs | bsd-3-clause | 20,355 | 0 | 11 | 4,861 | 3,921 | 2,144 | 1,777 | 421 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Search.API where
import Servant
import Servant.HTML.Blaze
import Text.Blaze.Html5
type SearchSite = Search
type Search = "search"
:> QueryParam "pname" String
:> Get '[HTML] Html
| hectorhon/autotrace2 | app/Search/API.hs | bsd-3-clause | 270 | 0 | 9 | 59 | 58 | 35 | 23 | 10 | 0 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
Desugaring exporessions.
-}
{-# LANGUAGE CPP #-}
module DsExpr ( dsExpr, dsLExpr, dsLocalBinds
, dsValBinds, dsLit, dsSyntaxExpr ) where
#include "HsVersions.h"
import Match
import MatchLit
import DsBinds... | vikraman/ghc | compiler/deSugar/DsExpr.hs | bsd-3-clause | 40,089 | 118 | 25 | 12,746 | 7,752 | 4,047 | 3,705 | -1 | -1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Seek (
testSeek1
, testSeek2
, testSeek1h
, testSeek2h
) where
import Data.Iteratee as I
import qualified Data.Iteratee.IO.Handle as H
import Data.Data
import Data.ByteString.Char8 (ByteString)
import ... | JohnLato/iteratee | tests/Seek.hs | bsd-3-clause | 3,073 | 0 | 17 | 651 | 887 | 450 | 437 | 77 | 6 |
module Main where
import CodeGen.LispToJs
import CodeGen.JsToStr
import Parser
import TypeChecker
import Data.List
import System.Directory
import System.Environment
import Interpret
import Ast (Program)
import Data.Foldable
doc :: [String]
doc = [ "Usage: alisp <filename> [OPTIONS]"
, ""
, " <filename> s... | davidpdrsn/alisp | src/Main.hs | bsd-3-clause | 1,575 | 0 | 14 | 516 | 451 | 235 | 216 | 53 | 4 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
module Predicates where
import Dirs
import SiteState
import StorageBackend
import Prove
import Serial
import Language.Why3.... | GaloisInc/verification-game | web-prover/src/Predicates.hs | bsd-3-clause | 14,600 | 8 | 25 | 4,213 | 3,935 | 2,084 | 1,851 | -1 | -1 |
import qualified Data.Char as Char
import qualified Data.List as List
import qualified Zora.List as ZList
prep :: [Integer] -> String
prep = map (Char.intToDigit . fromIntegral)
has_property :: String -> Bool
has_property s = and
[ ((read . ZList.subseq 1 3 $ s) `mod` 2) == 0
, ((read . ZList.subseq 2 3 $ s) `mod` ... | bgwines/project-euler | src/solved/problem43.hs | bsd-3-clause | 781 | 0 | 13 | 162 | 399 | 226 | 173 | 20 | 1 |
{-# LANGUAGE CPP #-}
module Prelude.Kai (
-- * Standard types, classes and related functions
-- ** Basic data types
Bool(False, True),
(&&), (||), not, otherwise, bool,
Void,
absurd, vacuous,
Identity(..),
Proxy(..),
asProxyTypeOf,
Maybe(Nothing, Just),
maybe,
Eith... | fumieval/prelude-kai | src/Prelude/Kai.hs | bsd-3-clause | 5,808 | 0 | 11 | 1,549 | 1,357 | 965 | 392 | 188 | 2 |
act = undefined
act1 = undefined
act2 = undefined
actN = undefined
expr1 = undefined
expr2 = undefined
exprN = undefined
doNotation1, doNotation2, doNotation3, doNotation4 :: Maybe ()
translated1, translated2, translated3, translated4 :: Maybe ()
finalTranslation2, semicolon, semicolonTranslated :: Maybe ()
{-- snip... | binesiyu/ifl | examples/ch14/Do.hs | mit | 2,093 | 0 | 13 | 686 | 427 | 235 | 192 | 63 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : ./Common/Lib/SizedList.hs
Description : lists with their size similar to Data.Edison.Seq.SizedSeq
Copyright : C. Maeder DFKI Bremen 2008
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portab... | spechub/Hets | Common/Lib/SizedList.hs | gpl-2.0 | 2,061 | 0 | 11 | 510 | 846 | 429 | 417 | 61 | 2 |
-- Copyright 2012-2013 Greg Horn
--
-- This file is part of rawesome.
--
-- rawesome is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later v... | ghorn/rawesome | wtfviz/src/PendulumOpt.hs | lgpl-3.0 | 3,850 | 0 | 26 | 924 | 1,091 | 578 | 513 | 65 | 3 |
module FunctionArgRef where
-- Test simple argument reference.
-- - @a defines/binding ParamFA
f a =
-- - @a ref ParamFA
a
-- Test pattern-matched argument reference.
-- - @a defines/binding ParamGA
-- - @b defines/binding ParamGB
g (a,b) =
-- - @a ref ParamGA
-- - @b ref ParamGB
a + b
| google/haskell-indexer | kythe-verification/testdata/basic/FunctionArgRef.hs | apache-2.0 | 309 | 0 | 6 | 75 | 38 | 25 | 13 | 5 | 1 |
-- FAILING TEST: this test SHOULD FAIL BUT DOESN'T
-- issue #519
{-# LANGUAGE DeriveFunctor #-}
module Main where
data AstIndex = IxExpr | IxType
{-@ measure isExprIndex @-}
isExprIndex :: AstIndex -> Bool
isExprIndex IxExpr = True
isExprIndex _ = False
{-@ measure isTypeIndex @-}
isTypeIndex :: AstIndex -> Bo... | ssaavedra/liquidhaskell | tests/neg/Ast.hs | bsd-3-clause | 1,179 | 0 | 9 | 311 | 182 | 107 | 75 | 20 | 1 |
{-|
Module : Idris.REPL
Description : Entry Point for the Idris REPL and CLI.
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE CPP, FlexibleContexts, PatternGuards #-}
-- FIXME: {-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
{-# OPTIONS_GHC -fwarn-unused-imports #-}
module Idris.REPL
( ide... | kojiromike/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | 72,158 | 0 | 22 | 26,602 | 22,826 | 11,113 | 11,713 | 1,403 | 77 |
module Split_output
where
import Data.Char
import Data.Maybe
import qualified Data.List as DL
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as CH
--Splits the lilac output file into strings representing that data from each run
split_byte_file :: Char -> String -> IO [BS.ByteString]
s... | schets/LILAC | src/scripts/haskell/Split_output.hs | bsd-3-clause | 1,385 | 5 | 12 | 281 | 379 | 204 | 175 | 23 | 1 |
{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes #-}
import Data.Char
import Data.ByteString (ByteString)
import Text.Papillon
import qualified Data.ByteString.Char8 as BSC
parseXmlDecl :: ByteString -> Maybe (Int, Int)
parseXmlDecl = either (const Nothing) (Just . fst) . runError . xmlDecl . parse
[papill... | YoshikuniJujo/forest | subprojects/xml-pipe/test/papillon.hs | bsd-3-clause | 846 | 0 | 10 | 163 | 141 | 79 | 62 | 14 | 1 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "dist/dist-sandbox-261cd265/build/System/Posix/Process/ByteString.hs" #-}
{-# LINE 1 "System/Posix/Process/ByteString.hsc" #-}
{-# LINE 2 "System/Posix/Process/ByteString.hsc" #-}
{-# LANGUAGE Safe #-}
{-# LINE 6 "System/Posix/Process/ByteString.hsc" #-}
----------------------... | phischu/fragnix | tests/packages/scotty/System.Posix.Process.ByteString.hs | bsd-3-clause | 4,271 | 0 | 24 | 987 | 659 | 383 | 276 | 78 | 3 |
module Main where
import Numeric
import Data.Char
import System.Random (randomRIO)
import System.Directory
data TestNumber = Rnd Integer Integer | Fixed Integer deriving Show
rndLong :: TestNumber
rndLong = Rnd (2 ^ 30) (2 ^ 60)
rndSmallInt :: TestNumber
rndSmallInt = Rnd 0 5000
tests :: [[TestNumber]]
tests = har... | TelerikAcademy-Cloning/CSharp-Part-2 | Exams/2016-12-07/2016-12-07-Morning/1. Functional Numeral System/TestGen.hs | mit | 3,176 | 0 | 14 | 1,188 | 1,072 | 574 | 498 | 74 | 2 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}
{- |
Module : $Header$
Description : coding out subsorting
Copyright : (c) C. Maeder DFKI GmbH 2012
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : ... | keithodulaigh/Hets | Comorphisms/ExtModal2ExtModalTotal.hs | gpl-2.0 | 4,036 | 0 | 15 | 823 | 852 | 450 | 402 | 79 | 1 |
{-# LANGUAGE QuasiQuotes, FlexibleInstances #-}
module View where
import Str(str)
import Acl
import Util
import Console
import Diff
-- LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class')
-- LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog')
vi... | sourcewave/pg-schema-diff | Rule.hs | unlicense | 4,697 | 0 | 15 | 883 | 839 | 447 | 392 | 42 | 3 |
{-
Copyright 2015 Google Inc. 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-2.0
Unless required by applicable law or a... | xwysp/codeworld | codeworld-base/src/GHC/ConsoleHandler.hs | apache-2.0 | 751 | 0 | 4 | 136 | 23 | 17 | 6 | 4 | 0 |
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for... | nomeata/ghc | compiler/nativeGen/RegAlloc/Linear/Stats.hs | bsd-3-clause | 2,425 | 66 | 22 | 491 | 731 | 406 | 325 | 62 | 5 |
module PackageTests.BuildDeps.InternalLibrary1.Check where
import PackageTests.PackageTester
import System.FilePath
import Test.Tasty.HUnit
suite :: FilePath -> Assertion
suite ghcPath = do
let spec = PackageSpec
{ directory = "PackageTests" </> "BuildDeps" </> "InternalLibrary1"
, config... | corngood/cabal | Cabal/tests/PackageTests/BuildDeps/InternalLibrary1/Check.hs | bsd-3-clause | 448 | 0 | 13 | 109 | 98 | 54 | 44 | 12 | 1 |
{-# LANGUAGE RecordWildCards #-}
-- | Data pagination.
module Data.Pagination where
import Data.Default
import Data.Maybe
import Safe
import Network.URI
import Network.URI.Params
-- | A pagination object, holds information about the name, total, per
-- page, current page, etc.
data Pagination = Pagination
{ pnTo... | chrisdone/haskellnews | upstream/snap-app/src/Data/Pagination.hs | bsd-3-clause | 1,565 | 0 | 14 | 447 | 377 | 205 | 172 | 39 | 2 |
{-+
Knot-tying definitions for the base+property+typeinfo syntax to Isabelle
translation.
-}
module PropDecorate2Isabelle where
import BaseStruct2Isabelle(transP,transD,transE,transId)
import PropStruct2Isabelle(transPD,transPA,transPP)
import Prop2Isabelle(transQType,transType,transContext)
import qualified Prop2Isab... | forste/haReFork | tools/hs2isabelle/PropDecorate2Isabelle.hs | bsd-3-clause | 1,956 | 0 | 10 | 335 | 514 | 273 | 241 | 39 | 2 |
-- stolen from Haddock's Types.hs
module Distribution.Server.Pages.Package.HaddockTypes where
data Doc id
= DocEmpty
| DocAppend (Doc id) (Doc id)
| DocString String
| DocParagraph (Doc id)
| DocIdentifier id
| DocModule String
| DocEmphasis (Doc id)
| DocMonospaced (Doc id)
| DocUnorderedList [Doc i... | ocharles/hackage-server | Distribution/Server/Pages/Package/HaddockTypes.hs | bsd-3-clause | 1,389 | 0 | 11 | 363 | 373 | 222 | 151 | 38 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ImplicitParams #-}
module Distribution.Compat.Stack (
WithCallStack,
CallStack,
annotateCallStackIO,
withFrozenCallStack,
withLexicalCallStack,
callStack,
prettyCallStack,
parentSrcLocPrefix
) where
import System.IO.Error
#i... | themoritz/cabal | Cabal/Distribution/Compat/Stack.hs | bsd-3-clause | 3,192 | 0 | 11 | 563 | 407 | 232 | 175 | 33 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module T5358 where
import Language.Haskell.TH
t1, t2 :: Int
t1 x = x
t2 x = x
prop_x1 x = t1 x == t2 x
$(return [])
runTests = $( do VarI _ t _ <- reify (mkName "prop_x1")
error $ ("runTest called error: " ++ pprint t)
)
| ezyang/ghc | testsuite/tests/th/T5358.hs | bsd-3-clause | 288 | 0 | 12 | 87 | 113 | 57 | 56 | 10 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
module Data.FreeAgent.Types.Notes where
import qualified Data.ByteString as BS
import Control.Applicative ((<$>), (<*>), empty)
import Control.Lens
import Data.Aeson
import ... | perurbis/hfreeagent | src/Data/FreeAgent/Types/Notes.hs | mit | 1,199 | 0 | 17 | 373 | 251 | 147 | 104 | 30 | 0 |
{-
The MIT License (MIT)
Copyright (c) 2015 Wasif Hasan Baig <pr.wasif@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to u... | baig/pandoc-csv2table | src/Text/Table/Definition.hs | mit | 3,812 | 0 | 7 | 1,002 | 355 | 235 | 120 | 49 | 0 |
module Spear.Math.Circle
where
import Spear.Math.Vector
import Data.List (foldl')
-- | A circle in 2D space.
data Circle = Circle
{ center :: {-# UNPACK #-} !Vector2
, radius :: {-# UNPACK #-} !Float
}
-- | Create a circle from the given points.
circle :: [Vector2] -> Circle
circle [] = C... | jeannekamikaze/Spear | Spear/Math/Circle.hs | mit | 715 | 0 | 10 | 201 | 239 | 132 | 107 | 15 | 1 |
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Translate where
import IRC.Types
import CAH.Cards.Types
import Data.Monoid
import qualified Data.Text as T
import Data.Text (Text)
int :: Integer -> Text
int = T.pack . show
showCards :: [(Integer,WhiteCard)] -> Text
show... | EXio4/ircah | src/Translate.hs | mit | 4,005 | 0 | 15 | 1,597 | 1,121 | 551 | 570 | 88 | 27 |
-- Find the unique number
-- https://www.codewars.com/kata/585d7d5adb20cf33cb000235
module FindUniqueDouble.JorgeVS.Kata where
findUnique :: [Double] -> Double
findUnique (x:y:z:xs) | (x == y) && (y == z) = head . filter (not . (== x)) $ xs
| y == z = x
| x == z = y
... | gafiatulin/codewars | src/6 kyu/FindUniqueDouble.hs | mit | 351 | 0 | 11 | 119 | 125 | 66 | 59 | 6 | 1 |
module DNA (nucleotideCounts) where
import Data.Foldable (foldl')
import Data.Map.Strict (Map, fromList, insertWith, member)
import qualified Data.Map.Strict as M
nucleotideCounts :: String -> Either String (Map Char Int)
nucleotideCounts = foldl' f (Right empty)
where
empty :: Map Char Int
... | genos/online_problems | exercism/haskell/nucleotide-count/src/DNA.hs | mit | 593 | 0 | 11 | 151 | 245 | 137 | 108 | 11 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.