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 : System.Taffybar.Support.PagerHints
-- Copyright : (c) José A. Romero L.
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : José A. Romero L. <[email protected]>
-- Stability : unstable
-- Portability ... | teleshoes/taffybar | src/System/Taffybar/Support/PagerHints.hs | bsd-3-clause | 3,992 | 0 | 17 | 732 | 674 | 366 | 308 | 51 | 3 |
-- Monadic command line checkers..
-- @2013 Angel Alvarez
module OptsCheck where
-- Main module needed imports
import Control.Exception (SomeException,evaluate,try)
import Control.Monad(foldM,liftM,ap)
import Control.Monad.IO.Class
import Control.Monad.Trans.Either
import Data.List (find)
import Data.Maybe ( fromMay... | felipeZ/Dynamics | src/OptsCheck.hs | bsd-3-clause | 5,822 | 0 | 14 | 1,272 | 1,123 | 614 | 509 | 77 | 3 |
module Main where
import Tandoori.GHC
import Tandoori.GHC.Parse
import Tandoori.GHC.Scope
import GHC
import Outputable
import IOEnv
import System.Environment
import Tandoori.Typing.Infer
import Tandoori.Typing.Show
typecheckMod mod = runDyn $ do
env <- getSession
... | bitemyapp/tandoori | src/main.hs | bsd-3-clause | 1,106 | 0 | 13 | 494 | 271 | 137 | 134 | 26 | 3 |
module PigLatin (translate) where
import Data.Char (isLetter)
import Data.List (isSuffixOf)
consonantCluster :: String -> (String, String)
consonantCluster = qu . break (`elem` "aeiou")
where qu (cs, ('u':rest)) | "q" `isSuffixOf` cs = (cs ++ "u", rest)
qu pair = pair
translateWord :: String -> String
trans... | pminten/xhaskell | pig-latin/example.hs | mit | 569 | 0 | 10 | 118 | 226 | 127 | 99 | 14 | 2 |
{-
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | Ye-Yong-Chi/codeworld | codeworld-base/src/GHC/Int.hs | apache-2.0 | 729 | 0 | 4 | 136 | 23 | 17 | 6 | 4 | 0 |
{-# LANGUAGE Rank2Types #-}
-- | Internal types to the library.
module Stack.Types.Internal where
import Control.Concurrent.MVar
import Control.Monad.Logger (LogLevel)
import Data.Monoid.Extra
import Data.Text (Text)
import Lens.Micro
import Network.HTTP.Client.Conduit (Manager,HasHttpManager(..))
import Stack.Types... | phadej/stack | src/Stack/Types/Internal.hs | bsd-3-clause | 4,124 | 0 | 16 | 937 | 1,034 | 561 | 473 | 109 | 1 |
module SwapArgsSpec (main, spec) where
import Test.Hspec
-- import qualified GHC as GHC
-- import qualified GhcMonad as GHC
-- import qualified RdrName as GHC
-- import qualified SrcLoc as GHC
import Language.Haskell.Refact.Refactoring.SwapArgs
import TestUtils
import System.Directory
-- -------... | RefactoringTools/HaRe | test/SwapArgsSpec.hs | bsd-3-clause | 1,382 | 0 | 18 | 275 | 219 | 119 | 100 | 19 | 1 |
module PackageTests.OrderFlags.Check where
import Test.Tasty.HUnit
import PackageTests.PackageTester
import System.FilePath
import Control.Exception
#if !MIN_VERSION_base(4,6,0)
import Prelude hiding (catch)
#endif
suite :: FilePath -> Assertion
suite ghcPath = do
let spec = PackageSpec
{ directory =... | Helkafen/cabal | Cabal/tests/PackageTests/OrderFlags/Check.hs | bsd-3-clause | 685 | 0 | 12 | 171 | 159 | 87 | 72 | 18 | 1 |
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Core.Runtime.Tests
( tests
) where
--------------------------------------------------------------------------------
import qualified Data.ByteString as B
import Syste... | Minoru/hakyll | tests/Hakyll/Core/Runtime/Tests.hs | bsd-3-clause | 2,676 | 0 | 21 | 697 | 537 | 263 | 274 | 57 | 1 |
module SvgTests.BuilderTests where
import Svg.Builder
import Test.QuickCheck
prop1_sanitizeId str =
let sanitized = sanitizeId str
illegals = map (\c -> not $ elem c ",()/<>% ") sanitized
allTrue = and illegals
in allTrue
| Ian-Stewart-Binks/courseography | hs/SvgTests/BuilderTests.hs | gpl-3.0 | 250 | 0 | 13 | 61 | 73 | 38 | 35 | 8 | 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="bs-BA">
<title>Forced Browse Add-On</title>
<maps>
<homeID>top</homeID>
<mapref locatio... | thc202/zap-extensions | addOns/bruteforce/src/main/javahelp/org/zaproxy/zap/extension/bruteforce/resources/help_bs_BA/helpset_bs_BA.hs | apache-2.0 | 965 | 77 | 67 | 157 | 419 | 211 | 208 | -1 | -1 |
module Test1 where
f = e1 + e2
where
e1 = 1 + 2
e2 = 1 - 2
| kmate/HaRe | old/testing/refacSlicing/Test1.hs | bsd-3-clause | 94 | 0 | 7 | 54 | 33 | 19 | 14 | 4 | 1 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.Accordion
-- Copyright : (c) [email protected]
-- License : BSD
--
-- Maintainer : [email protected]
-- Stability : ... | adinapoli/xmonad-contrib | XMonad/Layout/Accordion.hs | bsd-3-clause | 1,949 | 0 | 14 | 464 | 380 | 215 | 165 | 23 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Tests.JSON where
import Haste
import Haste.JSON
import Haste.Serialize
import Control.Applicative
data ABC = A | B | C
deriving (Show, Read)
data Foo = Foo {
string :: String,
number :: Int,
bool :: Bool,
nested :: Either String Foo,
enum :: ABC
} ... | beni55/haste-compiler | Tests/JSON.hs | bsd-3-clause | 1,304 | 0 | 15 | 415 | 450 | 241 | 209 | 49 | 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="hr-HR">
<title>AJAX Spider | ZAP Extensions</title>
<maps>
<homeID>top</homeID>
<mapre... | msrader/zap-extensions | src/org/zaproxy/zap/extension/spiderAjax/resources/help_hr_HR/helpset_hr_HR.hs | apache-2.0 | 974 | 80 | 66 | 160 | 415 | 210 | 205 | -1 | -1 |
{-# LANGUAGE TypeFamilies #-}
-- This is actually perfectly ok!
module NonLinearSigErr where
type family E a b
type instance E a (a :: *) = [a]
| urbanslug/ghc | testsuite/tests/indexed-types/should_fail/NonLinearSigErr.hs | bsd-3-clause | 147 | 0 | 6 | 30 | 34 | 23 | 11 | 4 | 0 |
-- !!! Test exceptions in a foreign import "wrapper"
import Foreign
import Foreign.C
import System.Exit
type IOF = IO ()
foreign import ccall "wrapper" wrap_f_io :: IOF -> IO (FunPtr IOF)
foreign import ccall "dynamic" call_io :: FunPtr IOF -> IOF
mk_error = error "this is an error"
main = do f <- wrap_f_io mk_err... | holzensp/ghc | testsuite/tests/ffi/should_run/ffi008.hs | bsd-3-clause | 334 | 0 | 9 | 62 | 100 | 52 | 48 | 8 | 1 |
module Y2015.D12Spec (spec) where
{-# LANGUAGE OverloadedStrings #-}
import Y2015
import Test.Hspec
import Data.ByteString.Lazy.Char8 (pack)
spec :: Spec
spec = parallel $ do
describe "Day 12" $ do
describe "jsonSum" $ do
it "sums three-member lists" $
jsonSum (pack "[1,2,3]")... | tylerjl/adventofcode | test/Y2015/D12Spec.hs | mit | 1,522 | 0 | 18 | 518 | 376 | 185 | 191 | -1 | -1 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Provides a dummy authentication module that simply lets a user specify
-- their identifier. This is not intended for real world use, just for
-- testi... | geraldus/yesod | yesod-auth/Yesod/Auth/Dummy.hs | mit | 2,294 | 0 | 16 | 576 | 365 | 205 | 160 | 34 | 4 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Common where
import Control.Arrow ((>>>), first, left)
import Control.Applicative
import Control.Concurrent (forkIO, killThread, threadDelay)
import Control.Concurrent.Async
import Control.Concurrent.MVar
... | Rufflewind/conplex | Common.hs | mit | 4,561 | 0 | 18 | 933 | 1,620 | 829 | 791 | 112 | 2 |
-- makeBackronym
-- http://www.codewars.com/kata/55805ab490c73741b7000064/
module Codewars.Exercise.Backronym where
import Codewars.Exercise.Backronym.Dictionary (dict)
import Data.Char (toUpper)
makeBackronym :: String -> String
makeBackronym = unwords . map (dict . toUpper)
| gafiatulin/codewars | src/7 kyu/Backronym.hs | mit | 280 | 0 | 8 | 29 | 59 | 36 | 23 | 5 | 1 |
module Tamari where
import Data.List
import Data.Maybe
import Catalan
import Bijections
rotR1 :: Tree -> [Tree]
rotR1 (B (t1 @ (B t11 t12)) t2) =
B t11 (B t12 t2) : [B t1' t2 | t1' <- rotR1 t1] ++ [B t1 t2' | t2' <- rotR1 t2]
rotR1 (B L t2) = [B L t2' | t2' <- rotR1 t2]
rotR1 _ = []
rotL1 :: Tree -> [Tree]
rotL1 (... | noamz/linlam-gos | src/Tamari.hs | mit | 5,691 | 2 | 20 | 1,576 | 2,305 | 1,178 | 1,127 | 117 | 6 |
--Task 1
--sumProducts [[1,2,3], [4,5], [], [-2,3,0,5,1]] -> 27 -- 27 = 6 + 20 + 1 + 0
sumProducts m = sum (map product nonEmptyLists)
where nonEmptyLists = filter ( \ x -> not (null x)) m
sumProducts2 m = sum products
where products = map ( \ lst -> (foldr ( \ x res -> x*res ) 1 lst) ) m
--Task 2
--occurrenc... | pepincho/Functional-Programming | haskell/ex-4.hs | mit | 1,678 | 8 | 12 | 398 | 779 | 390 | 389 | 35 | 1 |
-- FIXME: Depend on the not-yet-released project-template library.
{-# LANGUAGE OverloadedStrings #-}
module MultiFile where
import Control.Monad (unless)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Resource (runExceptionT)
import qualif... | piyush-kurur/yesod | yesod/MultiFile.hs | mit | 3,652 | 0 | 19 | 1,527 | 869 | 459 | 410 | 81 | 5 |
{-# LANGUAGE MultiWayIf#-}
module Mealy where
import Data.Maybe (isJust)
import FRP.Yampa
import qualified Graphics.Gloss.Interface.IO.Game as G
import Buttons
leftmost p = (p>90)
rightmost p = (p<(-90))
centermost p = (p>(-10) && p <10)
isClick = isEvent. filterE (isJust. toYampaEvent)
moveLeft =... | santolucito/Euterpea_Projects | QuantumArt/Mealy.hs | mit | 801 | 0 | 11 | 193 | 398 | 231 | 167 | 29 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.MutationObserver
(js_newMutationObserver, newMutationObserver, js_observe, observe,
js_takeRecords, takeRecords, js_disconnect, disconnect,
MutationObserver, castToMutationObserver, gTypeMut... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/MutationObserver.hs | mit | 3,169 | 28 | 12 | 505 | 723 | 417 | 306 | 53 | 1 |
import Data.Array
minfree :: [Int] -> Int
minfree = findFalse . buildList
findFalse :: Array Int Bool -> Int
findFalse = length . takeWhile id . elems
buildList :: [Int] -> Array Int Bool
buildList xs = accumArray (||) False (0, n) $
zip [x | x <- xs, x <= n] $ repeat True
where
... | hajifkd/pearlsfd | chapter1/sol2.hs | gpl-3.0 | 346 | 0 | 10 | 112 | 140 | 73 | 67 | 9 | 1 |
module DocGraph.Document where
import Control.Arrow ((>>>))
import Data.Char (isSpace)
import Data.Either (rights)
import Data.List (dropWhile, dropWhileEnd)
import qualified Data.Tree as DT
import DocGraph.Types
import Text.Parsec hiding (token)
traverseDocumentIO :: FilePath -> IO DocGraph
traverseDocumentIO path... | wldmr/haskell-docgraph | src/DocGraph/Document.hs | gpl-3.0 | 1,878 | 0 | 11 | 514 | 738 | 382 | 356 | 51 | 4 |
module Stlc.Types
( Type (Tvar, Arrow, Times, Union, Unitty, Bottom)
, typeinference
, typeinfer
, unify
, applyctx
, emptyctx
, incrementindices
, variables
, normalizeTemplate
, applynormalization
, Top (Top)
, Context
, Variable
, Substitution
)
where
import Control.Monad
import Lambda... | M42/mikrokosmos | source/Stlc/Types.hs | gpl-3.0 | 9,417 | 0 | 15 | 2,394 | 3,921 | 1,976 | 1,945 | 201 | 18 |
{-#LANGUAGE TypeSynonymInstances, UndecidableInstances, FlexibleInstances, MultiParamTypeClasses, GADTs, DataKinds, PolyKinds, TypeOperators, ViewPatterns, PatternSynonyms, RankNTypes, FlexibleContexts, AutoDeriveTypeable #-}
module Carnap.Languages.Util.GenericConstructors where
import Carnap.Core.Data.Types
import C... | gleachkr/Carnap | Carnap/src/Carnap/Languages/Util/GenericConstructors.hs | gpl-3.0 | 16,035 | 0 | 14 | 4,924 | 6,232 | 3,176 | 3,056 | 314 | 0 |
{-# LANGUAGE EmptyDataDecls,
MultiParamTypeClasses,
GADTs,
RankNTypes,
FlexibleInstances #-}
----------------
---------- Old, deprecated Csound interface!
---------- See CsoundExp.hs for better interface (incl. realtime support)
----------------
module Csound wher... | ejlilley/AbstractMusic | Csound.hs | gpl-3.0 | 2,900 | 0 | 13 | 659 | 836 | 445 | 391 | 39 | 1 |
-- Utility functions specific to Aura
{-
Copyright 2012, 2013, 2014 Colin Woodbury <[email protected]>
This file is part of Aura.
Aura 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 Li... | joehillen/aura | src/Aura/Utils.hs | gpl-3.0 | 4,801 | 0 | 16 | 1,032 | 1,371 | 743 | 628 | 76 | 1 |
module Handler.LibraryItemToggleStatus where
import Import
-- | Toggle the 'inProgress' attribute of a 'LibraryItem'.
getLibraryItemToggleStatusR :: LibraryItemId -> Handler Html
getLibraryItemToggleStatusR libraryItemId = do
item <- runDB $ get404 libraryItemId
toggleInProgressStatus $ Entity libr... | prikhi/MyBookList | Handler/LibraryItemToggleStatus.hs | gpl-3.0 | 357 | 0 | 9 | 62 | 62 | 30 | 32 | 7 | 1 |
-- | These tools are useful when you actually want to *implement* a grammar in
-- Haskell. They mostly provide "lifting" functions from the single- to the
-- multi-tape case.
--
-- NOTE Consider copying this code, if you extracted stand-alone code, as the
-- grammar products library pulls in many additional dependenci... | choener/GrammarProducts | old-BioInf/GrammarProducts/Tools.hs | gpl-3.0 | 369 | 0 | 3 | 59 | 13 | 11 | 2 | 1 | 0 |
{-|
Module : Emyrald
Description : The Emyrald Language v0.1.0.0
Copyright : © 2015 Dathan Ault-McCoy
License : GPL-3
Stability : experimental
Portability : POSIX
Emyrald is a lightweight, functional, symbolic, and homoiconic
programming language inspired by Scheme and Haskell. Its goal
is to create t... | Kwarrtz/Emyrald | src/Emyrald.hs | gpl-3.0 | 6,688 | 0 | 5 | 1,194 | 67 | 44 | 23 | 17 | 0 |
module Lib
( runTargets
) where
import System.IO
import System.Exit (die)
import Network.SSH.Client.LibSSH2
import Network.SSH.Client.LibSSH2.Foreign (initialize, exit)
import Control.Concurrent.ParallelIO.Global
import System.Log.Logger (infoM, Priority (INFO, DEBUG), setLevel, updateGlobalLogger, addHandler,... | bneijt/clustercute | src/Lib.hs | gpl-3.0 | 3,209 | 0 | 15 | 650 | 944 | 467 | 477 | 79 | 2 |
{-# LANGUAGE OverloadedStrings #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.StorageGateway.Types
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <[email protected]>
-- Stability... | fmapfmapfmap/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/Types.hs | mpl-2.0 | 5,058 | 0 | 13 | 1,244 | 712 | 433 | 279 | 141 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.FusionTable... | brendanhay/gogol | gogol-fusiontables/gen/Network/Google/FusionTables/Types/Product.hs | mpl-2.0 | 60,269 | 0 | 23 | 15,925 | 12,626 | 7,244 | 5,382 | 1,392 | 1 |
--
-- Copyright 2017-2018 Azad Bolour
-- Licensed under GNU Affero General Public License v3.0 -
-- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md
--
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE RecordWildCards #-}
module Board... | azadbolour/boardgame | haskell-server/src/BoardGame/Server/Domain/Play.hs | agpl-3.0 | 2,073 | 0 | 11 | 386 | 529 | 306 | 223 | 67 | 1 |
-- yammat - Yet Another MateMAT
-- Copyright (C) 2015 Amedeo Molnár
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published
-- by the Free Software Foundation, either version 3 of the License, or
-- (at your option) an... | nek0/yammat | Handler/Avatar.hs | agpl-3.0 | 5,785 | 0 | 18 | 1,380 | 1,564 | 769 | 795 | 144 | 3 |
{- x2
Map an expanded, transposed (horizontal, if you will) file like
PINA XXHHHHLLL
PINB 01101Z010
To binary bytes as given by the wavetable
TODO This is a bit slower than I'd like
-}
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as B
import qualified Data.HashMap.Strict as... | gitfoxi/vcd-haskell | app/hus-x2-hub.hs | agpl-3.0 | 1,708 | 7 | 12 | 433 | 478 | 237 | 241 | 51 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import qualified Prelude as P
import MatrixMul3x3
import System.Re... | ra1u/lambdaya-bus | examples/MatrixMultiply/Client.hs | lgpl-3.0 | 982 | 0 | 13 | 267 | 305 | 168 | 137 | 31 | 1 |
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ImpredicativeTypes #-}
import Control.Monad
import Control.Applicative
import Control.Exception
newtype DB c a = DB {
fromDB :: IO a
}
instance Functor (DB c) where
fmap = liftM
instance Applicative (DB c) where
pure = return
(<*>) = ap
instance Monad (DB c) where
... | seckcoder/lang-learn | haskell/samples/src/RankN/DB.hs | unlicense | 2,020 | 0 | 11 | 426 | 673 | 348 | 325 | -1 | -1 |
module MyWords where
myWords :: Char -> String -> [String]
myWords c s = go [] s c
where go acc "" c = reverse acc
go acc (x:ss) c
| x == c = go acc ss c
| otherwise = go ((takeWhile (/= c) (x:ss)) : acc) (dropWhile (/= c) (x:ss)) c
firstSen = "Tyger Tyger, burni... | aniketd/learn.haskell | haskellbook/myWords.hs | unlicense | 860 | 0 | 14 | 245 | 263 | 140 | 123 | 24 | 2 |
module HeronianTriangles.A305704Spec (main, spec) where
import Test.Hspec
import HeronianTriangles.A305704 (a305704)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A305704" $
it "correctly computes the first 20 elements" $
take 20 (map a305704 [1..]) `shouldBe` expectedValue where
expectedV... | peterokagey/haskellOEIS | test/HeronianTriangles/A305704Spec.hs | apache-2.0 | 405 | 0 | 10 | 78 | 160 | 95 | 65 | 10 | 1 |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... | facebook/fbthrift | thrift/lib/hs/Thrift/Protocol/Binary.hs | apache-2.0 | 7,761 | 0 | 18 | 1,546 | 2,160 | 1,103 | 1,057 | 150 | 12 |
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE Trustworthy #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_HADDOCK show-extensions #-}
{-|
Copyright : (C) 2013-2015, University of Twente
License : BSD2 (see the file LICENSE)
Maintainer : Christiaan Baaij <[email protected]>
-}
module CLaSH.Sign... | Ericson2314/clash-prelude | src/CLaSH/Signal.hs | bsd-2-clause | 4,201 | 0 | 9 | 955 | 599 | 401 | 198 | 65 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Types where
import Data.Ini
import Data.List (group, sort, sortOn)
import Data.Maybe (mapMaybe, listToMaybe)
import Data.Ord (Down(Down))
import Data.Text (Text, unpack)
import Data.Time.Calendar (Day)
import Text.XmlHtml (Document)
type File = (FilePath, Text)
data Blog... | kqr/two-wrongs-st | src/Types.hs | bsd-2-clause | 2,105 | 0 | 16 | 552 | 619 | 346 | 273 | 46 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for @xm list --long@ parser -}
{-
Copyright (C) 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1... | apyrgio/snf-ganeti | test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs | bsd-2-clause | 7,773 | 0 | 16 | 1,575 | 1,410 | 744 | 666 | 107 | 2 |
module Data.Iteratee (
module Data.Iteratee.Base
, module Data.Iteratee.Exception
, module Data.Iteratee.IO
) where
------------------------------------------------------------------------
-- Imports
------------------------------------------------------------------------
import Data.Iteratee.Base
import Data.Itera... | tanimoto/iteratee | src/Data/Iteratee.hs | bsd-3-clause | 357 | 0 | 5 | 26 | 50 | 35 | 15 | 7 | 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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Ordinal.PT.Corpus
( corpus
) where
import Data.String
im... | facebookincubator/duckling | Duckling/Ordinal/PT/Corpus.hs | bsd-3-clause | 2,204 | 0 | 9 | 877 | 329 | 198 | 131 | 61 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Test.Concurrent where
import qualified Test.Hspec as HS
import qualified Test.Hspec.QuickCheck as HS
import qualified Test.QuickCheck as Q
import qualified Control.Concurrent as CC
import qualified Control.Concurr... | asakamirai/kazura-queue | test/Test/Concurrent.hs | bsd-3-clause | 5,114 | 0 | 16 | 1,331 | 1,785 | 906 | 879 | -1 | -1 |
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-}
module AtomTestCases where
import Text.XML.HXT.Core
import Data.Tree.NTree.TypeDefs(NTree)
import Web.HRSS.Data.Atom
import Test.Framework as TF (testGroup, Test)
import Test.Framework.Providers.QuickCheck2 (testProperty)
xmlAtom0 :: [Char]
xmlAtom0 = "\
\<?xml ... | kdridi/hrss | src/test/AtomTestCases.hs | bsd-3-clause | 5,484 | 0 | 11 | 782 | 413 | 218 | 195 | 30 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUA... | vigoo/stack | src/Stack/Config.hs | bsd-3-clause | 27,563 | 0 | 30 | 8,183 | 5,733 | 2,882 | 2,851 | 521 | 12 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
module Diagrams.TwoD.Path.Metafont.Types where
import Control.Lens hiding (( # ))
#if __GLASGOW_HASKELL__ < ... | diagrams/diagrams-contrib | src/Diagrams/TwoD/Path/Metafont/Types.hs | bsd-3-clause | 4,322 | 0 | 11 | 938 | 880 | 496 | 384 | -1 | -1 |
--
-- Copyright © 2013-2015 Anchor Systems, Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
-- the 3-clause BSD licence.
--
{-# LANGUAGE TupleSections #-}
... | olorin/git-vogue | lib/Git/Vogue/PluginCommon.hs | bsd-3-clause | 7,195 | 0 | 15 | 1,825 | 1,492 | 798 | 694 | 116 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Servant.Servant.Db
( PackageDB(..)
, AddPackageIfMissing
, GetPackage
) where
import Con... | jkarni/servant-servant | src/Servant/Servant/Db.hs | bsd-3-clause | 1,081 | 0 | 10 | 178 | 268 | 152 | 116 | 29 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
-- | Github API: http://developer.github.com/v3/oauth/
module Main where
import Data.Aeson.TH (defaultOptions, deriveJSON)
import qualified Data.ByteString.Cha... | reactormonk/hoauth2 | example/StackExchange/test.hs | bsd-3-clause | 2,512 | 0 | 13 | 955 | 457 | 259 | 198 | 51 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
-- | SendGrid Client
module Email.SendGrid.Client where
import Data.Bifunctor (bimap)
import Data.ByteString.Lazy.Builder
import qualified Data.ByteString as B
-- import qualified Data.ByteString.Lazy as BL
import qualified Data.By... | bitemyapp/sendgrid-haskell | src/Email/SendGrid/Client.hs | bsd-3-clause | 4,729 | 0 | 12 | 904 | 1,206 | 694 | 512 | 101 | 1 |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_shader_atomic_float - device extension
--
-- == VK_EXT_shader_atomic_float
--
-- [__Name String__]
-- @VK_EXT_shader_atomic_float@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 261
--
-- [__Revision__]
-- 1
--
-- [... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_shader_atomic_float.hs | bsd-3-clause | 14,106 | 0 | 14 | 2,267 | 2,299 | 1,341 | 958 | -1 | -1 |
module Main ( main ) where
import Debug.Trace
import Control.Exception ( evaluate )
main :: IO ()
main = do
putStrLn "The test is successful if the word 'Evaluated' appears only once below:"
evaluate $ let x = trace "Evaluated" (1 + 1) in x + (trace "Evaluated" (1 + 1)) + x
return () | thoughtpolice/cse-ghc-plugin | tests/Traced.hs | bsd-3-clause | 298 | 0 | 15 | 68 | 106 | 54 | 52 | 8 | 1 |
--------------------------------------------------------------------
-- !
-- Module : Text.TDoc.QQ
-- Copyright : (c) Nicolas Pouillard 2009-2011
-- License : BSD3
--
-- Maintainer : Nicolas Pouillard <[email protected]>
--
--------------------------------------------------------------------
{-# LANG... | np/tdoc | Text/TDoc/QQ.hs | bsd-3-clause | 1,507 | 0 | 11 | 303 | 404 | 224 | 180 | 28 | 2 |
-- | Extra functions to help DFM deal with operators tree.
module Youtan.Regex.OperatorsExtra where
import Control.Monad.State
import Youtan.Regex.Operators ( Counter(..), Operator(..), OperatorID, initID, nextFreeID )
-- | Replaces counters in a tree with 'KleeneStar' keeping the input language.
simplifyCounter :: ... | triplepointfive/Youtan | src/Youtan/Regex/OperatorsExtra.hs | bsd-3-clause | 1,903 | 0 | 10 | 391 | 592 | 296 | 296 | 37 | 7 |
import qualified TUDMensa as T
main = T.tudMensa T.defaultOpts
| dschoepe/tud-mensa | Main.hs | bsd-3-clause | 64 | 1 | 6 | 10 | 22 | 11 | 11 | 2 | 1 |
{- Data/Singletons/Util.hs
(c) Richard Eisenberg 2013
[email protected]
This file contains helper functions internal to the singletons package.
Users of the package should not need to consult this file.
-}
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, RankNTypes,
TemplateHaskell, GeneralizedNewt... | int-index/singletons | src/Data/Singletons/Util.hs | bsd-3-clause | 15,210 | 0 | 14 | 3,843 | 5,122 | 2,715 | 2,407 | 331 | 12 |
module Emit where
import Syntax
import Codegen
import LLVM.Module
import LLVM.AST as AST
import LLVM.Context
import Control.Monad.Except
runEmit :: ExceptT String IO String -> IO String
runEmit e = do
result <- runExceptT e
case result of
Right code -> return code
Left error -> putStrLn error >> return ... | poiuj/pfcc | src/Emit.hs | bsd-3-clause | 846 | 0 | 13 | 162 | 255 | 127 | 128 | 27 | 2 |
module ParserUtil ( runGet
, runGetMaybe
, parseManyLazily
, parseManyLazyByteStringLazily
, parseKeepRaw
, match
, match_
, eof
) where
import qualified Control.Monad as M
im... | benma/blockchain-parser-hs | src/ParserUtil.hs | bsd-3-clause | 1,869 | 0 | 15 | 527 | 646 | 336 | 310 | 51 | 2 |
{-|
This is a module of cross-platform file handling for Unix\/Mac\/Windows.
The standard module "System.Directory" and "System.FilePath" have
following shortcomings:
* getModificationTime exists in "System.Directory". But getAccessTime,
getChangeTime, getCreationTime do not exist.
* getModificationTime returns ob... | kazu-yamamoto/easy-file | System/EasyFile.hs | bsd-3-clause | 2,530 | 0 | 5 | 408 | 143 | 100 | 43 | 36 | 0 |
module Jerimum.Storage.PostgreSQL.Setup
( Context(..)
, setup
, destroy
, findSegment
, openSegment
, closeSegment
, addSchemas
) where
import Control.Monad
import qualified Data.Map as M
import Data.Monoid
import qualified Data.Text ... | dgvncsz0f/nws | src/Jerimum/Storage/PostgreSQL/Setup.hs | bsd-3-clause | 5,022 | 0 | 17 | 1,472 | 1,060 | 551 | 509 | 133 | 2 |
-- Can get Pythagorean triplets via 2ab, a^2-b^2,a^2+b^2 trick
-- Brute-force some values of a and b
main :: IO ()
main = print answer
where possibleTrips :: [(Int,Int)]
possibleTrips = [(a,b) | a <- [1..500], b <- [1..500]]
passedTrips = filter (\(a,b) -> a>b && (2*a*b)+(a*a-b*b)+(a*a+b*b) ==... | akerber47/haskalah | test/files/euler/9.hs | bsd-3-clause | 462 | 6 | 18 | 121 | 249 | 131 | 118 | 8 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE BangPatterns #-}
module Language.Fixpoint.Solver.Eliminate
(eliminateAll) where
import Language.Fixpoint.Types
import Language.Fixpoint.Types.Names (existSymbol)
import Language.Fixpoint.Types.Visitor (kvars)
import ... | gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Solver/Eliminate.hs | bsd-3-clause | 2,798 | 0 | 11 | 659 | 978 | 528 | 450 | 51 | 1 |
-- | @TemplateHaskell@ utilities for generating lens fields.
module Extended.Lens.TH
( fieldsVerboseLensRules
) where
import Universum
import Data.Char (toUpper)
import Data.List (stripPrefix)
import Language.Haskell.TH.Syntax (N... | serokell/importify | src/Extended/Lens/TH.hs | mit | 1,262 | 0 | 13 | 307 | 226 | 128 | 98 | 16 | 1 |
-- | Types describing runtime errors related to DB.
module Pos.DB.Error
( DBError (..)
) where
import Formatting (bprint, int, stext, (%))
import qualified Formatting.Buildable
import Universum
data DBError =
-- | Structure of DB is malformed (e. g. data is inconsistent,
... | input-output-hk/pos-haskell-prototype | db/src/Pos/DB/Error.hs | mit | 899 | 0 | 11 | 264 | 163 | 92 | 71 | 22 | 0 |
module NFA.Nerode.Congruent.Quiz where
import qualified NFA.Nerode.Congruent.Config as C
import qualified NFA.Nerode.Congruent.Instance as I
import qualified NFA.Roll
import NFA.Property
import NFA.Infinite
import qualified Convert.Language
import qualified Convert.Input
import NFA.Nerode.Congruent.Check
import ... | florianpilz/autotool | src/NFA/Nerode/Congruent/Quiz.hs | gpl-2.0 | 1,552 | 0 | 15 | 487 | 390 | 216 | 174 | -1 | -1 |
{- DATX02-17-26, automated assessment of imperative programs.
- Copyright, 2017, see AUTHORS.md.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at... | Centril/DATX02-17-26 | libsrc/Util/TH.hs | gpl-2.0 | 3,154 | 0 | 14 | 683 | 681 | 359 | 322 | 51 | 5 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeFamilies #-}
module Rehi.Utils.ArgList where
import Data.ByteString (ByteString)
import Data.ByteString.Char8 (split)
import Data.Monoid (Monoid)
import GHC.Exts(IsString, fromString, IsList, Item, fromList, toList)
newtype ArgList = ArgList { getArgList :... | max630/git-rehi | app/Rehi/Utils/ArgList.hs | gpl-2.0 | 548 | 0 | 8 | 79 | 143 | 86 | 57 | 14 | 0 |
{- DATX02-17-26, automated assessment of imperative programs.
- Copyright, 2017, see AUTHORS.md.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at... | DATX02-17-26/DATX02-17-26 | libsrc/Norm/FloatToDouble.hs | gpl-2.0 | 2,197 | 0 | 14 | 479 | 217 | 118 | 99 | 20 | 2 |
module GameLogic.Action.ModifyPlayer where
import Control.Lens
import GameLogic.Data.Facade
decreaseGamePlayerFree :: Int -> Int -> MaybeGameState ()
decreaseGamePlayerFree playerInd cost = do
curFree <- use $ playerOfGame playerInd . free
when (cost > curFree) $ fail "Not enough free"
playerOfGame playe... | EPashkin/gamenumber-freegame | src_gl/GameLogic/Action/ModifyPlayer.hs | gpl-3.0 | 454 | 0 | 10 | 73 | 134 | 67 | 67 | -1 | -1 |
{-# LANGUAGE TemplateHaskellQuotes #-}
-- Trac #2632
module MkData where
import Language.Haskell.TH
op :: Num v => v -> v -> v
op a b = a + b
decl1 = [d| func = 0 `op` 3 |]
decl2 = [d| op x y = x
func = 0 `op` 3 |]
| mpickering/ghc-exactprint | tests/examples/ghc8/T2632.hs | bsd-3-clause | 233 | 0 | 7 | 70 | 64 | 40 | 24 | -1 | -1 |
-- | Operations on the 'Area' type that involve random numbers.
module Game.LambdaHack.Server.DungeonGen.AreaRnd
( -- * Picking points inside areas
xyInArea, mkRoom, mkVoidRoom
-- * Choosing connections
, connectGrid, randomConnection
-- * Plotting corridors
, Corridor, connectPlaces
) where
import... | Concomitant/LambdaHack | Game/LambdaHack/Server/DungeonGen/AreaRnd.hs | bsd-3-clause | 7,635 | 0 | 20 | 2,153 | 2,639 | 1,412 | 1,227 | -1 | -1 |
{-# LANGUAGE CPP #-}
#if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703
{-# LANGUAGE Safe #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Set
-- Copyright : (c) Daan Leijen 2002
-- License : BSD-style
-- Maintainer : [email protected]
-... | jwiegley/ghc-release | libraries/containers/Data/Set.hs | gpl-3.0 | 3,728 | 0 | 5 | 1,463 | 274 | 206 | 68 | 57 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-iam/gen/Network/AWS/IAM/ListPolicies.hs | mpl-2.0 | 7,264 | 0 | 14 | 1,550 | 891 | 539 | 352 | 88 | 1 |
module Negation where
print' :: Double -> Fay ()
print' = print
main :: Fay ()
main = do print' $ (-7/2)
print' $ (-7)/2
print' $ -f x/y
where f n = n * n
x = 5
y = 2
| fpco/fay | tests/negation.hs | bsd-3-clause | 216 | 1 | 10 | 91 | 110 | 57 | 53 | 10 | 1 |
{-# LANGUAGE CPP #-}
module CmmInfo (
mkEmptyContInfoTable,
cmmToRawCmm,
mkInfoTable,
srtEscape,
-- info table accessors
closureInfoPtr,
entryCode,
getConstrTag,
cmmGetClosureType,
infoTable,
infoTableConstrTag,
infoTableSrtBitmap,
infoTableClosureType,
infoTablePtrs,
infoTableNonPtrs,
... | lukexi/ghc | compiler/cmm/CmmInfo.hs | bsd-3-clause | 20,843 | 2 | 19 | 5,149 | 3,772 | 2,040 | 1,732 | 298 | 7 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Mode.Common
-- License : GPL-2
-- Maintainer : [email protected]
-- Stability : experimental
-- Portability : portable
--
-- Common functions used by modes.
module Yi.Mode.Common (TokenBasedMode, fu... | noughtmare/yi | yi-core/src/Yi/Mode/Common.hs | gpl-2.0 | 6,577 | 0 | 18 | 1,694 | 1,339 | 730 | 609 | 95 | 3 |
<?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>Mga WebSocket | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapr... | thc202/zap-extensions | addOns/websocket/src/main/javahelp/org/zaproxy/zap/extension/websocket/resources/help_fil_PH/helpset_fil_PH.hs | apache-2.0 | 987 | 87 | 29 | 161 | 402 | 214 | 188 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for ganeti-htools.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions a... | apyrgio/ganeti | test/hs/Test/Ganeti/Luxi.hs | bsd-2-clause | 6,883 | 0 | 16 | 1,628 | 1,222 | 628 | 594 | 111 | 2 |
{-# LANGUAGE CPP, TypeFamilies #-}
-- -----------------------------------------------------------------------------
-- | This is the top-level module in the LLVM code generator.
--
module LlvmCodeGen ( llvmCodeGen, llvmFixupAsm ) where
#include "HsVersions.h"
import Llvm
import LlvmCodeGen.Base
import LlvmCodeGen.Co... | green-haskell/ghc | compiler/llvmGen/LlvmCodeGen.hs | bsd-3-clause | 6,448 | 0 | 20 | 1,704 | 1,380 | 685 | 695 | 119 | 3 |
--------------------------------------------------------------------
-- |
-- Module : XMonad.Util.EZConfig
-- Copyright : Devin Mullins <[email protected]>
-- Brent Yorgey <[email protected]> (key parsing)
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Devin Mullins <[email protected]... | markus1189/xmonad-contrib-710 | XMonad/Util/EZConfig.hs | bsd-3-clause | 26,039 | 0 | 16 | 8,344 | 3,684 | 2,278 | 1,406 | 327 | 3 |
module Test13 where
f (x:xs) = x : xs
g = 1 : [1,2]
| kmate/HaRe | old/testing/refacFunDef/Test13.hs | bsd-3-clause | 55 | 0 | 7 | 17 | 38 | 22 | 16 | 3 | 1 |
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module T14164 where
data G (x :: a) = GNil | GCons (G x)
type family F (xs :: [a]) (g :: G (z :: a)) = (res :: [a]) | res -> a where
F (x:xs) GNil = x:xs
F (x:xs) (GCons rest) = x:F xs rest
| sdiehl/ghc | testsuite/tests/indexed-types/should_compile/T14164.hs | bsd-3-clause | 313 | 0 | 9 | 84 | 134 | 81 | 53 | -1 | -1 |
-- Original test case for #11627 (space_leak_001.hs)
import Data.List
main :: IO ()
main = print $ length $ show (foldl' (*) 1 [1..100000] :: Integer)
| ezyang/ghc | testsuite/tests/profiling/should_run/T11627a.hs | bsd-3-clause | 153 | 1 | 9 | 28 | 56 | 29 | 27 | 3 | 1 |
{-# LANGUAGE TypeFamilies, RankNTypes #-}
module T10899 where
class C a where
type F a
type F a = forall m. m a
| ezyang/ghc | testsuite/tests/indexed-types/should_fail/T10899.hs | bsd-3-clause | 118 | 0 | 8 | 29 | 35 | 20 | 15 | 5 | 0 |
{-# LANGUAGE TemplateHaskell, EmptyCase #-}
-- Trac #2431: empty case expression
-- now accepted
module Main where
import Language.Haskell.TH
f :: Int
f = $(caseE (litE $ CharL 'a') [])
main = print f
| urbanslug/ghc | testsuite/tests/th/TH_emptycase.hs | bsd-3-clause | 217 | 0 | 10 | 50 | 52 | 30 | 22 | 6 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses, TypeFamilies, FlexibleContexts, UndecidableInstances #-}
-- | This module exports 'RuleM', the monad used for writing
-- simplification rules.
module Futhark.Optimise.Simplifier.RuleM
( RuleM
, simplify
, cannotSimplify
, liftMay... | ihc/futhark | src/Futhark/Optimise/Simplifier/RuleM.hs | isc | 2,642 | 0 | 15 | 608 | 841 | 424 | 417 | 56 | 2 |
-- Logic module
-- Functions for updating game state and responding to user input
module Logic(updateGameState, handleEvent) where
import State
import Piece
import Playfield
import Graphics.Gloss
import Graphics.Gloss.Interface.Pure.Game -- for Event
import System.Random
-- Piece falling velocity, in cel... | mgeorgoulopoulos/TetrisHaskellWeekend | Logic.hs | mit | 4,308 | 0 | 13 | 948 | 1,199 | 630 | 569 | 74 | 1 |
-- Tenn1518's XMonad configuration
import XMonad
import XMonad.Actions.Warp
import XMonad.Actions.Commands
import XMonad.Actions.RotSlaves
import XMonad.Util.EZConfig
import XMonad.Util.Ungrab
import XMonad.Util.Loggers
import qualified XMonad.StackSet as W
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.Ewmh... | Tenn1518/dotfiles | config/xmonad/xmonad.hs | mit | 3,744 | 5 | 12 | 1,101 | 797 | 459 | 338 | 78 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : GitBak
-- Copyright : (c) Agorgianitis Loukas, 2015
-- License : MIT
--
-- Maintainer : Agorgianitis Loukas <[email protected]>
-- Stability : experimental
-- Portability : portable
--
-- Main of gitbak execut... | ElArtista/GitBak | src/Main.hs | mit | 5,319 | 0 | 27 | 1,303 | 1,150 | 586 | 564 | -1 | -1 |
-- Section 6
import Data.List
import qualified Data.Map as Map
import Data.Char
numUniques :: (Eq a) => [a] -> Int
numUniques = length . nub
wordNums :: String -> [(String, Int)]
wordNums = map (\ws -> (head ws, length ws)) . group . sort . words
digitSum :: Int -> Int
digitSum = sum .map digitToInt . show
firstTo... | ymkjp/Algorithms-and-Data-Structures | 6.hs | mit | 1,230 | 11 | 12 | 246 | 600 | 328 | 272 | 34 | 2 |
{-# LANGUAGE GADTs #-}
module Main where
import Test.Framework.Runners.Console
import Test.Framework.Providers.API
import Test.Framework.Providers.HUnit
import Test.HUnit
import Data.List
import Data.Traversable
--import LProperties
import LUnitTests
main = do
unitTests <- LUnitTests.tests
defaultMain [unitTes... | joshcough/L5-Haskell | test/main.hs | mit | 348 | 0 | 8 | 43 | 69 | 43 | 26 | 12 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.