_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
a3c08642af777446ca7483b7a958d28fba6cee88826091e7a12ef8656edea784 | lehins/Color | SVG.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
-- |
-- Module : Graphics.Color.Standard.SVG
Copyright : ( c ) 2021
-- License : BSD3
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable
--
Source : #Co... | null | https://raw.githubusercontent.com/lehins/Color/504d3f81620aa63b0da25279b78773420630dd13/Color/src/Graphics/Color/Standard/SVG.hs | haskell | |
Module : Graphics.Color.Standard.SVG
License : BSD3
Stability : experimental
Portability : non-portable
| Get a color value by specifying its SVG standard name at the type level:
>>> import Graphics.Color.Standard
>>> import Graphics.Color.Space.CIE1976.LAB
>>> color (SVG :: SVG "aqua") :: Color... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
Copyright : ( c ) 2021
Maintainer : < >
Source : #ColorKeywords
module Graphics.Color.Standard.SVG where
This file is generated with files / mkStdSVGModule
import Prelude hiding (tan)
... |
faf1dc0b1d4f202a12d84d685c389928d4fa701d22cdbee72fde5db3b3b05108 | KeenS/cl-fast-cont | two-pass.lisp | (in-package :cl-user)
(defpackage cl-fast-cont.transform
(:use :cl))
(in-package :cl-fast-cont.transform)
pass 1
walk down AST and expand macros
;;; and find call/cc(shift), then mark the expr and parents as 'want-cont'
(defstruct (marker (:constructor make-marker% (expr)))
expr)
(defun make-marker (want-co... | null | https://raw.githubusercontent.com/KeenS/cl-fast-cont/4b225f5a8824c7c27c3245ee5c64c1607ae916a2/src/two-pass.lisp | lisp | and find call/cc(shift), then mark the expr and parents as 'want-cont'
(expr env) -> marker
((values) (mark-want-cont-values env))
((values-list) (mark-want-cont-values-list env))
FIXME: handle declarations
FIXME: set want-cont attribute to the symbol
TODO: is this env correct?
FIXME: han... | (in-package :cl-user)
(defpackage cl-fast-cont.transform
(:use :cl))
(in-package :cl-fast-cont.transform)
pass 1
walk down AST and expand macros
(defstruct (marker (:constructor make-marker% (expr)))
expr)
(defun make-marker (want-cont-p expr)
(if want-cont-p
(make-marker% expr)
expr))
(defun... |
50d87d04ab0eacd66d614e11ff8b538acd120b6a0a72f019d5bd3b19c6fa6483 | Shimuuar/fixed-vector | Cereal.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
-- | Module with cereal instances for data types defined in fixed
-- vector
module Data.Vector.Fixed.Instances.Cereal where
import Data.Vector.Fixed (... | null | https://raw.githubusercontent.com/Shimuuar/fixed-vector/48a2e3fb1033814a76b1c8f4388d2f97b577be09/fixed-vector-cereal/Data/Vector/Fixed/Instances/Cereal.hs | haskell | # LANGUAGE TypeFamilies #
| Module with cereal instances for data types defined in fixed
vector | # LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Data.Vector.Fixed.Instances.Cereal where
import Data.Vector.Fixed (Arity)
import qualified Data.Vector.Fixed as F
import qualified Data.Vector.Fixed.Boxed as B
import qu... |
fda94d189eb807bd526d2e3f50db9bc824fe60ca5dcbad745ffc2e65efe9c8d7 | chaoxu/fancy-walks | 92.hs |
import Data.Array.IArray
next 0 = 0
next x = next a + b ^ 2
where
(a, b) = x `divMod` 10
lst89 = (89:) $ takeWhile (/=89) $ tail $ iterate next 89
limit = 10 ^ 7 - 1
canArrive89 = (cache!)
where
bnds = (1, limit)
cache = listArray bnds $ map go $ range bnds :: Array Int Bool
go 1 = False
g... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/92.hs | haskell |
import Data.Array.IArray
next 0 = 0
next x = next a + b ^ 2
where
(a, b) = x `divMod` 10
lst89 = (89:) $ takeWhile (/=89) $ tail $ iterate next 89
limit = 10 ^ 7 - 1
canArrive89 = (cache!)
where
bnds = (1, limit)
cache = listArray bnds $ map go $ range bnds :: Array Int Bool
go 1 = False
g... | |
91dc2bd18a2f1414a9685292fe7d9e549b7809f3edd8b0960dc6211c27244eab | frex-project/metaocaml-frex | abelian_groups.mli | module S : Aux.Sig with module Ops := Algebra.Cgroup_ops
module Coproduct_cgroup (A : S.Algebra) (B : S.Algebra) :
S.COPRODUCT with module A.T = A.T and module B.T = B.T
module PS_commutative_group (A : Algebra.CGROUP)
(C : Algebra.CGROUP with type t = A.t code) :
S.PS with type A.T.t = A.t
| null | https://raw.githubusercontent.com/frex-project/metaocaml-frex/e249551a41bd6a8af1a95d77bf9946822a19e3b0/lib/abelian_groups.mli | ocaml | module S : Aux.Sig with module Ops := Algebra.Cgroup_ops
module Coproduct_cgroup (A : S.Algebra) (B : S.Algebra) :
S.COPRODUCT with module A.T = A.T and module B.T = B.T
module PS_commutative_group (A : Algebra.CGROUP)
(C : Algebra.CGROUP with type t = A.t code) :
S.PS with type A.T.t = A.t
| |
cc382e833ec1792295773110516cd284e670a4ad679caf9828c89cedc6fc59b1 | tweag/linear-base | Internal.hs | # LANGUAGE DerivingVia #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LinearTypes #-}
# LANGUAGE PartialTypeSignatures #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - partial - type - signatures #
{-# OPTIONS_HADDOCK hide #-}
module Data.Array.Polarized.Pull.Internal where
import qualified Data.Functor.Linear as ... | null | https://raw.githubusercontent.com/tweag/linear-base/eedda420101f50be4e9e8c8fdee4d10711c6207a/src/Data/Array/Polarized/Pull/Internal.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE LinearTypes #
# OPTIONS_HADDOCK hide #
| A pull array is an array from which it is easy to extract elements, and
this can be done in any order. The linear consumption of a pull array means
each element is consumed exactly once, but the length can be accessed
freely.
In the linear cons... | # LANGUAGE DerivingVia #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - partial - type - signatures #
module Data.Array.Polarized.Pull.Internal where
import qualified Data.Functor.Linear as Data
import Data.Vector (Vector)
import qualified Data.Vector as Vector
import Pr... |
433d5107adb2d3cdadb977414f3f7c125a609378a3f8e6ed7561a72a232345be | thephoeron/quipper-language | Typeable.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
# LANGUAGE CPP #
# LANGUAGE StandaloneDeriving #... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/Libraries/Typeable.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
# LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
we provide the missing instances here.
Unfortunately, there is no easy way ... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
# LANGUAGE CPP #
# LANGUAGE StandaloneDeriving #
#if __GLASGOW_HASKELL__ < 780
# LANGUAGE ScopedTypeVariables #
#endif
| The standard Haskell module " Data . Typeable " only provides
instances for tuples up to length 7 . Since we need... |
f79689a3acef15102a90887942085e5cdeffaeaf9691cbe0b4888baca7957e43 | clash-lang/clash-compiler | T2046B.hs | module T2046B where
import Clash.Prelude
import Clash.Explicit.Testbench
import T2046BType (T2046B)
topEntity :: T2046B -> T2046B
topEntity ((a, b), (c, d), (e, f), (g, h), i) =
( (toEnum (fromEnum a), toEnum (fromEnum b))
, (toEnum (fromEnum c), toEnum (fromEnum d))
, (toEnum (fromEnum e), toEnum (fromEnum f)... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/a85df82b6a9454f36014f4e5a65277a49c866df6/tests/shouldwork/Issues/T2046B.hs | haskell | # NOINLINE topEntity # | module T2046B where
import Clash.Prelude
import Clash.Explicit.Testbench
import T2046BType (T2046B)
topEntity :: T2046B -> T2046B
topEntity ((a, b), (c, d), (e, f), (g, h), i) =
( (toEnum (fromEnum a), toEnum (fromEnum b))
, (toEnum (fromEnum c), toEnum (fromEnum d))
, (toEnum (fromEnum e), toEnum (fromEnum f)... |
dcb26d0e27a1f6fc00fa1497d43f1328fa6af2d16000bed9703d5a609b5f561c | WorksHub/client | views.cljc | (ns wh.metrics.views
(:require
#?(:clj [cheshire.core :as json])
#?(:clj [wh.url :as url])
[clojure.string :as str]
[wh.components.forms :as forms]
[wh.components.www-homepage :as www]
[wh.interop :refer [unparse-arg]]
[wh.metrics.subs :as subs]
[wh.re-frame.subs :refer [<sub]]))
(def... | null | https://raw.githubusercontent.com/WorksHub/client/fb88fe90a7b7f5ee1ec02166358e8adc7d07fc9d/common-pages/src/wh/metrics/views.cljc | clojure | (ns wh.metrics.views
(:require
#?(:clj [cheshire.core :as json])
#?(:clj [wh.url :as url])
[clojure.string :as str]
[wh.components.forms :as forms]
[wh.components.www-homepage :as www]
[wh.interop :refer [unparse-arg]]
[wh.metrics.subs :as subs]
[wh.re-frame.subs :refer [<sub]]))
(def... | |
e8f6e3b0843306890156a04576797837ea84ac11a5b2e1ad3470ca462af1a9fa | 2600hz-archive/whistle | rebar_edoc.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
rebar : Erlang Build Tools
%%
Copyright ( c ) 2010 ( )
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this softw... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/utils/rebar/src/rebar_edoc.erl | erlang | ex: ts=4 sw=4 et
-------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sel... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
rebar : Erlang Build Tools
Copyright ( c ) 2010 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the... |
0746a8eb981053b4ed889ac03852367c52b741060181b273866fe7a67060cc9c | samrocketman/home | glass-text.scm | Glass Effect Text V1.0 ( 11 - 2007 ) ( c ) Copyright
Created by
; Comments directed to
;
; Create Glass Effect Text
;
Simply enter the text and select the effect type . The scrip will generate 4 frames with the selected effect
; You can control various aspects of each effect by adjusting the effect tweak pa... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/glass-text.scm | scheme | Comments directed to
Create Glass Effect Text
You can control various aspects of each effect by adjusting the effect tweak parameter and the scatter
parameter.
Simply save the generated text as an animated .GIF and you're done.
Selecting Raw Layer will display all raw layers only
Clicking off animation wi... | Glass Effect Text V1.0 ( 11 - 2007 ) ( c ) Copyright
Created by
Simply enter the text and select the effect type . The scrip will generate 4 frames with the selected effect
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the Lic... |
69b5997b3ff5091d7e8696a4517ebcd3ade43a5700bd422676d0dd2b91673e39 | jbclements/RSound | random-tone-example.rkt | #lang racket
play a bunch of long tones ; each one is 4 seconds long , fades in and out
slowly , and consists of two waveforms from Adventure Kid 's samples ,
;; differing in pitch by a small random amount. The notes are chosen from
;; a scale built on a specified set of intervals. The code is written in
;; a som... | null | https://raw.githubusercontent.com/jbclements/RSound/c699db1ffae4cf0185c46bdc059d7879d40614ce/rsound/examples/random-tone-example.rkt | racket | each one is 4 seconds long , fades in and out
differing in pitch by a small random amount. The notes are chosen from
a scale built on a specified set of intervals. The code is written in
a somewhat HTDP-friendly way.
given a list of intervals, start at the given
note and build a scale by jumping using the given... | #lang racket
slowly , and consists of two waveforms from Adventure Kid 's samples ,
(require rsound)
(require rsound/envelope)
(require rackunit)
(define SR 44100)
(define (s sec) (* SR sec))
(define major-triad-intervals (list 4 3 5))
(define major-scale-intervals (list 2 2 1 2 2 2 1))
(define micro-tonal-interv... |
05a683d290104012a3976ac26e218146714bd450168da57d7b7589889f006fb8 | processone/xml | xml_test.erl | %%%----------------------------------------------------------------------
File : xml_test.erl
Author : < >
%%% Purpose : xml module testing
Created : 17 Dec 2013 by < >
%%%
%%%
Copyright ( C ) 2002 - 2015 ProcessOne , SARL . All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0... | null | https://raw.githubusercontent.com/processone/xml/7a710d4ab48640f9b2704076c5aaf282352d577e/test/xml_test.erl | erlang | ----------------------------------------------------------------------
Purpose : xml module testing
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDI... | File : xml_test.erl
Author : < >
Created : 17 Dec 2013 by < >
Copyright ( C ) 2002 - 2015 ProcessOne , SARL . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(xml_test).
-com... |
f3034ba1706b6d5545bb208ffa68b0e04efb64c71a37faf02c26b0c27951dc75 | tonyg/kali-scheme | arch.scm | ; -*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*-
Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
; This is file arch.scm.
;;;; Architecture description
In non - Kali , this is Vanilla 19
; Things that the VM and the runtime system b... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/vm/arch.scm | scheme | -*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*-
This is file arch.scm.
Architecture description
Things that the VM and the runtime system both need to know.
Bytecodes: for compiler and interpreter
Instruction specification is
(op . args)
OP may be a name or a list of names
ARGS are
byte - a byte... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
In non - Kali , this is Vanilla 19
(define bits-used-per-byte 8)
(define byte-limit (expt 2 bits-used-per-byte))
- a byte
two instructions into a single , shorter one )... |
6e26ec3ad16bcae6c0939b83fbd4db09a9d8217887109834aa25e806cf2bdbe0 | mwand/eopl3 | tests.scm | (module tests mzscheme
(provide test-list)
;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;;
(define test-list
'(
;; simple arithmetic
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
;; nested arithmetic
(nested-arith-left "-(-(44,33),22... | null | https://raw.githubusercontent.com/mwand/eopl3/b50e015be7f021d94c1af5f0e3a05d40dd2b0cbf/chapter5/exceptions/tests.scm | scheme | tests ;;;;;;;;;;;;;;;;
simple arithmetic
nested arithmetic
simple variables
simple unbound variables
simple conditionals
test dynamic typechecking
make sure that the test and both arms get evaluated
properly.
and make sure the other arm doesn't get evaluated.
simple let
check nested let and shadowing
simp... | (module tests mzscheme
(provide test-list)
(define test-list
'(
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
(nested-arith-left "-(-(44,33),22)" -11)
(nested-arith-right "-(55, -(22,11))" 44)
(test-var-1 "x" 10)
(test... |
f590039953951d198cb337846300b52b88b92a74b1a7bf0533f18e8123db6e2b | johnridesabike/acutis | compile.mli | (**************************************************************************)
(* *)
Copyright ( c ) 2022 .
(* *)
This Source Code For... | null | https://raw.githubusercontent.com/johnridesabike/acutis/19f04e5b65cdc8910eaa2cdee5ad7ef110484b47/lib/compile.mli | ocaml | ************************************************************************
****************************... | Copyright ( c ) 2022 .
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
* Orchestrate the { ! , { ! } , { ! } , and { ! Ma... |
dc6dd8bd372f030d4cc68f3f8c6a92cf55521dfc9a5db5008406a9725e1f8bba | kostyushkin/erlworld | rand.erl |
%%%-------------------------------------------------------------------
Rand
%%%
%%% @doc A random number generator server.
%%%
%%% You create a new random server by calling the new function and
%%% then pass this into the random function when generating numbers.
%%%
%%% This is only meant as a chea... | null | https://raw.githubusercontent.com/kostyushkin/erlworld/1c55c9eb0d12db9824144b4ff7535960c53e35c8/src/rand.erl | erlang | -------------------------------------------------------------------
@doc A random number generator server.
You create a new random server by calling the new function and
then pass this into the random function when generating numbers.
This is only meant as a cheap and cheerful random number module.
For ... |
Rand
the Erlang OTP .
@author
-module( rand ).
-author("Joseph Lenton").
-define( RAND_GET_RANDOM, random_get_random ).
-export([
new/0,
random/2, random/3,
destroy/1
]).
@spec new ( ) - > Server::pid ( )
new() ->
data_server:new(
... |
0619e4c0db9668fecb34f919eb61e3d776f9196ba98bfe7d14b673f43041334e | bittide/bittide-hardware | FirmwareIntegrationTests.hs | SPDX - FileCopyrightText : 2022 Google LLC
--
SPDX - License - Identifier : Apache-2.0
module Tests.ContranomySim.FirmwareIntegrationTests ( generateTests ) where
import Clash.Prelude hiding (map)
import Prelude
import qualified Data.ByteString as BS
import qualified Data.List ... | null | https://raw.githubusercontent.com/bittide/bittide-hardware/cb920b8f292f27fd7c095a4d7b8ded66dd9975e5/contranomy-sim/tests/Tests/ContranomySim/FirmwareIntegrationTests.hs | haskell |
| Load an elf binary, inspect the debug output
^ Action to place the @.elf@ file in the given 'FilePath'
^ Cycles to sample before giving up
add device tree as a memory mapped component
add padding to prevent uninitialised accesses
Hook up to println-debugging
^ Name of the test
^ Path to the ELF file
^ Path ... | SPDX - FileCopyrightText : 2022 Google LLC
SPDX - License - Identifier : Apache-2.0
module Tests.ContranomySim.FirmwareIntegrationTests ( generateTests ) where
import Clash.Prelude hiding (map)
import Prelude
import qualified Data.ByteString as BS
import qualified Data.List ... |
84abe1267aef0917acdb2b81852f309921def0dca7efc99cc2409f96a29085d4 | oakes/defexample | project.clj | (defproject defexample "1.7.1-SNAPSHOT"
:description "A macro for defining code examples"
:url ""
:license {:name "Public Domain"
:url ""}
:repositories [["clojars" {:url ""
:sign-releases false}]]
:profiles {:dev {:main dynadoc.example}})
| null | https://raw.githubusercontent.com/oakes/defexample/c6b8de8f910c51293a269652a5ae9bc0aa2320d3/project.clj | clojure | (defproject defexample "1.7.1-SNAPSHOT"
:description "A macro for defining code examples"
:url ""
:license {:name "Public Domain"
:url ""}
:repositories [["clojars" {:url ""
:sign-releases false}]]
:profiles {:dev {:main dynadoc.example}})
| |
ceaddaa421889d72e194d2788a691ee21c723f5362e9093def52b9edcab4168e | kadena-io/chainweb-node | Utils.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# ... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/574dae887fdd2fafa134be3df79096c606106e76/src/Chainweb/RestAPI/Utils.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
|
Stability: experimental
* Servant Utils
* API Version
* Server Timestamp Header
* Paging
* Chainweb API Endpoints
* Some API
$someapi
** Some Server
** Content Types for Clients
internal modules
--... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MagicHash #
# LANGUAGE MultiParamType... |
2aca253f3657f2538f698a545efd5aac103b4dca9deead37f8d0add44977c951 | typeable/compaREST | Link.hs | # OPTIONS_GHC -Wno - orphans #
module Data.OpenApi.Compare.Validate.Link () where
import Data.OpenApi
import Data.OpenApi.Compare.Behavior
import Data.OpenApi.Compare.Subtree
import Text.Pandoc.Builder
instance Subtree Link where
type SubtreeLevel Link = 'LinkLevel
type CheckEnv Link = '[]
checkStructuralCompa... | null | https://raw.githubusercontent.com/typeable/compaREST/6d8a67339c0e7b20a6c721eec7a2db093a0311fc/src/Data/OpenApi/Compare/Validate/Link.hs | haskell | # OPTIONS_GHC -Wno - orphans #
module Data.OpenApi.Compare.Validate.Link () where
import Data.OpenApi
import Data.OpenApi.Compare.Behavior
import Data.OpenApi.Compare.Subtree
import Text.Pandoc.Builder
instance Subtree Link where
type SubtreeLevel Link = 'LinkLevel
type CheckEnv Link = '[]
checkStructuralCompa... | |
84b57cfa4575b11b5c627162b8e2f0962a94fda81cf64082f0b980b485a02df6 | system-f/papa | Implement.hs | # LANGUAGE NoImplicitPrelude #
module Papa.Bifunctors.Implement(
module Papa.Bifunctors.Implement.Data.Bifoldable
) where
import Papa.Bifunctors.Implement.Data.Bifoldable
| null | https://raw.githubusercontent.com/system-f/papa/5c4d71e08b905a882dd9a4a7d0c336411971c360/papa-bifunctors-implement/src/Papa/Bifunctors/Implement.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Papa.Bifunctors.Implement(
module Papa.Bifunctors.Implement.Data.Bifoldable
) where
import Papa.Bifunctors.Implement.Data.Bifoldable
| |
5bc01d1fa3002fd9702b64c89c46abd8b85f8fff2190524e45dc9199d8b517e2 | mejgun/haskell-tdlib | GetPreferredCountryLanguage.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.GetPreferredCountryLanguage where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
Returns an IETF language tag of the language preferred in the country , which must be used to fill native fields in Tele... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/GetPreferredCountryLanguage.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
| |
module TD.Query.GetPreferredCountryLanguage where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
Returns an IETF language tag of the language preferred in the country , which must be used to fill native fields in Telegram Passport personal details . Returns a 40... |
bcf66d1a9a4db4bbe1167e398d5260059026b5e43a0d388cc08854c24ed6f4fc | technomancy/leiningen | user.clj | (ns leiningen.core.user
"Functions exposing user-level configuration."
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.java.shell :as shell]
[leiningen.core.utils :as utils])
(:import (com.hypirion.io Pipe)
(org.apache.commons.io.output TeeOutput... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/leiningen-core/src/leiningen/core/user.clj | clojure | assumes the file exist
collection of places to look | (ns leiningen.core.user
"Functions exposing user-level configuration."
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.java.shell :as shell]
[leiningen.core.utils :as utils])
(:import (com.hypirion.io Pipe)
(org.apache.commons.io.output TeeOutput... |
d75d271869018ee1ff81f49078c67f545a65486ddf8735a1c3f9f50a72e8e5a9 | loguntsov/reliable_udp | rudp_average.erl | -module(rudp_average).
-author("Sergey Loguntsov <>").
%% API
-export([
new/0,
add/2, add/3,
reset/1,
calc/1
]).
-record(average, {
sum = 0 :: float(),
count = 0 :: pos_integer(),
old_sum = 0,
old_count = 0
}).
-type average() :: #average{}.
-export_type([
average/0
]).
new() ->
#average{}.
add... | null | https://raw.githubusercontent.com/loguntsov/reliable_udp/6544c08a551397182f33ca89ce2ff1db470a0daa/src/rudp_average.erl | erlang | API | -module(rudp_average).
-author("Sergey Loguntsov <>").
-export([
new/0,
add/2, add/3,
reset/1,
calc/1
]).
-record(average, {
sum = 0 :: float(),
count = 0 :: pos_integer(),
old_sum = 0,
old_count = 0
}).
-type average() :: #average{}.
-export_type([
average/0
]).
new() ->
#average{}.
add(Value,... |
a79bad273be9063b75118d752cb8f910b7b4294874903bc6eba29ad114d3edbc | typedclojure/typedclojure | cs_gen.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/c7be1ddb61eb27c524078da6c3673a3dd246c26d/typed/clj.checker/src/typed/cljc/checker/cs_gen.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns ^:no-doc typed.cljc.checker.cs-gen
(:require [clojure.core.typed :as t :refer [letfn>]]
[clojure.core.typed.coerce-utils :as coerce]
[clojure.core.typed.contract-utils :as con]
[clojure.core.typed.current-impl :as impl]
[... |
2d0aabd9d874b918b548bf6d5119a512c6044790e6ffb5e1e4b66793a89391ca | tsloughter/kuberl | kuberl_v1_weighted_pod_affinity_term.erl | -module(kuberl_v1_weighted_pod_affinity_term).
-export([encode/1]).
-export_type([kuberl_v1_weighted_pod_affinity_term/0]).
-type kuberl_v1_weighted_pod_affinity_term() ::
#{ 'podAffinityTerm' := kuberl_v1_pod_affinity_term:kuberl_v1_pod_affinity_term(),
'weight' := integer()
}.
encode(#{ 'podAffini... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_weighted_pod_affinity_term.erl | erlang | -module(kuberl_v1_weighted_pod_affinity_term).
-export([encode/1]).
-export_type([kuberl_v1_weighted_pod_affinity_term/0]).
-type kuberl_v1_weighted_pod_affinity_term() ::
#{ 'podAffinityTerm' := kuberl_v1_pod_affinity_term:kuberl_v1_pod_affinity_term(),
'weight' := integer()
}.
encode(#{ 'podAffini... | |
cfbb5c420392e58992aa905fb9cb0d951c9d53187b8bca709f2c4362958d26a9 | godotclj/godotclj | jna_model.clj | (ns godotclj.jna-model
(:require [godotclj.proto :as proto]))
(require '[tech.v3.datatype.ffi.jna])
(extend-type Long
proto/ToPointer
(->ptr [value]
(com.sun.jna.Pointer. value))
proto/ToAddress
(->address [value]
value))
(extend-type tech.v3.datatype.ffi.Pointer
proto/ToAddress
(->address [ptr... | null | https://raw.githubusercontent.com/godotclj/godotclj/23e9c62e7083f7be9aff8bb205d2a270dd5b5e39/src/clojure/godotclj/jna_model.clj | clojure | (ns godotclj.jna-model
(:require [godotclj.proto :as proto]))
(require '[tech.v3.datatype.ffi.jna])
(extend-type Long
proto/ToPointer
(->ptr [value]
(com.sun.jna.Pointer. value))
proto/ToAddress
(->address [value]
value))
(extend-type tech.v3.datatype.ffi.Pointer
proto/ToAddress
(->address [ptr... | |
e9a5a3d4eda586d6868b91226c87b481dddf24fdfbd3d0ee060829944ea4eccb | CSVdB/pinky | LinearAlgebraSpec.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DataKinds #
module Test.Pinky.Core.LinearAlgebraSpec where
import Pinky
import Test.Hspec
import Test.Pinky.Core.Gen ()
import Test.Pinky.Core.LinearAlgebraGen ()
import Test.Validity
import TestImport
type Ve... | null | https://raw.githubusercontent.com/CSVdB/pinky/e77a4c0812ceb4b8548c41a7652fb247c2ab39e0/pinky-test-utils/test/Test/Pinky/Core/LinearAlgebraSpec.hs | haskell | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DataKinds #
module Test.Pinky.Core.LinearAlgebraSpec where
import Pinky
import Test.Hspec
import Test.Pinky.Core.Gen ()
import Test.Pinky.Core.LinearAlgebraGen ()
import Test.Validity
import TestImport
type Ve... | |
889e4f200cd1de8bd30716cfd3d1c85f002eb8aee5a0d826ddbf4292d58c9407 | felko/pion | Token.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
-- | Type of tokens and lexemes
module Language.Pion.Lexer.Token
*
DelimiterType (..),
Delimiter (..),
delimiterSymbol,
-- * Keywords
Keyword (..),
keywordText,
-- * Logical symbols
ConnectiveType (..),
ModalityType (..),
... | null | https://raw.githubusercontent.com/felko/pion/657fb28ebc37fccd76ad25312b299935bbb66d0f/src/Language/Pion/Lexer/Token.hs | haskell | | Type of tokens and lexemes
* Keywords
* Logical symbols
* Punctuation
* Abstract token
* Concrete token
* Stream of tokens
| Delimiter type.
| @{@ @}@
| @(@ @)@
| @[@ @]@
| @⟨@ @⟩@
| Whether a delimiter is an opening or a closing one.
| Symbols of delimiters.
| Type of keywords.
| Textual content of a... | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module Language.Pion.Lexer.Token
*
DelimiterType (..),
Delimiter (..),
delimiterSymbol,
Keyword (..),
keywordText,
ConnectiveType (..),
ModalityType (..),
Punctuation (..),
punctuationSymbol,
Lexeme (..),
Token (... |
733340df72bab8b2edce0fee204cd90e4c235e7f6ee2b601a7d17896389f424f | c-cube/linol | server.ml |
open Sigs
(** Current state of a document. *)
type nonrec doc_state = {
uri: Lsp.Types.DocumentUri.t;
languageId: string;
version: int;
content: string;
}
* { 2 Request ID }
unique ID of a request , used by to map each request to its reply .
unique ID of a request, used by JSONRPC to map each re... | null | https://raw.githubusercontent.com/c-cube/linol/5a29a9e1456a431122c51f44bc10c51f46f8d592/src/server.ml | ocaml | * Current state of a document.
* String representation of the ID
* Method called to handle client requests.
@param notify_back an object used to reply to the client, send progress
messages, diagnostics, etc.
@param id the query RPC ID, can be used for tracing, cancellation, etc.
* Set to true... |
open Sigs
type nonrec doc_state = {
uri: Lsp.Types.DocumentUri.t;
languageId: string;
version: int;
content: string;
}
* { 2 Request ID }
unique ID of a request , used by to map each request to its reply .
unique ID of a request, used by JSONRPC to map each request to its reply. *)
module Req_id... |
b9f21b5edd8aa1b9259b0c9b23542accf427acbf94e94a0fe6fee9ff46ac3cc2 | static-analysis-engineering/codehawk | bCHMetrics.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : and
------------------------------------------------------------------------------
The MIT License ( MIT )... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchlib/bCHMetrics.ml | ocaml | chutil
bchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : and
------------------------------------------------------------------------------
The MIT License ( MIT )... |
1ddea641e2a74ba5445f4ac92e607fb56d7a88c320213369eda4f92bbcbd089c | GaloisInc/surveyor | Handlers.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
| The main event handler for the B... | null | https://raw.githubusercontent.com/GaloisInc/surveyor/96b6748d811bc2ab9ef330307a324bd00e04819f/surveyor-brick/src/Surveyor/Brick/Handlers.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
All of the state is hidden in this module. The system can only modify state
by sending messages. To facilitate this, no mutation functions are exported.
* State types
* Lenses ('L.Getter's only)
commands that take ... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
| The main event handler for the Brick UI
module Surveyor.Brick.Handlers (
appHandleEvent,
SBE.BrickUIExtension,
SBE.BrickUIState,
SBE.block... |
1c6fb5ec18d33ea18da9cc0fe4b7ef50fd6e38e832f9601b6368f98133d75ffd | fmi/clojure-examples | state.clj | (ns life.state
(use [life.logic :only (next-gen new-world alive? change-cell living within?)]))
(def ^:private history (ref [(new-world)]))
(def ^:private current (ref 0))
(defn living-cells []
(dosync (living (get (ensure history) (ensure current)))))
(defn cell-alive? [cell]
((living-cells) cell))
(defn tog... | null | https://raw.githubusercontent.com/fmi/clojure-examples/46ec0fe7bdfdfccde1ab74a94c64dbd73ea58269/2013/01-game-of-life/src/life/state.clj | clojure | (ns life.state
(use [life.logic :only (next-gen new-world alive? change-cell living within?)]))
(def ^:private history (ref [(new-world)]))
(def ^:private current (ref 0))
(defn living-cells []
(dosync (living (get (ensure history) (ensure current)))))
(defn cell-alive? [cell]
((living-cells) cell))
(defn tog... | |
710fba7ded9f555fe461b490d1ed40f881426f2dbf446bf5899025c38c5668a0 | OCamlPro/ocp-build | onlyUnix.ml | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-unix/onlyUnix.ml | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
open MinUnix
external wait : unit -> int * process_status = "unix_wait"
external fork : unit -> int = "unix_fork"
external getppid : unit -> int = "unix_getppid"
exte... |
069bc0962e57210bf53817004310602b803b6f395dd01f6787f9aa186ec542dc | cbaggers/varjo | generics.lisp | (in-package :varjo.internals)
(defgeneric name (obj))
(defgeneric %add-function (func-name func-spec env))
(defgeneric %add-symbol-binding (var-name val env))
(defgeneric %get-symbol-macro-spec (macro-name env))
(defgeneric %uniform-name (thing env))
(defgeneric (setf compiled-functions) (val e key))
(defgeneric (setf... | null | https://raw.githubusercontent.com/cbaggers/varjo/9e77f30220053155d2ef8870ceba157f75e538d4/src/varjo.internals/generics.lisp | lisp | (in-package :varjo.internals)
(defgeneric name (obj))
(defgeneric %add-function (func-name func-spec env))
(defgeneric %add-symbol-binding (var-name val env))
(defgeneric %get-symbol-macro-spec (macro-name env))
(defgeneric %uniform-name (thing env))
(defgeneric (setf compiled-functions) (val e key))
(defgeneric (setf... | |
04489ec23b22934ef3b197ab41201fe52bbc3f486bdc338edfb49cbd2c9fc5d0 | SNePS/SNePS2 | defun-noun.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : SNEPSUL ; Base : 10 -*-
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
Version : $ I d : defun - noun.lisp , v
;;; This file is part of SNePS.
$ BEGIN LICENSE$
The contents of this file are subject to the University ... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/demo/sneps/brachet-dist/defun-noun.lisp | lisp | Syntax : Common - Lisp ; Package : SNEPSUL ; Base : 10 -*-
This file is part of SNePS.
you may
not use this file except in compliance with the License. You
may obtain a copy of the License at
. edu/sneps/Downloads/ubpl.pdf.
or implied. See the License for the specific language gov
erning rights and limitatio... |
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
Version : $ I d : defun - noun.lisp , v
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Software distributed under the License is distributed on an
" AS IS " basis , WITHOUT WARRANTY OF ANY KI... |
ff1f2ea8c7dd8e061f15aa9fef75db103b8217dcbab3186bb149ae1fd4ca8506 | EduardoRFS/ppx_let_locs | list_412.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/EduardoRFS/ppx_let_locs/46b0cdfc46c4bc1450a25b6ae455cc65e663acd0/ocaml/stdlib/list_412.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* List operations .
Some functions are flagged as not tail - recursive . A tail - recursive
... |
efad1586096ec647c74292686c581ed2369c901500c469e159d4fe8c15ae3fec | kraison/vivace-graph-v3 | globals.lisp | (in-package :graph-db)
(defvar *cache-enabled* t)
(alexandria:define-constant +db-version+ 1)
(defvar *graph* nil)
(alexandria:define-constant +main-table-file+ "main.dat" :test 'equal)
(alexandria:define-constant +meta-file+ "meta.dat" :test 'equal)
(alexandria:define-constant +data-file+ "data.dat" :test 'equal)
... | null | https://raw.githubusercontent.com/kraison/vivace-graph-v3/cf2caaf26baccec9afd4d6a79375cd9ff5fe0613/globals.lisp | lisp | Key namespaces
Sentinel values for skip lists
For views, aggregrate key symbol
index-lists
ve-key / ve-index
vev-key / vev-index
Type bytes for serialization | (in-package :graph-db)
(defvar *cache-enabled* t)
(alexandria:define-constant +db-version+ 1)
(defvar *graph* nil)
(alexandria:define-constant +main-table-file+ "main.dat" :test 'equal)
(alexandria:define-constant +meta-file+ "meta.dat" :test 'equal)
(alexandria:define-constant +data-file+ "data.dat" :test 'equal)
... |
743456b870ff385b9d5008473a0f6def4a19d4fb68027e9eefd7b0828e93422b | input-output-hk/cardano-ledger-byron | File.hs | # LANGUAGE TemplateHaskell #
module Test.Cardano.Chain.Epoch.File
( tests
)
where
import Cardano.Prelude
import Control.Monad.Trans.Resource (ResIO, runResourceT)
import Data.Maybe (isJust)
import Hedgehog (Group, Property, (===), discover)
import qualified Hedgehog as H
import Streaming (Of((:>)))
import qualif... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/test/Test/Cardano/Chain/Epoch/File.hs | haskell | to work). Now the question is whether it is OK to use an hardcoded value
for the number of slots per epoch, and if so in which module should we
store this constant? | # LANGUAGE TemplateHaskell #
module Test.Cardano.Chain.Epoch.File
( tests
)
where
import Cardano.Prelude
import Control.Monad.Trans.Resource (ResIO, runResourceT)
import Data.Maybe (isJust)
import Hedgehog (Group, Property, (===), discover)
import qualified Hedgehog as H
import Streaming (Of((:>)))
import qualif... |
7cfbca824b8fc87c09899766106889717a4c4ebf5d548dafa187ca30d11f7204 | yuriy-chumak/ol | platform.scm | Platform independent OpenGL Library part
(define-library (OpenGL ES platform)
(export
GL types
/usr / include / GLES / gl.h
GLvoid GLvoid*
GLchar
GLenum
GLboolean
GLbitfield
GLbyte
GLshort
GLint
GLsizei
GLubyte GLubyte*
GLushort GLushort*
GLuint GLuint* GLuint&
GLflo... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/5e00a1d1df8a8f20d5d6b7714275a1578a56b8a0/libraries/unsupported/platform.scm | scheme | WGL / GLX / CGL / EGL/ ... universal functions
gl:GetProcAddress
context creation
internal variables
deprecated
============================================================================
== implementation ==========================================================
Platform Types
todo: khronos_ssize_t -cond-exp... | Platform independent OpenGL Library part
(define-library (OpenGL ES platform)
(export
GL types
/usr / include / GLES / gl.h
GLvoid GLvoid*
GLchar
GLenum
GLboolean
GLbitfield
GLbyte
GLshort
GLint
GLsizei
GLubyte GLubyte*
GLushort GLushort*
GLuint GLuint* GLuint&
GLflo... |
2f9a3ef63c04402f14590f0575b21686e380e963c53844d96c719d2ea7744d55 | ocaml-ppx/ocamlformat | Docstring.mli | (**************************************************************************)
(* *)
(* OCamlFormat *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/461e0c499a1aac6ca11c736a96fbdb4d9a622e20/lib/Docstring.mli | ocaml | ************************************************************************
OCamlFormat
... | Copyright ( c ) Facebook , Inc. and its affiliates .
This source code is licensed under the MIT license found in
val parse :
loc:Warnings.loc
-> string
-> (Odoc_parser.Ast.t, Odoc_parser.Warning.t list) Result.t
val parse_file : Lexing.position -> string -> Odoc_parser.... |
d108d2ea144a207512f1219c9c8df6c2d3ea51ac8a62e9bf5762161dd9ed5aad | karamellpelle/grid | MemoryData.hs | grid is a game written in Haskell
Copyright ( C ) 2018
--
-- 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 License , or
-- (at your optio... | null | https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/source/Game/Memory/MemoryData.hs | haskell |
This file is part of grid.
grid is free software: you can redistribute it and/or modify
(at your option) any later version.
grid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GN... | grid is a game written in Haskell
Copyright ( C ) 2018
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Game.Memory.MemoryData
(
#ifdef GRID_STYL... |
ad64f750b916f03780071198bf9092f05046ab7901d8768ef09c95da687046cd | umber-lang/umber | typed.ml | open Import
open Names
let type_error_msg = Type_bindings.type_error_msg
module Pattern = struct
include Pattern
type nonrec t = Nothing.t t [@@deriving sexp]
(* TODO: either split up Untyped/Typed patterns into different types or stop returning
a pattern from these functions *)
let of_untyped_with_nam... | null | https://raw.githubusercontent.com/umber-lang/umber/43339b87e10a704bffea16341f6285bc3cba058e/src/typed.ml | ocaml | TODO: either split up Untyped/Typed patterns into different types or stop returning
a pattern from these functions
TODO: inferring unqualified name given type information
Unions must define the same names with the same types
Process bindings in order without any recursion
FIXME: I don't think this handles... | open Import
open Names
let type_error_msg = Type_bindings.type_error_msg
module Pattern = struct
include Pattern
type nonrec t = Nothing.t t [@@deriving sexp]
let of_untyped_with_names ~names ~types (pat : Untyped.Pattern.t)
: Names.t * (t * Type.t)
=
let rec of_untyped_with_names ~names ~types pa... |
bfc0e912d2d0b352ee77954aaaf7803b1ff179c299988219f80221d506408a1c | geophf/1HaskellADay | Exercise.hs | {-# LANGUAGE OverloadedStrings #-}
module Y2018.M06.D22.Exercise where
import Data.Aeson
import Network.HTTP.Conduit
below import available via 1HaskellADay git repository
import Y2018.M06.D19.Exercise
-
Okay , a rather simple exercise today involving a REST call .
You have an AWS Lambda function at :
-
... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M06/D22/Exercise.hs | haskell | # LANGUAGE OverloadedStrings #
}
-
That takes an article ID and article text and returns a set of entities, or
key phrases of that article (... this is the work that it does ... in theory).
You have a set of article ids and texts extracted from the data archive that
we did analysis on before (see above import)
-
Read... |
module Y2018.M06.D22.Exercise where
import Data.Aeson
import Network.HTTP.Conduit
below import available via 1HaskellADay git repository
import Y2018.M06.D19.Exercise
-
Okay , a rather simple exercise today involving a REST call .
You have an AWS Lambda function at :
-
Okay, a rather simple exercise toda... |
d8b0adc02ad238f21ee9ce1bff301f64d5741733c6c5ba460829ebf06474c31b | commercialhaskell/stack | Main.hs | import System.Process (rawSystem)
import Control.Exception (throwIO)
import StackTest
import Control.Monad (unless)
main :: IO ()
main = rawSystem "sh" ["run.sh"] >>= throwIO
| null | https://raw.githubusercontent.com/commercialhaskell/stack/80fe03c1f89e69b791de13a2b5eededdf1660c64/test/integration/tests/ghc-install-hooks/Main.hs | haskell | import System.Process (rawSystem)
import Control.Exception (throwIO)
import StackTest
import Control.Monad (unless)
main :: IO ()
main = rawSystem "sh" ["run.sh"] >>= throwIO
| |
78fc793c1e010183058e2bb58eb647663e64722929045e4d8fd5e0fb022baa99 | ghollisjr/cl-ana | h5ex-t-bitatt.lisp | Copyright by The HDF Group .
;;;; All rights reserved.
;;;;
This file is part of hdf5 - cffi .
The full hdf5 - cffi copyright notice , including terms governing
;;;; use, modification, and redistribution, is contained in the file COPYING,
;;;; which can be found at th... | null | https://raw.githubusercontent.com/ghollisjr/cl-ana/5cb4c0b0c9c4957452ad2a769d6ff9e8d5df0b10/hdf-cffi/examples/datatypes/h5ex-t-bitatt.lisp | lisp | All rights reserved.
use, modification, and redistribution, is contained in the file COPYING,
which can be found at the root of the source code distribution tree.
If you do not have access to this file, you may request a copy from
.
fields to an attribute with a dataspace of DIM0xDIM1, then
the data, and output... | Copyright by The HDF Group .
This file is part of hdf5 - cffi .
The full hdf5 - cffi copyright notice , including terms governing
This example shows how to read and write
datatypes to an attribute . The program first writes bit
closes the file . Next , it ... |
f526e6b37b6eae8574b40e51242eb82af08eb186e6b355b48650681e530d66d4 | facebookarchive/duckling_old | _communication.clj | (
"phone number"
#"(?i)(\+?[0-9\(][0-9\- \(\)\.]{6,16}( ?e?xt?\.? ?\d+)?)"
{:dim :phone-number
:value (-> %1 :groups first)}
"url"
#"((https?://)?(\w+\.)+\w{2,4}(:\d+)?[^ ]*)"
{:dim :url
:value (-> %1 :groups first)}
"localhost url"
#"((https?://)?localhost(:\d+)?[^ ]*)"
{:dim :url
:value (-> %1 :grou... | null | https://raw.githubusercontent.com/facebookarchive/duckling_old/bf5bb9758c36313b56e136a28ba401696eeff10b/resources/languages/et/rules/_communication.clj | clojure | (
"phone number"
#"(?i)(\+?[0-9\(][0-9\- \(\)\.]{6,16}( ?e?xt?\.? ?\d+)?)"
{:dim :phone-number
:value (-> %1 :groups first)}
"url"
#"((https?://)?(\w+\.)+\w{2,4}(:\d+)?[^ ]*)"
{:dim :url
:value (-> %1 :groups first)}
"localhost url"
#"((https?://)?localhost(:\d+)?[^ ]*)"
{:dim :url
:value (-> %1 :grou... | |
af04955438a25dd6e824d758b7c05a59b135e54fff9babb5065700bb452fa12f | kelamg/HtDP2e-workthrough | ex244.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex244) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Abstraction/ex244.rkt | racket | about the language level of this file in a form that our tools can easily process.
These are legal because the passed in function x, is used in all
definitions by supplying arguments to it in the function body
of f in each case. This is legal because in this case, function
arguments are being used to perform compu... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex244) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define (f x) (x 10))
(define (f x) (x f))
(define (f x y) ... |
70df3942a169d264e326578b76a2be83f0ac2333bad272a8d70819875e674e11 | HunterYIboHu/htdp2-solution | 25.1-bundle.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname 25.1-bundle-undergoing) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t const... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter5/Section25-non-standard-recursion/25.1-bundle.rkt | racket | about the language level of this file in a form that our tools can easily process.
[List-of 1String] N -> [List-of String]
bundles chunks of s into strings of length n. | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname 25.1-bundle-undergoing) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(check-expect (bundle (explode "abcde... |
ed3f1a2c975db2e9b2eb33db74c7b41557d5fb3839ef0f89ca642c6e10c8ca8b | dannypsnl/plt-research | turnstile.rkt | #lang turnstile+
(provide (type-out →) λ #%app ann #%module-begin #%top-interaction require #%datum
Int String)
( → typ / param * ... / return )
(define-type-constructor →
#:arity >= 1
#:arg-variances
(λ (stx)
(syntax-parse stx
[(_ typ/param* ... typ/return)
(append
(stx-map... | null | https://raw.githubusercontent.com/dannypsnl/plt-research/6e8c2af4252f418cb84ac1ead49991c89c5f377b/stlc/turnstile.rkt | racket | inferred form: (λ (x) x)
infer type of func, produces a arrow type
ensure exp and type length matched
if fail, use `num-args-fail-msg` constructs error message
check(⇐) arg*
check, ⇐ e : type
synth, ⇒ e : type
extension
an integer literal synth type Int
an string literal synth type String
unknown literal | #lang turnstile+
(provide (type-out →) λ #%app ann #%module-begin #%top-interaction require #%datum
Int String)
( → typ / param * ... / return )
(define-type-constructor →
#:arity >= 1
#:arg-variances
(λ (stx)
(syntax-parse stx
[(_ typ/param* ... typ/return)
(append
(stx-map... |
cff8a6c4287af9d8e40a2d0639aa15a469cf375ce14697b8b602b7b89cb19ced | lispbuilder/lispbuilder | setup-and-draw.lisp | Converted from the " Setup and Draw " Processing example at :
;;;;; ""
;;;;; (C)2006 Luke J Crook
(in-package #:sdl-examples)
(defun setup-and-draw ()
(let ((width 200) (height 200)
(y 100))
(sdl:with-init ()
(sdl:window width height :title-caption "Setup and Draw, from Processing.org")
(setf (sd... | null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl/examples/setup-and-draw.lisp | lisp | ""
(C)2006 Luke J Crook | Converted from the " Setup and Draw " Processing example at :
(in-package #:sdl-examples)
(defun setup-and-draw ()
(let ((width 200) (height 200)
(y 100))
(sdl:with-init ()
(sdl:window width height :title-caption "Setup and Draw, from Processing.org")
(setf (sdl:frame-rate) 30)
(sdl:with-ev... |
dc098b59e6dfa717c52742a636d5ff42ff5cc9283369000b03668cb913d4f41a | shriphani/sleipnir | layout.clj | (ns sleipnir.views.layout
(:require [hiccup.page :refer [html5 include-css]]))
(defn common [& body]
(html5
[:head
[:title "Welcome to sleipnir"]
(include-css "/css/screen.css")]
[:body body]))
| null | https://raw.githubusercontent.com/shriphani/sleipnir/2eeb711c63cea61ba25dba46e1144cfd59e4f1dc/src/sleipnir/views/layout.clj | clojure | (ns sleipnir.views.layout
(:require [hiccup.page :refer [html5 include-css]]))
(defn common [& body]
(html5
[:head
[:title "Welcome to sleipnir"]
(include-css "/css/screen.css")]
[:body body]))
| |
2dfd96179fa9fba852cc29f705629c2e47c7f6d9cf2aafef7225b4b5c233d37b | skanev/playground | 48.scm | SICP exercise 2.48
;
; A directed line segment in the plane can be represented as a pair of
; vectors - the vector running from the origin to the start-point of the
; segment, and the vector running from the origin to the end-point of the
segment . Use your vector representation from Exercise 2.46 to define a
; rep... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/48.scm | scheme |
A directed line segment in the plane can be represented as a pair of
vectors - the vector running from the origin to the start-point of the
segment, and the vector running from the origin to the end-point of the
representation for segments with a constructor make-segment and selectors
start-segment and end-segmen... | SICP exercise 2.48
segment . Use your vector representation from Exercise 2.46 to define a
(define (make-segment start end)
(list start end))
(define (start-segment segment)
(car segment))
(define (end-segment segment)
(cadr segment))
(define (make-vect x y)
(list x y))
|
5ae6eddfd42be8f685bf6e8a6533948ba85afb9dafb763db879412886d81eba0 | hercules-ci/hercules-ci-agent | SingleState.hs | | Work around Nix regression causing corruption when EvalState is destroyed and a new one created .
module SingleState (withGlobalState, evalState) where
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Hercules.CNix.Expr
import Hercules.CNix.Store.TestUtil (withTempStore)
import Protolude hiding (e... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/8a476e9328d197d0d41872b1674638827e18bae0/hercules-ci-cnix-expr/test/SingleState.hs | haskell | | Work around Nix regression causing corruption when EvalState is destroyed and a new one created .
module SingleState (withGlobalState, evalState) where
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Hercules.CNix.Expr
import Hercules.CNix.Store.TestUtil (withTempStore)
import Protolude hiding (e... | |
3b213d05ac1eae6a64dfb942674d5760a13b725c3089454f25478a22fe9dd4ee | ghc/ghc | T22669.hs | module T22669 where
| null | https://raw.githubusercontent.com/ghc/ghc/1c050ed26f50f3a8788e650f23d6ff55badc1072/testsuite/tests/driver/T22669.hs | haskell | module T22669 where
| |
81e5e46fa4a3ec8d0bb757d2ecb7e8b2c98492f68d0857d6875f0cd04ea3f89b | input-output-hk/cardano-sl | Behavior.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE LambdaCase #-}
module Pos.Chain.Ssc.Behavior
( SscBehavior (..)
, SscOpeningParams (..)
, SscSharesParams (..)
) where
import Universum
import qualified Data.Aeson as A
import Data.Aeson.Options (defaultOptions)
import ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/chain/src/Pos/Chain/Ssc/Behavior.hs | haskell | # LANGUAGE LambdaCase #
--------------------------------------------------------------------------
Types for the behavior config
--------------------------------------------------------------------------
| SSC settings (a part of the behavior config).
The syntax of this config section is as follows:
@
ssc:
... | # LANGUAGE DeriveGeneric #
module Pos.Chain.Ssc.Behavior
( SscBehavior (..)
, SscOpeningParams (..)
, SscSharesParams (..)
) where
import Universum
import qualified Data.Aeson as A
import Data.Aeson.Options (defaultOptions)
import Data.Default (Default (..))
... |
a7ec028c12a7416613e1b2ebc3d59dbed50563a9562c798bac424c3af9fca503 | ndmitchell/tagsoup | Reverse.hs |
main = reverse
reverse = foldl (flip (:)) []
flip f x y = f y x
foldl f z list = case list of
[] -> z
(x:xs) -> foldl f (f z x) xs
| null | https://raw.githubusercontent.com/ndmitchell/tagsoup/e116d3b965e4f149581bd55e45a05661b1113536/test/TagSoup/Generate/programs/Reverse.hs | haskell |
main = reverse
reverse = foldl (flip (:)) []
flip f x y = f y x
foldl f z list = case list of
[] -> z
(x:xs) -> foldl f (f z x) xs
| |
fed9b77c618e779e5e38b072ba718fe30da34f5ac1a7fc18fc10a526ff183e42 | tweag/ormolu | comment-spacing-out.hs | -- | Something.
foo ::
-- | Foo.
Int ->
-- | Bar.
IO ()
foo _ = pure () -- comment
| null | https://raw.githubusercontent.com/tweag/ormolu/7d4e47b4ed97e0fede8231950c29211561a52846/data/examples/other/comment-spacing-out.hs | haskell | | Something.
| Foo.
| Bar.
comment | foo ::
Int ->
IO ()
|
514dbd979c14a4c2dac4b2ec06645cc5035d94024572eb3f8380e1509e9c7ae2 | PDP-10/panda | defmacro.lsp | DEFMAC -*-Mode : Lisp;Package : SI;Lowercase : T-*-
;;; *****************************************************************
* * * * * NIL * * * * * * * * DEFUN & and DEFMACRO * * * * * * * * * * * * * * * * * * * * * * * * * *
;;; *****************************************************************
* *... | null | https://raw.githubusercontent.com/PDP-10/panda/522301975c062914ea3d630a1daefde261ddf590/files/maclisp/defmacro.lsp | lisp | Package : SI;Lowercase : T-*-
*****************************************************************
*****************************************************************
*****************************************************************
This OWN-SYMBOL declaration is here so that it is easy to change
the number of... | * * * * * NIL * * * * * * * * DEFUN & and DEFMACRO * * * * * * * * * * * * * * * * * * * * * * * * * *
* * ( c ) Copyright 1981 Massachusetts Institute of Technology * * * * *
(herald DEFMACRO /166)
#-NIL (include ((lisp) subload lsp))
#-NIL (eval-when (eval compile)
(subload SHARPCONDITIONALS)
)
... |
5bc304afa971a59c10923edd18c90a142d6d6a3b97001d418650b6401894e5ee | ibdknox/crate | element.cljs | (ns crate.element
(:use [crate.util :only [to-uri]])
(:use-macros [crate.def-macros :only [defelem]])
(:require
Must require crate.compiler for defelem to work .
[crate.compiler :as compiler]
[clojure.string :as str]))
(defn javascript-tag
"Wrap the supplied javascript up in script tags and a CDATA s... | null | https://raw.githubusercontent.com/ibdknox/crate/ac992fa48e2818918b14a01b7d5fcbefa10ae058/src/crate/element.cljs | clojure | (ns crate.element
(:use [crate.util :only [to-uri]])
(:use-macros [crate.def-macros :only [defelem]])
(:require
Must require crate.compiler for defelem to work .
[crate.compiler :as compiler]
[clojure.string :as str]))
(defn javascript-tag
"Wrap the supplied javascript up in script tags and a CDATA s... | |
ced680a62a8e14d5ec5049f464f5700c42b3b898ce78253ffaace8789fffac74 | ocaml-sf/learn-ocaml-corpus | comparison.ml | let (++) (x : req) (y : req) : req =
match x, y with
| Infinite, _
| _, Infinite ->
Infinite
| Finite x, Finite y ->
Finite (x + y)
let (<==) (x : req) (y : req) : bool =
match x, y with
| _, Infinite ->
true
| Infinite, Finite _ ->
true (* wrong *)
| Finite x, Finite y ->
... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/pprint/wrong/comparison.ml | ocaml | wrong | let (++) (x : req) (y : req) : req =
match x, y with
| Infinite, _
| _, Infinite ->
Infinite
| Finite x, Finite y ->
Finite (x + y)
let (<==) (x : req) (y : req) : bool =
match x, y with
| _, Infinite ->
true
| Infinite, Finite _ ->
| Finite x, Finite y ->
x <= y
let rec requir... |
b4a5e37f32d1241b53b0e46191885baf069c4fe0be5df8922eac2f8b365fa702 | ajhc/demo-android-ndk | Main.hs | # LANGUAGE ForeignFunctionInterface #
import Control.Monad
import Data.Bits
import Foreign.Ptr
import Foreign.Storable
import Foreign.Marshal.Alloc
import Foreign.Marshal.Array
import AndroidNdk
import CubeVertices
-- some magic
androidActs :: AndroidNdkActs
androidActs = AndroidNdkActs { drawFrame = engineDrawFrame
... | null | https://raw.githubusercontent.com/ajhc/demo-android-ndk/dc54f9d219c9d9ca34afe1efeb2798a8773de68c/cube/hs_src/Main.hs | haskell | some magic
Dummy main
True main
Process the next input event.
Process the next main command.
Just the current frame in the display.
xxx heavy | # LANGUAGE ForeignFunctionInterface #
import Control.Monad
import Data.Bits
import Foreign.Ptr
import Foreign.Storable
import Foreign.Marshal.Alloc
import Foreign.Marshal.Array
import AndroidNdk
import CubeVertices
androidActs :: AndroidNdkActs
androidActs = AndroidNdkActs { drawFrame = engineDrawFrame
... |
43c0d83c70f79dfbd433a4dee684f336db88945962f699d1c9cc627aabc5ff66 | tsloughter/kuberl | kuberl_v1alpha1_webhook_throttle_config.erl | -module(kuberl_v1alpha1_webhook_throttle_config).
-export([encode/1]).
-export_type([kuberl_v1alpha1_webhook_throttle_config/0]).
-type kuberl_v1alpha1_webhook_throttle_config() ::
#{ 'burst' => integer(),
'qps' => integer()
}.
encode(#{ 'burst' := Burst,
'qps' := Qps
}) ->
#{ ... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1alpha1_webhook_throttle_config.erl | erlang | -module(kuberl_v1alpha1_webhook_throttle_config).
-export([encode/1]).
-export_type([kuberl_v1alpha1_webhook_throttle_config/0]).
-type kuberl_v1alpha1_webhook_throttle_config() ::
#{ 'burst' => integer(),
'qps' => integer()
}.
encode(#{ 'burst' := Burst,
'qps' := Qps
}) ->
#{ ... | |
40a678b485b3c38ff71b1def3cf5cf5442d34306a01e7ef599682fd69fdf3c2f | haskell/time | AddDays.hs | module Test.Calendar.AddDays (
addDaysTest,
) where
import Data.Time.Calendar
import Test.Calendar.AddDaysRef
import Test.Tasty
import Test.Tasty.HUnit
days :: [Day]
days =
[ fromGregorian 2005 2 28
, fromGregorian 2004 2 29
, fromGregorian 2004 1 31
, fromGregorian 2004 12 31
, fromGregorian ... | null | https://raw.githubusercontent.com/haskell/time/dba6302b244a7b991ee7cac0d16461fddd222965/test/main/Test/Calendar/AddDays.hs | haskell | module Test.Calendar.AddDays (
addDaysTest,
) where
import Data.Time.Calendar
import Test.Calendar.AddDaysRef
import Test.Tasty
import Test.Tasty.HUnit
days :: [Day]
days =
[ fromGregorian 2005 2 28
, fromGregorian 2004 2 29
, fromGregorian 2004 1 31
, fromGregorian 2004 12 31
, fromGregorian ... | |
ab7359bb0c1be78d6811f97df18d285cb7031e7fbfe9ae17ae23280518b2606e | thheller/shadow-experiments | components.cljs | (ns shadow.experiments.grove.components
(:require-macros [shadow.experiments.grove.components])
(:require
[goog.object :as gobj]
[shadow.cljs.modern :refer (defclass)]
[shadow.experiments.arborist :as sa]
[shadow.experiments.arborist.common :as common]
[shadow.experiments.arborist.protocols :as ... | null | https://raw.githubusercontent.com/thheller/shadow-experiments/f5617079ad6fe553b612505047b258036cf85eb8/src/main/shadow/experiments/grove/components.cljs | clojure | this file is an exercise in writing the least idiomatic clojure code possible
shield your eyes and beware!
called on start for hot-reload purposes
otherwise components may decide to skip rendering and preventing nested UI updates
will be stripped in release builds
FIXME: maybe use array, never directly accessible... | (ns shadow.experiments.grove.components
(:require-macros [shadow.experiments.grove.components])
(:require
[goog.object :as gobj]
[shadow.cljs.modern :refer (defclass)]
[shadow.experiments.arborist :as sa]
[shadow.experiments.arborist.common :as common]
[shadow.experiments.arborist.protocols :as ... |
aafdc52513a689f0f4f5c96a6d8984f6e0139a4f671a75cb5ac86a0f28ffe906 | Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator | Util.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
-- | Utility functions for the OpenAPI code generator
module OpenAPI.Generate.Internal.Util
( haskellifyText,
haskellifyName,
haskellifyNameM,
transformToModuleName,
uppercaseFirstText,
mapMaybeM,
liftedAppend,
joinWithPoint,
... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/cf1dbffce53ea82268dbe80b0e8e6ab1a52c4cf6/openapi3-code-generator/src/OpenAPI/Generate/Internal/Util.hs | haskell | # LANGUAGE OverloadedStrings #
| Utility functions for the OpenAPI code generator
| Checks if the casing of a character can be changed.
This is required to ensure the functions 'Char.toUpper' and 'Char.toLower' actually do something.
Additionally, this function applies style settings according to the need of the co... | # LANGUAGE LambdaCase #
module OpenAPI.Generate.Internal.Util
( haskellifyText,
haskellifyName,
haskellifyNameM,
transformToModuleName,
uppercaseFirstText,
mapMaybeM,
liftedAppend,
joinWithPoint,
joinWith,
)
where
import qualified Control.Applicative as Applicative
import qualified... |
caefc832268a146b9e417123ce3bae125ac0073ffc012f21ed71412dead9595b | penpot/penpot | container.cljc | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.common.types.container
(:require
[app.common.data.macros :as dm]
[app.common.geom.point :as gp... | null | https://raw.githubusercontent.com/penpot/penpot/2ea81c0114fb13ece945b7082aff0bcd7383e563/common/src/app/common/types/container.cljc | clojure |
Copyright (c) KALEIDOS INC
Ensure that the component root is not an instance
Make the original shape an instance of the new component.
instance, maintain this instanceness untouched.
If frame-id points to a shape inside the component, remap it to the
corresponding new frame shape. If not, set it to nil.
If fram... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.common.types.container
(:require
[app.common.data.macros :as dm]
[app.common.geom.point :as gpt]
[app.common.geom.shapes :as... |
99927bbb522acc5fed54689054922d40c0659155d4dacb7afeaa67ddb99698c2 | WorksHub/client | attachments.cljs | (ns wh.common.attachments
(:require [clojure.string :as str]))
(defn downloadable? [filename]
(some-> filename
(str/ends-with? ".pdf")
not))
| null | https://raw.githubusercontent.com/WorksHub/client/1a5a28a4c54b99f7178fe5cb4b5ceb54eb473d83/client/src/wh/common/attachments.cljs | clojure | (ns wh.common.attachments
(:require [clojure.string :as str]))
(defn downloadable? [filename]
(some-> filename
(str/ends-with? ".pdf")
not))
| |
5d0c594b0fc3a3d222ce38e5f99b5d66510e231e7ef2c5218e6445ca5cf78d27 | iokasimov/apart | Binary.hs | module Test.Apart.Structures.Tree.Binary
( any_left_left_is_less_any_right_is_greater) where
import "base" Data.Functor.Bind (Bind (..))
import "comonad" Control.Comonad (extract)
import "hedgehog" Hedgehog (Property (..), Gen (..), forAll, property, assert)
import "hedgehog" Hedgehog.Gen (enumBounded, list)
import "... | null | https://raw.githubusercontent.com/iokasimov/apart/5a3a8c0cfb516d5a55121dc39f7465f572866c90/Test/Apart/Structures/Tree/Binary.hs | haskell | module Test.Apart.Structures.Tree.Binary
( any_left_left_is_less_any_right_is_greater) where
import "base" Data.Functor.Bind (Bind (..))
import "comonad" Control.Comonad (extract)
import "hedgehog" Hedgehog (Property (..), Gen (..), forAll, property, assert)
import "hedgehog" Hedgehog.Gen (enumBounded, list)
import "... | |
3ff98481acc19b4a34ddbb774daa893cd5c37188830dd1e1d0bb8879da8c19d7 | target/theta-idl | Kotlin.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedLists #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications #
module Test.Theta.Tar... | null | https://raw.githubusercontent.com/target/theta-idl/0fed73dc7f3963fd2c63cb408edcda0547a6d453/theta/test/Test/Theta/Target/Kotlin.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell # | # LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedLists #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeApplications #
module Test.Theta.Target.Kotlin where
import Theta.Metadata (Metadata (..))
import qualified Theta.Types as Theta
import ... |
f28573865089f28fccf95c56be56d54518f6a27880a89e837a551b4e7d62131a | aeternity/aeternity | aecore_suite_utils.erl | -module(aecore_suite_utils).
%% Common Test configuration functions.
-export([init_per_suite/2,
init_per_suite/3,
init_per_suite/4]).
-export([top_dir/1,
make_shortcut/1,
node_config/2,
create_config/4,
create_seed_file/5,
make_multi/2,
node_shor... | null | https://raw.githubusercontent.com/aeternity/aeternity/b253417e4754a95338512782ef8b55233f7c4f94/apps/aecore/test/aecore_suite_utils.erl | erlang | Common Test configuration functions.
(N, Config)
Mocking helpers for tests
Keys for P2P communication
pp_23YdvfRPQ1b1AMWmkKZUGk2cQLqygQp55FzDWZSEUicPjhxtp5
pp_2M9oPohzsWgJrBBCFeYi3PVT4YF7F2botBtq6J1EGcVkiutx3R
Keys for signing / verification
the list is generated
================================================... | -module(aecore_suite_utils).
-export([init_per_suite/2,
init_per_suite/3,
init_per_suite/4]).
-export([top_dir/1,
make_shortcut/1,
node_config/2,
create_config/4,
create_seed_file/5,
make_multi/2,
node_shortcut/2,
shortcut_dir/1,
... |
27ec14cda1577ebf65c117218b33817f359de5189c3877546484da3eed327fd3 | LoupVaillant/Monokex | proto_run.ml | open Utils
module P = Proto
TODO : maybe those two belong to Proto ?
let shares_key key p = List.mem key (P.shared_keys p)
let has_key key p = List.mem key (P.all_keys p)
let shares_client_key p = shares_key P.IS p
let shares_server_key p = shares_key P.RS p
let has_client_key p = has_key P.IS p
let has_ser... | null | https://raw.githubusercontent.com/LoupVaillant/Monokex/ea8a16156164644dab25f6e7aefd85b169a4e7ee/src/proto_run.ml | ocaml | Ephemeral
Static
ee exchange
es exchange
se exchange
ss exchange
payload
first hash (init)
client key (init)
server key (init)
prelude (init) | open Utils
module P = Proto
TODO : maybe those two belong to Proto ?
let shares_key key p = List.mem key (P.shared_keys p)
let has_key key p = List.mem key (P.all_keys p)
let shares_client_key p = shares_key P.IS p
let shares_server_key p = shares_key P.RS p
let has_client_key p = has_key P.IS p
let has_ser... |
9b4179c6a27fdd9783694fc2754674b60f021b4727b7d277912536583dd762ce | inaka/sumo_db | sumo_backend.erl | %%% @doc Behavior for sumo backends.
%%%
Copyright 2012 Inaka & lt;> ;
%%%
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
%%%
%%% -2.0
%%%
%%% Unless required by applicable l... | null | https://raw.githubusercontent.com/inaka/sumo_db/331ea718c13a01748a7739ad4078b0032f4d32e5/src/sumo_backend.erl | erlang | @doc Behavior for sumo backends.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for t... | Copyright 2012 Inaka & lt;> ;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
< >
-module(sumo_backend).
-author("Marcelo Gornstein <>").
-github("").
-license("Apache License 2.0").
-callback start_link(atom(), [t... |
cb5bac7924b906ce0805176fcac56d1e58f64abfdb3376a7433966d124edf8f1 | NoRedInk/haskell-libraries | Http.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
| Making HTTP requests using an API inspired by Elm 's elm / http .
module Http
( -- * Handlers
Handler,
handler,
-- * Requests
get,
post,
request,
Internal.Request' (..),
Internal.Request,
Internal.Error (..),
-- * Header... | null | https://raw.githubusercontent.com/NoRedInk/haskell-libraries/3bce799cc2b441c79bbd3a4de7377c3651eced2d/nri-http/src/Http.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
* Handlers
* Requests
* Header
* Body
* Expect
* Elaborate Expectations
* Use with external libraries
| Create a 'Handler' for making HTTP requests.
| Third party libraries that make HTTP requests often take a 'HTTP.Manager'.
This helper allows us to call such a libr... |
| Making HTTP requests using an API inspired by Elm 's elm / http .
module Http
Handler,
handler,
get,
post,
request,
Internal.Request' (..),
Internal.Request,
Internal.Error (..),
Internal.Header,
header,
Internal.Body,
emptyBody,
stringBody,
jsonBody,
... |
d37078228f80dde9993b821419047f8938ba091db897a36d3b5252ced6cf9a77 | MinaProtocol/mina | composition_types.mli | open Pickles_types
module Opt = Plonk_types.Opt
type ('a, 'b) opt := ('a, 'b) Opt.t
type ('var, 'value, 'field, 'checked) snarky_typ :=
('var, 'value, 'field, 'checked) Snarky_backendless.Types.Typ.t
* { 2 Module aliases }
module Digest = Digest
module Spec = Spec
module Branch_data = Branch_data
module Bulletpro... | null | https://raw.githubusercontent.com/MinaProtocol/mina/a4e030878c166014f8731c356b48ce362abd6f90/src/lib/pickles/composition_types/composition_types.mli | ocaml | * This module contains structures which contain the scalar-field elements
that are required to finalize the verification of a proof that is
partially verified inside a circuit.
Each verifier circuit starts by verifying the parts of a proof involving
group operations. At the end, there is a seq... | open Pickles_types
module Opt = Plonk_types.Opt
type ('a, 'b) opt := ('a, 'b) Opt.t
type ('var, 'value, 'field, 'checked) snarky_typ :=
('var, 'value, 'field, 'checked) Snarky_backendless.Types.Typ.t
* { 2 Module aliases }
module Digest = Digest
module Spec = Spec
module Branch_data = Branch_data
module Bulletpro... |
ba4073c2f1077beee1352a71680cae3b808d3daac90dca524cc001b808d78df9 | haskell/wreq | Lens.hs | # LANGUAGE RankNTypes , TemplateHaskell #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Network.Wreq.Internal.Lens
(
HTTP.Request
, method
, secure
, host
, port
, path
, queryString
, requestHeaders
, requestBody
, requestVersion
, requestManagerOverride
... | null | https://raw.githubusercontent.com/haskell/wreq/2da0070625a680d5af59e36c3ca253ef6a80aea9/Network/Wreq/Internal/Lens.hs | haskell | * Useful functions
This is only a lens up to the ordering of the list (which changes
when we modify the list).
| Set a header to the given value, replacing any prior value.
| Set a header to the given value, but only if the header was not
already set. | # LANGUAGE RankNTypes , TemplateHaskell #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Network.Wreq.Internal.Lens
(
HTTP.Request
, method
, secure
, host
, port
, path
, queryString
, requestHeaders
, requestBody
, requestVersion
, requestManagerOverride
... |
8cd6d123efae61cca4210156fca79b8b8c9b0e3cb173b3138b0b8125e55c5d0b | jtza8/interact | bitmap-font-sprite.lisp | ; Use of this source code is governed by a BSD-style
license that can be found in the license.txt file
; in the root directory of this project.
(in-package :interact)
(defclass bitmap-font-sprite (sprite)
((glyph-width :initform (error "must specify glyph-width")
:initarg :glyph-width
... | null | https://raw.githubusercontent.com/jtza8/interact/ea2121d7e900dac4fe2a085bd5f2783a640e71f8/src/bitmap-font-sprite.lisp | lisp | Use of this source code is governed by a BSD-style
in the root directory of this project. | license that can be found in the license.txt file
(in-package :interact)
(defclass bitmap-font-sprite (sprite)
((glyph-width :initform (error "must specify glyph-width")
:initarg :glyph-width
:reader glyph-width)
(glyph-height :initform (error "must specify glyph-height")
... |
715a69f2a3406320e2667f5ba0349f82429fe309d5b64a8d405e2626de4a7c33 | manuel-serrano/bigloo | process.scm | ;*---------------------------------------------------------------------*/
* serrano / prgm / project / bigloo / recette / process.scm * /
;* */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/recette/process.scm | scheme | *---------------------------------------------------------------------*/
* */
* */
* Process tests */
*---------------------------... | * serrano / prgm / project / bigloo / recette / process.scm * /
* Author : * /
* Creation : Sat Nov 28 10:52:56 1992 * /
* Last change : Fri Jan 1 07:49:22 2016 ( serrano ) * /
(module pr... |
75144ae5a2b13a869cfc55383684ceffe58b03d4f42ff4f7b9f2356b7058cda6 | SHoltzen/dice | Passes.mli | (** Passes over the external and internal grammar.
* Implementations of syntactic sugar, optimizations, etc. *)
type config = { max_list_length: int }
val default_config : config
val expand_recursion : ?recursion_limit:int -> ExternalGrammar.program -> ExternalGrammar.program
(** Inline all function calls *)
val ... | null | https://raw.githubusercontent.com/SHoltzen/dice/794185ea5451c785eb0535d48f796d2ee0e83f1f/lib/Passes.mli | ocaml | * Passes over the external and internal grammar.
* Implementations of syntactic sugar, optimizations, etc.
* Inline all function calls
* Compute the number of paths through the probabilistic program.
* Note: assumes that function calls are inlined, no iteration |
type config = { max_list_length: int }
val default_config : config
val expand_recursion : ?recursion_limit:int -> ExternalGrammar.program -> ExternalGrammar.program
val inline_functions : ExternalGrammar.program -> ExternalGrammar.program
val num_paths : ExternalGrammar.program -> LogProbability.t
val from_extern... |
1d542f3ba3f1f37d5781b9f3d57cdc45d3b75e8525c2ee72bfb455ec32546faf | binsec/haunted | bigint.mli | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/base/bigint.mli | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
c078e83571b457fbcef7d826c0cdeaf6ae4ac3d21125476a1d0f48af71cc4922 | serokell/blockchain-util | BaseM.hs | # LANGUAGE DeriveFunctor #
{-# LANGUAGE Rank2Types #-}
module Snowdrop.Core.BaseM
(
BaseMConstraint
, BaseM (..)
, Effectful (..)
, CtxConcurrently (..)
, concurrently
, raceMany
) where
import Universum hiding (log)
import Data.Default... | null | https://raw.githubusercontent.com/serokell/blockchain-util/a6428c6841e7002605a115002f58eff78ff9f128/snowdrop-core/src/Snowdrop/Core/BaseM.hs | haskell | # LANGUAGE Rank2Types #
| TODO: make an effective implementation
A natural transformation from effect data type to monad.
| Base execution monad.
Having, say, `instance Effectful Maybe IO`,
while `B2 (pure () :: IO ())` would be perfectly valid. | # LANGUAGE DeriveFunctor #
module Snowdrop.Core.BaseM
(
BaseMConstraint
, BaseM (..)
, Effectful (..)
, CtxConcurrently (..)
, concurrently
, raceMany
) where
import Universum hiding (log)
import Data.Default (Default (def))
import ... |
5f03b1e75e5c844a5e19bce5b263090dc89eecbc83b5b149a2c0215f0ef39be4 | babashka/sci | bench.cljc | (ns sci.impl.bench
(:require [sci.impl.macros :as macros])
#?(:cljs (:require-macros [sci.impl.bench :refer [record]])))
(def times (atom {}))
(defn reset-times []
(reset! times {}))
(defn print-times []
(doseq [[k v] @times]
(println k v)))
(macros/deftime
(defmacro record [k & body]
`(let [start... | null | https://raw.githubusercontent.com/babashka/sci/6bfb8a6e5928c5953ea8c8fe49acb4e4dc27b137/src/sci/impl/bench.cljc | clojure | (ns sci.impl.bench
(:require [sci.impl.macros :as macros])
#?(:cljs (:require-macros [sci.impl.bench :refer [record]])))
(def times (atom {}))
(defn reset-times []
(reset! times {}))
(defn print-times []
(doseq [[k v] @times]
(println k v)))
(macros/deftime
(defmacro record [k & body]
`(let [start... | |
e3dac4a94d586d5e0f4fa6a789485f193e234cd04e68172de59512785d5a0f0d | NorfairKing/smos | GetUserPermissions.hs | module Smos.Server.Handler.GetUserPermissions
( serveGetUserPermissions,
)
where
import Smos.Server.Handler.Import
serveGetUserPermissions :: AuthNCookie -> ServerHandler UserPermissions
serveGetUserPermissions ac = do
mAdmin <- asks serverEnvAdmin
pure
UserPermissions
{ userPermissionsIsAdmin = mAd... | null | https://raw.githubusercontent.com/NorfairKing/smos/91efacaede3574e2f8f9d9601bf0383897eebfd8/smos-server/src/Smos/Server/Handler/GetUserPermissions.hs | haskell | module Smos.Server.Handler.GetUserPermissions
( serveGetUserPermissions,
)
where
import Smos.Server.Handler.Import
serveGetUserPermissions :: AuthNCookie -> ServerHandler UserPermissions
serveGetUserPermissions ac = do
mAdmin <- asks serverEnvAdmin
pure
UserPermissions
{ userPermissionsIsAdmin = mAd... | |
068453a4da7f4a711fdf10c73792548d709752931701e5aa01d5eea13e7dc1ed | PrincetonUniversity/lucid | Printing.ml | open Batteries
open Syntax
open SyntaxUtils
let cfg = Cmdline.cfg
let concat_map sep f lst = lst |> List.map f |> String.concat sep
let list_to_string f lst = Printf.sprintf "[%s]" (concat_map "; " f lst)
let comma_sep f xs = concat_map "," f xs
let integer_to_string n =
if cfg.verbose_types then Integer.to_string ... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/8ca93fd803caaa80cf2e301154791564dd3fed7e/src/lib/frontend/Printing.ml | ocaml | Possibly look into forall operators later
Binary operators
^ Printf.sprintf "[ty:%s]"
@@ Option.map_default ty_to_string "" e.ety | open Batteries
open Syntax
open SyntaxUtils
let cfg = Cmdline.cfg
let concat_map sep f lst = lst |> List.map f |> String.concat sep
let list_to_string f lst = Printf.sprintf "[%s]" (concat_map "; " f lst)
let comma_sep f xs = concat_map "," f xs
let integer_to_string n =
if cfg.verbose_types then Integer.to_string ... |
3b5d4b26c3dba986929808dbf97db421ae8b68faf2901e98fb893f5483e3867a | JHU-PL-Lab/jaylang | solver.ml | open Core
open Dj_common.Log.Export
let ctx = Z3.mk_context []
module SuduZ3 = Sudu.Z3_api.Make (struct
let ctx = ctx
end)
type value = Sudu.Z3_api.plain =
| Int of int [@printer Fmt.int]
| Bool of bool [@printer Fmt.bool]
| Fun of string [@printer Fmt.string]
| Record of string [@printer Fmt.string]
[@@de... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/src/dbmc/solver.ml | ocaml | open Core
open Dj_common.Log.Export
let ctx = Z3.mk_context []
module SuduZ3 = Sudu.Z3_api.Make (struct
let ctx = ctx
end)
type value = Sudu.Z3_api.plain =
| Int of int [@printer Fmt.int]
| Bool of bool [@printer Fmt.bool]
| Fun of string [@printer Fmt.string]
| Record of string [@printer Fmt.string]
[@@de... | |
97d6aae3c642efca078751dce8cf2ead4edebf1642ee356613a595a69e15eb90 | marick/fp-oo | ts_scheduling.clj | (ns solutions.ts-scheduling
(:use midje.sweet)
(:import java.util.Date))
(load-file "solutions/pieces/scheduling-1.clj")
(fact "note-unavailability"
(fact "with available instructors"
(note-unavailability [{:full? true, :empty? false}
{:full? false, :empty? true}
... | null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/test/solutions/ts_scheduling.clj | clojure | As above | (ns solutions.ts-scheduling
(:use midje.sweet)
(:import java.util.Date))
(load-file "solutions/pieces/scheduling-1.clj")
(fact "note-unavailability"
(fact "with available instructors"
(note-unavailability [{:full? true, :empty? false}
{:full? false, :empty? true}
... |
1db9295a13e8b141c149d11b552b0c39cb5dc085b66210473a399424ed2f65b0 | jellelicht/guix | datastructures.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 , 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU 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 t... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/datastructures.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 , 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages datastructures)
#:use-module (gnu packages)
#:use-module ((guix licenses) ... |
3332bc2ac2dfa2a9fa4208af81f14b14bef7c30b79ce935578741de7c9df27fe | google/proto-lens | protoc-gen-haskell.hs | -- Copyright 2016 Google Inc. All Rights Reserved.
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file or at
-- -source/licenses/bsd
# LANGUAGE CPP #
# LANGUAGE OverloadedLabels #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
module Main where
im... | null | https://raw.githubusercontent.com/google/proto-lens/95d14dc6c3ce5ff9fe30f87245bbe3879a05c9a9/proto-lens-protoc/app/protoc-gen-haskell.hs | haskell | Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
-source/licenses/bsd
# LANGUAGE OverloadedStrings #
so that we can run the test suite against the Generated API.
TODO: switch back to Data.ProtoLens.Encoding once... |
# LANGUAGE CPP #
# LANGUAGE OverloadedLabels #
# LANGUAGE PatternSynonyms #
module Main where
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString as B
import Data.Map.Strict ((!))
#if !MIN_VERSION_base(4,11,0)
import Data.Semigroup ((<>))
#endif
import qualified Data.Set as Set
import qualified Da... |
a1d4785691c95f0567a8f6f76f4fba8ece75d478e9f0a3bcebc700236f744c7c | shayan-najd/NativeMetaprogramming | T10908.hs | # OPTIONS_GHC -fwarn - missing - exported - signatures #
module Bug (Data.List.intercalate, x) where
import qualified Data.List
intercalate = True
x :: Bool
x = intercalate
| null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/warnings/should_compile/T10908.hs | haskell | # OPTIONS_GHC -fwarn - missing - exported - signatures #
module Bug (Data.List.intercalate, x) where
import qualified Data.List
intercalate = True
x :: Bool
x = intercalate
| |
cc52b3154b2be8ecb810e69d4c0e06af67c416d67fb9832ca7851a712cfd5e94 | ocaml/dune | only_packages.ml | open Import
open Memo.O
module Clflags = struct
type t =
| No_restriction
| Restrict of
{ names : Package.Name.Set.t
; command_line_option : string
}
let to_dyn = function
| No_restriction -> Dyn.Variant ("No_restriction", [])
| Restrict { names; command_line_option } ->
... | null | https://raw.githubusercontent.com/ocaml/dune/b62e8a1b65466e83bfe0ee8631565e07d4a6bf99/src/dune_rules/only_packages.ml | ocaml | open Import
open Memo.O
module Clflags = struct
type t =
| No_restriction
| Restrict of
{ names : Package.Name.Set.t
; command_line_option : string
}
let to_dyn = function
| No_restriction -> Dyn.Variant ("No_restriction", [])
| Restrict { names; command_line_option } ->
... | |
6b65137b12329b13c767ddb03f3c97ca7ac06c15f0addb3eb9d95cb07bc3b46f | EwenG/replique | classpath_jdk9+.clj | (ns replique.classpath-jdk9+
(:import [java.lang.module ModuleFinder ModuleReference]))
;; workaround for -2284
(defmacro interface-static-call
[sym argtypes]
`(let [m# (.getMethod ~(symbol (namespace sym))
~(name sym)
(into-array Class ~argtypes))]
(fn [& arg... | null | https://raw.githubusercontent.com/EwenG/replique/45719ec95f463107f4c4ca79b7f83a7882b450cb/src/replique/classpath_jdk9%2B.clj | clojure | workaround for -2284 | (ns replique.classpath-jdk9+
(:import [java.lang.module ModuleFinder ModuleReference]))
(defmacro interface-static-call
[sym argtypes]
`(let [m# (.getMethod ~(symbol (namespace sym))
~(name sym)
(into-array Class ~argtypes))]
(fn [& args#]
(.invoke m# n... |
a803a9ba34de9db011ac4f08a843fd6e85f620d605276ffbcc2b93f2a7893454 | helium/blockchain-core | blockchain_keys_SUITE.erl | -module(blockchain_keys_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export([
keys_test/1
]).
%%--------------------------------------------------------------------
%% COMMON TEST CALLBACK FUNCTIONS
%%---... | null | https://raw.githubusercontent.com/helium/blockchain-core/2e5a2d1f7d7baa79500b09c70c2a9af9b9577eab/test/blockchain_keys_SUITE.erl | erlang | --------------------------------------------------------------------
COMMON TEST CALLBACK FUNCTIONS
--------------------------------------------------------------------
--------------------------------------------------------------------
@doc
Running tests for this suite
@end
-------------------------------------... | -module(blockchain_keys_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export([
keys_test/1
]).
@public
all() ->
[
keys_test
].
init_per_testcase(TestCase, Config) ->
blockchain_ct_u... |
1d5719b97a92abcacc251e71d507c5f425b9d49b652539587134896a3d748a00 | ghcjs/ghcjs | mc03.hs | -- "Big tuple" stress test for monad comprehensions
{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp -XParallelListComp -O0 #-}
module Main where
main = putStrLn (show output)
where
output = [ x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
x10 + x11 + x12 + x13 + x14 + x15 + x16 + x1... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/deSugar/mc03.hs | haskell | "Big tuple" stress test for monad comprehensions
# OPTIONS_GHC -XMonadComprehensions -XTransformListComp -XParallelListComp -O0 # |
module Main where
main = putStrLn (show output)
where
output = [ x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 +
x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 +
x30 + x31 + x32 + x33 + x34 + x... |
42bea9736070de402fcaebdf9c4eb4e0be5493ee8f51c7890232bf5cf44d4fcd | haskell-compat/base-compat | Batteries.hs | {-# LANGUAGE PackageImports #-}
# OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
-- | Reexports "Data.Proxy.Compat"
-- from a globally unique namespace.
module Data.Proxy.Compat.Repl.Batteries (
module Data.Proxy.Compat
) where
import "this" Data.Proxy.Compat
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat-batteries/src/Data/Proxy/Compat/Repl/Batteries.hs | haskell | # LANGUAGE PackageImports #
| Reexports "Data.Proxy.Compat"
from a globally unique namespace. | # OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
module Data.Proxy.Compat.Repl.Batteries (
module Data.Proxy.Compat
) where
import "this" Data.Proxy.Compat
|
78f0aaadcff9a8e1cbc1546f928c3fd020c9fb338495ea1f409e4812762278d8 | besport/calendar | date_sig.mli | (**************************************************************************)
(* *)
(* This file is part of Calendar. *)
(* *)
Copyright... | null | https://raw.githubusercontent.com/besport/calendar/f30f515614ee810b2e063f56f5e50f41ecaeae96/src/date_sig.mli | ocaml | ************************************************************************
This file is part of Calendar.
... | Copyright ( C ) 2003 - 2011
Lesser General Public License version 2.1 as published by the
Free Software Foundation , with a special linking exception ( usual
See the GNU Lesser General Public Licence version 2.1 for more
* Date interface . A date may be seen as a triple ( year , mo... |
a2348f73739f52caa2a8fb1e4263564bcd9132c81b569378b146770f5247b67e | racket/rhombus-prototype | write.rkt | #lang racket/base
(require racket/keyword
racket/symbol)
;; Writing a shubbery represented as an S-expression
(provide write-shrubbery)
(define rx:identifier #px"^(?:\\p{L}|_)(?:\\p{L}|\\p{N}|_)*$")
(define (write-shrubbery v [op (current-output-port)])
(cond
[(and (pair? v) (eq? 'group (car v)))
... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/f21679842c56b0841b156dde6b389e0366f15532/shrubbery/write.rkt | racket | Writing a shubbery represented as an S-expression
printing a raw group | #lang racket/base
(require racket/keyword
racket/symbol)
(provide write-shrubbery)
(define rx:identifier #px"^(?:\\p{L}|_)(?:\\p{L}|\\p{N}|_)*$")
(define (write-shrubbery v [op (current-output-port)])
(cond
[(and (pair? v) (eq? 'group (car v)))
(display "«" op)
(write-shrubbery-term v op)
... |
0673202aae3110397919c1fbf7619c78919d7adf0255e8fafdd359db71538ef8 | zachjs/sv2v | Simplify.hs | # LANGUAGE PatternSynonyms #
sv2v
- Author : < >
-
- Elaboration of size casts , dimension query system functions , and ternary
- expressions where the condition references a localparam .
-
- Our conversions generate a lot of ternary expressions . This conversion
- attempts to make the code ou... | null | https://raw.githubusercontent.com/zachjs/sv2v/9de4d4430556f2aa5a3d2520138246bfa18472f1/src/Convert/Simplify.hs | haskell | # LANGUAGE PatternSynonyms #
sv2v
- Author : < >
-
- Elaboration of size casts , dimension query system functions , and ternary
- expressions where the condition references a localparam .
-
- Our conversions generate a lot of ternary expressions . This conversion
- attempts to make the code ou... | |
2f420b6c9211f59fdad06badd73dfc1247baf2ce60e52392908bb790680de6b9 | antoniogarrote/tokengame | actors.clj | (ns tokengame.examples.actors
(:use [tokengame.nodes]
[matchure]))
(defn ping
([]
(loop [continue true
msg (receive)]
(cond-match
[#"exit" msg] (recur false msg)
[#"exception" msg] (throw (Exception. "Ping actor received exception"))
[[?from ?data] msg] (do (... | null | https://raw.githubusercontent.com/antoniogarrote/tokengame/a0c04f1609eb3950b5a8e3630036c5005f3baece/src/tokengame/examples/actors.clj | clojure | (ns tokengame.examples.actors
(:use [tokengame.nodes]
[matchure]))
(defn ping
([]
(loop [continue true
msg (receive)]
(cond-match
[#"exit" msg] (recur false msg)
[#"exception" msg] (throw (Exception. "Ping actor received exception"))
[[?from ?data] msg] (do (... | |
5398b00cdb4553f3d720e000670536f35805ce63eb720ed7a1e97c21fbff8a3d | yzh44yzh/practical_erlang | test.erl | -module(test).
-export([run/0]).
run() ->
case template_test:test() of
ok -> init:stop(0);
error -> init:stop(1)
end.
| null | https://raw.githubusercontent.com/yzh44yzh/practical_erlang/c9eec8cf44e152bf50d9bc6d5cb87fee4764f609/07_binary_string/solution/test.erl | erlang | -module(test).
-export([run/0]).
run() ->
case template_test:test() of
ok -> init:stop(0);
error -> init:stop(1)
end.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.