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 GameSpec (spec) where
import Test.Hspec
import Game
import Samples
spec = do
describe "initGame" $ do
context "a messed up place" $
it "returns an error" $
initGame "1. applesauce (dinosaur)" `shouldBe`
Left "\"Map error: \" (line 1, column 25):\nunex... | emhoracek/explora | test-suite/GameSpec.hs | gpl-2.0 | 640 | 0 | 13 | 229 | 113 | 54 | 59 | 17 | 1 |
{- This module was generated from data in the Kate syntax
highlighting file literate-curry.xml, version 0.2, by Björn Peemöller (bjp@informatik.uni-kiel.de) -}
module Text.Highlighting.Kate.Syntax.LiterateCurry
(highlight, parseExpression, syntaxName, syntaxExtensions)
where
import Text.Highlighting.Kate.... | ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/LiterateCurry.hs | gpl-2.0 | 5,138 | 0 | 15 | 853 | 1,528 | 827 | 701 | 88 | 9 |
{- To speed up:
- drawing polygons
- computing points on screen for cells
-}
module Caching
( Cache, makeCache
, cellCentre, antPolygon, drawPolygons
) where
import Graphics.UI.WX
import Simulator
import Data.Array.IO
import Data.List
import Control.Monad
import qualified Data.Array as A
data Cac... | Chiel92/ants | simulation/Caching.hs | gpl-2.0 | 7,939 | 0 | 16 | 2,050 | 3,482 | 1,820 | 1,662 | 154 | 4 |
module Main where
import Graphics.Gloss
import Graphics.Gloss.Interface.IO.Game
import Bitfield
import Control.Applicative ((<$>))
import Data.List
import System.Environment
import qualified World
data Board = Board {
speed :: Int
, windowSize :: (Int, Int)
, gridSize :: (Int, Int)
, liveOn :: [Int]
, gi... | scravy/GameOfLife | GameOfLife.hs | gpl-3.0 | 3,360 | 0 | 20 | 1,121 | 1,146 | 619 | 527 | 73 | 8 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 karamellpelle@hotmail.com
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the Lice... | karamellpelle/grid | source/Game/LevelPuzzle/File.hs | gpl-3.0 | 945 | 0 | 5 | 166 | 58 | 47 | 11 | 6 | 0 |
{--
The first two consecutive numbers to have two distinct prime factors are:
14 = 2 × 7
15 = 3 × 5
The first three consecutive numbers to have three distinct prime factors are:
644 = 2² × 7 × 23
645 = 3 × 5 × 43
646 = 2 × 17 × 19.
Find the first four consecutive... | goalieca/haskelling | 047.hs | gpl-3.0 | 903 | 0 | 10 | 249 | 249 | 130 | 119 | 14 | 1 |
module Noise (perlin2D, noiseMat) where
import GHC.Int
import Data.Bits
import qualified Data.List as List
import System.Random
import qualified Data.Vector as Vec
--import Criterion.Main
fI :: (Integral a, Num b) => a -> b
fI = fromIntegral
flatMap f [] = []
flatMap f (x:xs) = (f x) ++ flatMap f xs
randList :: Int ... | eniac314/wizzard | src/Noise.hs | gpl-3.0 | 4,193 | 0 | 21 | 1,715 | 1,556 | 825 | 731 | 68 | 3 |
module Game.Toliman.Internal.Types where
import Control.Lens (makeLensesWith, underscoreFields)
import Language.Haskell.TH (Name, DecsQ)
makeUnderscoreFields :: Name -> DecsQ
makeUnderscoreFields = makeLensesWith underscoreFields
| duncanburke/toliman-core | src/Game/Toliman/Internal/Types.hs | mpl-2.0 | 233 | 0 | 5 | 23 | 52 | 32 | 20 | 5 | 1 |
module Main where
import Development.Shake
import Development.Shake.Command
import Development.Shake.FilePath
import Development.Shake.Util
import Prelude hiding ((*>))
import Data.Map.Lazy (fromList)
import Data.Text.Lazy (unpack)
import Text.Blaze (string)
import Text.Blaze.Html (Html)
import Text.Blaze.Html.Rende... | dequbed/blog | src/Main.hs | mpl-2.0 | 1,933 | 0 | 19 | 408 | 581 | 312 | 269 | 55 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/DynamicTargetingKeys/List.hs | mpl-2.0 | 5,072 | 0 | 17 | 1,182 | 699 | 403 | 296 | 103 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-proximitybeacon/gen/Network/Google/Resource/ProximityBeacon/Beacons/Attachments/Create.hs | mpl-2.0 | 8,210 | 0 | 20 | 1,856 | 1,040 | 613 | 427 | 144 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/DescribeUserProfiles.hs | mpl-2.0 | 4,491 | 0 | 10 | 839 | 549 | 330 | 219 | 62 | 1 |
{- ORMOLU_DISABLE -}
-- Example 12 - the rounded union of a square and a circle.
import Control.Applicative (pure)
import Graphics.Implicit
out = unionR 14 [
square True (pure 80) -- pure 80 turns into (V2 80 80)
, translate (pure 40) $ circle 30
]
main = writeSVG 2 "example12.svg" out
| colah/ImplicitCAD | Examples/example12.hs | agpl-3.0 | 297 | 0 | 10 | 62 | 74 | 39 | 35 | 6 | 1 |
-- !! ATTENTION: SPOILERS AHEAD !! --
module BinaryTrees where
import Prelude hiding ( Left, Right, flip, insert )
import Data.Function ( on )
import Data.List ( nubBy )
import Control.Monad ( void )
import Data.Composition ( (.:) )
import Lists ( combinations )
{-# ANN module "HLint: ignore U... | nilthehuman/H-99 | BinaryTrees.hs | unlicense | 5,700 | 0 | 15 | 1,579 | 2,406 | 1,211 | 1,195 | 119 | 3 |
-- These are the tests for our api. The only real interesting part is the
-- 'main' function, where we specific that the test database is in memory.
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE InstanceSigs #-}
{-# L... | cdepillabout/testing-code-that-accesses-db-in-haskell | with-db/in-memory-db/test/Test.hs | apache-2.0 | 4,606 | 0 | 17 | 1,074 | 843 | 463 | 380 | 74 | 1 |
import Data.List
chk _ [] = []
chk n (x:xs) =
(min x n):( chk (n-1) xs )
ans x =
let s = sort x
l = length x
in
maximum $ chk l s
main = do
_ <- getLine
l <- getLine
let i = map read $ words l :: [Int]
o = ans i
print o
| a143753/AOJ | 0319.hs | apache-2.0 | 257 | 0 | 11 | 98 | 161 | 78 | 83 | 14 | 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>OpenAPI Support Add-on</title>
<maps>
<homeID>openapi</homeID>
<mapref l... | secdec/zap-extensions | addOns/openapi/src/main/javahelp/org/zaproxy/zap/extension/openapi/resources/help_ru_RU/helpset_ru_RU.hs | apache-2.0 | 971 | 77 | 67 | 157 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE GADTs #-}
module GfxPP where
import System.Environment
import SDL
import SDL.Input.Keyboard
import Linear
import Linear.Affine ( Point(P) )
import Control.Monad
import Control.Monad.Loops
import Control.Monad.Primitive
import Control.Monad.I... | piotrm0/planar | GfxPP.hs | artistic-2.0 | 2,201 | 0 | 8 | 397 | 603 | 374 | 229 | -1 | -1 |
{-# LANGUAGE PatternSynonyms #-}
module Data.YQL.Response
( Response(..)
, pattern ResponseJSON
, pattern ResponseByteString
, object ) where
import Control.Lens
import Data.Aeson (Value)
import Data.ByteString.Lazy
data Response
= Response
{ responseObject :: Either Value ByteStri... | fabianbergmark/YQL | src/Data/YQL/Response.hs | bsd-2-clause | 638 | 0 | 10 | 133 | 211 | 113 | 98 | 19 | 1 |
module Benchmarks.Mul
( initEnv
, benchmark
) where
import Control.Exception (evaluate)
import Criterion.Main
import Data.Int (Int32, Int64)
import Data.Text.Internal (mul32, mul64)
import qualified Data.Vector.Unboxed as U
oldMul :: Int64 -> Int64 -> Int64
oldMul m n
| n == 0 = 0
... | bgamari/text | benchmarks/haskell/Benchmarks/Mul.hs | bsd-2-clause | 8,716 | 0 | 12 | 572 | 4,042 | 2,633 | 1,409 | 137 | 1 |
{-#LANGUAGE OverloadedStrings #-}
module Twilio.Types.PriceUnit where
import Control.Monad
import Data.Aeson
import Data.Text (Text)
import qualified Data.Text as T
data PriceUnit
= USD
| EUR
| JPY
| OtherPriceUnit !Text
deriving Eq
instance Show PriceUnit where
show USD = "USD"
show EUR = "EUR"
sho... | seagreen/twilio-haskell | src/Twilio/Types/PriceUnit.hs | bsd-3-clause | 603 | 0 | 8 | 120 | 197 | 104 | 93 | 25 | 0 |
-- print3broken.hs
module AddStuff where
addStuff :: Integer -> Integer -> Integer
addStuff a b = a + b + 5
subtractStuff :: Integer -> Integer -> Integer
subtractStuff x y = x - y - 10
subtractOne = subtractStuff 1
autoCurry :: ((t1, t2) -> t) -> t1 -> t2 -> t
autoCurry f a b = f (a, b) | pdmurray/haskell-book-ex | src/ch5/AddStuff.hs | bsd-3-clause | 292 | 0 | 8 | 64 | 126 | 68 | 58 | 8 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : TestSuite.CodeGeneration.Fibonacci
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Test suite for Data.SBV.Examples.CodeGeneration.Fibona... | josefs/sbv | SBVTestSuite/TestSuite/CodeGeneration/Fibonacci.hs | bsd-3-clause | 999 | 0 | 11 | 244 | 162 | 88 | 74 | 12 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
module Types where
import Control.Remote.Monad
import Control.Remote.Monad.Binary
import Data.Binary
data Prim :: * -> * where
Push :: Int -> Prim... | ku-fpg/remote-binary | example/Types.hs | bsd-3-clause | 1,051 | 0 | 16 | 393 | 313 | 162 | 151 | 32 | 1 |
{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, TupleSections,
RecordWildCards #-}
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
-----------------------------------------------------------------------------
--
-- GHC Interactive User Interface
--
-- (c) The GHC ... | siddhanathan/ghc | ghc/InteractiveUI.hs | bsd-3-clause | 131,183 | 93 | 103 | 37,854 | 30,432 | 15,501 | 14,931 | -1 | -1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.ShaderSubroutine
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portabl... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/ShaderSubroutine.hs | bsd-3-clause | 1,287 | 0 | 4 | 139 | 100 | 74 | 26 | 22 | 0 |
module System.IO.Streams.Logging.Internal.Types
( Logger(..)
, LoggerState(..)
) where
------------------------------------------------------------------------------
import Blaze.ByteString.Builder (Builder)
import Control.Concurrent.MVar (MVar)
import Data.ByteString.Char8 (Byt... | snapframework/logging-streams | src/System/IO/Streams/Logging/Internal/Types.hs | bsd-3-clause | 1,056 | 0 | 11 | 217 | 144 | 92 | 52 | 12 | 0 |
{-# LANGUAGE FlexibleInstances, DeriveFunctor, RankNTypes, LambdaCase #-}
module Grin.Grin
( module Grin.Grin
, module Grin.Syntax
) where
import Data.Functor.Foldable as Foldable
import Debug.Trace (trace)
import Lens.Micro.Platform
import Data.Maybe
import Data.Text (pack, unpack)
import Data.List (nub)
impor... | andorp/grin | grin/src/Grin/Grin.hs | bsd-3-clause | 3,478 | 0 | 12 | 1,003 | 1,337 | 682 | 655 | 106 | 6 |
import HeyJude (sing)
main = mapM_ putStrLn $ lines sing
| eccstartup/HeyJude | Main.hs | bsd-3-clause | 58 | 0 | 6 | 11 | 24 | 12 | 12 | 2 | 1 |
import Control.Monad.Trans
import System.Console.Haskeline
import System.Console.ANSI
import System.Environment
import System.IO
import System.Directory
import Doc
type Repl a= InputT IO a
ckModule [] = putStr "-- missing module id"
ckModule [x] = putStr (x++" -- missing where keyword")
ckModule (x:"where":xs) = putS... | trxeste/wrk | haskell/haskellTextEditor/haskellEd.hs | bsd-3-clause | 9,139 | 0 | 17 | 2,523 | 3,639 | 1,711 | 1,928 | 254 | 9 |
module REPL where
import Control.Monad.IO.Class (liftIO)
import SimpleLang.Syntax
import System.Console.Haskeline
process :: String -> IO ()
process s =
let exs = parseExpr s in
case exs of
Right ev -> case eval ev of
Just evaled -> print evaled
Nothing... | AlphaMarc/WYAH | app/REPL.hs | bsd-3-clause | 617 | 0 | 13 | 186 | 201 | 98 | 103 | 20 | 3 |
module Main where
import Test.DocTest
main :: IO ()
main = doctest ["FizzBuzz.hs", "FizzBuzz'.hs"]
| temmings/FizzBuzz | Haskell/doctests.hs | bsd-3-clause | 101 | 0 | 6 | 16 | 33 | 19 | 14 | 4 | 1 |
module Con.Types.Aggregate (Aggregate, newAgg, singleton, retrieve, aggregate, aggSum, mean, variance) where
import qualified Data.Map as M
type Aggregate = M.Map String Double
newAgg :: Aggregate
newAgg = M.empty
singleton :: String -> Double -> Aggregate
singleton = M.singleton
retrieve :: String -> Aggregate ->... | josephturnerjr/caster | src/Con/Types/Aggregate.hs | bsd-3-clause | 710 | 0 | 10 | 135 | 262 | 146 | 116 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Commands
( RelativeDirection(..)
, Position(..)
, Range(..)
, Args(..)
, CommandName(..)
, StateInfo(..)
, CommandState(..)
) where
import Data.List (find)
import qualified Data.Text as T
import qualified Data.Vector as V
import Control.Monad.State
import Syst... | jecxjo/hed | src/Commands.hs | bsd-3-clause | 2,686 | 0 | 59 | 759 | 852 | 480 | 372 | 79 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Error
-- Copyright : (c) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : provisional
-- Port... | FranklinChen/hugs98-plus-Sep2006 | packages/unix/System/Posix/Error.hs | bsd-3-clause | 1,587 | 14 | 11 | 272 | 410 | 216 | 194 | 28 | 2 |
-- |
-- Datatype library for the MySQL datatypes
--
-- $Id: DataTypeLibMysql.hs,v 1.1 2005/09/02 17:09:39 hxml Exp $
module Yuuko.Text.XML.HXT.RelaxNG.DataTypeLibMysql
( mysqlNS
, mysqlDatatypeLib
)
where
import Yuuko.Text.XML.HXT.RelaxNG.DataTypeLibUtils
import Data.Maybe
-- -------------------------------... | nfjinjing/yuuko | src/Yuuko/Text/XML/HXT/RelaxNG/DataTypeLibMysql.hs | bsd-3-clause | 5,316 | 30 | 12 | 1,570 | 1,020 | 659 | 361 | 109 | 1 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.DepthClamp
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability :... | haskell-opengl/OpenGLRaw | src/Graphics/GL/ARB/DepthClamp.hs | bsd-3-clause | 633 | 0 | 5 | 91 | 47 | 36 | 11 | 7 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
-- Create a source distribution tarball
module Stac... | juhp/stack | src/Stack/SDist.hs | bsd-3-clause | 23,376 | 0 | 24 | 6,267 | 4,819 | 2,518 | 2,301 | 392 | 12 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.FramebufferNoAttachments
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/FramebufferNoAttachments.hs | bsd-3-clause | 2,405 | 0 | 12 | 235 | 261 | 166 | 95 | -1 | -1 |
{-# language CPP #-}
-- No documentation found for Chapter "ExternalFenceFeatureFlagBits"
module Vulkan.Core11.Enums.ExternalFenceFeatureFlagBits ( ExternalFenceFeatureFlags
, ExternalFenceFeatureFlagBits( EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT
... | expipiplus1/vulkan | src/Vulkan/Core11/Enums/ExternalFenceFeatureFlagBits.hs | bsd-3-clause | 3,092 | 1 | 10 | 779 | 357 | 215 | 142 | -1 | -1 |
module Math.Simplicial.PreScale where
data PreScale = Absolute Double | ConditionFactor Double
deriving (Eq, Show)
| michiexile/hplex | pershom/src/Math/Simplicial/PreScale.hs | bsd-3-clause | 132 | 0 | 6 | 31 | 32 | 19 | 13 | 3 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System.Directory.PathWalk
( WalkStatus(Continue, StopRecursing)
, pathWalkInterruptible
)
import System.FilePath.Posix (takeFileName, (</>))
import Data.Foldable (for_)
import System.Environment (getArgs)
import qualified Data.HashSet as HashSet
import... | FranklinChen/change-travis-stuff | app/Main.hs | bsd-3-clause | 1,765 | 0 | 19 | 387 | 451 | 249 | 202 | 55 | 3 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.System
-- Copyright : Duncan Coutts 2007-2008
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- Cabal often... | plumlife/cabal | Cabal/Distribution/System.hs | bsd-3-clause | 7,080 | 0 | 13 | 1,657 | 1,535 | 866 | 669 | 124 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Generate (htmlSkeleton, html, js, scripts) where
import Control.Monad (forM_, when)
import Text.Blaze (preEscapedToMarkup)
import Text.Blaze.Html5 ((!))
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
import Compile
import qualified Ut... | avh4/elm-lang.org | backend/Generate.hs | bsd-3-clause | 2,134 | 0 | 17 | 525 | 659 | 330 | 329 | 55 | 3 |
module Sharc.Instruments.FrenchHornMuted (frenchHornMuted) where
import Sharc.Types
frenchHornMuted :: Instr
frenchHornMuted = Instr
"French_horn_muted"
"French Horn (muted)"
(Legend "McGill" "2" "20")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 73.41 26 "d2"))
(Pitch 73.... | anton-k/sharc-timbre | src/Sharc/Instruments/FrenchHornMuted.hs | bsd-3-clause | 76,962 | 0 | 15 | 21,252 | 30,412 | 15,801 | 14,611 | 2,587 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Examples.CRC.Parity
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Parity check as CRC's
-----------------------------------------------... | Copilot-Language/sbv-for-copilot | SBVUnitTest/Examples/CRC/Parity.hs | bsd-3-clause | 983 | 0 | 11 | 212 | 248 | 134 | 114 | 16 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module Sky.Ideas.AnnotatedType where
-- Take some implementation of types and values
data BaseType r
= BaseType ... | xicesky/sky-haskell-playground | src/Sky/Ideas/AnnotatedType.hs | bsd-3-clause | 3,191 | 0 | 13 | 707 | 1,045 | 564 | 481 | 75 | 2 |
{-# LANGUAGE RecordWildCards #-}
module Test where
import HTorrent.Common
import HTorrent.Tracker
import HTorrent.Types
import HTorrent.Peer
import HTorrent.Parsers.Bencode
import HTorrent.Parsers.PWP
import HTorrent.Parsers.THP
import HT... | nickspinale/shawarma | tests/Test.hs | mit | 2,176 | 0 | 13 | 740 | 569 | 303 | 266 | 58 | 1 |
module Homework.Week12.Assignment where
| laser/cis-194-spring-2017 | src/Homework/Week12/Assignment.hs | mit | 41 | 0 | 3 | 4 | 7 | 5 | 2 | 1 | 0 |
import Drawing
import Exercises
import Geometry
main = drawPicture myPicture
myPicture points =
message "Orthocenter of triangle ABC"
& red (drawSegment (o,a') & drawSegment (a',a) & drawLine (b,c) )
& green (drawSegment (o,b') & drawSegment (b',b) & drawLine (c,a) )
& blue (drawSegment (o,c') & draw... | alphalambda/hsmath | src/Learn/Geometry/ex12orthocenter.hs | gpl-2.0 | 709 | 0 | 18 | 188 | 353 | 194 | 159 | 19 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-ssm/gen/Network/AWS/SSM/GetDocument.hs | mpl-2.0 | 4,104 | 0 | 13 | 977 | 659 | 391 | 268 | 83 | 1 |
module Utils.Exceptions(InspectErrors(..))
where
import Control.Exception(Exception)
data InspectErrors = InvalidLabelError
| MissingCSError
| MissingDBError
deriving(Eq, Show)
instance Exception InspectErrors
| atodorov/bdcs | src/tools/inspect/Utils/Exceptions.hs | lgpl-2.1 | 253 | 0 | 6 | 61 | 56 | 33 | 23 | 7 | 0 |
{-# LANGUAGE
TemplateHaskell
, DeriveDataTypeable
, QuasiQuotes
, DataKinds
, TypeFamilies
, RankNTypes
, ScopedTypeVariables
, DataKinds
#-}
{-# OPTIONS -fno-warn-missing-signatures -W #-}
-- This option causes the compilation of this module to dump the derived
-- code. For some reason, hint beli... | suhailshergill/hakaru | Tests/EmbedDatatypes.hs | bsd-3-clause | 1,245 | 0 | 10 | 288 | 331 | 173 | 158 | 29 | 1 |
{-# LANGUAGE CPP #-}
-- ----------------------------------------------------------------------------
-- | Base LLVM Code Generation module
--
-- Contains functions useful through out the code generator.
--
module LlvmCodeGen.Base (
LlvmCmmDecl, LlvmBasicBlock,
LiveGlobalRegs,
LlvmUnresData, L... | holzensp/ghc | compiler/llvmGen/LlvmCodeGen/Base.hs | bsd-3-clause | 18,044 | 0 | 22 | 4,132 | 4,137 | 2,199 | 1,938 | 289 | 6 |
module Optimize (optimize) where
import Control.Applicative
import qualified Control.Monad as M
import qualified Data.Traversable as T
import qualified AST.Expression.General as Expr
import qualified AST.Expression.Canonical as Can
import qualified AST.Expression.Optimized as Opt
import qualified AST.Module as Module... | pairyo/elm-compiler | src/Optimize.hs | bsd-3-clause | 12,177 | 0 | 25 | 3,662 | 3,660 | 1,854 | 1,806 | 294 | 20 |
module Canonicalize.Port (check) where
import Control.Applicative ((<$>))
import qualified Data.Foldable as Foldable
import qualified AST.Declaration as D
import qualified AST.Expression.General as E
import qualified AST.Expression.Canonical as Canonical
import qualified AST.Type as T
import qualified AST.Variable as... | Axure/elm-compiler | src/Canonicalize/Port.hs | bsd-3-clause | 3,484 | 0 | 18 | 1,093 | 1,185 | 596 | 589 | 93 | 11 |
-- Fizz / Buzz
-- http://www.codewars.com/kata/51dda84f91f5b5608b0004cc/
module FizzBuzz where
fizzbuzz :: Int -> [Int]
fizzbuzz n = [f 3 - f 15, f 5 - f 15, f 15]
where f = div (n-1)
| gafiatulin/codewars | src/6 kyu/FizzBuzz.hs | mit | 190 | 0 | 9 | 40 | 75 | 40 | 35 | 4 | 1 |
module Nunavut.Util (
module X
) where
import Nunavut.Util.Dimensions as X
import Nunavut.Util.Error as X
import Nunavut.Util.NonEmpty as X
| markcwhitfield/nunavut | src/Nunavut/Util.hs | mit | 145 | 0 | 4 | 24 | 36 | 26 | 10 | 5 | 0 |
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
-- |
-- NeatInterpolation provides a quasiquoter for producing strings
-- with a simple interpolation of input values.
-- It removes the excessive indentation from the input and
-- accurately manages the indentation of all lines of interpolated variables.
-- But enough... | rasendubi/neat-interpolation | library/NeatInterpolation.hs | mit | 3,373 | 0 | 18 | 743 | 611 | 353 | 258 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE RecordWildCards #-}
-- | Run third-party analysis webservices
module Model.Scenario.ServicePlugin
( ServicePlugin, SPView (..)
, spName, spURL, spIcon, spIconBgColor, spView
) where
import JavaSc... | achirkin/qua-view | src/Model/Scenario/ServicePlugin.hs | mit | 3,436 | 0 | 19 | 910 | 1,050 | 550 | 500 | 85 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.PositionError
(pattern PERMISSION_DENIED, pattern POSITION_UNAVAILABLE,
pattern TIMEOUT, js_getCode, getCode, js_getMessage, getMessage,
PositionError, castToPositionError, gTypePositionErro... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/PositionError.hs | mit | 1,897 | 12 | 11 | 241 | 485 | 295 | 190 | 32 | 1 |
module Main where
import Control.Monad
import Deanie
import Model.BetaBernoulli as Model
posterior :: Double -> Double -> Program (Double, Double)
posterior a b =
importance Model.observations (beta a b) logDensityBernoulli
main :: IO ()
main = do
samples <- replicateM 1000 (sample (rvar (posterior 1 1)))
map... | jtobin/deanie | test/BetaBernoulliImportance.hs | mit | 386 | 0 | 14 | 70 | 141 | 71 | 70 | 13 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Redmine.Types where
import Data.Time (Day, UTCTime)
import Network.HTTP.Conduit
import Data.Monoid
import Data.Typeable
import Data.Data
import Data.Aeson
import qualified Data.Text as T
data Status = Closed | Open deriving (Eq, Show)
data VersionsRsp = VersionsRsp { v... | lookunder/RedmineHs | src/Redmine/Types.hs | mit | 9,072 | 0 | 10 | 3,644 | 2,050 | 1,184 | 866 | 174 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
-- |
-- Module : Zora.Graphing.TreeGraphing
-- Copyright : (c) Brett Wines 2014
--
-- License : BSD-style
--
-- Maintainer : bgwines@cs.stanford.edu
-- St... | thomasjm/hrtree | Zora-1.1.18/Zora/Graphing/TreeGraphing.hs | mit | 6,043 | 103 | 14 | 1,341 | 1,444 | 812 | 632 | 119 | 2 |
{-
Dolce - VM/Data.hs
Copyright (c) 2014, Susisu
see: license.txt
-}
{-# LANGUAGE RankNTypes #-}
module VM.Data (
Type(..),
Value(..),
typeOf,
OperationError(..),
showAsWarning,
ArgumentError(..),
VMState,
newVMState,
getFPS,
setFPS,
getCorrection,
setCorrec... | susisu/Dolce | src/VM/Data.hs | mit | 5,671 | 0 | 15 | 1,422 | 1,735 | 886 | 849 | 135 | 2 |
module Graphics.Shader (
) where
--------------------------------------------------------------------------------
import Control.Monad.State
import Graphics.Shader.Internal.Expression
import Graphics.Shader.Internal.Statement
import Graphics.Shader.Internal.Variable
import Graphics.Shader.Program
-------------------... | Mokosha/shaders | Graphics/Shader.hs | mit | 694 | 0 | 12 | 82 | 167 | 91 | 76 | 13 | 1 |
module GitHub.Users where
import GitHub.Internal
currentUser = "/user"
users = "/users"
user u = users <> "/" <> u
--| GET /users/:user
getUser ::
UserName ->
GitHub UserData
getUser = ghGet . user
--| GET /user
getCurrentUser ::
GitHub CurrentUserData
getCurrentUser = ghGet currentUser
--| PATCH /user
updateCur... | SaneApp/github-api | src/GitHub/Users.hs | mit | 502 | 14 | 8 | 83 | 187 | 94 | 93 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified PasswordBasedVectors as Pwd
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Tests
----------------------------------------------------------------------
withQuickCheckDepth :: Te... | RNCryptor/rncryptor-hs | test/Main.hs | mit | 1,460 | 0 | 12 | 355 | 218 | 116 | 102 | 25 | 1 |
-- Ops.hs ---
--
-- Filename: Ops.hs
-- Description:
-- Author: Manuel Schneckenreither
-- Maintainer:
-- Created: Fri Oct 10 14:08:54 2014 (+0200)
-- Version:
-- Package-Requires: ()
-- Last-Updated: Sun May 7 22:49:27 2017 (+0200)
-- By: Manuel Schneckenreither
-- Update #: 1332
-- URL:
-- Doc URL:
-- ... | ComputationWithBoundedResources/ara-inference | src/Data/Rewriting/ARA/ByInferenceRules/AnalyzerSignature/Ops.hs | mit | 4,848 | 0 | 12 | 1,592 | 1,139 | 633 | 506 | 68 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dax-cluster-ssespecification.html
module Stratosphere.ResourceProperties.DAXClusterSSESpecification where
im... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/DAXClusterSSESpecification.hs | mit | 1,466 | 0 | 12 | 157 | 173 | 100 | 73 | 22 | 1 |
-- |
module Jammin where
import Data.List
data Fruit = Peach
| Plum
| Apple
| Blackberry
deriving (Eq, Ord, Show)
data JamJars = Jam Fruit Int
deriving (Eq, Ord, Show)
data JamJars' = Jam'
{ fruit :: Fruit
, num :: Int
... | Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Jammin.hs | mit | 1,212 | 0 | 8 | 355 | 412 | 225 | 187 | 38 | 1 |
{-| Parsing data from text-files.
This module holds the code for loading the cluster state from text
files, as produced by @gnt-node@ and @gnt-instance@ @list@ command.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the ter... | badp/ganeti | src/Ganeti/HTools/Backend/Text.hs | gpl-2.0 | 17,133 | 123 | 19 | 4,583 | 4,227 | 2,327 | 1,900 | 296 | 5 |
-- A unit fraction contains 1 in the numerator.
-- The decimal representation of the unit fractions with denominators 2 to 10 are given:
-- 1/2 = 0.5
-- 1/3 = 0.(3)
-- 1/4 = 0.25
-- 1/5 = 0.2
-- 1/6 = 0.1(6)
-- 1/7 = 0.(142857)
-- 1/8 = 0.125
-- 1/9 = 0.(1)
-- 1/10 ... | ciderpunx/project_euler_in_haskell | euler026.hs | gpl-2.0 | 3,543 | 0 | 10 | 834 | 508 | 301 | 207 | 24 | 2 |
import Data.List (sort)
data BinaryTree a =
Empty
| Node {
val :: a,
left :: BinaryTree a,
right :: BinaryTree a
}
deriving (Show, Read)
instance (Eq a) => Eq (BinaryTree a) where
x == y = (toList x) == (toList y)
instance (Ord a) => Ord (BinaryTree a) where
x < y = (toList x) < (to... | apvanzanten/learningMeAHaskell | bst.hs | gpl-3.0 | 2,673 | 0 | 10 | 662 | 1,481 | 754 | 727 | 74 | 2 |
-- |Deep evaluation support for lazy ByteStrings
module ByteStringDeep (force) where
import Control.DeepSeq
import Data.ByteString.Lazy.Internal
-- Thanks to Bas van Dijk for the idea:
-- http://www.haskell.org/pipermail/libraries/2011-November/017062.html
instance NFData ByteString where
rnf Empty = ()
... | elovalo/helovalo | src/ByteStringDeep.hs | gpl-3.0 | 346 | 1 | 8 | 58 | 61 | 35 | 26 | 6 | 0 |
module Paths_PasswordChecker (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
... | BinRoot/PasswordStrength | dist/build/autogen/Paths_PasswordChecker.hs | gpl-3.0 | 1,207 | 0 | 10 | 167 | 332 | 190 | 142 | 26 | 1 |
-- | Composition of a binary and a unary function.
(-|)::(b -> c) -> (a -> b) -> a -> c
(-|) g f a1 = g (f a1)
-- | Composition of a binary and a binary function.
(¦|)::(b -> b -> c) -> (a -> b) -> a -> a -> c
(¦|) g f a1 a2 = g (f a1)(f a2)
-- | Composition of a binary and a ternary function.
(-¦|)::(b -> b -> b -> ... | jplLloyd/pointwise-composition | src/Data/Generated.hs | gpl-3.0 | 6,394 | 0 | 26 | 1,740 | 4,569 | 2,352 | 2,217 | 40 | 1 |
--------------------------------------------------------------------------------
-- This file is part of Hellnet
--
-- Hellnet is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3... | Voker57/hellnet | hell-serve.hs | gpl-3.0 | 3,427 | 56 | 20 | 648 | 918 | 495 | 423 | 82 | 4 |
module Zoepis.ZEventMessage where
import Graphics.Rendering.OpenGL
data Button = LeftButton | MiddleButton | RightButton
data ZEvent = KeyPress Char
| KeyRelease Char
| MouseDown Button (GLint, GLint)
| MouseUp Button
| MouseMove (GLint, GLint)
| Tic Int --... | abakst/Zoepis | Zoepis/ZEventMessage.hs | gpl-3.0 | 374 | 0 | 7 | 110 | 74 | 46 | 28 | 9 | 0 |
{-|
Description: Helpers for interacting with the graph database. Incomplete.
This module is responsible for inserting values associated with the graphs
into the database. These functions are just helpers for the main function
in "Svg.Parser", though it is possible to put all of the data retrieval code in
here as well... | Ian-Stewart-Binks/courseography | hs/Svg/Database.hs | gpl-3.0 | 1,553 | 0 | 11 | 336 | 287 | 151 | 136 | 25 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
module FuncTorrent.ServerThread where
import Control.Concurrent
import Control.Monad.IO.Class
import Control.Monad.Trans.Maybe
import Data.ByteString (ByteString)
import System.IO
import Network
import FuncTorrent.Metainfo (Metainfo(..))
import FuncTorre... | harshavardhana/functorrent | src/FuncTorrent/ServerThread.hs | gpl-3.0 | 3,604 | 0 | 19 | 771 | 947 | 486 | 461 | 91 | 4 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/Organizations/Get.hs | mpl-2.0 | 5,347 | 0 | 17 | 1,304 | 854 | 497 | 357 | 120 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Sessions/DetectIntent.hs | mpl-2.0 | 7,829 | 0 | 16 | 1,581 | 803 | 478 | 325 | 128 | 1 |
import Prelude
import GHC.Num
import Graphics.UI.SDL as SDL
import Graphics.UI.SDL.Image as Image
import Control.Monad.State
import Control.Monad as Monad
import System.Random as Random
import Harbinger
-- The sand game but with random numbers
-- Not as painful as I expected
-- This is the container for the state
t... | abramhindle/haskell-sand-game | Sand5.hs | lgpl-3.0 | 15,065 | 0 | 21 | 4,406 | 4,998 | 2,688 | 2,310 | 307 | 10 |
--
-- Minio Haskell SDK, (C) 2017 Minio, 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 ... | donatello/minio-hs | Setup.hs | apache-2.0 | 654 | 0 | 4 | 110 | 26 | 21 | 5 | 2 | 1 |
module Database.VCache.VPut
( VPut
-- * Prim Writers
, putVRef, putPVar
, putVSpace
, putWord8
, putWord16le, putWord16be
, putWord32le, putWord32be
, putWord64le, putWord64be
, putStorable
, putVarNat, putVarInt
, reserve, reserving, unsafePutWord8
, putByteString, ... | dmbarbour/haskell-vcache | hsrc_lib/Database/VCache/VPut.hs | bsd-2-clause | 9,465 | 0 | 16 | 2,558 | 2,960 | 1,587 | 1,373 | 173 | 2 |
module Muon.Site where
import qualified Shelly as S
import Data.List
import qualified Data.Text as T
import Paths_muon
-- | Copies default site files to p
initialise :: FilePath -> IO ()
initialise p = do
putStrLn "Initialising"
dir <- getDataFileName ""
S.shelly $ S.cp_r (S.fromText . T.pack $ stripR '/' dir) (... | kaashif/haskell-muon | lib/Muon/Site.hs | bsd-2-clause | 550 | 0 | 12 | 106 | 180 | 95 | 85 | 15 | 1 |
{-
Set up an example Sqlite database and execute a couple of example queries
-- Toon Nolten
-}
import Database.HDBC
import Database.HDBC.Sqlite3 (connectSqlite3)
import Data.List
create_TopGear_table :: IConnection conn => conn -> IO Integer
create_TopGear_table conn =
run conn
"CREATE TABLE lap_times (Mod... | toonn/haskell-casestt | example_database.hs | bsd-2-clause | 1,511 | 30 | 16 | 323 | 426 | 214 | 212 | 39 | 4 |
module Help where
-- a simple helpme file, containing hardcoded strings, mostly for
-- testing buildin functions and pipes
lambda = "\n\
\ iIIIIIIIIIIIIIIIII~ \n\
\ ,:IIIIIIIIIIIIIIIIIIIIIIIIIIII \n\
\ ... | nvasilakis/lsh | Help.hs | bsd-3-clause | 4,833 | 0 | 4 | 2,445 | 18 | 13 | 5 | 3 | 1 |
{-
This module provides (monadic) conversion between all time scales.
We use overlapping instances to reduce the number of instance
declarations necessary. One could instead use brute force and provide
explicit 'Convert' instances for all combinations of time scales.
-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ... | bjornbm/astro | src/Astro/Time/Convert.hs | bsd-3-clause | 2,094 | 1 | 11 | 395 | 516 | 275 | 241 | 36 | 0 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE Overl... | rfranek/duckling | Duckling/Temperature/IT/Corpus.hs | bsd-3-clause | 1,455 | 0 | 9 | 469 | 218 | 131 | 87 | 34 | 1 |
{-# LANGUAGE BangPatterns #-}
module Data.Time.RFC3339 (
parseRFC3339, readRFC3339, parseISODate, readISODate, showRFC3339
) where
import Control.Applicative
import Data.ByteString (ByteString)
import Data.Char (toUpper, toLower)
import Data.Attoparsec.Char8
import ... | pqwy/google-web-apis | Data/Time/RFC3339.hs | bsd-3-clause | 2,112 | 0 | 11 | 592 | 732 | 383 | 349 | 52 | 2 |
module Main where
import Control.Arrow
import Control.Applicative
import qualified Data.ByteString.Lazy as BS
import Data.Char
import Data.List
import Data.Maybe
import qualified Data.Text as T
import qualified Data.Text.Encoding ... | jezen/mail-for-muggles | src/Main.hs | bsd-3-clause | 3,459 | 0 | 15 | 847 | 1,264 | 675 | 589 | 79 | 2 |
module Text.Levels
( Segm (..)
, Morph (..)
, Tagged (..)
, Labeled (..)
, word
, label
) where
import Data.Text
-- Type classes for different text annotation levels.
-- | Segmentation level
class Segm s where
-- | Word on given position
word_ :: s -> Int -> Text
-- | Sentence length
sentLen :: s... | kawu/nerf-misc | src/Text/Levels.hs | bsd-3-clause | 1,102 | 0 | 9 | 283 | 326 | 176 | 150 | 26 | 2 |
-- | IEEE 754 math makes a distrinction between -0.0 and +0.0. This module
-- contains RULES that ignore this distinction.
--
-- Importing this module is similar to compiling with gcc's
-- @-fno-signed-zeros@.
module Numeric.FastMath.SignedZeros () where
import GHC.Exts
{-# RULES
"minusDouble 0 x" forall x. (-... | liyang/fast-math | Numeric/FastMath/SignedZeros.hs | bsd-3-clause | 589 | 0 | 4 | 149 | 22 | 17 | 5 | -1 | -1 |
module Collins where
--import Prelude(Show, Eq, Integer)
import Prelude hiding (gcd, negate, rem, (*), (+), (-), (/), (^))
import Domains.Euclidean
import Domains.Ring
import Data.Polynomial
import Debug.Trace
infixr 8 ^
powerAssociative :: (a -> a -> a)... | pmilne/algebra | src/Collins.hs | bsd-3-clause | 2,497 | 2 | 23 | 795 | 960 | 493 | 467 | 39 | 5 |
import SpecHU(runHU)
import SpecQC(runQC)
main:: IO ()
main = do
runHU
runQC | cwiertniamichal/FunctionalProgramming | test/SpecMain.hs | bsd-3-clause | 85 | 0 | 6 | 20 | 38 | 20 | 18 | 6 | 1 |
module Playground12 where
class Describable a where
describe :: a -> String
instance Describable Icecream where
describe Chocholate = "Cioccolato è buono"
describe Vanilla = "La vanigli è buona"
data Icecream = Chocholate | Vanilla
| stefanocerruti/haskell-primer-alpha | src/Playground12.hs | bsd-3-clause | 253 | 0 | 7 | 54 | 56 | 30 | 26 | 7 | 0 |
{-# LANGUAGE InstanceSigs, OverloadedStrings, DeriveAnyClass #-}
module Complex where
import Data.List.Split
import GHC.Generics
data Complex = Cartesian { r:: Double, i::Double } |
Polar { rho :: Double, theta::Double}
deriving (Eq)
instance Num Complex where
(+) :: Complex -... | balopat/quantum-computing | src/Complex.hs | bsd-3-clause | 2,226 | 0 | 12 | 632 | 974 | 512 | 462 | 46 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
import Ivory.Language
import qualified Ivory.Compile.C.CmdlineFrontend as C (compile)
fib_loop :: Def ('[Ix 1000] :-> Uint32)
fib_loop = proc "fib_loop" $ \ n -> body $ do
a <- local (ival 0)
b <- local (ival 1)
n `times` \ _ -> do
a' <- deref a
... | Hodapp87/ivory | ivory-examples/examples/FibTutorial.hs | bsd-3-clause | 563 | 0 | 16 | 129 | 222 | 110 | 112 | 20 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.