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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-- | These graph traversal functions mirror the ones in Cabal, but work with
-- the more complete (and fine-grained) set of dependencies provided by
-- PackageFixedDeps rather than only the library dependencies provided by
-- PackageInstalled.
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
module Distributio... | thoughtpolice/cabal | cabal-install/Distribution/Client/PlanIndex.hs | bsd-3-clause | 14,140 | 0 | 18 | 3,512 | 2,410 | 1,345 | 1,065 | 181 | 5 |
{-# LANGUAGE MagicHash #-}
------------------------------------------------------------------------
-- |
-- Module : Kask.Math
-- Copyright : (c) 2016 Konrad Grzanek
-- License : BSD-style (see the file LICENSE)
-- Created : 2016-09-25
-- Maintainer : kongra@gmail.com
-- Stability : experimental
-- Po... | kongra/kask-base | src/Kask/Math.hs | bsd-3-clause | 1,391 | 0 | 9 | 331 | 375 | 199 | 176 | -1 | -1 |
import System.Environment
import System.IO
import Text.ParserCombinators.Parsec
import Control.Monad
import Data.ByteString.Lazy.Char8 as BS hiding (length,take,drop,filter,head,concat)
import Control.Applicative hiding ((<|>), many)
{--
getfirst(Open usp Tukubai)
designed by Nobuaki Tounaka
written by Ryuichi Ueda
... | ShellShoccar-jpn/Open-usp-Tukubai | COMMANDS.HS/getfirst.hs | mit | 3,182 | 0 | 13 | 815 | 726 | 384 | 342 | 39 | 4 |
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 703
{-# LANGUAGE Safe #-}
#endif
{- |
Maintainer : judah.jacobson@gmail.com
Stability : experimental
Portability : portable (FFI)
-}
module System.Console.Terminfo(
module System.Console.Terminfo.Base,
module System.Console.Terminfo.Keys,
module System.Cons... | DavidAlphaFox/ghc | libraries/terminfo/System/Console/Terminfo.hs | bsd-3-clause | 702 | 0 | 5 | 86 | 104 | 77 | 27 | 14 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE ViewPatterns #-}
module Database.Persist.Quasi
( parse
, PersistSettings (..)
, upperCaseSettings
, lowerCaseSettings
, nullable
#if TEST
, Token (..)
, tokenize
, parseFieldType
#endif
... | jasonzoladz/persistent | persistent/Database/Persist/Quasi.hs | mit | 20,244 | 0 | 20 | 6,206 | 6,360 | 3,282 | 3,078 | 399 | 13 |
{-# LANGUAGE UnboxedSums #-}
module Main where
import T14051a
main :: IO ()
main = print $ case func () of
(# True | #) -> 123
_ -> 321
| ezyang/ghc | testsuite/tests/unboxedsums/T14051.hs | bsd-3-clause | 143 | 0 | 9 | 37 | 51 | 28 | 23 | 7 | 2 |
-- Killed 6.2.2
-- The trouble was that 1 was instantiated to a type (t::?)
-- and the constraint (Foo (t::? -> s::*)) didn't match Foo (a::* -> b::*).
-- Solution is to zap the expected type in TcEpxr.tc_expr(HsOverLit).
module ShouldCompile where
class Foo a where
foo :: a
instance Foo (a -> b) where
f... | ezyang/ghc | testsuite/tests/typecheck/should_compile/tc186.hs | bsd-3-clause | 362 | 0 | 7 | 81 | 60 | 34 | 26 | 7 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Compiler
-- Copyright : Isaac Jones 2003-2004
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : por... | DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Compiler.hs | bsd-3-clause | 7,244 | 0 | 15 | 1,380 | 1,301 | 728 | 573 | 104 | 2 |
{-# LANGUAGE RecordWildCards #-}
{-|
Module : Stats
Description : Compute various simple statistics on a FASTA file.
Copyright : (c) Bernie Pope, 2016
License : MIT
Maintainer : bjpope@unimelb.edu.au
Stability : experimental
Portability : POSIX
Read a single FASTA file as input and compute:
* Num s... | supernifty/biotool | haskell/src/Stats.hs | mit | 4,327 | 0 | 11 | 1,015 | 451 | 256 | 195 | 58 | 2 |
module Database.PostgreSQL.Protocol.Codecs.Time
( dayToPgj
, utcToMicros
, localTimeToMicros
, timeOfDayToMcs
, pgjToDay
, microsToUTC
, microsToLocalTime
, mcsToTimeOfDay
, mcsToDiffTime
, intervalToDiffTime
, diffTimeToInterval
, diffTimeToMcs
) where
import Data.... | postgres-haskell/postgres-wire | src/Database/PostgreSQL/Protocol/Codecs/Time.hs | mit | 3,087 | 1 | 10 | 590 | 785 | 437 | 348 | 82 | 1 |
{-|
Module : Network.CircleCI.Cache
Copyright : (c) Denis Shevchenko, 2016
License : MIT
Maintainer : me@dshevchenko.biz
Stability : alpha
API call for work with project build's cache.
-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiWayIf... | denisshevchenko/circlehs | src/Network/CircleCI/Cache.hs | mit | 4,019 | 0 | 12 | 1,099 | 508 | 299 | 209 | 65 | 2 |
-- lastButOne :: [a] -> a
lastButOne x = if length x <= 2
then Nothing
else Just (x !! (length x -2))
| rglew/rwh | ch2/lastButOne.hs | mit | 123 | 2 | 11 | 44 | 47 | 24 | 23 | 3 | 2 |
import Data.Char
import Data.List
-- 1) Define your own version of Data.List.Intercalate, called intercalate’
intercalate' :: [a] -> [[a]] -> [a]
intercalate' _ [] = []
intercalate' [] yss = concat yss
intercalate' xs (ys:yss) = ys ++ xs ++ intercalate' xs yss
-- 2)
type Probability = Double
type DiscreteRandVar = [... | kbiscanic/PUH | hw05/homework.hs | mit | 6,769 | 14 | 15 | 1,601 | 2,313 | 1,214 | 1,099 | 106 | 8 |
import Test.HUnit
import Q13
assertEqualEntryList :: String -> [Entry Int] -> [Entry Int] -> Assertion
assertEqualEntryList = assertEqual
test1 = TestCase (assertEqualEntryList "encodeDirect [] should be [] ." ([] ) (encodeDirect [] ))
test2 = Tes... | cshung/MiscLab | Haskell99/q13.test.hs | mit | 1,220 | 0 | 11 | 302 | 369 | 203 | 166 | 11 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.NavigatorUserMediaErrorCallback
(newNavigatorUserMediaErrorCallback,
newNavigatorUserMediaErrorCallbackSync,
newNavigatorUserMediaErrorCallbackAsync,
NavigatorUserMediaErrorCallback)... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/NavigatorUserMediaErrorCallback.hs | mit | 2,966 | 0 | 13 | 723 | 532 | 316 | 216 | 50 | 1 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TypeFamilies #-}
module Database.Persist.Types
( module Database.Persist.Types.Base
, SomePersistField (..)
, Update (..)
, SelectOpt (..)
, BackendSpecificFilter
, Filter (..)
, Key
, Entity (..)
) where
import Database.Persis... | gbwey/persistentold | persistent/Database/Persist/Types.hs | mit | 420 | 0 | 5 | 77 | 81 | 58 | 23 | 14 | 0 |
module Control.Concurrent.Transactional.Channel.Broadcast (
BroadcastChannel (), newBroadcastChannel, broadcast, enroll,
BroadcastListener (), listen
) where
import Control.Concurrent.Transactional.Event
import Control.Concurrent.Transactional.EventHandle
import Data.List.Util
import Control.Applicative ((<$>... | YellPika/Hannel | src/Control/Concurrent/Transactional/Channel/Broadcast.hs | mit | 1,865 | 0 | 18 | 523 | 549 | 298 | 251 | 46 | 1 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
-- uses packages: comonad-transformers,streams,MonadRandom
import Prelude hiding (iterate,tail,repeat,sequence,take,zip,unzip)
import Data.Stream.Infinite (Stream ((:>)),iterate,tail,repeat,take,zip,unzip,unfold)
import Data.Foldable
import Data.Traversab... | danidiaz/haskell-sandbox | probca.hs | mit | 3,841 | 0 | 15 | 864 | 1,125 | 602 | 523 | 61 | 4 |
module Stackage.Tarballs
( makeTarballs
) where
import qualified Codec.Archive.Tar as Tar
import qualified Data.ByteString.Lazy as L
import qualified Data.Map as Map
import qualified Data.Set as Set
import Stackage.Types
import Stackage.Util
import Syste... | sinelaw/stackage | Stackage/Tarballs.hs | mit | 1,764 | 0 | 19 | 579 | 483 | 249 | 234 | 36 | 5 |
{-|
Module : Language.GoLite.Pretty
Description : Pretty-printer definition and combinators.
Copyright : (c) Jacob Errington and Frederic Lafrance, 2016
License : MIT
Maintainer : goto@mail.jerrington.me
Stability : experimental
Specific definitions for GoLite pretty-printing.
-}
module Language.GoLite.... | djeik/goto | libgoto/Language/GoLite/Pretty.hs | mit | 801 | 0 | 6 | 132 | 69 | 45 | 24 | 10 | 1 |
{-# LANGUAGE ConstraintKinds, DeriveFunctor, DeriveFoldable, DeriveTraversable, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, ImplicitParams, LambdaCase, MultiParamTypeClasses, OverloadedStrings, PackageImports, ScopedTypeVariables, TemplateHaskell, TupleSections #-}
module Formura.MPIFortran.Transl... | nushio3/formura | src/Formura/MPIFortran/Translate.hs | mit | 47,185 | 54 | 26 | 12,586 | 15,223 | 7,570 | 7,653 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Codex.Tester (
oneOf,
tester,
nullTester,
-- * module re-exports
Meta, Code(..),
lookupFromMeta,
module Codex.Tester.Monad,
module Codex.Tester.Result,
module Codex.Tester.Utils,
module Codex.Tester.Limits,
-- * generic stuff
module Control.Monad,
modu... | pbv/codex | src/Codex/Tester.hs | mit | 1,477 | 0 | 10 | 355 | 305 | 182 | 123 | 39 | 1 |
-- Copyright © 2013 Julian Blake Kongslie <jblake@jblake.org>
-- Licensed under the MIT license.
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -Wall -Werror -fno-warn-unused-imports #-}
module Main
where
import Control.DeepSeq
import Control.Monad
import qualified Data.ByteString.Lazy as BS
import Data.Data
i... | jblake/gbasm | src/Main.hs | mit | 2,154 | 0 | 24 | 396 | 557 | 302 | 255 | 58 | 2 |
{-#LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens
import Control.Monad
import Control.Monad.Reader
import Control.Monad.Writer
import System.Environment
import System.Exit
import System.IO
import System.Console.CmdArgs.Implicit
import Crystal.AST
import Crystal.Check
import Crystal.Config
import... | Botje/crystal | Crystal.hs | gpl-2.0 | 1,461 | 0 | 15 | 353 | 410 | 211 | 199 | 39 | 2 |
{-# OPTIONS -w -O0 #-}
{-# LANGUAGE CPP, StandaloneDeriving, DeriveDataTypeable #-}
{- |
Module : Alloy/ATC_Alloy.der.hs
Description : generated Typeable, ShATermConvertible instances
Copyright : (c) DFKI GmbH 2012
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stabil... | nevrenato/HetsAlloy | Alloy/ATC_Alloy.hs | gpl-2.0 | 4,444 | 0 | 13 | 765 | 945 | 480 | 465 | 66 | 0 |
module ItemsSpec (spec) where
import Test.Hspec
import Items
import Data.Map (fromList)
spec = do
describe "changeItem" $
it "changes something about the item" $
changeItem "open" (const "closed")
Item { itemName = "box", itemInfo = fromList [("open", "open")], itemActions=[]}... | emhoracek/explora | test-suite/ItemsSpec.hs | gpl-2.0 | 445 | 0 | 14 | 124 | 136 | 79 | 57 | 11 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
-- Copyright (C) 2007-8 JP Bernardy
-- Copyright (C) 2004-5 Don Stewart - http://www.cse.unsw.edu.au/~dons
-- Originally derived from: riot/UI.hs Copyright (c) Tuomo Valkonen 2004.
-- | This module defines a user interface implemented using vty.
module Yi.UI.Vty (start) where
im... | codemac/yi-editor | src/Yi/UI/Vty.hs | gpl-2.0 | 19,502 | 0 | 25 | 5,605 | 5,696 | 3,000 | 2,696 | 334 | 18 |
-- vim: set expandtab:
import XMonad
import XMonad.Layout.Spacing
import XMonad.Hooks.FadeInactive
import XMonad.Util.CustomKeys
import XMonad.Hooks.Place
import XMonad.Hooks.DynamicLog
import XMonad.Util.Paste
inskey _ = [ ((noModMask, 0x1008ff13), spawn "amixer set Master 5%+")
, ((noModMask, ... | lngauthier/LEAA.6 | xmonad.hs | gpl-2.0 | 2,604 | 0 | 14 | 881 | 688 | 390 | 298 | 49 | 1 |
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}
module Language.ArrayForth.Interpreter where
import Data.Bits
import Data.Functor ((<$>))
import Data.Maybe (fromJust, fromMaybe, mapM... | TikhonJelvis/array-forth | src/Language/ArrayForth/Interpreter.hs | gpl-3.0 | 6,810 | 34 | 17 | 2,290 | 2,022 | 1,078 | 944 | 108 | 29 |
module HEP.Automation.MadGraph.Dataset.Set20110713set2 where
import HEP.Storage.WebDAV.Type
import HEP.Automation.MadGraph.Model
import HEP.Automation.MadGraph.Machine
import HEP.Automation.MadGraph.UserCut
import HEP.Automation.MadGraph.SetupType
import HEP.Automation.MadGraph.Model.SChanC8Vschmaltz
import HEP.Aut... | wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110713set2.hs | gpl-3.0 | 2,508 | 0 | 10 | 830 | 394 | 250 | 144 | 47 | 1 |
import Data.HashMap as M
import Data.IORef
import Data.Maybe
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Glade
import Graphics.Rendering.Cairo
import Graphics.UI.Gtk.Gdk.Events
import System.Random
type HM = M.Map (Integer,Integer) Integer
type BranchObject = (Integer, BranchColor)
type Board = [Bush BranchObject]
d... | arihantsethia/Haskenbush | haskenbush.hs | gpl-3.0 | 22,747 | 10 | 25 | 6,940 | 7,693 | 3,840 | 3,853 | 417 | 6 |
{-# LANGUAGE RecordWildCards #-}
module Main (main) where
import Control.Monad.Trans.Reader
import Control.Monad.Trans.State
import Data.Maybe
import Foreign.C.Types
import GHC.Word
import Reactive
import qualified Reactive.Banana as RB
import Reac... | seppeljordan/geimskell | tests/UnitTests.hs | gpl-3.0 | 3,685 | 0 | 20 | 1,188 | 771 | 393 | 378 | 85 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
-- | This module defines a type representing the location of a core in
-- the 8 × 18 grid.
--
-- All of the actually interesting code ... | TikhonJelvis/array-forth | src/Language/ArrayForth/Core.hs | gpl-3.0 | 2,830 | 37 | 13 | 751 | 680 | 364 | 316 | 40 | 1 |
Config {
font = "xft:Inconsolata Nerd Font Mono Medium:size=9:antialias=true"
, additionalFonts = ["xft:FontAwesome:size=9:antialias=true" ]
-- , bgColor = "#000000"
-- , fgColor = "#ffffff"
-- , borderColor = "#000000"
-- Colors alt -- solarized dark:
, bgColor = "#002b36"
, fgColo... | hnrck/dotfiles | wm/xmonad/xmobar.hs | gpl-3.0 | 3,369 | 0 | 9 | 1,781 | 416 | 266 | 150 | -1 | -1 |
module Geometry.Cube
( volume
, area
) where
import qualified Geometry.Cuboid as Cuboid
volume :: Float -> Float
volume side = Cuboid.volume side side side
area :: Float -> Float
area side = Cuboid.area side side side
| medik/lang-hack | Haskell/LearnYouAHaskell/c06/Geometry/Cube.hs | gpl-3.0 | 227 | 0 | 6 | 46 | 74 | 41 | 33 | 8 | 1 |
module Examples.Power.QDSL where
import Prelude
import QFeldspar.QDSL hiding (div)
power :: Int -> Qt (Float -> Float)
power n =
if n < 0 then
[|| \x -> if x == 0 then 0 else 1 / ($$(power (-n)) x) ||]
else if n == 0 then
[|| \ _x -> 1 ||]
else if even n then
[|| \x -> $$sqr ($$(power (n `div` 2)) x)... | shayan-najd/QFeldspar | Examples/Power/QDSL.hs | gpl-3.0 | 924 | 23 | 17 | 281 | 551 | 310 | 241 | -1 | -1 |
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.MachineLearning
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintain... | fmapfmapfmap/amazonka | amazonka-ml/gen/Network/AWS/MachineLearning.hs | mpl-2.0 | 10,861 | 0 | 5 | 2,297 | 986 | 715 | 271 | 210 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-siteverification/gen/Network/Google/Resource/SiteVerification/WebResource/List.hs | mpl-2.0 | 2,436 | 0 | 11 | 520 | 218 | 136 | 82 | 42 | 1 |
import System.Environment (getArgs)
import Database.LMDB
import Database.LMDB.Raw
import Control.Applicative
import qualified Data.ByteString.Char8 as B
main = do
args <- getArgs
case args of
[x] -> main' x
_ -> putStrLn "Usage: mdblist <path>"
where
main' x = do
table... | jimcrayne/lmdb-bindings | tools/mdblist.hs | agpl-3.0 | 381 | 0 | 10 | 115 | 106 | 55 | 51 | 13 | 2 |
module PGFTest where
import PGF
import Data.Maybe
main :: IO ()
main = do
pgf <- readPGF "lib/src/maltese/PGF/Lang.pgf"
let mlt = head $ languages pgf
let love = mkCId "love_V2"
-- Parsing
let (Just typ) = functionType pgf love
let trees = parse pgf mlt typ "ħabb"
print trees
-- Linearize... | johnjcamilleri/Maltese-GF-Resource-Grammar | scripts/PGFTest.hs | lgpl-3.0 | 554 | 0 | 14 | 137 | 207 | 99 | 108 | 15 | 1 |
{-# language ViewPatterns, ScopedTypeVariables, PackageImports, EmptyDataDecls,
TypeSynonymInstances, FlexibleInstances,
StandaloneDeriving, DeriveDataTypeable,
DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
mo... | nikki-and-the-robots/nikki | src/Utils.hs | lgpl-3.0 | 17,979 | 0 | 16 | 4,815 | 7,579 | 4,014 | 3,565 | -1 | -1 |
{-# LANGUAGE FlexibleInstances, OverloadedStrings, UnicodeSyntax, CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Network.HTTP.LinkSpec where
import Test.Hspec
import Test.QuickCheck
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import qualified Data.Text as T
imp... | myfreeweb/http-link-header | test-suite/Network/HTTP/LinkSpec.hs | unlicense | 1,519 | 0 | 28 | 354 | 472 | 253 | 219 | 29 | 1 |
import Data.Char
enc 'z' = 'a'
enc 'Z' = 'A'
enc c = chr (ord c + 1)
encode s = map enc s
dec 'a' = 'z'
dec 'A' = 'Z'
dec c = chr (ord c - 1)
decode s = map dec s
main :: IO()
main = do
contents <- readFile "./encode/input.txt" --將讀到的內容存進一個自訂變數中
writeFile "./encode/output.txt" (encode contents) --... | bestian/haskell-sandbox | encode.hs | unlicense | 552 | 0 | 9 | 103 | 173 | 83 | 90 | 15 | 1 |
import Helpers.Subsets (allSubsets, eachPair)
import Data.List
-- See 2021-02-13T19:58:00 email from Richard.
-- Number of irreflexive, antisymmetric, antitransitive
-- a n = length $ filter (not . isAntitransitive) $ allAntisymmetricAndIrreflexive n
-- map a [0..]
-- [1,1,3,21,317,9735,
-- Bounded above by 3^Binomial... | peterokagey/haskellOEIS | src/Sandbox/Richard/antiequivalence.hs | apache-2.0 | 2,084 | 0 | 11 | 345 | 1,068 | 615 | 453 | 31 | 1 |
module Opts where
import Data.Text (Text, pack)
import Options.Applicative
data Args
= Args
{ inputDir :: !FilePath
, stopList :: !(Maybe FilePath)
} deriving (Show, Eq)
parseArgs :: IO Args
parseArgs = execParser opts
opts' :: Parser Args
opts' = Ar... | erochest/stat-nlp | Opts.hs | apache-2.0 | 940 | 0 | 13 | 309 | 241 | 123 | 118 | 29 | 1 |
{-|
Module : Marvin.API.Preprocess.OneHotEncode
Description : Encoding nominal features to binaries.
-}
module Marvin.API.Preprocess.OneHotEncode where
import qualified Data.Vector as Vec
import Marvin.API.Fallible
import Marvin.API.Table.Internal
-- | Encodes a 'NominalColumn' to a 'BinaryTable'
-- where each ... | gaborhermann/marvin | src/Marvin/API/Preprocess/OneHotEncode.hs | apache-2.0 | 1,474 | 0 | 15 | 257 | 302 | 162 | 140 | 17 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Site.Map where
import Data.Text (Text)
data Page = Index | Talk | Meetup
render :: Page -> [(Text, Text)] -> Text
render Index _ = "/"
render Talk _ = "/talk"
render Meetup _ = "/meetup"
| lucasdicioccio/haskell-paris-src | Site/Map.hs | apache-2.0 | 242 | 0 | 8 | 54 | 82 | 47 | 35 | 8 | 1 |
-- Copyright 2016 David Edwards
--
-- 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 wr... | davidledwards/rpn-haskell | src/AST.hs | apache-2.0 | 2,009 | 0 | 16 | 551 | 669 | 362 | 307 | 31 | 10 |
{- | Implements several tests to control the validy of the program
-}
module Test.Muste where
import PGF
import PGF.Internal
import Muste.Grammar.Internal
import Muste.Tree
import Muste
import Test.HUnit.Text
import Test.HUnit.Base
import Data.Maybe
import qualified Data.Map as M
import Control.Monad
import Data.Set (S... | daherb/Haskell-Muste | muste-lib/Test/Muste.hs | artistic-2.0 | 8,365 | 0 | 18 | 1,672 | 2,487 | 1,358 | 1,129 | 105 | 1 |
{-# LANGUAGE PackageImports #-}
import "cwezi" Application (getApplicationDev)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, settingsPort)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Concurrent (threadDelay)
... | mossplix/CERP-Project | devel.hs | bsd-2-clause | 699 | 0 | 10 | 123 | 186 | 101 | 85 | 23 | 2 |
module Jerimum.PostgreSQL.Types.Int32Array
-- * CBOR codec
( int32ArrayEncoderV0
, int32ArrayDecoderV0
, encodeInt32Array
-- * Text codec
, parseInt32Array
, formatInt32Array
-- * Value constructors
, fromInt32Array
) where
import qualified Codec.CBOR.Decoding as D
import qualif... | dgvncsz0f/nws | src/Jerimum/PostgreSQL/Types/Int32Array.hs | bsd-3-clause | 1,532 | 0 | 8 | 335 | 320 | 191 | 129 | 34 | 1 |
{-# LANGUAGE DeriveFunctor #-}
-- | Reimplementation of pipe's core data type as Free monad
module Pipes.Free where
import Control.Monad
import Control.Monad.Free
import Pipes.Void
----------------------------------------------------------------
-- Data type
-----------------------------------------------------------... | Shimuuar/data-folds | Pipes/Free.hs | bsd-3-clause | 3,731 | 0 | 16 | 1,224 | 1,441 | 747 | 694 | -1 | -1 |
-- | A number of invariant checks on the B-tree type
module Data.BTree.Invariants
( invariants
, nodeSizeInvariant
, balancingInvariant
) where
import Data.BTree.Internal
import qualified Data.BTree.Array as A
-- | Check all invariants
invariants :: BTree k v -> Bool
invariants btree = all ($ btree) [... | jaspervdj/b-tree | tests/Data/BTree/Invariants.hs | bsd-3-clause | 1,557 | 0 | 13 | 410 | 468 | 245 | 223 | 32 | 2 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
module Data.Angle
( Angle
, toAngle
, fromAngle
, AngleRange (..)
) where
import Data.Fixed (mod')
import Data.AdditiveGroup
import Data.MetricSpace
import Data.VectorSpace
import System.Random
... | jdmarble/angle | src/Data/Angle.hs | bsd-3-clause | 1,618 | 0 | 9 | 455 | 705 | 367 | 338 | 43 | 1 |
module SimpleTests where
import TestHelpers
import Control.Parallel.MPI.Simple
import Control.Concurrent (threadDelay)
import Data.Serialize ()
import Data.Maybe (isJust)
root :: Rank
root = 0
simpleTests :: Rank -> [(String,TestRunnerTest)]
simpleTests rank =
[ mpiTestCase rank "send+recv simple message" $ syncS... | bjpop/haskell-mpi | test/SimpleTests.hs | bsd-3-clause | 10,324 | 0 | 14 | 3,404 | 2,817 | 1,346 | 1,471 | 173 | 1 |
{-# LANGUAGE TemplateHaskell #-}
--
-- Pins.hs -- definition of GPIO pins
--
-- Copyright (C) 2013, Galois, Inc.
-- All Rights Reserved.
--
module Ivory.BSP.STM32F405.GPIO.Pins where
import Ivory.BSP.STM32.Peripheral.GPIOF4.Regs
import Ivory.BSP.STM32.Peripheral.GPIOF4.TH
import Ivory.BSP.STM32F405.GPIO.Ports
-- E... | GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32F405/GPIO/Pins.hs | bsd-3-clause | 665 | 0 | 5 | 88 | 125 | 72 | 53 | 14 | 0 |
{-# LANGUAGE OverloadedStrings, PackageImports #-}
import "monads-tf" Control.Monad.State
import Data.Pipe
import Data.Pipe.ByteString
import System.IO
import Network.Sasl
import Network.Sasl.Plain.Client
import qualified Data.ByteString as BS
data St = St [(BS.ByteString, BS.ByteString)] deriving Show
instance Sas... | YoshikuniJujo/sasl | examples/clientP.hs | bsd-3-clause | 868 | 2 | 14 | 143 | 325 | 174 | 151 | 25 | 3 |
import Parser
import Compiler
main :: IO ()
main = do
code <- getContents
case parse code of
Nothing -> error "Parse error"
Just parsed -> putStrLn $ compile parsed
| roboguy13/MetaForth | src/MetaForth.hs | bsd-3-clause | 183 | 0 | 11 | 48 | 64 | 30 | 34 | 8 | 2 |
module MsgPack.RPC.Types where
import MsgPack
import Control.Applicative ((<$>),(<*>))
import Data.Int (Int32)
type MsgId = Int32
type Method = String
-- Message Tags ----------------------------------------------------------------
data MessageType
= MsgRequest
| MsgResponse
| MsgNotify
deriving (Show... | GaloisInc/msf-haskell | src/MsgPack/RPC/Types.hs | bsd-3-clause | 2,625 | 0 | 14 | 650 | 749 | 387 | 362 | 76 | 0 |
module Sword.ViewPorter where
import Sword.Utils
import Sword.Hero
type ViewPort = (Coord, Coord)
insideViewPort :: ViewPort -> Coord -> Bool
insideViewPort ((x1, y1), (x2, y2)) (x, y) = xinside && yinside
where xinside = (x1 <= x) && (x < x2)
yinside = (y1 <= y) && (y < y2)
updateViewPort :: ViewPort -> ... | kmerz/the_sword | src/Sword/ViewPorter.hs | bsd-3-clause | 862 | 0 | 12 | 208 | 445 | 253 | 192 | 20 | 1 |
module Main(main) where
import Enterprise.FizzBuzz
import System.Environment
main = do
putStrLn "How many numbers should I FizzBuzz?"
n <- getLine
putStrLn $ show $ fizzBuzzRange $ (read n :: Int)
| JHawk/enterpriseFizzBuzz | src/Main.hs | bsd-3-clause | 214 | 0 | 9 | 47 | 61 | 32 | 29 | 7 | 1 |
module Lava.MyST
( ST
, STRef
, newSTRef
, readSTRef
, writeSTRef
, runST
, fixST
, unsafePerformST
, unsafeInterleaveST
, unsafeIOtoST
)
where
import System.IO
import System.IO.Unsafe
import Data.IORef
newtype ST s a
= ST (IO a)
unST :: ST s a -> IO a
unST (ST io) = io
instance Functor (S... | dfordivam/lava | Lava/MyST.hs | bsd-3-clause | 1,164 | 0 | 12 | 295 | 583 | 296 | 287 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
import Network.HaskellNet.IMAP.SSL
import Network.HaskellNet.SMTP.SSL as SMTP
import Network.HaskellNet.Auth (AuthType(LOGIN))
import qualified Data.ByteString.Char8 as B
username = "username@gmail.com"
password = "password"
recipient = "someone@somew... | da-x/HaskellNet-SSL | examples/gmail.hs | bsd-3-clause | 1,068 | 0 | 11 | 241 | 278 | 142 | 136 | 29 | 2 |
-----------------------------------------------
module Board where
import qualified Data.Map.Strict as Map
import Color
import Position
-----------------------------------------------
nums = [1,2..19] -- last number defines size of board
chars = ['A'..'Z']
-----------------------------------------------
newtype ... | irmikrys/Gomoku | src/Board.hs | bsd-3-clause | 2,825 | 0 | 15 | 565 | 951 | 483 | 468 | 55 | 1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
module ETA.Utils.Maybes (
module Data.Maybe,
MaybeErr(..), -- Instance of Monad
failME, isSuccess,
orElse,
firstJust, firstJusts,
whenIsJust,
expectJust,
... | alexander-at-github/eta | compiler/ETA/Utils/Maybes.hs | bsd-3-clause | 3,588 | 0 | 14 | 1,114 | 868 | 455 | 413 | 62 | 1 |
{-|
Module : Data.Number.MPFR.Mutable
Description : Mutable MPFR's
Copyright : (c) Aleš Bizjak
License : BSD3
Maintainer : ales.bizjak0@gmail.com
Stability : experimental
Portability : non-portable
This module provides a \"mutable\" interface to the MPFR library. Funct... | ekmett/hmpfr | src/Data/Number/MPFR/Mutable.hs | bsd-3-clause | 2,166 | 0 | 5 | 388 | 123 | 95 | 28 | 13 | 0 |
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FlexibleContexts #-}
-- |
-- Module : Simulation.Aivika.Trans.Experiment.Types
-- Copyright : Copyright (c) 2012-2017, David Sorokin <david.sorokin@gmail.com>
-- License : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability : experimenta... | dsorokin/aivika-experiment | Simulation/Aivika/Trans/Experiment/Types.hs | bsd-3-clause | 19,767 | 0 | 22 | 8,087 | 3,110 | 1,583 | 1,527 | 255 | 2 |
module Superfuse.Frontend where
import Data.Int
import Data.Kind
import Data.Word
import GHC.TypeLits
-- | Signed integral types
data IType = I8 | I16 | I32 | I64
-- | Unsigned integral types
data UType = U8 | U16 | U32 | U64
-- | Floating-point types
data FType = F32 | F64
-- | Scalar types
data SType = SIType IT... | TerrorJack/superfuse | src/Superfuse/Frontend.hs | bsd-3-clause | 1,697 | 36 | 10 | 475 | 605 | 324 | 281 | -1 | -1 |
{-# LANGUAGE CPP #-}
-- -----------------------------------------------------------------------------
--
-- Main.hs, part of Alex
--
-- (c) Chris Dornan 1995-2000, Simon Marlow 2003
--
-- ----------------------------------------------------------------------------}
module Main (main) where
import AbsSyn
import CharSe... | simonmar/alex | src/Main.hs | bsd-3-clause | 19,538 | 7 | 21 | 6,012 | 5,134 | 2,672 | 2,462 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
module Language.Haskell.GhcMod.Types where
-- | Output style.
data OutputStyle = LispStyle -- ^ S expression style.
| PlainStyle -- ^ Plain textstyle.
-- | The type for line separator. Historically, a Null string is used.
newtype LineSeparator = LineSeparator Stri... | bitemyapp/ghc-mod | Language/Haskell/GhcMod/Types.hs | bsd-3-clause | 3,570 | 0 | 13 | 861 | 739 | 435 | 304 | 69 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Language.Haskell.Exts.Pretty
-- Copyright : (c) Niklas Broberg 2004-2009,
-- (c) The GHC Team, Noel Winstanley 1997-2000
-- License : BSD-style (see the file LICENSE.txt)
--
-- Maintainer : Nikl... | rodrigogribeiro/mptc | src/Language/Haskell/Exts/Pretty.hs | bsd-3-clause | 68,127 | 0 | 23 | 22,789 | 22,708 | 11,309 | 11,399 | 1,228 | 4 |
{-# LANGUAGE OverlappingInstances, ScopedTypeVariables, TemplateHaskell, FlexibleContexts #-}
module YaLedger.Main
(module YaLedger.Types,
module YaLedger.Types.Reports,
LedgerOptions (..),
parseCmdLine,
defaultParsers,
defaultMain,
lookupInit,
initialize,
runYaLedger
) where
import Prelude... | portnov/yaledger | YaLedger/Main.hs | bsd-3-clause | 14,989 | 0 | 26 | 4,669 | 4,197 | 2,157 | 2,040 | 308 | 11 |
-- {-# LANGUAGE OverloadedStrings #-}
-- {-# LANGUAGE RecordWildCards #-}
-- {-# LANGUAGE MultiWayIf #-}
import Development.Shake
import Development.Shake.FilePath
-- import Development.Shake.Util
-- import Development.Shake.Command
-- import Control.Applicative ((<$>))
import qualified Control.Monad as M
-- impo... | reuleaux/pire | docs/Build.hs | bsd-3-clause | 17,072 | 44 | 20 | 7,190 | 2,837 | 1,467 | 1,370 | 273 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
-- | Type-level specification of Explorer API (via Servant).
module Pos.Explorer.Web.Api
( ExplorerApi
, explorerApi
, ExplorerApiRecord(..)
) where
import ... | input-output-hk/pos-haskell-prototype | explorer/src/Pos/Explorer/Web/Api.hs | mit | 5,375 | 0 | 17 | 1,613 | 1,124 | 610 | 514 | -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="fil-PH">
<title>Code Dx | Ekstensyon ng ZAP</title>
<maps>
<homeID>top</homeID>
<mapre... | veggiespam/zap-extensions | addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_fil_PH/helpset_fil_PH.hs | apache-2.0 | 985 | 80 | 66 | 163 | 423 | 213 | 210 | -1 | -1 |
{-# LANGUAGE ParallelListComp #-}
{-# LANGUAGE TemplateHaskell #-}
module Database.DSH.SL.Opt.Rewrite.Projections where
-- This module contains rewrites which aim to simplify and merge complex expressions
-- which are expressed through multiple operators.
import Control.Monad
import Database.Al... | ulricha/dsh | src/Database/DSH/SL/Opt/Rewrite/Projections.hs | bsd-3-clause | 20,558 | 0 | 7 | 6,277 | 1,496 | 848 | 648 | 360 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveFunctor,
TypeSynonymInstances, PatternGuards #-}
module Idris.AbsSyntax(module Idris.AbsSyntax, module Idris.AbsSyntaxTree) where
import Idris.Core.TT
import Idris.Core.Evaluate
import Idris.Core.Elaborate hiding (Tactic(..))
import Idris.Core.... | aaronc/Idris-dev | src/Idris/AbsSyntax.hs | bsd-3-clause | 100,715 | 8 | 29 | 37,107 | 38,111 | 18,917 | 19,194 | 1,861 | 49 |
module Get_top_scores
where
import Split_output
import qualified Data.List as DL
import qualified Data.Maybe as DM
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as CH
import Numeric as NU
get_top_scores :: Int -> [BS.ByteString] -> [BS.ByteString]
get_top_scores num instrs =
... | schets/LILAC | src/scripts/haskell/get_top_scores.hs | bsd-3-clause | 1,397 | 0 | 14 | 436 | 388 | 208 | 180 | 27 | 1 |
{- |
Module : $Header$
Description : derived functions for signatures with symbol sets
Copyright : (c) Till Mossakowski, and Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : till@informatik.uni-bremen.de
Stability : provisional
Portability : non-portable (imports Logic.L... | keithodulaigh/Hets | Logic/ExtSign.hs | gpl-2.0 | 6,085 | 0 | 18 | 1,448 | 1,700 | 817 | 883 | 123 | 1 |
{-|
Module : Unicorn
Description : The Unicorn CPU emulator.
Copyright : (c) Adrian Herrera, 2016
License : GPL-2
Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
framework based on QEMU.
Further information is available at <http://www.unicorn-engine.org>.
-}
module Unicorn
( -... | alekhin0w/unicorn | bindings/haskell/src/Unicorn.hs | gpl-2.0 | 13,109 | 0 | 15 | 4,464 | 1,871 | 1,026 | 845 | 211 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/ModifyClusterParameterGroup.hs | mpl-2.0 | 5,650 | 0 | 11 | 1,046 | 578 | 352 | 226 | 69 | 1 |
{-# LANGUAGE CPP, GADTs #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
-- ----------------------------------------------------------------------------
-- | Handle conversion of CmmProc to LLVM code.
--
module LlvmCodeGen.CodeGen ( genLlvmProc ) where
#include "HsVersions.h"
import Llvm
import LlvmCodeGen.Base
import... | fmthoma/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | 62,423 | 1,208 | 18 | 19,321 | 16,183 | 8,613 | 7,570 | 1,087 | 64 |
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, TypeSynonymInstances #-}
-- | Karma
module Plugin.Karma (theModule) where
import Plugin
import qualified Message as Msg (nick, Nick, Message, showNick, readNick, lambdabotName, nName)
import qualified NickEq as E
import qualified Data.Map as M
import Text.Printf
$(... | jwiegley/lambdabot | Plugin/Karma.hs | mit | 3,839 | 0 | 18 | 1,173 | 1,224 | 625 | 599 | 70 | 2 |
import Control.Concurrent.STM
main = do
c <- newTChanIO
atomically $ writeTChan c 'a'
c1 <- atomically $ cloneTChan c
atomically (readTChan c) >>= print
atomically (readTChan c1) >>= print
atomically (writeTChan c 'b')
atomically (readTChan c) >>= print
atomically (readTChan c1) >>= print
| gridaphobe/packages-stm | tests/cloneTChan001.hs | bsd-3-clause | 307 | 0 | 10 | 60 | 123 | 55 | 68 | 10 | 1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1999
-}
module TcTypeable(
mkTypeableBinds, mkModIdBindings
) where
import TcBinds( addTypecheckedBinds )
import IfaceEnv( newGlobalBinder )
import TcEnv
import TcRnMonad
import PrelNames( gHC_TYPES, trModuleDataConName,... | AlexanderPankiv/ghc | compiler/typecheck/TcTypeable.hs | bsd-3-clause | 8,150 | 0 | 19 | 2,230 | 1,215 | 641 | 574 | 101 | 3 |
{-# LANGUAGE DeriveGeneric #-}
module Distribution.Client.Dependency.Types (
PreSolver(..),
Solver(..),
PackagesPreferenceDefault(..),
) where
import Data.Char
( isAlpha, toLower )
import qualified Distribution.Compat.ReadP as Parse
( pfail, munch1 )
import Distribution.Text
... | headprogrammingczar/cabal | cabal-install/Distribution/Client/Dependency/Types.hs | bsd-3-clause | 2,033 | 0 | 11 | 476 | 342 | 199 | 143 | 37 | 0 |
-- | examine all uses of types in a program to determine which ones are
-- actually needed in the method generation
module E.TypeAnalysis(typeAnalyze, Typ(),expandPlaceholder) where
import Control.Monad.Error
import Control.Monad.Identity
import Control.Monad.State
import Data.Maybe
import Data.Monoid
import qualifie... | m-alvarez/jhc | src/E/TypeAnalysis.hs | mit | 17,383 | 1 | 29 | 4,816 | 7,419 | 3,697 | 3,722 | -1 | -1 |
module Avg where
{-@ LIQUID "--real" @-}
{-@ measure sumD :: [Double] -> Double
sumD([]) = 0.0
sumD(x:xs) = x + (sumD xs)
@-}
{-@ measure lenD :: [Double] -> Double
lenD([]) = 0.0
lenD(x:xs) = (1.0) + (lenD xs)
@-}
{-@ expression Avg Xs = ((sumD Xs) / (lenD Xs)) @-}
{-@ meansD :: xs:{v:[Doubl... | mightymoose/liquidhaskell | tests/pos/Avg.hs | bsd-3-clause | 699 | 0 | 7 | 179 | 129 | 71 | 58 | 9 | 1 |
{-# LANGUAGE CPP, MagicHash #-}
--
-- (c) The University of Glasgow 2002-2006
--
-- | ByteCodeGen: Generate bytecode from Core
module ByteCodeGen ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where
#include "HsVersions.h"
import ByteCodeInstr
import ByteCodeItbls
import ByteCodeAsm
import ByteCodeLink
import LibFFI
... | ghc-android/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | 65,519 | 0 | 24 | 21,137 | 14,217 | 7,297 | 6,920 | -1 | -1 |
module PatBindIn3 where
sumSquares x = (sq x pow) + (sq x pow) where pow = 2
sq = x ^ pow
anotherFun 0 y = sq y where sq x = x ^ 2
| kmate/HaRe | old/testing/liftToToplevel/PatBindIn3AST.hs | bsd-3-clause | 136 | 0 | 7 | 40 | 75 | 39 | 36 | 4 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP
, NoImplicitPrelude
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_HADDOCK not-home #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC... | jtojnar/haste-compiler | libraries/ghc-7.10/base/GHC/Conc/IO.hs | bsd-3-clause | 6,475 | 0 | 15 | 1,470 | 1,004 | 551 | 453 | 80 | 2 |
module T10185 where
import Data.Coerce
import Data.Proxy
foo :: (Coercible (a b) (c d), Coercible (c d) (e f)) => Proxy (c d) -> a b -> e f
foo _ = coerce
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/T10185.hs | bsd-3-clause | 157 | 0 | 9 | 35 | 93 | 48 | 45 | 5 | 1 |
module TypeStructure.TH where
import TypeStructure.Prelude.Basic
import TypeStructure.Prelude.Transformers
import TypeStructure.Prelude.Data
import TypeStructure.Prelude.TH
import qualified TypeStructure.Class as Class
import qualified TypeStructure.TH.Model as M
import qualified TypeStructure.TH.Template as Template
... | nikita-volkov/type-structure | src/TypeStructure/TH.hs | mit | 3,897 | 0 | 20 | 947 | 1,527 | 761 | 766 | -1 | -1 |
-- Some math helpers
module MathHelpers where
import Linear
rotationMatrix :: Double -> M22 Double
rotationMatrix a = V2 (V2 (cos a) (- sin a))
(V2 (sin a) (cos a))
rotatedUnit :: Double -> V2 Double
rotatedUnit a = V2 (cos a) (sin a)
data MovingPosition = MovingPosition {
position :: V2 ... | Solonarv/Asteroids | MathHelpers.hs | mit | 2,035 | 1 | 11 | 441 | 766 | 398 | 368 | 44 | 1 |
module Network.TCP.Proxy.Socks5 where
{-
TODO: implement
main RFC
https://www.ietf.org/rfc/rfc1928.txt
GSS API authentication
https://tools.ietf.org/html/rfc1961
UserName/Password auth
https://tools.ietf.org/html/rfc1929
-}
protocol = undefined
| danoctavian/tcp-proxy | src/Network/TCP/Proxy/Socks5.hs | mit | 269 | 0 | 4 | 44 | 14 | 10 | 4 | 2 | 1 |
-- File : Helper.hs
-- Author : Martin Valentino
-- Purpose : A helper function use for list operations
module Helper where
-- Sort list in descending order
quicksort :: Ord t => [t] -> [t]
quicksort [] = []
quicksort (x:xs) = quicksort large ++ (x : quicksort small)
where small = [y | y <- xs, y <= x]
... | martindavid/code-sandbox | comp90048/assignments/project1/Helper.hs | mit | 860 | 0 | 9 | 211 | 322 | 175 | 147 | 13 | 1 |
module Render.Raytracer where
import Geometry.Object
import Geometry.Vector
import Math.SceneParams
import Math.Intersect
import Math.Shader
computePixelPairColor :: Scene -> (Scalar, Scalar) -> Color
computePixelPairColor scene (i, j) = computePixelColor scene i j
computePixelColor :: Scene -> Scalar -> Scalar -> C... | dongy7/raytracer | src/Render/Raytracer.hs | mit | 3,964 | 0 | 13 | 912 | 1,296 | 690 | 606 | 70 | 3 |
module CommandContent
( CommandContent(..)
, findContent404
, contentHeader
, contentBody
) where
import Import
import Archive
import Network.AWS
import Network.AWS.S3 (_NoSuchKey)
import qualified Data.ByteString.Lazy as BL
data CommandContent
= Live Token Command
| Archived BL.ByteStri... | pbrisbin/tee-io | src/CommandContent.hs | mit | 1,163 | 0 | 13 | 259 | 269 | 152 | 117 | -1 | -1 |
---------------
-- Aufgabe 1 --
---------------
data GeladenerGast = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T deriving (Eq,Ord,Enum,Show)
type Schickeria = [GeladenerGast] -- Aufsteigend geordnet
type Adabeis = [GeladenerGast] -- Aufsteigend geordnet
type Nidabe... | Batev/Vienna-University-of-Technology | Functional Programming/Complex functions/ComplexFunctions8.hs | mit | 3,393 | 0 | 14 | 889 | 1,491 | 802 | 689 | 58 | 3 |
module System.Logging.Facade.HsLogger (hsLoggerSink) where
import qualified System.Log.Logger as HsLogger
import System.Logging.Facade.Types
hsLoggerSink :: String -> LogRecord -> IO ()
hsLoggerSink defaultChannel record = HsLogger.logM channel level (message "")
where
mLocation = logRecordLocation re... | beni55/logging-facade | logging-facade-hslogger/src/System/Logging/Facade/HsLogger.hs | mit | 1,726 | 0 | 11 | 327 | 389 | 209 | 180 | 25 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.