code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
module Weight.PlateCalc(displayPlateCalc,Plate(..),plateCalc, Plates(Plates,getPlates), BarType(..)) where
import BasicPrelude
newtype Plates = Plates {
getPlates :: [Plate]
}
--instance Show Plates where
-- show = displayPlates
data BarType = Barbell | Dumb... | mindreader/iron-tracker | Weight/PlateCalc.hs | bsd-3-clause | 2,190 | 0 | 12 | 617 | 946 | 487 | 459 | 46 | 9 |
{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module Language.Lc.Interpreter.Dynamic
( dynamicInterpreter
) where
import Language.Lc
--------------------------------------------------------------
-- Dynamic interpreter
--------------------------------------------------------------
-- | dynamic interpreter, it... | d-dorazio/lc | src/Language/Lc/Interpreter/Dynamic.hs | bsd-3-clause | 1,941 | 0 | 10 | 382 | 363 | 191 | 172 | 29 | 2 |
{-# LANGUAGE RankNTypes, FlexibleInstances, UndecidableInstances, OverloadedStrings #-}
module Main where
import Data.Text (Text)
import Text.AFrame
import Text.AFrame.DSL
import Web.AFrame.GHCi
import Web.AFrame
import Lens.Micro
example :: AFrame
example = scene $ do
c <- colorSelector "color" "#123456"
h <-... | ku-fpg/aframe-server | DSL/Example.hs | bsd-3-clause | 1,930 | 0 | 16 | 490 | 522 | 261 | 261 | 49 | 1 |
module Test.Hspec.Expectations.Matcher (matchList) where
import Prelude hiding (showList)
import Data.List
matchList :: (Show a, Eq a) => [a] -> [a] -> Maybe String
xs `matchList` ys
| null extra && null missing = Nothing
| otherwise = Just (err "")
where
extra = xs \\ ys
missing =... | hspec/hspec-expectations | src/Test/Hspec/Expectations/Matcher.hs | mit | 899 | 0 | 11 | 244 | 303 | 153 | 150 | 20 | 2 |
-- |
-- Module: Math.NumberTheory.Moduli.Equations
-- Copyright: (c) 2018 Andrew Lelechenko
-- Licence: MIT
-- Maintainer: Andrew Lelechenko <[email protected]>
--
-- Polynomial modular equations.
--
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
module Math.NumberTheo... | Bodigrim/arithmoi | Math/NumberTheory/Moduli/Equations.hs | mit | 3,890 | 0 | 18 | 969 | 1,304 | 717 | 587 | 92 | 5 |
{-# Language RebindableSyntax #-}
{-# Language ScopedTypeVariables #-}
{-# Language FlexibleContexts #-}
module Main where
import Prelude hiding ((>>=), (>>), fail, return)
import Symmetry.Language
import Symmetry.Verify
pingServer :: (DSL repr) => repr (Process repr ())
pingServer = do myPid <- self
... | gokhankici/symmetry | checker/tests/pos/Ping00.hs | mit | 1,093 | 0 | 13 | 458 | 261 | 138 | 123 | 23 | 1 |
{- Copyright 2013 Gabriel Gonzalez
This file is part of the Suns Search Engine
The Suns Search Engine 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
o... | Gabriel439/suns-search | src/Util.hs | gpl-3.0 | 1,204 | 0 | 16 | 275 | 255 | 141 | 114 | 11 | 2 |
{-
Copyright 2010-2012 Cognimeta Inc.
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 writ... | Cognimeta/perdure | src/Database/Perdure/WordNArrayRef.hs | apache-2.0 | 1,724 | 0 | 11 | 299 | 336 | 174 | 162 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE ScopedTypeVariables #-}
#ifdef TRUSTWORTHY
{-# LANGUAGE Trustworthy #-}
#endif
#if __GLASGOW_HASKELL__ >= 710
{-# LANGUAGE PatternSynonyms #-}
{-# ... | ddssff/lens | src/Control/Lens/Cons.hs | bsd-3-clause | 14,364 | 0 | 12 | 2,904 | 3,153 | 1,860 | 1,293 | -1 | -1 |
{-# LANGUAGE CPP, FlexibleInstances, IncoherentInstances, NamedFieldPuns,
NoImplicitPrelude, OverlappingInstances, TemplateHaskell,
UndecidableInstances #-}
{-|
Module: Data.Aeson.TH
Copyright: (c) 2011, 2012 Bryan O'Sullivan
(c) 2011 MailRank, Inc.
License: Apache
Stability: experime... | maximkulkin/aeson | Data/Aeson/TH.hs | bsd-3-clause | 33,875 | 0 | 24 | 13,014 | 7,561 | 4,077 | 3,484 | 554 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-autoscaling/gen/Network/AWS/AutoScaling/DescribeAutoScalingInstances.hs | mpl-2.0 | 6,046 | 0 | 12 | 1,175 | 726 | 431 | 295 | 78 | 1 |
-- c.f #3613
module T3613 where
import Control.Monad
foo :: Maybe ()
foo = return ()
bar :: IO ()
bar = return ()
fun1 = let fooThen m = foo>> m
in fooThen (bar>> undefined)
fun2 = let fooThen m = foo>> m
in fooThen (do {bar; undefined})
| sdiehl/ghc | testsuite/tests/typecheck/should_fail/T3613.hs | bsd-3-clause | 260 | 0 | 10 | 71 | 121 | 62 | 59 | 10 | 1 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
-- | Provide the user with a rich text editor.
module Yesod.Form.Nic
( YesodNic (..)
, nicHtmlField
) where
import Yesod.Core
import Yesod.Form
import Text.HT... | Daniel-Diaz/yesod | yesod-form/Yesod/Form/Nic.hs | mit | 1,714 | 0 | 13 | 358 | 402 | 222 | 180 | 38 | 2 |
{-# LANGUAGE DeriveFunctor #-}
module Type where
import qualified Data.List as List
import qualified Data.Set as Set
import Data.Set(Set)
import Expr(Expr(..))
import FreeVars
-- Data definitions
type TyVar = String
data BaseType a =
TBool |
TInt |
TFun a (BaseType a) (BaseType a) |
TVar TyVar
deriving (... | authchir/mini-ml | src/Type.hs | isc | 1,418 | 0 | 12 | 303 | 557 | 295 | 262 | 43 | 0 |
module Constants where
timestep = 0.01
updatesPerFrame = 1 :: Int
numStars = 1000
massOfStar = 1.0
goldenAngle = pi * (3.0 - (sqrt 5.0))
softeningLength = 0.01
forgetDistance = 10.0
treeForceAccuracy = 0.1
bigG = 0.001
| pauldoo/scratch | NBody/Constants.hs | isc | 221 | 0 | 9 | 39 | 69 | 41 | 28 | 10 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Network.API.Mandrill.Messages.Types where
import Data.Char
import Data.Time
import qualified Data.Text as T
import Control.Monad
import Data.Monoid
import Data.Aeson
import Data.Aeson.... | adinapoli/mandrill | src/Network/API/Mandrill/Messages/Types.hs | mit | 2,044 | 0 | 10 | 414 | 336 | 195 | 141 | 45 | 0 |
module Occupation where
import Data.Set (Set)
import qualified Data.Set as Set
import qualified Data.List as List
{--
-
- From 101 Puzzles in Thought and Logic, problem 6.
-
- Clark, Jones, Morgan, and Smith are four men whose occupation are
- butcher,
- druggist, grocer, and policeman, though not necessarily respect... | nlim/haskell-playground | src/Occupation.hs | mit | 2,910 | 0 | 11 | 571 | 896 | 498 | 398 | 45 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module CountdownGame.Actions
( anleitung
, play
, register
, postRegister
, admin
, highScores
, getPlayers
, getSnapshot
, evalFormula
, isLocalhost
)where
import Debug.Trace (trace)
import Control.Monad.... | CarstenKoenig/Countdown | src/web/CountdownGame/Actions.hs | mit | 3,608 | 0 | 19 | 726 | 1,011 | 539 | 472 | 102 | 2 |
import System.IO
import System.Exit
import System.Environment(getArgs)
import Data.List
import Data.Char
-- General functions
genBigPuzzle :: [Int] -> [[Int]]
genBigPuzzle [] = []
genBigPuzzle lst
| ((head lst) == 0) = [[0..9]] ++ (genBigPuzzle (tail lst))
| otherwise = [ [head lst] ] ++ (genBi... | ruben2020/small-haskell-proj | sudoku_solver/sudsolv.hs | mit | 9,479 | 13 | 17 | 3,191 | 4,020 | 2,019 | 2,001 | 224 | 4 |
module Network.Freddy.CorrelationIdGenerator (CorrelationId, generateCorrelationId) where
import System.Random (randomIO)
import qualified Data.UUID as UUID
import Data.UUID (UUID)
import Data.Text (Text)
type CorrelationId = Text
generateCorrelationId :: IO CorrelationId
generateCorrelationId = do
uuid <- newUUID... | salemove/freddy-hs | src/Network/Freddy/CorrelationIdGenerator.hs | mit | 388 | 0 | 9 | 52 | 104 | 60 | 44 | 12 | 1 |
{-# Language RankNTypes #-}
module Unison.Runtime.Journal where
import Control.Concurrent (forkIO)
import Control.Concurrent.STM (STM, atomically)
import Control.Concurrent.STM.TSem
import Control.Concurrent.STM.TVar
import Control.Concurrent.STM.TQueue
import Control.Exception
import Control.Monad
import Data.List
im... | nightscape/platform | node/src/Unison/Runtime/Journal.hs | mit | 4,654 | 0 | 26 | 1,156 | 1,347 | 670 | 677 | 83 | 3 |
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y {- x y = x * 2 + y * 2 -}
doubleSmallNumber x = if x > 100 then x else x*2
doubleSmallNumber' x = (if x > 100 then x else x*2) + 2
a'B = "A'B cd"
{- リスト内包表記 -}
boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x, x /= 9] {- odd(奇数) even(偶数)... | INALOW/Haskell | baby.hs | mit | 24,255 | 0 | 11 | 2,180 | 2,484 | 1,361 | 1,123 | 142 | 6 |
-- |
-- Module : Initial.AST
-- Copyright : © 2019 Elias Castegren and Kiko Fernandez-Reyes
-- License : MIT
--
-- Stability : experimental
-- Portability : portable
--
-- This module includes functionality for creating an Abstract Syntax Tree (AST),
-- as well as helper functions for checking differ... | kikofernandez/kikofernandez.github.io | files/monadic-typechecker/typechecker/src/Initial/AST.hs | mit | 11,891 | 0 | 11 | 3,500 | 1,947 | 1,148 | 799 | 157 | 1 |
module Main ( main ) where
import qualified Example2 as Ex2
main :: IO()
main = Ex2.main
| fehu/h-logic-einstein | example-2/Main.hs | mit | 91 | 0 | 6 | 19 | 32 | 20 | 12 | 4 | 1 |
module Tree where
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Data.Monoid
data Tree a =
Empty
| Leaf a
| Node (Tree a) a (Tree a)
deriving (Eq, Show)
instance Functor Tree where
fmap _ Empty = Empty
fmap f (Leaf x) = Leaf $ f x
fmap f (Node t1 x t2) = Node (fmap f t1) (f x) (fmap ... | NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter21/Exercises/src/Tree.hs | mit | 1,013 | 0 | 11 | 282 | 482 | 245 | 237 | 33 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module SchemaQuickCheck
(schemaCGRQuickCheck)
where
import qualified Data.ByteString as BS
import Capnp.Convert (bsToParsed)
import Capnp.Errors (Error)
import Capnp.TraversalLimit (de... | zenhack/haskell-capnp | tests/SchemaQuickCheck.hs | mit | 1,400 | 0 | 12 | 276 | 302 | 165 | 137 | 33 | 2 |
module Solidran.Revp.Detail where
import Solidran.Revc.Detail (complementDna)
isReversePalindrome :: String -> Bool
isReversePalindrome s = complementDna s == s
findSequencesOfLengthFrom :: Int -> Int -> [a] -> [(Int, [a])]
findSequencesOfLengthFrom _ _ [] = []
findSequencesOfLengthFrom i n s
| length s < n = [... | Jefffrey/Solidran | src/Solidran/Revp/Detail.hs | mit | 892 | 0 | 14 | 199 | 326 | 176 | 150 | 18 | 1 |
-- Binomial coefficient. General Recursion.
module BinomialCoefficient where
bc :: Integer -> Integer -> Integer
bc _ 0 = 1
-- bc n 1 = n -- There would be an attempt to match this in every recursion step.
-- Under what condition(s) could this mathching be an advantage?
-- Under what con... | pascal-knodel/haskell-craft | Examples/· Recursion/· General Recursion/Calculations/BinomialCoefficient.hs | mit | 620 | 0 | 9 | 196 | 101 | 56 | 45 | 7 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK show-extensions #-}
{-# LANGUAGE MultiWayIf #-}
-- |
-- Module : Yi.Buffer.HighLevel
-- License : GPL-2
-- Maintainer : [email protected]
-- Stability : experimental
-- Portability : portable
--
--... | ethercrow/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | 39,767 | 0 | 22 | 11,084 | 9,520 | 4,847 | 4,673 | 830 | 8 |
{-# LANGUAGE DeriveDataTypeable #-}
module ArrayBonn.Expression where
import ArrayBonn.Operator
import Autolib.TES.Identifier
import Autolib.Reader
import Autolib.ToDoc
import Autolib.Size
import Autolib.Util.Zufall
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr hiding ( Operator )
... | Erdwolf/autotool-bonn | src/ArrayBonn/Expression.hs | gpl-2.0 | 2,259 | 10 | 14 | 674 | 705 | 361 | 344 | 59 | 1 |
module Web.Scotty.Login.Internal.Cookies where
import qualified Data.Text as T
import Data.Time.Clock
import Web.Cookie
import Web.Scotty.Cookie
import Web.Scotty.Trans
setSimpleCookieExpr :: (Monad m, ScottyError e)
=> T.Text
-> T.Text
... | asg0451/scotty-login-session | src/Web/Scotty/Login/Internal/Cookies.hs | gpl-2.0 | 501 | 0 | 10 | 190 | 122 | 70 | 52 | 13 | 1 |
{- |
Module : $Header$
Description : Compute the composition table of a relational algebra
Copyright : (c) Till Mossakowski, Uni Bremen 2002-2005
License : GPLv2 or higher, see LICENSE.txt
Maintainer : [email protected]
Stability : provisional
Portability : portable
Compute the compos... | nevrenato/Hets_Fork | CASL/CompositionTable/ComputeTable.hs | gpl-2.0 | 4,785 | 0 | 22 | 1,516 | 1,158 | 596 | 562 | 85 | 7 |
-- |
-- Module : Tests.Lexer
-- Copyright : (c) 2013 Rémy Oudompheng
-- License : GPLv3 (see COPYING)
--
-- This module provides tests for the lexer.
module Tests.Lexer (testsLexer) where
import Test.Tasty
import Test.Tasty.HUnit
import Language.Go.Parser.Lexer
import Language.Go.Parser.Tokens (
GoTok... | remyoudompheng/hs-language-go | tests/Tests/Lexer.hs | gpl-3.0 | 3,202 | 0 | 9 | 630 | 749 | 406 | 343 | 109 | 1 |
module Model.Types where
import ClassyPrelude.Yesod
type ControlIO m = (MonadIO m, MonadBaseControl IO m)
type DBM m a =
(ControlIO m, MonadThrow m, Monad m) => SqlPersistT m a
type DB a = forall m. DBM m a
type DBVal val =
( PersistEntity val
, PersistEntityBackend val ~ SqlBackend
, PersistStor... | alexeyzab/cards-with-comrades | backend/src/Model/Types.hs | gpl-3.0 | 522 | 0 | 12 | 110 | 190 | 103 | 87 | -1 | -1 |
-- | Parsers for P
-- | Juan García Garland (Nov. 2016)
module Parser where
import Lexer
import Language
import Exception
import ParserCombinators
-- | The type of P Parser
type PParser = Parser [Token]
pToken :: Token -> PParser Token
pToken t = Parser $ \s -> case s of
[] -> []
... | jota191/PLang | src/Parser.hs | gpl-3.0 | 2,158 | 0 | 17 | 1,022 | 569 | 303 | 266 | 49 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-|
Module : Hypercube.Shaders
Description : The shaders
Copyright : (c) Jaro Reinders, 2017
License : GPL-3
Maintainer : [email protected]
This module contains the shaders as bytestrings and a function that produces an OpenGL @Pr... | noughtmare/hypercube | src/Hypercube/Shaders.hs | gpl-3.0 | 1,313 | 0 | 14 | 232 | 320 | 153 | 167 | 33 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
-- Module : Khan.Model.IAM.ServerCertificate
-- Copyright : (c) 2013 Brendan Hay <[email protected]>
-- License : This Source Code Form is subject to the terms of
-- the Mozilla Public License, v. 2.0.
-- ... | brendanhay/khan | khan/Khan/Model/IAM/ServerCertificate.hs | mpl-2.0 | 2,222 | 0 | 13 | 618 | 467 | 243 | 224 | 42 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-games/gen/Network/Google/Resource/Games/Snapshots/Get.hs | mpl-2.0 | 3,548 | 0 | 14 | 842 | 487 | 287 | 200 | 73 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
-- Currently this file is buggy and poorly written--it is being used for
-- testing and prototyping. It will be rewritten.
module Api.Services.LokaService where
------------------------------------------------------... | jakespringer/loka | Server/src/api/services/LokaService.hs | lgpl-3.0 | 3,998 | 0 | 30 | 675 | 824 | 440 | 384 | 63 | 1 |
module StackVM (StackVal(..), StackExp(..), Stack, Program, stackVM) where
-- Values that may appear in the stack. Such a value will also be
-- returned by the stackVM program execution function.
data StackVal = IVal Integer | BVal Bool | Void deriving Show
-- The various expressions our VM understands.
data S... | spanners/cis194 | 05-type-classes/StackVM.hs | unlicense | 2,363 | 0 | 9 | 872 | 810 | 425 | 385 | 36 | 1 |
module Sandbox.CycleStructure where
import Data.Set (Set)
import qualified Data.Set as Set
import Data.List (permutations, (\\))
type PermutationWord = [Int]
type Cycle = [Int]
type CycleStructure = [[Int]]
fromWord p = recurse 1 [] (Set.fromList [1..length p]) where
recurse x currentCycle unseen
| null unseen ... | peterokagey/haskellOEIS | src/Sandbox/Sami/Bijection2.hs | apache-2.0 | 1,793 | 0 | 15 | 494 | 948 | 489 | 459 | 41 | 2 |
{-# LANGUAGE RankNTypes #-}
module HepMC.Pipes where
import Control.Monad.IO.Class
import Control.Monad.Trans
import Data.ByteString (ByteString)
import Data.Maybe (fromMaybe)
import HepMC.Event
import HepMC.Parse
import Pipes
im... | cspollard/HHepMC | src/HepMC/Pipes.hs | apache-2.0 | 1,241 | 0 | 21 | 392 | 398 | 200 | 198 | 33 | 4 |
module Main where
import RestrictionTests(restrictionTests)
import JEPFormulaTests(formulaTests)
import BonusTests(bonusTests)
import Test.HUnit
import Control.Monad
import System.Exit
tests :: [Test]
tests = [ formulaTests
, restrictionTests
, bonusTests
]
validate :: Test -> IO ()
validate ... | gamelost/pcgen-rules | test/Main.hs | apache-2.0 | 459 | 0 | 12 | 101 | 154 | 82 | 72 | 19 | 1 |
{-# LANGUAGE TemplateHaskell, UndecidableInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Type.Binary
-- Copyright : (C) 2006 Edward Kmett
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : Edward Kmett <ekmett... | ekmett/type-int | Data/Type/Binary.hs | bsd-2-clause | 1,934 | 0 | 5 | 319 | 99 | 80 | 19 | 10 | 0 |
module Graphics.GL.Low.Blending (
-- | When blending is enabled, colors written to the color buffer will be
-- blended using a formula with the color already there. The three options
-- for the formula are:
--
-- - S*s + D*d ('FuncAdd', the default)
-- - S*s - D*d ('FuncSubtract')
-- - D*d - S*s ('FuncReverseSubtract'... | sgraf812/lowgl | Graphics/GL/Low/Blending.hs | bsd-2-clause | 6,946 | 0 | 9 | 1,345 | 747 | 486 | 261 | 77 | 1 |
{-# LANGUAGE TypeOperators, DataKinds #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Metrology.SI.PolyTypes
-- Copyright : (C) 2013 Richard Eisenberg
-- License : BSD-style (see LICENSE)
-- Maintainer : Richard Eisenberg ([email protected])
-- ... | goldfirere/units | units-defs/Data/Metrology/SI/PolyTypes.hs | bsd-3-clause | 2,685 | 0 | 6 | 651 | 475 | 269 | 206 | 44 | 0 |
module Graphics.XHB.Connection.Open (open, DispName(..)) where
import System.Environment(getEnv)
import System.IO
import Control.Exception hiding (try)
import Control.Monad
import Control.Applicative((<$>))
import Data.Foldable (foldrM)
import Network.Socket
import Graphics.X11.Xauth
import Data.Maybe (fromMaybe)
... | aslatter/xhb | Graphics/XHB/Connection/Open.hs | bsd-3-clause | 3,778 | 0 | 17 | 1,299 | 1,103 | 549 | 554 | 78 | 3 |
module Zero.Index
(
Index(..)
) where
------------------------------------------------------------------------------
import Data.Aeson
import Zero.View
------------------------------------------------------------------------------
data Index = Index
deriving (Show, Generic)
instance ... | et4te/zero | src-shared/Zero/Index.hs | bsd-3-clause | 1,052 | 0 | 13 | 202 | 266 | 133 | 133 | -1 | -1 |
module Hack2.Contrib.Middleware.NotFound (not_found) where
import Hack2
import Hack2.Contrib.Response
import Hack2.Contrib.Constants
import Air.Light
import Prelude hiding ((.), (^), (>), (+))
import Data.Default
not_found :: Middleware
not_found _ = \_ -> return $
def
.set_status 404
.set_content_type _T... | nfjinjing/hack2-contrib | src/Hack2/Contrib/Middleware/NotFound.hs | bsd-3-clause | 354 | 3 | 7 | 56 | 105 | 66 | 39 | 13 | 1 |
-- | Support for providing a Frame-based API on top of an unreliable bytestream.
module Network.LambdaBridge.Frame
( frameProtocol
, maxFrameSize
, crc
) where
import Control.Exception as E
import Data.Word
import Data.Bits
import Control.Concurrent
import Control.Concurrent.MVar
import qualified Data.ByteString... | andygill/lambda-bridge | Network/LambdaBridge/Frame.hs | bsd-3-clause | 10,387 | 129 | 21 | 3,421 | 2,080 | 1,108 | 972 | 169 | 9 |
{-# LANGUAGE BangPatterns, RecordWildCards, NamedFieldPuns,
DeriveGeneric, DeriveDataTypeable, GeneralizedNewtypeDeriving,
ScopedTypeVariables #-}
-- | An experimental new UI for cabal for working with multiple packages
-------------------------------------------------------------------------... | sopvop/cabal | cabal-install/Distribution/Client/ProjectPlanOutput.hs | bsd-3-clause | 5,998 | 1 | 25 | 1,814 | 1,134 | 602 | 532 | 100 | 15 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP #-}
module BuildTyCl (
buildDataCon,
buildPatSyn,
TcMethInfo, buildClass,
mkNewTyConRhs, mkDataTyConRhs,
newImplicitBinder, newTyConRepName
) where
#include ... | ezyang/ghc | compiler/iface/BuildTyCl.hs | bsd-3-clause | 18,946 | 0 | 20 | 6,801 | 3,096 | 1,678 | 1,418 | 259 | 3 |
{-# LANGUAGE CPP #-}
module TcCanonical(
canonicalize,
unifyDerived,
makeSuperClasses, mkGivensWithSuperClasses,
StopOrContinue(..), stopWith, continueWith
) where
#include "HsVersions.h"
import TcRnTypes
import TcType
import Type
import TcFlatten
import TcSMonad
import TcEvidence
import Class
... | oldmanmike/ghc | compiler/typecheck/TcCanonical.hs | bsd-3-clause | 81,906 | 188 | 30 | 23,101 | 9,520 | 5,251 | 4,269 | -1 | -1 |
module Statsd.Test.Utils (utilsSpec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import Statsd.Utils
utilsSpec :: Spec
utilsSpec = do
describe "sanitizeKeyName" $ modifyMaxSize (+1000) sanitizeKeyNameSpec
sanitizeKeyNameSpec :: Spec
sanitizeKeyNameSpec = do
prop "never makes... | ant1441/haskell-statsd | test/Statsd/Test/Utils.hs | bsd-3-clause | 882 | 0 | 16 | 181 | 225 | 118 | 107 | 21 | 1 |
module DynamicTaskDuplicate where
import Data.ByteString.Lazy.Char8 as BLC
import Control.Distributed.Task.Types.TaskTypes
task :: Task
task = Prelude.map (\s -> s `BLC.append` (BLC.pack " - ") `BLC.append` s)
| michaxm/task-distribution | resources/DynamicTaskDuplicate.hs | bsd-3-clause | 213 | 0 | 12 | 28 | 68 | 43 | 25 | 5 | 1 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
import Language.Haskell.Liquid.Prelude
insert key value [] = [(key, value)]
insert _ _ _ = error ""
| spinda/liquidhaskell | tests/gsoc15/unknown/pos/duplicate-bind.hs | bsd-3-clause | 163 | 1 | 6 | 35 | 52 | 27 | 25 | 5 | 1 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-2006
RnEnv contains functions which convert RdrNames into Names.
-}
{-# LANGUAGE CPP, MultiWayIf, NamedFieldPuns #-}
module RnEnv (
newTopSrcBinder,
lookupLocatedTopBndrRn, lookupTopBndrRn,
lookupLocatedOccRn, lookupOccRn, lookupOccRn_m... | ezyang/ghc | compiler/rename/RnEnv.hs | bsd-3-clause | 64,166 | 69 | 22 | 17,961 | 8,661 | 4,440 | 4,221 | 721 | 13 |
module Turbinado.Server.Network (
receiveRequest -- :: Handle -> IO Request
, sendResponse -- :: Handle -> Response -> IO ()
) where
import Data.Maybe
import Network.Socket
import Turbinado.Controller.Monad
import Turbinado.Server.Exception
import Turbinado.Environment.Logger
import Turbin... | abuiles/turbinado-blog | Turbinado/Server/Network.hs | bsd-3-clause | 1,024 | 0 | 15 | 227 | 223 | 120 | 103 | 22 | 2 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.EXT.VertexWeighting
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <[email protected]>
-- Stability : stable
-- Portabil... | haskell-opengl/OpenGLRaw | src/Graphics/GL/EXT/VertexWeighting.hs | bsd-3-clause | 1,248 | 0 | 5 | 155 | 123 | 83 | 40 | 23 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main (main) where
im... | harendra-kumar/asyncly | test/PureStreams.hs | bsd-3-clause | 7,277 | 0 | 20 | 2,626 | 2,364 | 1,276 | 1,088 | 85 | 8 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.ShadowAmbient
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <[email protected]>
-- Stability : stable
-- Portability : portable
-... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/ShadowAmbient.hs | bsd-3-clause | 666 | 0 | 4 | 78 | 37 | 31 | 6 | 3 | 0 |
{-# LANGUAGE TemplateHaskell, PolyKinds, DataKinds, TypeFamilies, TypeInType,
TypeOperators, GADTs, ScopedTypeVariables, UndecidableInstances,
DefaultSignatures, FlexibleContexts
#-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Si... | int-index/singletons | src/Data/Singletons/Prelude/Num.hs | bsd-3-clause | 3,604 | 5 | 16 | 1,078 | 726 | 399 | 327 | 76 | 0 |
module REPL.Set (set) where
import Rating
import REPL.NPC (npcLookup)
import REPL.Util
set :: [String] -> Rating -> Either String Rating
set [] _ = Left "使い方: 'set NPC名 番号'"
set [_] _ = Left "使い方: 'set NPC名 番号'"
set (name:pos:_) r = case npcLookup name of
"dai" -> Right $ r {dai = newIndex n}
"kaour" -> Right... | sandmark/AlbanKnights | src/REPL/Set.hs | bsd-3-clause | 549 | 0 | 11 | 130 | 221 | 116 | 105 | 14 | 5 |
module EvalM where
import Control.Parallel
import Control.Parallel.Strategies hiding (parMap, parList)
import Sudoku (Grid, solve)
import Data.List (splitAt)
import Control.DeepSeq (force)
import Control.Monad
import Strategy (parList, badParList)
-- parMap abstraction enables us to apply parallelism to
-- all the el... | sebashack/EvalMonadExample | src/EvalM.hs | bsd-3-clause | 1,136 | 0 | 13 | 210 | 403 | 220 | 183 | 26 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
-- | Representations for tuple types
--
-- The reason for using symbol names ending with @_t@ is that 'deriveRender'
-- uses everything that comes before @_@ when rendering the constructor.
module Data.TypeRep.Types.Tuple wher... | emilaxelsson/open-typerep | src/Data/TypeRep/Types/Tuple.hs | bsd-3-clause | 6,264 | 0 | 24 | 1,448 | 3,262 | 1,700 | 1,562 | -1 | -1 |
{-# LANGUAGE FlexibleContexts, RankNTypes, CPP #-}
module AWS.EC2.Subnets
( describeSubnets
, createSubnet
, deleteSubnet
) where
import Data.Text (Text)
import Data.XML.Types (Event)
import Data.Conduit
import Control.Applicative
#if MIN_VERSION_conduit(1,1,0)
import Control.Monad.Trans.Resource (Mon... | IanConnolly/aws-sdk-fork | AWS/EC2/Subnets.hs | bsd-3-clause | 2,222 | 0 | 14 | 396 | 449 | 245 | 204 | 55 | 1 |
module RecordExplicitUsed where
import Language.Haskell.Names (Symbol (Value, symbolModule))
foo = Value {symbolModule = undefined}
| serokell/importify | test/test-data/haskell-names@records/03-RecordExplicitUsed.hs | mit | 144 | 0 | 6 | 26 | 34 | 23 | 11 | 3 | 1 |
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import System.Exit (ExitCode(..), exitWith)
import Binary (toDecimal)
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess
testCase :: St... | pminten/xhaskell | binary/binary_test.hs | mit | 808 | 0 | 12 | 163 | 300 | 158 | 142 | 23 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : $Header$
Description : abstract syntax of CASL specification libraries
Copyright : (c) Klaus Luettich, Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : [email protected]
Stability : provisional
Portability : n... | keithodulaigh/Hets | Syntax/AS_Library.der.hs | gpl-2.0 | 7,047 | 0 | 13 | 1,758 | 1,569 | 828 | 741 | 119 | 7 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/UpdateGatewaySoftwareNow.hs | mpl-2.0 | 4,801 | 0 | 9 | 850 | 463 | 283 | 180 | 56 | 1 |
<?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="id-ID">
<title>Laporan ekspor | ZAP Ekstensi</title>
<maps>
<homeID>top</homeID>
<mapr... | veggiespam/zap-extensions | addOns/exportreport/src/main/javahelp/org/zaproxy/zap/extension/exportreport/resources/help_id_ID/helpset_id_ID.hs | apache-2.0 | 970 | 80 | 66 | 160 | 415 | 210 | 205 | -1 | -1 |
<?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="ru-RU">
<title>ToDo-List</title>
<maps>
<homeID>todo</homeID>
<mapref location="map.jhm... | denniskniep/zap-extensions | addOns/todo/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs | apache-2.0 | 955 | 77 | 67 | 155 | 408 | 207 | 201 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
#ifdef USE_TEMPLATE_HASKELL
{-# LANGUAGE TemplateHaskell #-}
#endif
{-# LANGUAGE TypeFamilies #-}
module Reflex.Dom.Builder.Class.Events where
#ifdef USE_TEMPLATE_HASKELL
import Data.GADT.Compare.TH
#else
import Data.GADT... | reflex-frp/reflex-dom | reflex-dom-core/src/Reflex/Dom/Builder/Class/Events.hs | bsd-3-clause | 14,967 | 0 | 9 | 5,783 | 1,494 | 815 | 679 | 362 | 0 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
\section[StgLint]{A ``lint'' pass to check for Stg correctness}
-}
{-# LANGUAGE CPP #-}
module Eta.StgSyn.StgLint ( lintStgBindings ) where
import Eta.StgSyn.StgSyn
import Eta.Utils.Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList )
impor... | rahulmutt/ghcvm | compiler/Eta/StgSyn/StgLint.hs | bsd-3-clause | 18,470 | 0 | 19 | 5,281 | 4,948 | 2,530 | 2,418 | -1 | -1 |
{-# Language PatternGuards #-}
module Blub
( blub
, foo
, bar
) where
import Ugah.Foo
import Control.Applicative
import Ugah.Blub (a, b, c, d, e, f, g)
f :: Int -> Int
f = (+ 3)
g :: Int
g =
where
| jystic/hsimport | tests/goldenFiles/SymbolTest27.hs | bsd-3-clause | 213 | 0 | 5 | 58 | 82 | 52 | 30 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
module Main(main) where
import Data.Int
import DNA
import DDP
import DDP_Slice
----------------------------------------------------------------
-- Distributed dot product
----------------------------------------------------------------
-- | Actor for calculating dot product
ddpDot... | SKA-ScienceDataProcessor/RC | MS6/dna/core/dna-programs/ddp-in-memory.hs | apache-2.0 | 1,231 | 0 | 16 | 311 | 313 | 161 | 152 | 26 | 2 |
-- Time-stamp: <2010-03-10 17:33:14 cklin>
module Common where
import Control.Monad (liftM)
import Data.List ((\\), nub, nubBy)
import Data.Map (Map, findWithDefault, fromList, toList)
type Endo a = a -> a
bug :: String -> a
bug msg = error ("BUG: " ++ msg)
same :: Eq a => [a] -> Bool
same [] = True
same xs = and ... | minad/omega | vendor/algorithm-p/Common.hs | bsd-3-clause | 1,338 | 0 | 12 | 327 | 670 | 362 | 308 | 35 | 2 |
module Main where
import Control.Monad
import HROOT
main :: IO ()
main = do
tcanvas <- newTCanvas "Test" "Test" 640 480
h1 <- newTH1D "test" "test" 100 (-5.0) 5.0
let bx = [-11,-5,-3,-1,1,2,3,4]
setBins1 h1 7 bx
tRandom <- newTRandom 65535
let generator = gaus tRandom 0 2
let go n | n < 0 = ... | wavewave/HROOT | examples/variablebins.hs | gpl-3.0 | 624 | 0 | 15 | 198 | 290 | 134 | 156 | 25 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
module T13333 where
import Data.Data
import GHC.Exts (Constraint)
... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/T13333.hs | bsd-3-clause | 888 | 0 | 13 | 227 | 288 | 161 | 127 | 23 | 2 |
<?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="pt-BR">
<title>Automation Framework</title>
<maps>
<homeID>top</homeID>
<mapref locatio... | thc202/zap-extensions | addOns/automation/src/main/javahelp/org/zaproxy/addon/automation/resources/help_pt_BR/helpset_pt_BR.hs | apache-2.0 | 965 | 77 | 66 | 156 | 407 | 206 | 201 | -1 | -1 |
module HOSubtype where
{-@ foo :: f:(x:{v:Int | false} -> {v:Int | v = x}) -> () @-}
foo :: (Int -> Int) -> ()
foo pf = ()
test0 :: ()
test0 = foo useless_proof
{-@ generic_accept_stable ::
f:(x:a -> {v:a | (v = x)}) ->
()
@-}
generic_accept_stable :: (... | ssaavedra/liquidhaskell | tests/todo/SubType.hs | bsd-3-clause | 530 | 0 | 7 | 160 | 110 | 61 | 49 | 11 | 1 |
{-|
Module : Idris.DSL
Description : Code to deal with DSL blocks.
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE PatternGuards #-}
module Idris.DSL (debindApp, desugar) where
import Idris.AbsSyntax
import Idris.Core.TT
import Control.Monad.State.Strict
import Data.Generics.Uniplate.Dat... | kojiromike/Idris-dev | src/Idris/DSL.hs | bsd-3-clause | 10,286 | 0 | 17 | 3,694 | 4,873 | 2,387 | 2,486 | 195 | 22 |
module Dummy where
main :: IO ()
main = error ""
| mydaum/cabal | cabal-testsuite/PackageTests/AutogenModules/SrcDist/Dummy.hs | bsd-3-clause | 50 | 0 | 6 | 12 | 22 | 12 | 10 | 3 | 1 |
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Hadoop.Protos.ClientNamenodeProtocolProtos.FinalizeUpgradeRequestProto (FinalizeUpgradeRequestProto(..)) where
import Prelude ((+), (/))
import qualified Prelude as ... | alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/ClientNamenodeProtocolProtos/FinalizeUpgradeRequestProto.hs | mit | 2,999 | 1 | 16 | 537 | 554 | 291 | 263 | 53 | 0 |
#!/usr/bin/env runhaskell
import Control.Concurrent (threadDelay)
import Control.Monad (void)
import Data.Int (Int32)
import System.Libnotify
main :: IO ()
main = void $ withNotifications Nothing $ (homogeneous >> geterogeneous)
homogeneous = do new "Same title" "line 1" "" $ do addHint (HintString "append" "allowed... | supki/libnotify | tests/add-hint-test.hs | mit | 1,560 | 0 | 12 | 770 | 313 | 145 | 168 | 30 | 1 |
module Parser
(assert_, isComment
, LineRule, parseRuleFile
, parseTupleFile
, Error, runParser, lhs_, lexLine, line_, lexFile
) where
import Data.Char (isSpace)
import Types hiding (T)
import Parse hiding (string, identifier, char, token, int_)
data Lex a = Token a | Comment a | String a
deriving (Show,... | kovach/web2 | src/Parser.hs | mit | 7,216 | 0 | 16 | 1,842 | 3,098 | 1,595 | 1,503 | 171 | 6 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.HTMLDirectoryElement (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.HTMLDirectoryElement
#else
module Graphics.UI.Gtk.WebKit.DOM.HTMLDirectoryElement
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(U... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/HTMLDirectoryElement.hs | mit | 485 | 0 | 5 | 39 | 33 | 26 | 7 | 4 | 0 |
module D20.Internal.Character.Age (Age, IsAging (..)) where
import D20.Internal.Character.Ability
import Data.Map
import Data.Maybe
import Data.List
data Age
= Child
| YoungAdult
| Adult
| MiddleAged
| Old
| Venerable
deriving (Show,Eq,Enum,Ord)
type AgeBounds = (Int,Int)
class IsAging a where
get... | elkorn/d20 | src/D20/Internal/Character/Age.hs | mit | 1,883 | 0 | 15 | 758 | 658 | 401 | 257 | 65 | 1 |
module Colors.Nord where
colorScheme = "nord"
colorBack = "#2E3440"
colorFore = "#D8DEE9"
-- Black
color00 = "#343d46"
color08 = "#343d46"
-- Red
color01 = "#EC5f67"
color09 = "#EC5f67"
-- Green
color02 = "#99C794"
color10 = "#99C794"
-- Yellow
color03 = "#FAC863"
color11 = "#FAC863"
-- Blue
color04 = "#6699cc"
colo... | phdenzel/dotfiles | .config/xmonad/lib/Colors/Nord.hs | mit | 539 | 0 | 4 | 87 | 119 | 75 | 44 | 22 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2020.M11.D12.Solution where
-- Well, howdy! Yesterday, ...
import Y2020.M11.D11.Solution (allianceGraph)
{--
... we were all: "We're gonna upload alliances to the graph-store!"
But we didn't because the day ended in an unicode-error. *sad-face*
So, today, let's:
1. firs... | geophf/1HaskellADay | exercises/HAD/Y2020/M11/D12/Solution.hs | mit | 5,000 | 0 | 12 | 804 | 416 | 237 | 179 | 31 | 1 |
--константа в Хаскел
--можем изрично да посочим типа й, ако не - компилаторът ще се досети кой е
mypi :: Double
mypi = 3.141592
--Сигнатурата на ф-ия - ако я напишем, трябва да е пълна, т.е или да пише
--конкретните типове (Int,Float,Double,Bool,Char,String,...), или да включва
--ограничения за тях в зависимост кои д... | pepincho/Functional-Programming | haskell/ex-1.hs | mit | 3,859 | 0 | 11 | 645 | 687 | 360 | 327 | 43 | 2 |
-- My smallest code interpreter (aka Brainf**k)
-- https://www.codewars.com/kata/526156943dfe7ce06200063e
module Brainfuck (executeString) where
import Data.Char (chr, ord)
import Data.Maybe (mapMaybe)
data BFCommand = GoR | GoL | Inc | Dec | Print | Read | LoopL | LoopR deriving (Eq)
data Tape a = Tape [a] a [a]
t... | gafiatulin/codewars | src/2 kyu/Brainfuck.hs | mit | 3,288 | 10 | 10 | 1,010 | 1,113 | 649 | 464 | 55 | 5 |
--------------------------------------------------------------------------------
-- (c) Tsitsimpis Ilias, 2011-2012
--
-- Typed Abstract Syntax Tree for the Alan Language
--
-- Since the LLVM API is typed it's much easier to translate a typed abstract
-- syntax tree than an untyped abstract syntax tree. The TypedAst mo... | iliastsi/gac | src/basicTypes/TypedAst.hs | mit | 7,484 | 0 | 12 | 1,794 | 2,569 | 1,320 | 1,249 | -1 | -1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
-----------------------------------------------------------------------------
-- |
-- Module : ... | jkozlowski/better-bot | src/Network/Better/Types.hs | mit | 10,299 | 0 | 11 | 2,452 | 1,842 | 1,087 | 755 | 216 | 1 |
{-# LANGUAGE BangPatterns #-}
import Data.STRef
import Control.Monad
import Control.Monad.ST
import Control.Monad.State.Strict
example1 :: Int
example1 = runST $ do
x <- newSTRef 0
forM_ [1..1000] $ \j -> do
writeSTRef x j
readSTRef x
example2 :: Int
example2 = runST $ do
count <- newSTRef 0
replicat... | riwsky/wiwinwlh | src/st.hs | mit | 553 | 0 | 12 | 121 | 242 | 122 | 120 | 22 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
------------... | katychuang/raw-pixels | src/App/Combo.hs | gpl-2.0 | 4,720 | 0 | 12 | 860 | 685 | 383 | 302 | 55 | 1 |
-- | Boot process of Yi, as an instanciation of Dyre
module Yi.Boot (yi, yiDriver, reload) where
import qualified Config.Dyre as Dyre
import Config.Dyre.Relaunch
import Control.Monad.State
import Control.Monad.Trans
import qualified Data.Rope as R
import System.Directory
import Yi.Config
import Yi.Editor
import Yi.Ke... | codemac/yi-editor | src/Yi/Boot.hs | gpl-2.0 | 1,334 | 0 | 13 | 301 | 389 | 219 | 170 | 33 | 1 |
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances #-}
{-
Copyright (C) 2006-2016 John MacFarlane <[email protected]>
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, ... | fibsifan/pandoc | src/Text/Pandoc.hs | gpl-2.0 | 16,216 | 0 | 17 | 4,889 | 3,043 | 1,735 | 1,308 | 297 | 5 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Convert.Type where
import Autolib.Reader
import Autolib.ToDoc
import Data.Typeable
import qualified Convert.Input
import qualified CSP.Trace
import Autolib.Exp.Inter
import Autolib.Exp
import Autolib.NFA hiding ( alphabet )
import Autolib.... | marcellussiegburg/autotool | collection/src/Convert/Type.hs | gpl-2.0 | 1,035 | 18 | 10 | 258 | 270 | 159 | 111 | 30 | 3 |
module HLinear.Hook.EchelonForm.SmallCheck
where
import HLinear.Utility.Prelude
import Math.Structure ( isZero, nonZero, DecidableZero )
import Test.SmallCheck.Series ( Serial, Series(..), series, decDepth )
import qualified Data.Vector as V
import HLinear.Hook.EchelonForm.Basic
import HLinear.Hook.EchelonForm.Defin... | martinra/hlinear | src/HLinear/Hook/EchelonForm/SmallCheck.hs | gpl-3.0 | 834 | 0 | 19 | 231 | 260 | 141 | 119 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.