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 Network.IRC.Handlers.Greet (greetMsgHandlerMaker, welcomeMsgHandlerMaker) where
import ClassyPrelude
import Network.IRC
import Network.IRC.Util
greetMsgHandlerMaker :: MsgHandlerMaker
greetMsgHandlerMaker =
MsgHandlerMaker "greeter" $ \_ _ -> return $ newMsgHandler { onMessage = greeter }
welcomeMsgHandler... | abhin4v/hask-irc | hask-irc-handlers/Network/IRC/Handlers/Greet.hs | apache-2.0 | 1,304 | 0 | 22 | 308 | 406 | 212 | 194 | -1 | -1 |
module Calculus.Opra1 where
-- standard modules
import qualified Data.Char as Char
import qualified Data.Map as Map
import qualified Data.Set as Set
-- local modules
import Basics
import Calculus.Opra
data Opra1 = Opra1_0_0 | Opra1_0_1 | Opra1_0_2 | Opra1_0_3
| Opra1_1_0 | Opra1_1_1 | Opra1_1_2 | Opra1_1_... | spatial-reasoning/zeno | src/Calculus/Opra1.hs | bsd-2-clause | 50,817 | 0 | 6 | 18,479 | 1,214 | 1,122 | 92 | 26 | 0 |
module Handler.Root where
import Import
import Data.Int
data MemoForm = MemoForm {
text :: Textarea
}
selectAllMemos = do
selectList [] []
memoForm :: Html -> MForm Jabaraster Jabaraster (FormResult MemoForm, Widget)
memoForm = renderDivs $ MemoForm
<$> areq textareaField "あたらしいメモ" Nothing
getRootR :: Handle... | jabaraster/first-heroku | Handler/Root.hs | bsd-2-clause | 1,079 | 0 | 18 | 302 | 334 | 165 | 169 | 31 | 2 |
-- Copyright 2020 Google LLC
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file or at
-- https://developers.google.com/open-source/licenses/bsd
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Standalone... | google-research/dex-lang | src/lib/Export.hs | bsd-3-clause | 11,018 | 0 | 26 | 3,186 | 3,669 | 1,800 | 1,869 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
module Apidoc.DSL.Lenses where
import Apidoc.DSL.Types
import Control.Lens.TH
import Prelude hiding (Enum)
makePrisms ''TypeRef
makePrisms ''BuiltIn
makeLenses ''TypeName
makePrisms ''TypeName
makeLenses ''Uri
makePrisms ''Uri
makeLenses ''Na... | chrisbarrett/apidoc-checker | src/Apidoc/DSL/Lenses.hs | bsd-3-clause | 1,336 | 0 | 6 | 190 | 453 | 179 | 274 | 58 | 0 |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Twilio where
import Control.Monad.Catch as Ex
import qualified Control.Monad.Logger as Logger
import Control.Monad.Trans
import qualifie... | nejla/auth-service | service/src/Twilio.hs | bsd-3-clause | 2,866 | 0 | 18 | 1,126 | 584 | 321 | 263 | 63 | 3 |
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
-- | Discrete Vector Field on a \(sSet\). Also called an 'acyclic
-- matching':
-- <http://nlab-pages.s3.us-east-2.amazonaws.com/nlab/show/discrete+Morse+theory>
module Math.Topology.SSet.DVF where
import Data.Coerce
import qualified Math.Algebra.... | mvr/at | src/Math/Topology/SSet/DVF.hs | bsd-3-clause | 602 | 0 | 11 | 87 | 139 | 78 | 61 | 11 | 0 |
module Statistics.Iteratee.Tests
where
import Data.Iteratee as I
import Statistics.Iteratee as Si
import Statistics.Sample as St
import Test.Framework
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Control.Monad.Identity
import qualified Data.Vector.Unboxed as V
tests =
[ testGroup "Sample" $ m... | JohnLato/iter-stats | tests/Statistics/Iteratee/Tests.hs | bsd-3-clause | 1,588 | 0 | 10 | 343 | 519 | 294 | 225 | 35 | 2 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PolyKinds #-}
{-# OPTIONS_GHC -Wno-inline-rule-shadowing #-}
-- The RULES for the methods of class Category may never fire
-- e.g. identity/left, identity/right, association; see #10528
------------------------... | sdiehl/ghc | libraries/base/Control/Category.hs | bsd-3-clause | 1,991 | 0 | 9 | 487 | 342 | 204 | 138 | 38 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Distribution.Nixpkgs.Haskell.FromCabal.PostProcess ( postProcess ) where
import Control.Lens
import Control.Lens.Create
import Data.List.Split
import Data.Set ( Set )
import qualified Data.Set as Set
import Data.Set.Lens
import Distribution.Nixpkgs.Haskell
import Distribution... | gridaphobe/cabal2nix | distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs | bsd-3-clause | 15,746 | 0 | 18 | 3,452 | 1,848 | 1,009 | 839 | -1 | -1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# Language TemplateHaskell #-}
module Data.Excel.FormPopulate.Lens where
import Control.Lens
import Control.Lens.Lens
import Control.Lens.Prism
i... | smurphy8/excel-form-maker | src/Data/Excel/FormPopulate/Lens.hs | bsd-3-clause | 395 | 0 | 4 | 45 | 50 | 36 | 14 | 13 | 0 |
{-# LANGUAGE NoImplicitPrelude
, PackageImports
, TypeFamilies
, TypeSynonymInstances
, UnicodeSyntax
#-}
module Text.Numeral.Exp
( Unknown(unknown, isUnknown)
, Lit(lit)
, Neg(neg)
, Add(add)
, Mul(mul)
, Sub(sub)
, Frac(frac)
, Scale(scale... | roelvandijk/numerals-base | src/Text/Numeral/Exp.hs | bsd-3-clause | 3,861 | 2 | 10 | 807 | 633 | 397 | 236 | 73 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
module Rho.BitfieldSpec where
import Control.Exception (ErrorCall, catch)
import Control.Monad
import Data.Bits
import qualified Data.ByteString as B
import qualified Data.Set as S
import Test.Hspec
import... | osa1/rho-torrent | test/Rho/BitfieldSpec.hs | bsd-3-clause | 4,126 | 0 | 27 | 1,271 | 1,334 | 645 | 689 | 82 | 2 |
{-# LANGUAGE MultiWayIf #-}
module Task2
( goldMin
) where
getU :: Floating a => a -> a -> Int -> a
getU a b i = case i of
1 -> a + phy1 * (b - a)
2 -> a + phy2 * (b - a)
where
phy1 = (3 - sqrt(5)) / 2
phy2 = (sqrt(5) - 1) / 2
getPo... | vsulabs/OptimizationMethodsHs | src/Task2.hs | bsd-3-clause | 1,464 | 0 | 11 | 680 | 776 | 422 | 354 | 38 | 2 |
{-# OPTIONS_GHC -Wall #-}
-- | A Haskell binding to the bitcoind server.
module Network.Bitcoin
(
-- * Common Types
Client
, getClient
, BitcoinException(..)
, HexString
, TransactionID
, Satoshi(..)
, BTC
, Account
, Address
, ScriptSig
-- * Block Chain Operations
... | WraithM/network-bitcoin | src/Network/Bitcoin.hs | bsd-3-clause | 2,929 | 0 | 5 | 814 | 498 | 345 | 153 | 116 | 0 |
import System.Environment (getArgs)
import Control.Distributed.Process
import Control.Distributed.Process.Node (initRemoteTable)
import Control.Distributed.Process.Backend.SimpleLocalnet
import qualified WorkStealing
rtable :: RemoteTable
rtable = WorkStealing.__remoteTable initRemoteTable
main :: IO ()
main = do
a... | haskell-distributed/distributed-process-demos | src/WorkStealing/SimpleLocalnet.hs | bsd-3-clause | 674 | 0 | 19 | 129 | 197 | 103 | 94 | 19 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Main where
-- import Codec.Encryption.Padding (pkcs5, unPkcs5)
-- import Cod... | comatose/hecs | src/HECS.hs | bsd-3-clause | 8,388 | 0 | 16 | 1,981 | 2,421 | 1,219 | 1,202 | 156 | 3 |
module Tc.TcLiteral where
import Language.Haskell.Exts
import BuiltIn.BuiltInTypes
import Tc.TcMonad
import Utils.ErrMsg
-- type checking literals
tcLiteral :: Literal -> TcM (Context, Type)
tcLiteral (Char _) = return ([], tChar)
tcLiteral (String _) = return ([], tString)
tcLiteral (Int _) = do
... | rodrigogribeiro/mptc | src/Tc/TcLiteral.hs | bsd-3-clause | 567 | 0 | 10 | 186 | 185 | 97 | 88 | 15 | 1 |
-- | Code generation for sequential Python.
module Futhark.CodeGen.Backends.SequentialPython
( compileProg,
)
where
import Control.Monad
import qualified Data.Text as T
import qualified Futhark.CodeGen.Backends.GenericPython as GenericPython
import Futhark.CodeGen.Backends.GenericPython.AST
import qualified Futhar... | HIPERFIT/futhark | src/Futhark/CodeGen/Backends/SequentialPython.hs | isc | 1,697 | 0 | 11 | 387 | 372 | 205 | 167 | 45 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
module Yesod.Routes.TH.RouteAttrs
( mkRouteAttrsInstance
) where
import Yesod.Routes.TH.Types
import Yesod.Routes.Class
import Language.Haskell.TH.Syntax
import Data.Set (fromList)
import Data.Text (pack)
#if __GLASGOW_HASKE... | erikd/yesod | yesod-core/Yesod/Routes/TH/RouteAttrs.hs | mit | 1,489 | 0 | 12 | 303 | 498 | 265 | 233 | 34 | 2 |
module Foo.Foo where
<resolved>foo = putStrLn "oh no!"
| carymrobbins/intellij-haskforce | tests/gold/resolve/Module00001/Foo.hs | apache-2.0 | 56 | 2 | 5 | 9 | 22 | 11 | 11 | -1 | -1 |
import Paths_yesod_dsl (version)
import Data.Version (showVersion)
import YesodDsl.Parser
import System.Environment
import System.Console.GetOpt
import YesodDsl.Generator
import Control.Monad
data Flag = Version
| JsonPath String
| FayPath String deriving Eq
options :: [OptDescr Flag]
... | abrim/yesod-dsl | main/main.hs | bsd-2-clause | 1,387 | 0 | 19 | 508 | 392 | 205 | 187 | 37 | 6 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE... | rrnewton/pcg-random | src/System/Random/PCG.hs | bsd-3-clause | 8,895 | 0 | 12 | 1,752 | 1,665 | 895 | 770 | 136 | 1 |
module CPU.Common (
fetch
, fetch16
, jumpTo
, pushOntoStack
, popFromStack
) where
import CPU
import CPU.Environment (Register16(..))
import CPU.Types (Address, Opcode)
import CPU.Reference (CPUReference(..))
import BitTwiddling (joinBytes, joinBytesM, toBytes)
import Data.Word (Wo... | ChaosCabbage/my-haskell-flailing | src/CPU/Common.hs | bsd-3-clause | 1,222 | 0 | 10 | 309 | 394 | 207 | 187 | 37 | 1 |
module Prime.Factorize where
-- | find prime factorization if all prime factors are below bound
-- warning: uses trial division
easy :: Integer -> Integer -> Maybe [ (Integer, Int) ]
easy bound x = easy_for ( 2 : [ 3, 5 .. bound ] ) x
easy_for tts x = do
t : ts <- return tts
if t * t > x then Just [ (x, 1) ]
... | florianpilz/autotool | src/Prime/Factorize.hs | gpl-2.0 | 595 | 0 | 14 | 218 | 250 | 131 | 119 | 13 | 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... | Ye-Yong-Chi/codeworld | codeworld-base/src/GHC/Storable.hs | apache-2.0 | 739 | 0 | 4 | 136 | 23 | 17 | 6 | 4 | 0 |
module StackTest where
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Control.Concurrent
import Control.Exception
import Data.List (intercalate)
import System.Environment
import System.FilePath
import System.Directory
import System.IO
import System.IO.Error
import System.Pr... | mrkkrp/stack | test/integration/lib/StackTest.hs | bsd-3-clause | 5,701 | 0 | 15 | 1,377 | 1,710 | 844 | 866 | 137 | 3 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1998
\section[TypeRep]{Type - friends' interface}
Note [The Type-related module hierarchy]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Class
TyCon imports Class
TypeRep
TysPrim imports TypeRep ( including mkTyConTy )
Kind... | alexander-at-github/eta | compiler/ETA/Types/TypeRep.hs | bsd-3-clause | 33,572 | 0 | 17 | 8,963 | 5,429 | 2,922 | 2,507 | 371 | 5 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-------------------... | LinusU/fbthrift | thrift/compiler/test/fixtures/namespace/gen-hs/My/Namespacing/Extend/Test/ExtendTestService_Fuzzer.hs | apache-2.0 | 4,936 | 0 | 12 | 806 | 1,320 | 801 | 519 | 92 | 2 |
f a (x:xs) b = x + a + b : f a xs b ; f a [] b = [] | mpickering/hlint-refactor | tests/examples/ListRec3.hs | bsd-3-clause | 51 | 0 | 7 | 21 | 56 | 28 | 28 | 1 | 1 |
--
-- Copyright (c) 2011 Citrix Systems, Inc.
--
-- This program 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 2 of the License, or
-- (at your option) any later version.
--
-- This progra... | jean-edouard/manager | upgrade-db/Migrations/M_5.hs | gpl-2.0 | 1,839 | 0 | 12 | 458 | 280 | 166 | 114 | 23 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-| The implementation of Ganeti WConfd daemon server.
As TemplateHaskell require that splices be defined in a separate
module, we combine all the TemplateHaskell functionality that HTools
needs in this module (except the one for unittests).
-}
{-
Copyright (C) 2013, 2014 Google In... | mbakke/ganeti | src/Ganeti/WConfd/Server.hs | bsd-2-clause | 4,886 | 0 | 14 | 1,118 | 670 | 367 | 303 | 80 | 1 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1996-1998
Printing of Core syntax
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PprCore (
pprCoreExpr, pprParendExpr,
pprCoreBinding, pprCoreBindings, pprCoreAlt,
pprCoreBindingWithSize, pprCoreBindingsWithSize,... | acowley/ghc | compiler/coreSyn/PprCore.hs | bsd-3-clause | 19,663 | 0 | 20 | 5,867 | 5,425 | 2,717 | 2,708 | 348 | 6 |
import qualified Data.Vector as U
import Data.Bits
main = print . U.sum $ unfoldU 10000 k (0::Int)
where
k b = JustS (b :*: b+1) -- enumFromTo
| dolio/vector | old-testsuite/microsuite/unfold.hs | bsd-3-clause | 155 | 0 | 10 | 39 | 67 | 37 | 30 | 4 | 1 |
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE OverloadedStrings #-} -- hah, the test should be renamed...
-- Not actually a problem, we're now requiring overloaded strings, we j... | pikajude/yesod | yesod-core/test/YesodCoreTest/NoOverloadedStringsSub.hs | mit | 1,022 | 0 | 13 | 156 | 146 | 79 | 67 | 15 | 0 |
module CodeGen.Platform
(callerSaves, activeStgRegs, haveRegBase, globalRegMaybe, freeReg)
where
import CmmExpr
import Platform
import Reg
import qualified CodeGen.Platform.ARM as ARM
import qualified CodeGen.Platform.ARM64 as ARM64
import qualified CodeGen.Platform.PPC as PPC
import... | acowley/ghc | compiler/codeGen/CodeGen/Platform.hs | bsd-3-clause | 3,868 | 0 | 14 | 813 | 904 | 468 | 436 | 93 | 7 |
{-# LANGUAGE GADTs, ExistentialQuantification #-}
module Escape where
data ExpGADT t where
ExpInt :: Int -> ExpGADT Int
data Hidden = forall t . Hidden (ExpGADT t) (ExpGADT t)
hval = Hidden (ExpInt 0) (ExpInt 1)
-- With the type sig this is ok, but without it maybe
-- should be rejected because the result type i... | forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/gadt/gadt-escape1.hs | bsd-3-clause | 678 | 0 | 10 | 143 | 151 | 85 | 66 | 9 | 1 |
module JIT where
import Data.Int
import Data.Word
import Foreign.Ptr ( FunPtr, castFunPtr )
import Control.Monad.Except
import LLVM.General.Target
import LLVM.General.Context
import LLVM.General.CodeModel
import LLVM.General.Module as Mod
import qualified LLVM.General.AST as AST
import LLVM.General.PassManager
impo... | NoxHarmonium/lithium-lang | src/JIT.hs | mit | 1,731 | 0 | 27 | 446 | 482 | 255 | 227 | 42 | 2 |
{-|
Module : TestPrint
Description : The general Printing Test Functions
Copyright : (c) Andrew Burnett 2014-2015
Maintainer : andyburnett88@gmail.com
Stability : experimental
Portability : Unknown
This module provides the general functions required for writing Printing Tests
-}
module TestPrint (
printT... | aburnett88/HSat | tests-src/TestPrint.hs | mit | 1,278 | 0 | 10 | 317 | 235 | 124 | 111 | 25 | 1 |
-- simple routines for generating and analyzing combinatorial maps
module Maps where
import Control.Monad.State
import Control.Monad.List
import Data.List
import Data.Maybe
import qualified Data.Tuple as DT
import Util
import Formulas
import Bijections
data OMap = OMap { odarts :: [Int], sigma :: Perm, alpha :: Per... | noamz/linlam-gos | src/Maps.hs | mit | 19,711 | 0 | 24 | 4,565 | 8,028 | 4,292 | 3,736 | 334 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Propylgraph.Sentences (sentences, pairs) where
import Data.List
import qualified Data.Text.Lazy as T
sentenceTerminators :: [Char]
sentenceTerminators = ".?!"
punctuation :: [Char]
punctuation = "~`$%^&*()_-+=|\\}]{[\"':;/><,"
sentences :: T.Text -> [[T.Text]]
sentences xs... | TravisWhitaker/Propylgraph | Propylgraph/Sentences.hs | mit | 945 | 0 | 10 | 228 | 474 | 271 | 203 | 27 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
import Control.Monad.Random
data Ability = Ability
{
aName :: String
, aUri :: String
} deriving (Show)
data Move = Move
{ learnType :: String
, moveName :: String
, moveUri :: St... | codygman/pokemon-battle | src/Main.hs | mit | 1,019 | 0 | 9 | 255 | 271 | 160 | 111 | 31 | 1 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.HTMLFieldSetElement
(checkValidity, checkValidity_, reportValidity, reportValidity_,
setCustomValidity, s... | ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLFieldSetElement.hs | mit | 5,776 | 0 | 12 | 759 | 1,168 | 654 | 514 | 73 | 1 |
{-# LANGUAGE ExistentialQuantification, GADTs, RankNTypes #-}
module AlaCarte where
--- Haskell encoding of Runars talk on Monad Coproducts and Free Monads
--- https://dl.dropboxusercontent.com/u/4588997/ReasonablyPriced.pdf
data Interact a where
Ask :: String -> Interact String
Tell :: String -> Interact ()
d... | nlim/haskell-playground | src/AlaCarte.hs | mit | 1,643 | 0 | 11 | 446 | 691 | 356 | 335 | 39 | 2 |
module Main where
import Data.List (elemIndex, foldl', inits)
import Data.Maybe (catMaybes)
import Parser
text :: String
text = "abcdefgh" -- should be bfheacgd
scrampeled :: String
scrampeled = "fbgdceah"
main :: IO ()
main = do
insts <- instructions
putStrLn $ "Part 1: " ++ process insts text
putStrLn $ "... | CarstenKoenig/AdventOfCode2016 | Day21/Main.hs | mit | 3,999 | 0 | 13 | 993 | 1,515 | 746 | 769 | 135 | 3 |
{-#LANGUAGE CPP #-}
module Melchior.Remote.Internal.ParserUtils where
import Control.Monad
#ifdef __UHC_TARGET_JS__
import Data.Char
#else
import Data.Char hiding (isLetter)
#endif
newtype Parser a = Parser (String -> [(a, String)])
parse :: Parser a -> (String -> [(a, String)])
parse (Parser p) = p
instance Monad... | kjgorman/melchior | Melchior/Remote/Internal/ParserUtils.hs | mit | 1,842 | 1 | 13 | 479 | 937 | 491 | 446 | 47 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
module SoOSiM.Components.CodeAdapter where
import SoOSiM
import SoOSiM.Components.Types
data CodeAdapter = CodeAdapter
data Data = Data deriving Typeable
data CA_Cmd = AdaptCode Code DestinationArchitecture
| AdaptContext ThreadContext De... | christiaanb/SoOSiM | src-components/SoOSiM/Components/CodeAdapter.hs | mit | 2,986 | 0 | 20 | 724 | 752 | 362 | 390 | 81 | 6 |
{-# htermination replicateM :: Int -> IO a -> IO [a] #-}
import Monad
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Monad_replicateM_4.hs | mit | 70 | 0 | 3 | 14 | 5 | 3 | 2 | 1 | 0 |
-- |
-- Module: Math.NumberTheory.Powers.Modular
-- Copyright: (c) 2017 Andrew Lelechenko
-- Licence: MIT
-- Maintainer: Andrew Lelechenko <andrew.lelechenko@gmail.com>
--
-- Modular powers (a. k. a. modular exponentiation).
--
module Math.NumberTheory.Powers.Modular
{-# DEPRECATED "Use Data.Mod or Data.... | Bodigrim/arithmoi | Math/NumberTheory/Powers/Modular.hs | mit | 2,813 | 0 | 11 | 522 | 490 | 281 | 209 | 32 | 3 |
{- | After "Implementing Functional Languages: a tutorial"
-}
module GMachine
where
import Data.Map (Map)
import qualified Data.Map as Map
data GmState = GmState { code :: GmCode
, stack :: GmStack
, heap :: GmHeap
, globals :: GmGlobals
... | mmakowski/ambc | src/GMachine.hs | mit | 3,402 | 0 | 13 | 1,047 | 1,294 | 694 | 600 | 87 | 3 |
module Lab3 where
-----------------------------------------------------------------------------------------------------------------------------
-- LIST COMPREHENSIONS
------------------------------------------------------------------------------------------------------------------------------
-- =====================... | AkronCodeClub/edX-FP101x-Oct-2014 | ryan_p/HW1029/lab3.hs | mit | 1,315 | 0 | 10 | 172 | 316 | 181 | 135 | 15 | 1 |
-- | Monadic computations in which you need to be able to
-- short-circuit, in analogy "return" from "classic" programming languages
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Control.Monad.Trans.CircuitT
( CircuitT
, escape
, runCircuitT
)
where
import Control.Applicative
import ... | k-bx/circuitt | src/Control/Monad/Trans/CircuitT.hs | mit | 748 | 0 | 9 | 160 | 219 | 119 | 100 | 17 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Tests.Sodium.Stream.Salsa20 where
import Tests.Sodium.Stream.Common
import Crypto.Sodium.Hash.Sha256
import Crypto.Sodium.SecureM... | dnaq/crypto-sodium | test/Tests/Sodium/Stream/Salsa20.hs | mit | 1,573 | 0 | 14 | 458 | 409 | 255 | 154 | 33 | 1 |
-- Gap in Primes
-- http://www.codewars.com/kata/561e9c843a2ef5a40c0000a4/
module Codewars.G964.GapInPrimes where
import Data.List (find)
import Control.Arrow ((&&&))
gap :: Integer -> Integer -> Integer -> Maybe (Integer, Integer)
gap g m n = find (\(a, b) -> b-a == g) . uncurry zip . (id &&& drop 1) . filter isPri... | gafiatulin/codewars | src/5 kyu/GapInPrimes.hs | mit | 421 | 0 | 13 | 80 | 182 | 101 | 81 | 6 | 1 |
module ChatCore.Types where
import Control.Applicative
import Control.Lens (makeClassy)
import Data.Aeson
import qualified Data.ByteString as B
import qualified Data.Text as T
type ChatNetworkName = T.Text
type ChatBufferName = T.Text
-- | Represents a message destination. This can be either a channel or a user.
t... | Forkk/ChatCore | ChatCore/Types.hs | mit | 2,266 | 0 | 11 | 537 | 458 | 258 | 200 | -1 | -1 |
-- Ben Eggers
main = putStrLn "Hi, ma!" | BenedictEggers/99problems | Main.hs | mit | 40 | 0 | 5 | 8 | 10 | 5 | 5 | 1 | 1 |
{-# LANGUAGE FlexibleContexts #-}
import System.IO
import Control.Monad.State
import Control.Monad.Writer
import Data.Char (chr, ord, toUpper)
import Data.List (find)
import Data.Ord
-- States of Machine
data MyState = STATE_ERR
| STATE_S0
| STATE_S1
| STATE_I0
| ST... | zporky/langs-and-paradigms | projects/NT76QQ/haskell/state_machine.hs | mit | 4,461 | 0 | 15 | 1,228 | 1,379 | 787 | 592 | 96 | 3 |
module Stage ( loadObjects ) where
import GameObject
import Data.Complex
import Data.Array
-- loadObjects :: [GameObject]
-- a list of objects that are to newly loaded at this frame.
loadObjects clock isEasy vicViper gameObjects = if hp vicViper<=0 then [] else (case clock of
-- stage layout.
-- just like o... | keqh/Monadius_rewrite | Monadius/Stage.hs | gpl-2.0 | 10,811 | 0 | 23 | 1,710 | 6,364 | 3,657 | 2,707 | 145 | 154 |
{-# OPTIONS -w -O0 #-}
{- |
Module : COL/ATC_COL.der.hs
Description : generated Typeable, ShATermConvertible instances
Copyright : (c) DFKI Bremen 2008
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : non-portable(overlapping Ty... | nevrenato/Hets_Fork | COL/ATC_COL.hs | gpl-2.0 | 2,897 | 0 | 16 | 616 | 708 | 376 | 332 | 58 | 1 |
import qualified Patat.Main
main :: IO ()
main = Patat.Main.main
| jaspervdj/patat | src/Main.hs | gpl-2.0 | 66 | 0 | 6 | 11 | 25 | 14 | 11 | 3 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Model.BoardInfo
( BoardInfo (..)
) where
import Data.Aeson
import GHC.Generics
import Test.QuickCheck
import Model.Event
data BoardIn... | massimo-zaniboni/netrobots | robot_examples/haskell-servant/rest_api/lib/Model/BoardInfo.hs | gpl-3.0 | 806 | 0 | 13 | 158 | 174 | 103 | 71 | 25 | 0 |
module MiniMiniLogoSem where
import MiniMiniLogo
import Render
--
-- * Semantics of MiniMiniLogo
--
-- NOTE:
-- * MiniMiniLogo.hs defines the abstract syntax of MiniMiniLogo and some
-- functions for generating MiniMiniLogo programs. It contains the type
-- definitions for Mode, Cmd, and Prog.
-- * Rend... | caperren/Archives | OSU Coursework/CS 381 - Programming Language Fundamentals/Homework 3/MiniMiniLogoSem.perrenc.hs | gpl-3.0 | 2,841 | 0 | 13 | 526 | 519 | 314 | 205 | 24 | 2 |
module IntelBrightness.Core (
maxBrightness,
setBrightness
) where
readInt :: String -> Int
readInt = read
maxBrightness :: String -> IO Int
maxBrightness = fmap readInt . readFile . flip (++) "/max_brightness"
setBrightness :: (Show a) => String -> a -> IO ()
setBrightness path nb = writeFile (path ++ "... | mcoffin/intel-brightness | IntelBrightness/Core.hs | gpl-3.0 | 344 | 0 | 9 | 68 | 117 | 62 | 55 | 9 | 1 |
-- count the nodes of a n-ary tree
data Tree a = Node a [Tree a]
p70 :: Tree a -> Int
p70 (Node x []) = 1
p70 (Node x xs) = 1 + p70' xs where
p70' [] = 0
p70' (x:xs) = p70 x + p70' xs
| yalpul/CENG242 | H99/70-73/p70c.hs | gpl-3.0 | 202 | 0 | 9 | 68 | 110 | 55 | 55 | 6 | 2 |
import Math.NumberTheory.Moduli ( powerMod )
import Math.NumberTheory.Primes.Sieve ( sieveFrom )
main = let x = 10^9; y = 10^7; n = 10^15::Int in print $
sum $ map (a n) $ takeWhile (<=(x + y)) $ sieveFrom x
where
f (u, v, w) (x, y, _) = (mod (u * x + 13 * v * y) w, mod (u * y + v * x) w, w)
a ... | kkmonlee/Project-Euler-Solutions | Haskell/p492.hs | gpl-3.0 | 680 | 0 | 25 | 233 | 499 | 279 | 220 | 10 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-adsense/gen/Network/Google/Resource/AdSense/AdUnits/List.hs | mpl-2.0 | 4,134 | 0 | 16 | 969 | 571 | 335 | 236 | 86 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-games-configuration/gen/Network/Google/Resource/GamesConfiguration/AchievementConfigurations/List.hs | mpl-2.0 | 6,279 | 0 | 20 | 1,447 | 887 | 512 | 375 | 130 | 1 |
-- Canvas.Hs, control javascript canvas with Haskell
-- Copyright (C) 2013, Lennart Buit, Joost van Doorn, Pim Jager, Martijn Roo,
-- Thijs Scheepers
--
-- This library 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 Soft... | CanvasHS/Canvas.hs | canvashs-module/CanvasHs/Server/Static.hs | lgpl-2.1 | 4,130 | 4 | 15 | 1,030 | 913 | 500 | 413 | 42 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Spark.Core.GroupsSpec where
import Test.Hspec
import Data.Text(Text)
import Spark.Core.Context
import Spark.Core.Functions
import qualified Spark.Core.ColumnFunctions as C
import Spark.Core.Column
import Spark.Core.IntegrationUtilities
... | tjhunter/karps | haskell/test-integration/Spark/Core/GroupsSpec.hs | apache-2.0 | 970 | 0 | 13 | 186 | 352 | 190 | 162 | 31 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Web.Forms.Login where
import Web.Forms.Common
import Text.Blaze.Html (Html)
import Text.Digestive
import Text.Digestive.Bootstrap
import qualified Data.Text as T
data LoginRequest
= LoginRequest
{ lr_user :: T.Text
, lr_password :: T.Text
} deriving (Show)
login... | agrafix/funblog | src/Web/Forms/Login.hs | apache-2.0 | 1,008 | 0 | 14 | 299 | 232 | 134 | 98 | 30 | 1 |
module Integration (tests) where
import Protolude hiding (stdin, stdout, toS)
import Protolude.Conv (toS)
import Crypto.Hash (SHA256(..))
import Data.ByteArray.Encoding (convertFromBase, convertToBase, Base(Base16))
import qualified Data.ByteString as ByteString
import qualified Data.ByteString.Char8 as Char8
import ... | jml/haskell-spake2 | tests/Integration.hs | apache-2.0 | 3,430 | 0 | 21 | 774 | 856 | 446 | 410 | 62 | 1 |
import Control.Exception.Base (evaluate)
import Data.Char (digitToInt)
import System.Clock
import System.Environment (getArgs)
import System.IO
input :: Int
input = 100
solution :: Int -> Int
solution n
= sum
. map digitToInt
. show
. product
$ [2..toInteger n]
run :: (a -> b) -> a -> Int -> IO ()
run fun ... | japaric/euler_criterion.rs | problems/020/020.hs | apache-2.0 | 973 | 0 | 11 | 232 | 424 | 203 | 221 | 40 | 2 |
{-# LANGUAGE
QuasiQuotes
, PackageImports
#-}
module ScatterGridderWDep where
import "language-c-quote" Language.C.Syntax
import Language.C.Quote.CUDA
import Language.C.Smart ()
import Text.PrettyPrint.Mainland (
Doc
, ppr
, pretty
)
import Development.Shake
import Development.Shake.FilePath
im... | SKA-ScienceDataProcessor/RC | MS3/Sketches/CPU_Gridders/ScatterGridderWDep.hs | apache-2.0 | 5,300 | 0 | 15 | 1,538 | 731 | 418 | 313 | 75 | 2 |
{-# LANGUAGE FlexibleContexts #-}
import Control.Applicative
import Data.Either.Unwrap
import Text.Parsec as P
import Data.PGN
import Data.SAN
eol :: Stream s m Char => P.ParsecT s u m Char
eol = P.char '\n'
restOfLine :: Stream s m Char => P.ParsecT s u m String
restOfLine = P.many1 (P.noneOf "\n") <* eol
--space... | dancor/pgn | src/FicsToPgn.hs | bsd-2-clause | 1,049 | 0 | 13 | 226 | 413 | 197 | 216 | 36 | 1 |
module Foundation
( App (..)
, Route (..)
, AppMessage (..)
, resourcesApp
, Handler
, Widget
, Form
, maybeAuth
, requireAuth
, requireAuthId
, module Settings
, module Model
, getExtra
) where
import Prelude
import Yesod
import Yesod.Static
import Yesod.Auth
im... | seizans/ppl | Foundation.hs | bsd-2-clause | 6,136 | 0 | 17 | 1,328 | 852 | 478 | 374 | -1 | -1 |
module Drasil.GamePhysics.Body where
import Language.Drasil hiding (Symbol(..), Vector, organization, section)
import Language.Drasil.Printers (PrintingInformation(..), defaultConfiguration)
import Database.Drasil (Block(Parallel), ChunkDB, ReferenceDB, SystemInformation(SI),
cdb, rdb, refdb, _authors, _concepts, _c... | JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/GamePhysics/Body.hs | bsd-2-clause | 19,139 | 0 | 22 | 2,894 | 4,301 | 2,431 | 1,870 | 256 | 1 |
module Downloaders (runDownload, Download) where
import Dep (Dep(Dep))
import Control.Monad.Trans.Maybe
type Download a = MaybeT IO a
runDownload :: Download String -> IO (Maybe String)
runDownload = runMaybeT
| ericmoritz/deps | src/Downloaders.hs | bsd-3-clause | 219 | 0 | 8 | 37 | 69 | 41 | 28 | 6 | 1 |
module Hakyll.Core.DependencyAnalyzer.Tests where
import Control.Arrow (second)
import qualified Data.Set as S
import Data.Monoid (mempty)
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test)
import Hakyll.Core.DirectedGraph
import Hakyll.Core.DependencyAnalyzer
tests :: [Test... | sol/hakyll | tests/Hakyll/Core/DependencyAnalyzer/Tests.hs | bsd-3-clause | 1,524 | 0 | 10 | 544 | 600 | 339 | 261 | 52 | 1 |
module Problem51 where
import Data.Digits
import Data.List
isPrime :: Int -> Bool
isPrime n = not (any divisible [2..r])
where r = floor (sqrt (fromIntegral n))
divisible m = n `mod` m == 0
primes :: [Int]
primes = filter isPrime [2..]
findDigitPositions :: Int -> Int -> [Int]
findDigitPositions n d = ele... | noraesae/euler | src/Problem51.hs | bsd-3-clause | 1,092 | 0 | 14 | 282 | 459 | 235 | 224 | 28 | 2 |
{-# OPTIONS_GHC -Wall #-}
-- |This module does all the expansions needed to display the prompts
-- (@PS1@ and @PS2@, at least).
module System.Console.ShSh.Prompt ( prompt )
where
import Control.Monad.Trans ( liftIO )
import Data.Char ( chr )
import Data.Maybe ( fromMaybe )
import Data.List ( isPrefixOf )
import S... | shicks/shsh | System/Console/ShSh/Prompt.hs | bsd-3-clause | 2,326 | 0 | 14 | 688 | 676 | 352 | 324 | 45 | 3 |
module StackTest where
import Control.Exception
import Data.List (intercalate)
import System.Environment
import System.FilePath
import System.Directory
import System.IO
import System.Process
import System.Exit
import System.Info (os)
run' :: FilePath -> [String] -> IO ExitCode
run' cmd args = do
logInfo $ "Runnin... | sjakobi/stack | test/integration/lib/StackTest.hs | bsd-3-clause | 3,929 | 0 | 15 | 1,048 | 1,126 | 555 | 571 | 100 | 3 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
--
-- Copyright (c) 2009-2011, ERICSSON AB
-- 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 sour... | emwap/feldspar-language | src/Feldspar/Core/Frontend/MutableArray.hs | bsd-3-clause | 3,670 | 0 | 12 | 749 | 783 | 400 | 383 | 42 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wall #-}
module Chan.KickChan (
-- * Kick Channels
KickChan
-- ** Creation
, newKickCha... | JohnLato/kickchan | src/Chan/KickChan.hs | bsd-3-clause | 10,504 | 0 | 15 | 2,228 | 2,223 | 1,204 | 1,019 | 154 | 3 |
{-# LANGUAGE CPP #-}
{-|
Module : Numeric.CatchingExceptions.Num
Description : CatchingExceptions instances of Num etc
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental
Portability : portable
CatchingExceptions... | michalkonecny/num-exceptions | src/Numeric/CatchingExceptions/Num.hs | bsd-3-clause | 3,747 | 0 | 13 | 842 | 1,197 | 610 | 587 | 92 | 1 |
-- |
-- Module : Data.Git.Diff
-- License : BSD-style
-- Maintainer : Nicolas DI PRIMA <nicolas@di-prima.fr>
-- Stability : experimental
-- Portability : unix
--
-- Basic Git diff methods.
--
module Data.Git.Diff
(
-- * Basic features
BlobContent(..)
, BlobState(..)
, BlobStateDiff(..... | NicolasDP/hit | Data/Git/Diff.hs | bsd-3-clause | 11,919 | 0 | 19 | 4,086 | 3,009 | 1,602 | 1,407 | 202 | 11 |
{-# LANGUAGE OverloadedStrings #-}
module Translit.GHC where
import Data.Char
import qualified Data.List as L
import Data.Text (Text)
import qualified Data.Text as T
import Text.Regex.PCRE
fromCharCode :: Int -> Char
fromCharCode = chr
charCodeAt :: Int -> Text -> Int... | bergmark/transliterate | src/Translit/GHC.hs | bsd-3-clause | 924 | 0 | 11 | 236 | 395 | 218 | 177 | 26 | 2 |
{-#LANGUAGE OverloadedStrings #-}
module Main where
import Streaming
import Streaming.Network.TCP
import qualified Streaming.Prelude as S
import qualified Data.ByteString.Streaming as Q
import Control.Concurrent.Async
import qualified Data.ByteString as B
import Data.ByteString (ByteString)
import Data.Word8 (toUppe... | michaelt/streaming-network-tcp-examples | Main.hs | bsd-3-clause | 3,934 | 0 | 18 | 1,008 | 1,247 | 633 | 614 | 91 | 2 |
-- | Main API module
--
-- Use the functions in `Finance.TradeKing.Quotes` for access to the TradeKing API.
--
-- The functions in `Finance.TradeKing.Service` provide lower-level access to the TradeKing API,
-- handling things such as OAuth.
module Finance.TradeKing
(module Finance.TradeKing.Types,
... | tathougies/hstradeking | src/Finance/TradeKing.hs | bsd-3-clause | 578 | 0 | 5 | 100 | 66 | 47 | 19 | 9 | 0 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Tut.Json
( module Tut.Json
) where
import Tut.Misc
import Control.Category1
import Data.Aeson.Types
import qualified Data.Text as T
maybeFieldW :: Object -> Text -> (... | aaronvargo/htut | src/Tut/Json.hs | bsd-3-clause | 5,157 | 0 | 14 | 1,232 | 2,134 | 1,092 | 1,042 | 142 | 6 |
{-# LANGUAGE
CPP
, DefaultSignatures
, DeriveDataTypeable
, FlexibleInstances
, FlexibleContexts
, GADTs
, MultiParamTypeClasses
, Rank2Types #-}
#ifdef LANGUAGE_Trustworthy
{-# LANGUAGE Trustworthy #-}
#endif
{-# LANGUAGE
TypeFamilies
, TypeOperators
, UndecidableInstances #-}
{- |
Copyright ... | sonyandy/var | src/Data/Tuple/ByteArray.hs | bsd-3-clause | 7,545 | 0 | 12 | 2,332 | 2,492 | 1,259 | 1,233 | 208 | 1 |
blah :: [String] -> (Integer, String)
blah (y:x) = (read y, concat x)
main = do
x <- fmap (map (blah . words) . lines) getContents
let mn = minimum (map fst (filter ((/= "") . snd) x))
let mx = maximum (map fst (filter ((/= "") . snd) x))
let scale = mx - mn;
let minFont = 75
let maxFont = 150
flip map... | liamoc/liamoc.net | clouds.hs | bsd-3-clause | 666 | 0 | 18 | 176 | 352 | 178 | 174 | 16 | 2 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
-- |
-- Module : Data.Array.Nikola.Language.Optimize.Simpl
-- Copyright : (c) Geoffrey Mainland 2012
-- License : BSD-style
--
-- Maintainer : Geoffrey Mainland <mainland@apeiron.net>
-- Stability : experimental
-- Portability : non-portable
module Data... | mainland/nikola | src/Data/Array/Nikola/Language/Optimize/Simpl.hs | bsd-3-clause | 10,409 | 0 | 15 | 3,780 | 3,904 | 1,940 | 1,964 | 169 | 34 |
module Sexy.Instances.Applicative.IO () where
import Sexy.Data (IO(..))
import Sexy.Classes (Applicative(..))
import Sexy.Instances.Functor.IO ()
import Sexy.Instances.Pure.IO ()
instance Applicative IO where
-- (<*>) :: IO (a -> b) -> IO a -> IO b
(IO f) <*> (IO x) =
IO (\rw -> let (# rw', f' #) = f rw
... | DanBurton/sexy | src/Sexy/Instances/Applicative/IO.hs | bsd-3-clause | 395 | 0 | 13 | 108 | 144 | 82 | 62 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
module GenerateSketch where
import Data.Char
import ... | TikhonJelvis/array-forth-sketch | src/GenerateSketch.hs | bsd-3-clause | 3,643 | 0 | 10 | 1,173 | 644 | 363 | 281 | 77 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving, TemplateHaskell #-}
module Haskcord.Resource.User
where
import Control.Lens
import Data.Aeson
import Data.HashMap (lookup)
import Data.Word
import Haskcord.Resource.Base
import Haskcord.Resource.Id
data UserResource = UserResource {
_userResourceId :: UserId
, _user... | swagcod/haskcord | src/Haskcord/Resource/User.hs | bsd-3-clause | 1,778 | 0 | 22 | 395 | 452 | 244 | 208 | -1 | -1 |
{-
- Program1.hs
- By Steven Smith
-}
{-# LANGUAGE OverloadedStrings, RecursiveDo #-}
module Program1 where
import SpirV.Builder.Raw
program1 :: Builder ()
program1 = mdo
std450 <- extInstImport "GLSL.std.450"
memoryModel Logical GLSL450
progName <- string "program1"
float32 <- typeFloat 32
... | stevely/hspirv | test/src/Program1.hs | bsd-3-clause | 3,247 | 0 | 9 | 736 | 956 | 416 | 540 | 85 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
-- {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DataKinds #-}
-- {-# OPTIONS_GHC -Wall #-}... | reuleaux/pire | src/Pire/String2Text.hs | bsd-3-clause | 3,932 | 0 | 8 | 722 | 987 | 523 | 464 | 74 | 1 |
{-- snippet CannotShow --}
data CannotShow = CannotShow
deriving (Show)
-- will not compile, since CannotShow is not an instance of Show
data CannotDeriveShow = CannotDeriveShow CannotShow
deriving (Show)
data OK = OK
instance Show OK where
show _ = "OK"
data ThisWorks = ... | binesiyu/ifl | examples/ch06/AutomaticDerivation.hs | mit | 394 | 0 | 6 | 117 | 73 | 41 | 32 | 9 | 0 |
{-# LANGUAGE ForeignFunctionInterface #-}
module Foo where
import Foreign.C.Types
foreign export ccall hs_fact :: CInt -> CInt
hs_fact :: CInt -> CInt
hs_fact 0 = 1
hs_fact n = n * hs_fact (n - 1)
| ttakamura/sandbox | ffi/haskell2/foo.hs | mit | 200 | 0 | 8 | 38 | 64 | 36 | 28 | 7 | 1 |
module FP.Quiz where
import FP.Check
import FP.Conf
import FP.Instance
import FP.Roll
import FP.Expression
import Autolib.Size
import Autolib.ToDoc
import Autolib.TES.Identifier
import Control.Monad ( guard )
import Inter.Quiz
import Inter.Types
import Debug
import Data.Array
instance Generator FPTypeCheck Conf... | florianpilz/autotool | src/FP/Quiz.hs | gpl-2.0 | 559 | 0 | 7 | 98 | 166 | 94 | 72 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.