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 |
|---|---|---|---|---|---|
-- Statistics for an Athletic Association
-- http://www.codewars.com/kata/55b3425df71c1201a800009c/
module Codewars.G964.Stat where
import Data.List (sort, intercalate)
import Data.List.Split (split, dropDelims, oneOf)
import Text.Printf (printf)
stat :: String -> String
stat "" = ""
stat results = present . map ((s... | gafiatulin/codewars | src/6 kyu/Stat.hs | Haskell | mit | 1,191 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module System.Etc.Resolver.Cli.CommandTest where
import RIO
import qualified RIO.Set as Set
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertBool, assertEqual, assertFai... | roman/Haskell-etc | etc/test/System/Etc/Resolver/Cli/CommandTest.hs | Haskell | mit | 11,878 |
{-# LANGUAGE Arrows, NoMonomorphismRestriction, RebindableSyntax #-}
module System.ArrowVHDL.Circuit.Defaults where
import Control.Category
import Prelude hiding (id, (.))
import qualified Data.Bits as B -- (shiftL, shiftR, xor, (.&.))
import System.ArrowVHDL.Circuit
import System.ArrowVHDL.Circuit.Grid
import Sys... | frosch03/arrowVHDL | src/System/ArrowVHDL/Circuit/Defaults.hs | Haskell | cc0-1.0 | 12,752 |
module ProjectEuler.A268681 (a268681) where
import Data.List (nub)
import Tables.A007318 (a007318_row)
a268681 :: Integer -> Integer
a268681 n = sum $ filter squareFree $ nub $ concatMap a007318_row [0..n-1] where
squareFree k = all (\d -> k `mod` d /= 0) $ map (^2) [2..20]
| peterokagey/haskellOEIS | src/ProjectEuler/A268681.hs | Haskell | apache-2.0 | 280 |
module Helpers.CostasLikeArrays (countPermutationsUpToDihedralSymmetry, distinctDirections, distinctDistances) where
import Data.List (elemIndex, nub)
import Data.Maybe (mapMaybe)
import Data.Ratio ((%))
import Helpers.Subsets (eachPair)
type Permutation = [Int]
distinctDistances :: Permutation -> Int
distinctDistanc... | peterokagey/haskellOEIS | src/Helpers/CostasLikeArrays.hs | Haskell | apache-2.0 | 1,882 |
-- Show expressions in prefix notation
module OperationExtension1 where
import DataBase
import DataExtension
instance Show Lit
where
show (Lit i) = "Lit " ++ show i
instance (Exp x, Exp y, Show x, Show y) => Show (Add x y)
where
show (Add x y) = "Add (" ++ show x ++ ") (" ++ show y ++ ")"
instance (Exp x, S... | egaburov/funstuff | Haskell/tytag/xproblem_src/samples/expressions/Haskell/OpenDatatype1/OperationExtension1.hs | Haskell | apache-2.0 | 392 |
module Time where
import Data.IORef (readIORef, IORef, newIORef, modifyIORef')
import Control.Monad
import qualified Graphics.UI.GLUT as GLUT
import Concurrency (writeIORef)
type FloatType = Float
type Time = FloatType
type DTime = FloatType
type TimeIORef = IORef Time
newTimeIORef :: IO TimeIORef
newTimeIORef =... | epeld/zatacka | old/Time.hs | Haskell | apache-2.0 | 628 |
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Version
-- Copyright : (c) Simon Marlow 2003
-- License : BSD-like
--
-- Maintainer : haddock@projects.haskell.org
-- Stability : experimental
-- Portability : portable
----------------------------... | ghcjs/haddock-internal | src/Haddock/Version.hs | Haskell | bsd-2-clause | 705 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
-- |
-- Module : FRP.Animas.Vector3
-- Copyright : (c) Antony Courtney and Henrik Nilsson, Yale University, 2003
-- License : BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer : nilsson@cs.yale.edu
-- Stability : provisiona... | eamsden/Animas | src/FRP/Animas/Vector3.hs | Haskell | bsd-3-clause | 3,576 |
{-# LANGUAGE LambdaCase, OverloadedStrings #-}
-- | Bash script evaluation.
module Bash.Config.Eval
( Eval(..)
, interpret
) where
import Control.Applicative
import Control.Monad.Reader.Class
import Control.Monad.State.Class
import Data.Map (Map)
im... | knrafto/bash-config | src/Bash/Config/Eval.hs | Haskell | bsd-3-clause | 5,812 |
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
module Silvi
( module Silvi.Encode
, module Silvi.Random
, module Silvi.Types
) where
import Silvi.Encode
import Silvi.Random
import Silvi.Types
| chessai/silvi | src/Silvi.hs | Haskell | bsd-3-clause | 203 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.FramebufferMultisampleCoverage
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stab... | haskell-opengl/OpenGLRaw | src/Graphics/GL/NV/FramebufferMultisampleCoverage.hs | Haskell | bsd-3-clause | 959 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Module : SMSAero.Types
-- Copyright : (c) 2016, GetShopTV
-- License : BSD3
-- Maintainer : nickolay@getshoptv.com
-- Stability : experimental
--
-- This module defi... | GetShopTV/smsaero | src/SMSAero/Types.hs | Haskell | bsd-3-clause | 4,219 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
import Control.Applicative
import Control.Exception
import Control.Monad
import Data.List
import Data.Traversable (for)
import Distribution.PackageDescription
import Distribution.Simple
import Distribution.Simple.BuildPaths
import Distribution.Simple.Loca... | sethfowler/hslibvoyeur | Setup.hs | Haskell | bsd-3-clause | 5,766 |
-- | This module exports the types used to create flag writes.
module Data.Factual.Write.Flag
(
-- * Flag type
Flag(..)
-- * Problem type
, Problem(..)
-- * Required modules
, module Data.Factual.Shared.Table
) where
import Data.Factual.Write
import Data.Factual.Shared.Table
import Data.Maybe (... | rudyl313/factual-haskell-driver | Data/Factual/Write/Flag.hs | Haskell | bsd-3-clause | 2,737 |
module Language.SequentCore.Driver.Flags (
SeqFlags(..), SeqDumpFlag(..), SeqGeneralFlag(..),
FloatOutSwitches(..), FinalPassSwitches(..), ContifySwitches(..),
sgopt, sgopt_set, sgopt_unset,
sdopt, sdopt_set, sdopt_unset,
parseSeqFlags
) where
import CmdLineParser
import FastString
import MonadUtils
im... | lukemaurer/sequent-core | src/Language/SequentCore/Driver/Flags.hs | Haskell | bsd-3-clause | 13,520 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS -fno-warn-name-shadowing #-}
module Snap.Snaplet.Fay (
Fay
, initFay
, fayServe
, fayax
, toFayax
, fromFayax
) where
import Control.Applicative
import Control.M... | bergmark/snaplet-fay | src/Snap/Snaplet/Fay.hs | Haskell | bsd-3-clause | 6,274 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module Kiosk.Backend.Data ( DataTemplateEntry (..)
, DataTemplateEntryKey (..)
, DataTemplate (..)
... | plow-technologies/cobalt-kiosk-data-template | src/Kiosk/Backend/Data.hs | Haskell | bsd-3-clause | 959 |
module Day2 where
import Test.Hspec
import Utils
import qualified Text.Megaparsec.String as P
import qualified Text.Megaparsec as P
-- Input DSL
data Instruction = U | D | L | R deriving (Show)
-- Parsing
parser :: P.Parser [[Instruction]]
parser = P.sepBy (P.many (parserInstruction)) (P.string "\n")
parserInstru... | guibou/AdventOfCode2016 | src/Day2.hs | Haskell | bsd-3-clause | 2,376 |
module Handler.RemoveDeck where
import Kerchief.Prelude
import Prelude hiding (putStrLn)
import System.Directory (removeFile)
import System.FilePath ((</>))
import Kerchief (Kerchief, getDecksDir)
import Utils (askYesNo, getDirectoryContents')
handleRemoveDeck :: [String] -> Kerchief ()
handleRe... | mitchellwrosen/kerchief | src/Handler/RemoveDeck.hs | Haskell | bsd-3-clause | 1,119 |
{-|
Description: helpers for matching requests
contains various matching utilities
-}
{-# LANGUAGE TupleSections #-}
module Web.Respond.Request where
import Network.Wai
import qualified Data.ByteString.Lazy as LBS
import Control.Applicative ((<$>))
import Control.Monad.IO.Class (liftIO)
import qualified Network.HTTP... | raptros/respond | src/Web/Respond/Request.hs | Haskell | bsd-3-clause | 4,720 |
{-# LANGUAGE DeriveDataTypeable #-}
import qualified Data.ByteString.Lazy.Char8 as B
import System.Console.CmdArgs
import System.Exit
import Text.WikiEngine
import qualified Text.Blaze.Renderer.Utf8 as RenderUtf8 (renderHtml)
import qualified Text.Blaze.Renderer.Pretty as RenderPretty (renderHtml)
import qualified ... | vincenthz/wikiengine | Wikihtml.hs | Haskell | bsd-3-clause | 1,567 |
import Common.Numbers.Numbers (powMod)
main = print $ 1 + (28433 * (powMod 2 (7830457 :: Int) modulo) `mod` modulo) where
modulo = 10^10 :: Integer
| foreverbell/project-euler-solutions | src/97.hs | Haskell | bsd-3-clause | 154 |
{-# LANGUAGE PatternGuards, ViewPatterns, CPP, ScopedTypeVariables #-}
module General.Util(
PkgName, ModName,
URL,
pretty, parseMode, applyType, applyFun1, unapplyFun, fromName, fromQName, fromTyVarBind, declNames, isTypeSig,
fromDeclHead, fromContext, fromIParen, fromInstHead,
tarballReadFiles,
... | ndmitchell/hoogle | src/General/Util.hs | Haskell | bsd-3-clause | 12,086 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UndecidableInstances #-}
module Web.Zwaluw.Regular
( mkRouters
, Routers
, RouterList(..)
-- * Re-exported from Generics.Regular
, deriveAll
, PF
... | MedeaMelana/Zwaluw | Web/Zwaluw/Regular.hs | Haskell | bsd-3-clause | 2,485 |
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
module Database.Riak.Protocol.GetBucketRequest (GetBucketRequest(..)) where
import Prelude ((+), (/))
import qualified Prelude as Prelude'
import qualified Data.Typeable as Prelude'
import qualified Data.Data as Prelude'
import ... | iand675/hiker | Database/Riak/Protocol/GetBucketRequest.hs | Haskell | bsd-3-clause | 3,116 |
{-# language CPP #-}
-- No documentation found for Chapter "Exception"
module OpenXR.Exception (OpenXrException(..)) where
import GHC.Exception.Type (Exception(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
-- | This exception is thrown from calls to marshalled Vulkan c... | expipiplus1/vulkan | openxr/src/OpenXR/Exception.hs | Haskell | bsd-3-clause | 719 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.ShadingLanguageInclude
-- Copyright : (c) Sven Panne 2014
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.co... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/ShadingLanguageInclude.hs | Haskell | bsd-3-clause | 2,366 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# L... | ekmett/hask | old/src/Hask/Power.hs | Haskell | bsd-3-clause | 4,423 |
-- Copyright (c) 2017 Eric McCorkle. All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
--
-- 1. Redistributions of source code must retain the above copyright
-- notice, this list of conditi... | emc2/chill | src/IR/FlatIR/Syntax.hs | Haskell | bsd-3-clause | 60,607 |
{-# OPTIONS #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.Py.ParserMonad
-- Copyright : (c) 2009 Bernie Pope
-- License : BSD-style
-- Maintainer : bjpop@csse.unimelb.edu.au
-- Stability : experimental
-- Portability : ghc
--
-- Monad support ... | codeq/language-py | src/Language/Py/ParserMonad.hs | Haskell | bsd-3-clause | 5,757 |
-- |
-- Module : Crypto.PubKey.DSA
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : Good
--
-- An implementation of the Digital Signature Algorithm (DSA)
{-# LANGUAGE DeriveDataTypeable #-}
module Crypto.PubKey.DSA
( Params(..)
,... | tekul/cryptonite | Crypto/PubKey/DSA.hs | Haskell | bsd-3-clause | 5,630 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Provide ability to upload tarballs to Hackage.
module Stack.Upload
( -- * Upload
upload
, uploadBytes
, uploadRevi... | MichielDerhaeg/stack | src/Stack/Upload.hs | Haskell | bsd-3-clause | 8,635 |
module Models where
import Data.Monoid
import Language.Haskell.TH
import qualified Data.Text as Text
import Database.Persist.Quasi
import Database.Persist.Quasi.Internal
import Database.Persist.TH
import Database.Persist.Sql
-- TODO: we use lookupName and reify etc which breaks in IO. somehow need to
-- test this ou... | yesodweb/persistent | persistent/bench/Models.hs | Haskell | mit | 1,640 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
module DTypes.Classes.DTraversable
( DTraversable (..)
, dtraverse'
, dsequenceA'
, dtoList
) where
import DTypes.Classes.DFunctor
import DTypes.Compose
import DTypes.Trafo
import Data.Functor.Identit... | timjb/ftypes | src/DTypes/Classes/DTraversable.hs | Haskell | mit | 1,725 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module Tinc.Cache (
Cache
, CachedPackage(..)
, readCache
, findReusablePackages
, cachedExecutables
, populateCache
#ifdef TEST
, PopulateCacheAction(..)
, populateCacheAction
, PackageLocation... | haskell-tinc/tinc | src/Tinc/Cache.hs | Haskell | bsd-3-clause | 7,770 |
{-# LANGUAGE GeneralizedNewtypeDeriving, ConstraintKinds, PatternGuards, TupleSections #-}
module Idris.ParseExpr where
import Prelude hiding (pi)
import Text.Trifecta.Delta
import Text.Trifecta hiding (span, stringLiteral, charLiteral, natural, symbol, char, string, whiteSpace, Err)
import Text.Parser.LookAhead
impo... | NightRa/Idris-dev | src/Idris/ParseExpr.hs | Haskell | bsd-3-clause | 52,579 |
{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Array.Lens
-- Copyright : (C) 2012-16 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : provisional
-... | ddssff/lens | src/Data/Array/Lens.hs | Haskell | bsd-3-clause | 1,120 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.LineSegments
-- Copyright : (c) Sven Panne 2002-2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portable
-... | hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/LineSegments.hs | Haskell | bsd-3-clause | 6,619 |
------------------------------------------------------------------------------
--
-- Haskell: The Craft of Functional Programming, 3e
-- Simon Thompson
-- (c) Addison-Wesley, 1996-2011.
--
-- Chapter 10
--
-------------------------------------------------------------------------
-- Generalization: patterns of com... | c089/haskell-craft3e | Chapter10.hs | Haskell | mit | 4,289 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Stack.Constants.Config
( distDirFromDir
, workDirFromDir
, distRelativeDir
, imageStagingDir
, projectDockerSandboxDir
, configCacheFile
, configCabalMod
, buildCachesDir
, testSuccessFile
,... | anton-dessiatov/stack | src/Stack/Constants/Config.hs | Haskell | bsd-3-clause | 5,034 |
module Stack.Options.TestParser where
import Data.Maybe
import Data.Monoid.Extra
import Options.Applicative
import Options.Applicative.Args
import Options.Applicative.Builder.Extra
import Stack.Options.Utils
import Stack.Types.Config
-- | Parser fo... | AndreasPK/stack | src/Stack/Options/TestParser.hs | Haskell | bsd-3-clause | 1,314 |
{-# LANGUAGE CPP, Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude, MagicHash, StandaloneDeriving, BangPatterns,
KindSignatures, DataKinds, ConstraintKinds,
MultiParamTypeClasses, FunctionalDependencies #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
-- ip :: IP x a => a is strictly speaking ambigu... | snoyberg/ghc | libraries/ghc-prim/GHC/Classes.hs | Haskell | bsd-3-clause | 37,767 |
{-# LANGUAGE Arrows #-}
module CmdFail006 where
f = proc x -> ~(_ -< _)
| sdiehl/ghc | testsuite/tests/parser/should_fail/cmdFail006.hs | Haskell | bsd-3-clause | 73 |
<?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="pl-PL">
<title>Technology detection | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | kingthorin/zap-extensions | addOns/wappalyzer/src/main/javahelp/org/zaproxy/zap/extension/wappalyzer/resources/help_pl_PL/helpset_pl_PL.hs | Haskell | apache-2.0 | 984 |
module E.Annotate where
import Control.Monad.Reader
import Data.Monoid
import qualified Data.Traversable as T
import E.E
import E.Program
import E.Subst
import GenUtil
import Info.Info(Info)
import Name.Id
import Util.HasSize
import Util.SetLike
annotateCombs :: forall m . Monad m =>
(IdMap (Maybe E))
-> (Id... | m-alvarez/jhc | src/E/Annotate.hs | Haskell | mit | 6,286 |
{-# LANGUAGE CPP, MagicHash #-}
-- | Dynamically lookup up values from modules and loading them.
module DynamicLoading (
#ifdef GHCI
-- * Loading plugins
loadPlugins,
-- * Force loading information
forceLoadModuleInterfaces,
forceLoadNameModuleInterface,
forceLoadTyCon,... | urbanslug/ghc | compiler/main/DynamicLoading.hs | Haskell | bsd-3-clause | 10,751 |
{-# LANGUAGE PolyKinds , GADTs, ScopedTypeVariables, PatternSynonyms,
ViewPatterns #-}
module T12968 where
data TypeRep (a :: k)
data TRAppG (fun :: k2) where
TRAppG :: forall k1 k2 (a :: k1 -> k2) (b :: k1) .
TypeRep a -> TypeRep b -> TRAppG (a b)
pattern TRApp :: forall k2 (fun :: k2). ()
... | sdiehl/ghc | testsuite/tests/patsyn/should_compile/T12968.hs | Haskell | bsd-3-clause | 515 |
module Distribution.Simple.Test.LibV09
( runTest
-- Test stub
, simpleTestStub
, stubFilePath, stubMain, stubName, stubWriteLog
, writeSimpleTestStub
) where
import Distribution.Compat.CreatePipe ( createPipe )
import Distribution.Compat.Environment ( getEnvironment )
import... | DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/Test/LibV09.hs | Haskell | bsd-3-clause | 10,854 |
module B4 (myFringe) where
import D4 hiding (sumSquares)
import qualified D4
instance SameOrNot Float
where
isSameOrNot a b = a == b
isNotSame a b = a /= b
myFringe :: (Tree a) -> [a]
myFringe (Leaf x) = [x]
myFringe (Branch left right) = myFringe right
sumSquares ((x : xs)) = (x ^ 2) + (sumSquares ... | kmate/HaRe | old/testing/renaming/B4_AstOut.hs | Haskell | bsd-3-clause | 343 |
{-# OPTIONS -fglasgow-exts -O -dshow-passes #-}
module Foo where
import GHC.Base
foo :: Int -> Int
foo (I# n#) = bar i i
where i# = n# +# 1#
i = I# i#
bar :: Int -> Int -> Int
{-# INLINE [0] bar #-}
bar _ n = n
{- The trouble here was
*** Simplify:
Result size = 25
Result size ... | ezyang/ghc | testsuite/tests/eyeball/inline2.hs | Haskell | bsd-3-clause | 810 |
module P004Spec where
import qualified P004 as P
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "isPalindrome" $
it "回文数判定" $ do
let t = True
let f = False
let input = [0, 1, 9, 10, 11, 12, 21, 22, 100, 101, 111, 112, 121, 1001, 1010, 2022, 3303, 4444, 4554]... | yyotti/euler_haskell | test/P004Spec.hs | Haskell | mit | 747 |
#!/usr/bin/env runhaskell
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- import Control.Monad
-- import Data.Functor
-- import Data.Maybe
-- import Data.Monoid
import Debug.Trace
import qualified Data.Text as T
import qualified Data.... | sourcegraph/srclib-haskell | process-all-dependencies.hs | Haskell | mit | 2,199 |
import Control.Monad (unless)
import Test.Hspec (Spec, describe, expectationFailure, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import House (rhyme)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
specs = describe "rhyme" $ do... | exercism/xhaskell | exercises/practice/house/test/Tests.hs | Haskell | mit | 4,864 |
-- CamelCase Method
-- https://www.codewars.com/kata/587731fda577b3d1b0001196
module CamelCase.JorgeVS.Kata where
import Data.Char (toUpper)
camelCase :: String -> String
camelCase = concatMap (\(x:xs) -> toUpper x:xs) . words
| gafiatulin/codewars | src/6 kyu/CamelCase.hs | Haskell | mit | 230 |
{-# LANGUAGE OverloadedStrings #-}
module InTheKnow.Routes.Common.Templates (
base
) where
import Prelude hiding (head, div)
import Text.Blaze.Html5 hiding (base)
import qualified Text.Blaze.Html5.Attributes as A
import Data.Text (Text)
import Data.Monoid ((<>))
base :: Text -> Html -> Html
base t content =
doc... | jb55/intheknow | InTheKnow/Routes/Common/Templates.hs | Haskell | mit | 488 |
{-# LANGUAGE RecordWildCards #-}
{- |
Generate and solve friction constraints for colliding objects.
-}
module Physics.Constraints.Contact.Friction where
import Control.Lens
import Physics.Constraint
import Physics.Constraints.SolutionProcessors
import Physics.Constraints.Type... | ublubu/shapes | shapes/src/Physics/Constraints/Contact/Friction.hs | Haskell | mit | 1,593 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module Database.Persist.Sql.Raw where
import Database.Persist
import Database.Persist.Sql.Types
import Database.Persist.Sql.Class
import qualified Data.Map as Map
import Control.Monad.IO.Class (MonadIO, liftIO)
import... | junjihashimoto/persistent | persistent/Database/Persist/Sql/Raw.hs | Haskell | mit | 6,836 |
{-
**************************************************************
* Filename : RegTypes.hs *
* Author : Markus Forsberg *
* d97forma@dtek.chalmers.se *
* Last Modified : 5 July, 2001 ... | SAdams601/ParRegexSearch | test/fst-0.9.0.1/FST/RegTypes.hs | Haskell | mit | 7,853 |
-- Tube strike options calculator
-- http://www.codewars.com/kata/568ade64cfd7a55d9300003e/
module Codewars.Kata.Tube where
import Codewars.Kata.Tube.Types
calculator :: Double -> Double -> Double -> Decision
calculator distance busDrive busWalk | 60 * (distance / 5) < 10 = Walk
... | gafiatulin/codewars | src/7 kyu/Tube.hs | Haskell | mit | 504 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module RLPTest where
import Control.Monad (sequence)
import Data.Aeson
import Data.Aeson.Types (typeMismatch)
import Data.ByteString
import qualified Data.By... | iostat/relapse | test/RLPTest.hs | Haskell | mit | 3,532 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Spark.Core.ColumnSpec where
import Test.Hspec
import Data.List.NonEmpty(NonEmpty( (:|) ))
import Spark.Core.Context
import Spark.Core.Dataset
import Spark.Core.Column
import Spark.Core.Row
import Spark.Core.Functions
import Spark.Core.C... | krapsh/kraps-haskell | test-integration/Spark/Core/ColumnSpec.hs | Haskell | apache-2.0 | 1,901 |
import Prelude ((+),(-),(==),(/=),(*),($),(.),(++),(&&),(||),(!!),div,mod,map,take,splitAt,replicate,length,fromIntegral,drop,head,Eq,Show)
import Data.ByteString (ByteString(..),append,cons,pack)
import Data.Word (Word8(..))
import Crypto.Hash.SHA256
type Bool = Word8
data Node = Terminal {h::ByteString, s::[Bool], v:... | andres-erbsen/dename | utils/hsverify/cbht.hs | Haskell | apache-2.0 | 1,686 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Kubernetes.V1.PersistentVolume where
import GHC.Generics
import Data.Text
import Kubernetes.V1.ObjectMeta
import Kubernetes.V1.PersistentVolume... | minhdoboi/deprecated-openshift-haskell-api | kubernetes/lib/Kubernetes/V1/PersistentVolume.hs | Haskell | apache-2.0 | 2,004 |
module EdictDB where
import System.IO
import qualified Data.Text as DT
import Data.Text.Encoding
import qualified Data.ByteString.Char8 as C
type Word = (String, Char)
dbLookup :: String -> Maybe Word
dbLookup = undefined
returnLine :: IO String -> String
returnLine = undefined
getDict :: IO String
getDict = do
... | MarkMcCaskey/Refcon | EdictDB.hs | Haskell | apache-2.0 | 468 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Store (Id, Url, FileType, genId, genPut, put, get) where
import Control.Monad.Trans.AWS
(sinkBody, runResourceT, runAWST, send, presignURL, newEnv
,Env, Seconds, toBody, RqBody, Region(..), Credentials(..))
import Network.AWS.S3
(getObje... | svanderbleek/media-server | src/Store.hs | Haskell | bsd-3-clause | 2,245 |
-- |Type aliases used throughout the crypto-api modules.
module Crypto.Types where
import Data.ByteString as B
import Data.ByteString.Lazy as L
-- |The length of a field (usually a ByteString) in bits
type BitLength = Int
-- |The length fo a field in bytes.
type ByteLength = Int
| ekmett/crypto-api | Crypto/Types.hs | Haskell | bsd-3-clause | 283 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Web.RTBBidder.Types.Request.Video (Video(..)) where
import qualified Data.Aeson as AESON
import Data.Aeson ((.=), (.:), (.:?), (.!=))
import qualified Data.Text as TX
import Web.RTBBidder.Types.Request.Banner (Banner(..))
data Video = Video
... | hiratara/hs-rtb-bidder | src/Web/RTBBidder/Types/Request/Video.hs | Haskell | bsd-3-clause | 3,366 |
{-
(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,... | sgillespie/ghc | compiler/simplCore/Simplify.hs | Haskell | bsd-3-clause | 124,418 |
module Bot where
import Args
import Control.Applicative.Trans.Either
import Control.Concurrent.WriteSem
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception (catchJust)
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Reader
i... | intolerable/intolerable-bot | src/Bot.hs | Haskell | bsd-3-clause | 10,673 |
{-# LANGUAGE RecordWildCards #-}
module Task where
import Text.Printf
import Simulation.Aivika
import Data.Functor
data System = System {
processingDistribution :: (String, Parameter Double)
, bufferCapacity :: Int
}
data Input = Input {
generationDistribution :: (String, Parameter Double)
, inputSystem... | NCrashed/bmstu-aivika-tutorial-01 | src/Task.hs | Haskell | bsd-3-clause | 3,365 |
import System.Environment (getArgs)
import Data.List.Split (splitOn)
import Data.Bits (testBit)
compareBits :: [Int] -> String
compareBits [i, a, b] | testBit i (a - 1) == testBit i (b - 1) = "true"
| otherwise = "false"
main :: IO ()
main = do
[inpFile]... | nikai3d/ce-challenges | easy/position.hs | Haskell | bsd-3-clause | 442 |
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
{-# LANGUAGE PatternGuards, ScopedTypeVariables #-}
{-# LANGUAGE RecordWildCards, TemplateHaskell #-}
{- |
Module: Database.PostgreSQL.Simple.FromField
Copyright: (c) 2011 MailRank, Inc.... | avieth/postgresql-simple | src/Database/PostgreSQL/Simple/FromField.hs | Haskell | bsd-3-clause | 24,587 |
{-
Copyright (c) 2004, Philippa Jane Cowderoy
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 source code must retain the above copyright notice,
this list of conditions ... | nh2/flippi | src/RecentChanges.hs | Haskell | bsd-3-clause | 4,025 |
module Main (main) where
import System.Environment (getArgs)
import Language.Java.Paragon.Error
import Language.Java.Paragon.Interaction.Flags
import Language.Java.Paragon.Parac
-- | Main method, invokes the compiler
main :: IO ()
main = do
(flags, files) <- compilerOpts =<< getArgs
mapM_ (compileFile flags) fil... | bvdelft/paragon | src/Language/Java/Paragon.hs | Haskell | bsd-3-clause | 812 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-|
Module : Numeric.AERN.RefinementOrder.ApproxOrder
Description : Comparisons with semidecidable order
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental... | michalkonecny/aern | aern-order/src/Numeric/AERN/RefinementOrder/PartialComparison.hs | Haskell | bsd-3-clause | 8,565 |
{-# LANGUAGE OverloadedStrings #-}
module Api
( app
) where
import Control.Applicative ((<$>))
import Control.Monad (when)
import Data.Maybe (isNothing)
import Data.Text ()
import qualified Database.Persist.Sqlite as P
import ... | fujimura/spot | src/Api.hs | Haskell | bsd-3-clause | 1,675 |
{-|
Module : Idris.Erasure
Description : Utilities to erase irrelevant stuff.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE PatternGuards #-}
module Idris.Erasure (performUsageAnalysis, mkFieldName) where
import Idris.AbsSyntax
import Idris.ASTUtils
import Idris.Core.CaseTre... | enolan/Idris-dev | src/Idris/Erasure.hs | Haskell | bsd-3-clause | 22,527 |
{-# LANGUAGE CPP #-}
-- |Routines for integrating Tor with the standard network library.
module Tor.NetworkStack.System(systemNetworkStack) where
import Data.Binary.Put
import Data.ByteString(ByteString)
import Data.ByteString.Lazy(toStrict)
import qualified Data.ByteString as BS
import Data.Word
import Network(listen... | GaloisInc/haskell-tor | src/Tor/NetworkStack/System.hs | Haskell | bsd-3-clause | 2,757 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Examples.Misc.Floating
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Several examples involving IEEE-754 floating point number... | Copilot-Language/sbv-for-copilot | Data/SBV/Examples/Misc/Floating.hs | Haskell | bsd-3-clause | 6,829 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Program : prim4.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:47
Warning : this file is machine generated - do not mod... | uduki/hsQt | examples/prim4.hs | Haskell | bsd-2-clause | 1,841 |
{-# LANGUAGE CPP #-}
-- | Handy functions for creating much Core syntax
module MkCore (
-- * Constructing normal syntax
mkCoreLet, mkCoreLets,
mkCoreApp, mkCoreApps, mkCoreConApps,
mkCoreLams, mkWildCase, mkIfThenElse,
mkWildValBinder, mkWildEvBinder,
sortQuantVars, cast... | TomMD/ghc | compiler/coreSyn/MkCore.hs | Haskell | bsd-3-clause | 31,850 |
{-# LANGUAGE CPP, GADTs #-}
-----------------------------------------------------------------------------
--
-- Pretty-printing of Cmm as C, suitable for feeding gcc
--
-- (c) The University of Glasgow 2004-2006
--
-- Print Cmm as real C, for -fvia-C
--
-- See wiki:Commentary/Compiler/Backends/PprC
--
-- This is simpl... | AlexanderPankiv/ghc | compiler/cmm/PprC.hs | Haskell | bsd-3-clause | 48,336 |
-- | Generating C symbol names emitted by the compiler.
module CPrim
( atomicReadLabel
, atomicWriteLabel
, atomicRMWLabel
, cmpxchgLabel
, popCntLabel
, bSwapLabel
, word2FloatLabel
) where
import CmmType
import CmmMachOp
import Outputable
popCntLabel :: Width -> String
popCntLabel w ... | frantisekfarka/ghc-dsi | compiler/nativeGen/CPrim.hs | Haskell | bsd-3-clause | 2,263 |
<?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="es-ES">
<title>Getting started Guide</title>
<maps>
<homeID>top</homeID>
<mapref locati... | thc202/zap-extensions | addOns/gettingStarted/src/main/javahelp/org/zaproxy/zap/extension/gettingStarted/resources/help_es_ES/helpset_es_ES.hs | Haskell | apache-2.0 | 968 |
<?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="fil-PH">
<title>Mabilis na Pagsisimula | Ekstensyon ng ZAP</title>
<maps>
<homeID>top</homeI... | thc202/zap-extensions | addOns/quickstart/src/main/javahelp/org/zaproxy/zap/extension/quickstart/resources/help_fil_PH/helpset_fil_PH.hs | Haskell | apache-2.0 | 1,001 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude
, BangPatterns
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.ForeignPtr
-... | ml9951/ghc | libraries/base/GHC/ForeignPtr.hs | Haskell | bsd-3-clause | 19,296 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude
, BangPatterns
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.ForeignPtr
-... | ezyang/ghc | libraries/base/GHC/ForeignPtr.hs | Haskell | bsd-3-clause | 20,344 |
{-# OPTIONS_GHC -Wall #-}
nomain :: IO ()
nomain = putStrLn used
used :: String
used = "T13839"
nonUsed :: ()
nonUsed = ()
| sdiehl/ghc | testsuite/tests/rename/should_fail/T13839b.hs | Haskell | bsd-3-clause | 126 |
module Demo where
--
import Lesson01
import Lesson02
import Lesson03
import Lesson04
import Lesson05
import Lesson07
import Lesson08
import Lesson09
import Lesson10
import Lesson11
import Lesson12
import Lesson13
import Lesson14
import Lesson15
import Lesson17
import Lesson18
--
import qualified SDL
import System.Envir... | rueshyna/sdl2-examples | src/Demo.hs | Haskell | mit | 1,045 |
{-# LANGUAGE DuplicateRecordFields #-}
module IR.Pure where
import Data.Word
import qualified IR.Common as C
import qualified IR.Name as Name
type Brand = C.ListBrand Name.CapnpQ
data File = File
{ fileId :: !Word64
, fileName :: FilePath
, decls :: [Decl]
, reExportEnums :: [N... | zenhack/haskell-capnp | cmd/capnpc-haskell/IR/Pure.hs | Haskell | mit | 2,499 |
import Data.List
import Data.Char
include :: String -> String -> Bool
include xs ys = or . map (isPrefixOf ys) . tails $ xs
joinWith :: [String] -> String -> String
joinWith xs sep = concat . init . concat $ [[x, sep] | x <- xs]
split :: String -> Char -> [String]
split "" _ = []
split xs c = let (ys, zs) = break (=... | rkalis/monokalis-syntax | sample-files/Haskell.hs | Haskell | mit | 1,200 |
{-# LANGUAGE OverloadedStrings #-}
import Network.SOAP
import Network.SOAP.Transport.HTTP
import Text.XML.Stream.Parse
import qualified Data.Text as T
import qualified Text.XML as XML
import qualified Text.XML.Writer as W
main :: IO ()
main = do
transport <- initTransport "http://www.webservicex.net/ConvertTemper... | twopoint718/hsoap-testing | Temp.hs | Haskell | mit | 1,134 |
-- |
-- Module : Data.Edison.Assoc.AssocList
-- Copyright : Copyright (c) 2006, 2008 Robert Dockins
-- License : MIT; see COPYRIGHT file for terms and conditions
--
-- Maintainer : robdockins AT fastmail DOT fm
-- Stability : stable
-- Portability : GHC, Hugs (MPTC and FD)
--
-- The st... | robdockins/edison | edison-core/src/Data/Edison/Assoc/StandardMap.hs | Haskell | mit | 17,103 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Network.Wai.WebSockets where
import Network.Wai
import Control.Exception (Exception, throwIO, assert)
import Control.Applicative ((<$>))
import Control.Monad (when, unless)
import Data.Typeable (Typeable)
imp... | snoyberg/wai-websockets-native | Network/Wai/WebSockets.hs | Haskell | mit | 7,697 |
module Sound.Source where
import Data.Monoid
-- A source takes a time 't' and returns the amplitude of the source
-- at that time. 't' is a time in seconds, representing the current
-- time where 0.0 is the start of the audio data
newtype Source = Source { sample :: Double -> Double }
instance Monoid (Source) where
... | unknownloner/HaskellSynth | src/Sound/Source.hs | Haskell | mit | 1,204 |
{-# OPTIONS_GHC -Wall #-}
module HW04 where
import Data.List
newtype Poly a = P [a]
-- Exercise 1 -----------------------------------------
x :: Num a => Poly a
x = P [0, 1]
-- Exercise 2 ----------------------------------------
trimTail :: (Eq a, Num a) => [a] -> [a]
trimTail = reverse . trimHead . reverse
trim... | hanjoes/cis194 | hw4/HW04.hs | Haskell | mit | 2,807 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.IDBRequest
(js_getResult, getResult, js_getError, getError, js_getSource,
getSource, js_getTransaction, getTransaction, js_getReadyState,
getReadyState, success, error, IDBRequest, castToIDB... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/IDBRequest.hs | Haskell | mit | 3,705 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
module Main (main) where
#if !MIN_VERSION_base(4, 8, 0)
import Data.Monoid (mempty)
#endif
import Data.Word (Word8)
import Text.Printf (printf)
import System.Random (Random(random), RandomGen, getStdGen)
import Options.Applicative
#if MIN_VERSION_optparse_applic... | NicolasT/reedsolomon | bench/profiling.hs | Haskell | mit | 2,602 |
module ParserSpec (spec) where
import Test.Hspec
import Test.Hspec.Expectations.Contrib
import Language.CFrp.Parser
import Language.CFrp.Syntax
spec :: Spec
spec = do
describe "parseExprString" $ do
it "parses arithmetic" $ do
"(1 + x * 3) - _a0 / 5"
`shouldBeParsedE`
SubE
(AddE
... | psg-titech/cfrp | spec/ParserSpec.hs | Haskell | mit | 3,924 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.