_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 |
|---|---|---|---|---|---|---|---|---|
82108cab6ab9323104486f690651d7c059e0fb4e4c3060b9d8da04e5bf918f44 | pmundkur/flowcaml | flowperv.ml | (**************************************************************************)
(* *)
(* *)
, Projet C... | null | https://raw.githubusercontent.com/pmundkur/flowcaml/ddfa8a37e1cb60f42650bed8030036ac313e048a/src-flowcaml/runlib/flowperv.ml | ocaml | ************************************************************************
et en Automatique. All ri... |
, Projet Cristal , INRIA Rocquencourt
Copyright 2002 , 2003 Institut National de Recherche en Informatique
under the terms of the GNU Library General Public License , with the
$ I d : flowperv.ml , v 1.6 2003/06/27 ... |
934a64f45b8429118c29c9d2f892ab0fa385f328e0fd98376265276b01e5a66b | craigl64/clim-ccl | db-label.lisp | ;; -*- mode: common-lisp; package: silica -*-
;;
;;
;; See the file LICENSE for the full license governing this code.
;;
(in-package :silica)
(defclass generic-label-pane
(label-pane
space-requirement-mixin
leaf-pane)
()
(:default-initargs :align-x :left
:text-style *default-label-text-style*)... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/homegrown/db-label.lisp | lisp | -*- mode: common-lisp; package: silica -*-
See the file LICENSE for the full license governing this code.
not worth checking |
(in-package :silica)
(defclass generic-label-pane
(label-pane
space-requirement-mixin
leaf-pane)
()
(:default-initargs :align-x :left
:text-style *default-label-text-style*))
(defmethod compose-space ((pane generic-label-pane) &key width height)
(declare (ignore width height))
(multiple-v... |
7098838641ef4e652838ca0a1460dd842474f4bdb00ba4f44c0d5733bf23c261 | r0man/sablono | data_readers.clj | Use # j to read JSValue , om.next redefined # js to read Clojure maps :/
{j cljs.tagged-literals/read-js}
| null | https://raw.githubusercontent.com/r0man/sablono/3221c5bacd1c81f1f79bc1ec86f3d2652b1a12d2/test-resources/data_readers.clj | clojure | Use # j to read JSValue , om.next redefined # js to read Clojure maps :/
{j cljs.tagged-literals/read-js}
| |
b941e0f94be18d5964706b3285933491d93d9315ea09f975533c0e7eeaa47171 | corecursive/sicp-study-group | install.scm | (load "table.scm")
(load "type.scm")
;; installing polynomials
(define (install-polynomial-package)
(load "polynomial-package/representation.scm")
(load "polynomial-package/operation.scm")
(define (make-polynomial p)
(attach-type 'polynomial p))
(define (+polynomial p1 p2)
(make-polynomial (+poly p1... | null | https://raw.githubusercontent.com/corecursive/sicp-study-group/82b92a9759ed6c72d15cf955c806ce2a94336f83/wulab/lecture-4b/generic-operation/polynomial-package/install.scm | scheme | installing polynomials | (load "table.scm")
(load "type.scm")
(define (install-polynomial-package)
(load "polynomial-package/representation.scm")
(load "polynomial-package/operation.scm")
(define (make-polynomial p)
(attach-type 'polynomial p))
(define (+polynomial p1 p2)
(make-polynomial (+poly p1 p2)))
(define (*polyno... |
65ee1a7882a6bdc50a32d227ae6ed39a454b6950aecb2c5a8ad973cfacd5f38f | ZeusWPI/contests | ptaal.hs | import Control.Applicative ((<$>))
import Control.Monad (replicateM_)
import Data.Char (toLower)
isVowel :: String -> Bool
isVowel st = (fmap toLower st) `elem` ["a","e","i","o","u","ij"]
decode :: String -> String
decode str = decode' str 0
decode' (x:y:xs) i
| isVowel [x,y] = x : y : decode' xs (i+2)
| is... | null | https://raw.githubusercontent.com/ZeusWPI/contests/d78aec91be3ce32a436d160cd7a13825d36bbf3a/2010-vpw/ptaal.hs | haskell | import Control.Applicative ((<$>))
import Control.Monad (replicateM_)
import Data.Char (toLower)
isVowel :: String -> Bool
isVowel st = (fmap toLower st) `elem` ["a","e","i","o","u","ij"]
decode :: String -> String
decode str = decode' str 0
decode' (x:y:xs) i
| isVowel [x,y] = x : y : decode' xs (i+2)
| is... | |
f1516a0ff080cc916dc8a2d578d8d8274f0f8510e16264e958f79ed3d5258433 | uwplse/ferrite | append-chrome.rkt | #lang s-exp rosette
(require "../fs.rkt" "../lang.rkt" "../litmus.rkt" "../verifier.rkt" "../synth.rkt"
"../advfs.rkt" "../seqfs.rkt" "../ext4.rkt"
rackunit rackunit/text-ui)
(provide chrome-tests)
(current-bitwidth 16)
(define small? #f)
(define writes (if small? '(33 2 31) '(2509 13 2500)))
(de... | null | https://raw.githubusercontent.com/uwplse/ferrite/923736167fb00aec979f244787a8c33e48e1c551/rosette/litmus/append-chrome.rkt | racket | fd 0
no fences will fix this program
program is already correct with nodelalloc; no fences needed | #lang s-exp rosette
(require "../fs.rkt" "../lang.rkt" "../litmus.rkt" "../verifier.rkt" "../synth.rkt"
"../advfs.rkt" "../seqfs.rkt" "../ext4.rkt"
rackunit rackunit/text-ui)
(provide chrome-tests)
(current-bitwidth 16)
(define small? #f)
(define writes (if small? '(33 2 31) '(2509 13 2500)))
(de... |
14e66664ec67da3fad00d8fe2fa19c5fe64b0821c6b4cffe17033f44a3597f8c | fossas/fossa-cli | ListSpec.hs | module Extra.ListSpec (spec) where
import Data.List.Extra (singleton, (!?))
import Test.Hspec (Spec, describe, it, shouldBe)
spec :: Spec
spec = do
describe "singleton" $ do
it "should create a one-item list" $
singleton (3 :: Int) `shouldBe` [3]
describe "(!?)" $ do
it "should return the zero-inde... | null | https://raw.githubusercontent.com/fossas/fossa-cli/b2e0f7e08ad555c933ad750359348d54966e7e72/test/Extra/ListSpec.hs | haskell | index == length
index > length | module Extra.ListSpec (spec) where
import Data.List.Extra (singleton, (!?))
import Test.Hspec (Spec, describe, it, shouldBe)
spec :: Spec
spec = do
describe "singleton" $ do
it "should create a one-item list" $
singleton (3 :: Int) `shouldBe` [3]
describe "(!?)" $ do
it "should return the zero-inde... |
f4208d2ebabe5f476b9e9229c870f7faabb44ff4e9c6774296754e7b02b5d9f0 | biocaml/biocaml | bin_pred.ml | module Bin_pred = Biocaml_unix.Bin_pred
open OUnit
* This is a test against the R library ROCR . The reference result
* ( 0.8341875 ) is obtained as follows :
*
* data(ROCR.simple )
* performance(prediction ( ROCR.simple$predictions , ROCR.simple$labels ) , " auc " )
*
* This is a test against th... | null | https://raw.githubusercontent.com/biocaml/biocaml/ac619539fed348747d686b8f628e80c1bb8bfc59/lib/test/bin_pred.ml | ocaml | module Bin_pred = Biocaml_unix.Bin_pred
open OUnit
* This is a test against the R library ROCR . The reference result
* ( 0.8341875 ) is obtained as follows :
*
* data(ROCR.simple )
* performance(prediction ( ROCR.simple$predictions , ROCR.simple$labels ) , " auc " )
*
* This is a test against th... | |
e08d44b3642eaf22ddc83f3deda7616f4d58b17438259436bb2ddc77a1d9b99d | sangkilc/ofuzz | ballmutgen.ml | (* ofuzz - ocaml fuzzing platform *)
* ball - based mutational generator
@author < sangkil.cha\@gmail.com >
@since 2014 - 03 - 19
@author Sang Kil Cha <sangkil.cha\@gmail.com>
@since 2014-03-19
*)
Copyright ( c ) 2014 ,
All rights reserved .
Redistribution and use in source... | null | https://raw.githubusercontent.com/sangkilc/ofuzz/ba53cc90cc06512eb90459a7159772d75ebe954f/src/testgen/ballmutgen.ml | ocaml | ofuzz - ocaml fuzzing platform |
* ball - based mutational generator
@author < sangkil.cha\@gmail.com >
@since 2014 - 03 - 19
@author Sang Kil Cha <sangkil.cha\@gmail.com>
@since 2014-03-19
*)
Copyright ( c ) 2014 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
... |
b22f36f2af6e46f237dd058470610009da6f0e1aee857007e57d613fc0bbcdc5 | ocaml/ocaml | odoc_module.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml/ocaml/8a61778d2716304203974d20ead1b2736c1694a8/ocamldoc/odoc_module.mli | ocaml | ************************************************************************
OCaml
... | , projet Cambium , INRIA Paris
Copyright 2022 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
module String = Misc.Stdlib.String
module Name = Odoc_name
type module_element =
Element_module of t_mo... |
d67ae694470282c7feb8161af7f357d3c51f7e9e03b15ec2204a118e17e4f39d | pedestal/samples | service_test.clj | (ns jboss.service-test
(:require [clojure.test :refer :all]
[io.pedestal.service.test :refer :all]
[io.pedestal.service.http :as bootstrap]
[jboss.service :as service]))
(def service
(::bootstrap/service-fn (bootstrap/create-servlet service/service)))
(deftest home-page-test
... | null | https://raw.githubusercontent.com/pedestal/samples/caaf04afe255586f8f4e1235deeb0c1904179355/jboss/test/jboss/service_test.clj | clojure | (ns jboss.service-test
(:require [clojure.test :refer :all]
[io.pedestal.service.test :refer :all]
[io.pedestal.service.http :as bootstrap]
[jboss.service :as service]))
(def service
(::bootstrap/service-fn (bootstrap/create-servlet service/service)))
(deftest home-page-test
... | |
9967aa3721abfd9e484511cb7442b33ab834bb2cee6799944222bcc2d93b313f | msgpack/msgpack-haskell | devel.hs | {-# LANGUAGE PackageImports #-}
import "mpidl-web" Application (getApplicationDev)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, settingsPort)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Concurrent (threadDel... | null | https://raw.githubusercontent.com/msgpack/msgpack-haskell/f52a5d2db620a7be70810eca648fd152141f8b14/msgpack-idl-web/src/devel.hs | haskell | # LANGUAGE PackageImports # | import "mpidl-web" Application (getApplicationDev)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, settingsPort)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Concurrent (threadDelay)
main :: IO ()
main = do
... |
b22381264087bab6db0e10f1f8997396613393e1be6ded9c5b2c2617483c7da8 | kowainik/hakyll-shortcut-links | ShortcutLinks.hs | # LANGUAGE FlexibleContexts #
|
Copyright : ( c ) 2019 - 2021 Kowainik
License : MPL-2.0
Maintainer : < >
This package allows to use [ shortcut - links]( / package / shortcut - links )
package in websites generated by [ hakyll]( / package / hakyll ) .
The flexible interface allows to use the su... | null | https://raw.githubusercontent.com/kowainik/hakyll-shortcut-links/5fcd2efad7c8d239039ba52f5e4f6a335f896b68/src/Hakyll/ShortcutLinks.hs | haskell | --------------------------------------+----------------------------------------------------+
--------------------------------------+----------------------------------------------------+
--------------------------------------+----------------------------------------------------+
-------------------------------------+... | # LANGUAGE FlexibleContexts #
|
Copyright : ( c ) 2019 - 2021 Kowainik
License : MPL-2.0
Maintainer : < >
This package allows to use [ shortcut - links]( / package / shortcut - links )
package in websites generated by [ hakyll]( / package / hakyll ) .
The flexible interface allows to use the su... |
7abb8dd7d9666c91ad25a8bfc6ea5bbf7919ef5d034dd0d4212ae78bf4981da7 | venantius/yagni | graph.clj | (ns yagni.graph
"Functions for dealing with graphs."
(:require [clojure.set :as set]))
(defn- dfs
"Using a depth-first search algorithm, explore the graph from the given
starting node. Return what remains of the graph (should only include
nodes that aren't findable from the starting node.)"
[g n v]
(sw... | null | https://raw.githubusercontent.com/venantius/yagni/54aa78d06279c3258c6bd932e75c9a2d91bb2fc6/src/yagni/graph.clj | clojure | (ns yagni.graph
"Functions for dealing with graphs."
(:require [clojure.set :as set]))
(defn- dfs
"Using a depth-first search algorithm, explore the graph from the given
starting node. Return what remains of the graph (should only include
nodes that aren't findable from the starting node.)"
[g n v]
(sw... | |
368e21b6df4e3f95f834aca7ca9081a0ec4f40f33b16dc2738f4354b9984e9b7 | bhaskara/programmable-reinforcement-learning | create-sets.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; data-struct/set/create-sets.lisp
;; Ways of creating new sets
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package set)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; composing a function
;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/data-struct/set/create-sets.lisp | lisp |
data-struct/set/create-sets.lisp
Ways of creating new sets
composing a function
recursive closure
powerset of a set
|
(in-package set)
(defclass <image-set> (<numbered-set>)
((f :initarg :f
:reader f
:type function)
(f-inv :initarg :f-inv
:reader f-inv
:initform nil
:type function)
(s :initarg :s
:reader s
:type [set])))
(defun make-image-set (s f &optional (f-inv nil))
"... |
cf1ddd81711627f0fbcf4eef43a86493601d4e8c5c40600caad8669042e8ba1f | dcastro/haskell-flatbuffers | Examples.hs | module Examples
( module Examples.Generated
) where
import Examples.Generated
| null | https://raw.githubusercontent.com/dcastro/haskell-flatbuffers/cea6a75109de109ae906741ee73cbb0f356a8e0d/test/Examples.hs | haskell | module Examples
( module Examples.Generated
) where
import Examples.Generated
| |
c20f289d5fcacba0ad76e3db52b09856b63951b5bac4d8362843bb52c38f7ffd | ucsd-progsys/nate | m1.ml | let m1_val = 1 | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/easyocaml-additional/easyocaml-sample-lib/lang-levels/lang-foo/m1.ml | ocaml | let m1_val = 1 | |
f1252969772bc6f01e30f27c2416717007586ba186a0f61a5f56cd280e62e543 | reanimate/reanimate | vis.hs | #!/usr/bin/env stack
-- stack runghc --package reanimate
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Codec.Picture.Types
import Control.Lens ()
import Control.Monad
import Data.Function
import Data.List
import Data.List.NonEmp... | null | https://raw.githubusercontent.com/reanimate/reanimate/5ea023980ff7f488934d40593cc5069f5fd038b0/videos/morph/vis.hs | haskell | stack runghc --package reanimate
# LANGUAGE OverloadedStrings #
# mapA (translate (-3) 0) | #!/usr/bin/env stack
module Main where
import Codec.Picture.Types
import Control.Lens ()
import Control.Monad
import Data.Function
import Data.List
import Data.List.NonEmpty (NonEmpty)
import qualified Data.List.NonEmpty ... |
1cfe13d96c4ad7beae8861c83b5587b3cdf3e26737b69639943ddc4ddb1e0408 | Apress/haskell-quick-syntax-reference | ch2.hs | plus = \ a -> (\ b -> a + b)
plus :: Int -> Int -> Int
factorial = \ n -> if n==1 then 1 else n*factorial(n-1)
factorial :: Int -> Int
plus = \ a b -> a + b
plus :: int -> int -> int
plus a b = a + b
comp m n = (\ a -> m(n a))
comp :: (b -> c) -> (d -> e) -> d -> e
ff = (\ a -> a*a) `comp` (\ a -> a+a)
ff :: Integ... | null | https://raw.githubusercontent.com/Apress/haskell-quick-syntax-reference/8bcb2773532de752d6297a91a3aaf49fd92ed03b/ch2.hs | haskell | This refers to a in the function's type signature
Illegal, because refers to b in type signature
Legal, because b is now a free variable | plus = \ a -> (\ b -> a + b)
plus :: Int -> Int -> Int
factorial = \ n -> if n==1 then 1 else n*factorial(n-1)
factorial :: Int -> Int
plus = \ a b -> a + b
plus :: int -> int -> int
plus a b = a + b
comp m n = (\ a -> m(n a))
comp :: (b -> c) -> (d -> e) -> d -> e
ff = (\ a -> a*a) `comp` (\ a -> a+a)
ff :: Integ... |
c88d8d0ea3e3e7504b16b8a79f80f4b5c13257fc4f9780839ded3c70acfc35f9 | stylewarning/deprecated-coalton-prototype | global-environment.lisp | global-environment.lisp
(in-package #:coalton-impl)
Global Value Bindings ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
(defstruct entry
"An entry in the global value database."
(declared-type nil :type (or null ty))
(derived-type nil :type (or null ty))
source-form
node)
(define-global-var **global... | null | https://raw.githubusercontent.com/stylewarning/deprecated-coalton-prototype/4a42ffb4222fde3abfd1b50d96e455ff2eef9fe8/src/global-environment.lisp | lisp | ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
Global Type Definitions ;;;;;;;;;;;;;;;;;;;;;;; | global-environment.lisp
(in-package #:coalton-impl)
(defstruct entry
"An entry in the global value database."
(declared-type nil :type (or null ty))
(derived-type nil :type (or null ty))
source-form
node)
(define-global-var **global-value-definitions**
(make-hash-table :test 'eql)
"Database of Coalt... |
46275f913f12b648d0dcce8429a55bab7b541bcfcdbbc6e0bc7dabf0edfe00b4 | ryanpbrewster/haskell | polynomial.hs | {-# LANGUAGE GADTs #-}
import Data.List (intercalate)
import qualified Data.IntMap as M
import Debug.Trace
data Polynomial where
Polynomial :: M.IntMap Int -> Polynomial
instance Show Polynomial where
show (Polynomial coeffMap)
| M.null coeffMap = "0"
| otherwise = intercalate " + " (map showCoeffPa... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/hello-world/polynomial.hs | haskell | # LANGUAGE GADTs # | import Data.List (intercalate)
import qualified Data.IntMap as M
import Debug.Trace
data Polynomial where
Polynomial :: M.IntMap Int -> Polynomial
instance Show Polynomial where
show (Polynomial coeffMap)
| M.null coeffMap = "0"
| otherwise = intercalate " + " (map showCoeffPair $ M.toList coeffMap)... |
0539bdbb07f115f86c7dd628a1a055880dd8ae8a339122df0e7d33fd3a742156 | orbitz/web_typed | exception.ml | name : exception.ml
* synopsis : exception monad
* author :
* last revision : Thu Nov 13 09:51:57 UTC 2008
* ocaml version : 3.11
*
* Copyright ( C ) 2006 - 2008 , , O. Kiselyov
*
* This library is free software ; you can redistribute it and/or
* modify i... | null | https://raw.githubusercontent.com/orbitz/web_typed/e224c1be6a2d4fd0013ff9cdb27075c145a4b77e/libs/pa_monad/exception.ml | ocaml | * The values [('left, 'right) t] of generated from this module
represent (mutually exclusive) alternatives. Following the
Haskell folklore we put the correct or "right" result of a
computation into [Right] components and incorrect, or
exceptional values into [Left] components.
* [either f g x]
... | name : exception.ml
* synopsis : exception monad
* author :
* last revision : Thu Nov 13 09:51:57 UTC 2008
* ocaml version : 3.11
*
* Copyright ( C ) 2006 - 2008 , , O. Kiselyov
*
* This library is free software ; you can redistribute it and/or
* modify i... |
b82e993eb49f088c6a3a04c6ff4ad8bb4f89de1c13a6e89b1a7e733b2e686e7d | samrushing/irken-compiler | t_string_split.scm | ;; -*- Mode: Irken -*-
(include "lib/core.scm")
(include "lib/pair.scm")
(include "lib/string.scm")
(include "lib/format.scm")
(printn (string-split "quick brown fox" #\space))
(printn (string-split "%%vcon/list/cons" #\/))
(printn (string-split "thing" #\/))
(printn (string-split "" #\a))
(printn (string-split "..."... | null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_string_split.scm | scheme | -*- Mode: Irken -*- |
(include "lib/core.scm")
(include "lib/pair.scm")
(include "lib/string.scm")
(include "lib/format.scm")
(printn (string-split "quick brown fox" #\space))
(printn (string-split "%%vcon/list/cons" #\/))
(printn (string-split "thing" #\/))
(printn (string-split "" #\a))
(printn (string-split "..." #\.))
(printn (string-... |
99bc353da03c43204cc9950e8f131a4438a87d02bb9d90628dbfbc67390a1918 | vlstill/hsExprTest | Solution.hs | # LANGUAGE Unsafe #
module Solution where
{-# LINE 1 "Solution.hs" #-}
foo = id
| null | https://raw.githubusercontent.com/vlstill/hsExprTest/0c7754979cf837d48f5740674639e2decb96e547/examples/Solution.hs | haskell | # LINE 1 "Solution.hs" # | # LANGUAGE Unsafe #
module Solution where
foo = id
|
7e6aa63c880c5416210c2a1a6622233ef4e5f11ed62bf6b5071fcd2fae53b9c6 | BitGameEN/bitgamex | websocket_client.erl | @author
@doc Erlang websocket client
-module(websocket_client).
-export([start_link/3,
start_link/4,
cast/2,
send/2
]).
-export([ws_client_init/7]).
-type opt() :: {async_start, boolean()}
| {extra_headers, [{string() | binary(), string() | binary()}]}
... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/websocket_client/src/websocket_client.erl | erlang | @doc Start the websocket client
Send a frame asynchronously
@doc Create socket, execute handshake, and enter loop
Since we could have already received some data already, we simulate a Socket message.
@doc Send http upgrade request and validate handshake response challenge
@doc Blocks and waits until handshake res... | @author
@doc Erlang websocket client
-module(websocket_client).
-export([start_link/3,
start_link/4,
cast/2,
send/2
]).
-export([ws_client_init/7]).
-type opt() :: {async_start, boolean()}
| {extra_headers, [{string() | binary(), string() | binary()}]}
... |
69edd7a3157bc4f298973aec31ae59c0bf3212c06dd6ac620630daf592a7ad53 | gvolpe/shopping-cart-haskell | HasDigits.hs | # LANGUAGE DataKinds , DeriveGeneric , OverloadedStrings #
# LANGUAGE FlexibleInstances , KindSignatures , MultiParamTypeClasses #
{-# LANGUAGE ScopedTypeVariables, TypeApplications #-}
module Refined.HasDigits where
import Data.Typeable ( typeOf )
import GHC.Generics ... | null | https://raw.githubusercontent.com/gvolpe/shopping-cart-haskell/a9fbd4a7ce8b88fc5a19b2e22099c896cae0d1f6/src/Refined/HasDigits.hs | haskell | # LANGUAGE ScopedTypeVariables, TypeApplications # | # LANGUAGE DataKinds , DeriveGeneric , OverloadedStrings #
# LANGUAGE FlexibleInstances , KindSignatures , MultiParamTypeClasses #
module Refined.HasDigits where
import Data.Typeable ( typeOf )
import GHC.Generics ( Generic )
import GHC.TypeLits ... |
1acaadd6f0a510727215b9daf1d2049867a511a930253ecfc84857a14a52fe61 | WorksHub/client | events.cljs | (ns wh.promotions.create-promotion.events
(:require [cljs-time.core :as t]
[cljs-time.format :as tf]
[re-frame.core :refer [reg-event-db reg-event-fx]]
[wh.blogs.blog.events]
[wh.db :as db]
[wh.graphql-cache :refer [reg-query]]
[wh.graphql.compan... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/client/src/wh/promotions/create_promotion/events.cljs | clojure | query registerd in wh.graphql.jobs
query registerd in wh.graphql.company
query registerd in wh.graphql.issues
query registerd in wh.blogs.blog.events | (ns wh.promotions.create-promotion.events
(:require [cljs-time.core :as t]
[cljs-time.format :as tf]
[re-frame.core :refer [reg-event-db reg-event-fx]]
[wh.blogs.blog.events]
[wh.db :as db]
[wh.graphql-cache :refer [reg-query]]
[wh.graphql.compan... |
07fc26c55cf5a888ac6abbb27674a0434664c66f5556f9ccdada716b821ed3d2 | Rober-t/apxr_run | morphology_test.erl | -module(morphology_test).
-include_lib("eunit/include/eunit.hrl").
%% runners
morphology_test_() ->
[
fun get_init_sensors_subtest/0,
fun get_init_actuators_subtest/0,
fun get_sensors_subtest/0,
fun get_actuators_subtest/0,
fun get_init_substrate_cpps_subtest/0,
fun get_init_substrate_ceps_... | null | https://raw.githubusercontent.com/Rober-t/apxr_run/9c62ab028af7ff3768ffe3f27b8eef1799540f05/test/morphology_test.erl | erlang | runners
tests | -module(morphology_test).
-include_lib("eunit/include/eunit.hrl").
morphology_test_() ->
[
fun get_init_sensors_subtest/0,
fun get_init_actuators_subtest/0,
fun get_sensors_subtest/0,
fun get_actuators_subtest/0,
fun get_init_substrate_cpps_subtest/0,
fun get_init_substrate_ceps_subtest/0,
... |
2d634b91e269d7dac2eee2e61778a51b29ec236269f277149f1969570c852c79 | janestreet/async_unix | shutdown.ml | (* Unit tests are in ../../lib_test/shutdown_tests.ml *)
open Core
open Import
module Status_compatibility = struct
type t =
| Incompatible
| Compatible_and_replace
| Compatible_and_do_not_replace
end
module Status = struct
type t =
| Exit of int
| Signal of Signal.t
[@@deriving equal, sexp... | null | https://raw.githubusercontent.com/janestreet/async_unix/e38241dc5c2ffad9842b0100ffbc44fb7941bfe2/src/shutdown.ml | ocaml | Unit tests are in ../../lib_test/shutdown_tests.ml
Be careful to ensure [shutdown] doesn't raise just because
stderr is closed |
open Core
open Import
module Status_compatibility = struct
type t =
| Incompatible
| Compatible_and_replace
| Compatible_and_do_not_replace
end
module Status = struct
type t =
| Exit of int
| Signal of Signal.t
[@@deriving equal, sexp_of]
let compatibility t ~prior : Status_compatibility... |
6b3e54f4e40d651be231d5efde9c18b9b97fef6bb13d0ace842fd1ee5f98bb92 | scheme/scsh | scsh-version.scm | (define scsh-major-version 0)
(define scsh-minor-version 7)
(define scsh-version-string "0.7")
(define scsh-release-name "Revival")
| null | https://raw.githubusercontent.com/scheme/scsh/114432435e4eadd54334df6b37fcae505079b49f/scheme/scsh-version.scm | scheme | (define scsh-major-version 0)
(define scsh-minor-version 7)
(define scsh-version-string "0.7")
(define scsh-release-name "Revival")
| |
3ac9f5affc9fe51787248fa6ec66df535d0526a778edde7c86fcbd20dbfeda5a | pavlobaron/ErlangOTPBookSamples | exeval_logger.erl | -module(exeval_logger).
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
init(_Args) ->
{ok, F} = file:open(env_lib:get_env(logger, file), write),
{ok, F}.
handle_event(start_eval, F) ->
io:format(F, "---- Starting ----~n", []),
{ok, F};
handle_event({add, String, LV... | null | https://raw.githubusercontent.com/pavlobaron/ErlangOTPBookSamples/50094964ad814932760174914490e49618b2b8c2/otp/src/exeval_logger.erl | erlang | -module(exeval_logger).
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
init(_Args) ->
{ok, F} = file:open(env_lib:get_env(logger, file), write),
{ok, F}.
handle_event(start_eval, F) ->
io:format(F, "---- Starting ----~n", []),
{ok, F};
handle_event({add, String, LV... | |
5c0a10d8ba4297e1b8f4eb3957d1fba89bc090a251e8833b92992dca2e6a46b5 | mfoemmel/erlang-otp | wx_test_lib.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/test/wx_test_lib.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
Author : < >
Description : Library... |
d98b6100d1c3e9dc5681eb0f796475e116ec4c527aaab54b7381b7a3a7255768 | nallen05/djula | load.lisp | ; a test in this test group is run by READ'ing the file "in.sexp", giving the resultant
sexp to COMPILE - TOKENS in a dynamic environment similar to COMPILE - TEMPLATE [ ie ,
; *SEEN-VARIABLES* is bound, etc] then simulating the rest of the COMPILE-TEMPLATE /
; render-template process and comparing the results with "... | null | https://raw.githubusercontent.com/nallen05/djula/331e2d5b0c9967b636e4df22e847ac98f16f6ba9/test/2-compile-tokens-group/load.lisp | lisp | a test in this test group is run by READ'ing the file "in.sexp", giving the resultant
*SEEN-VARIABLES* is bound, etc] then simulating the rest of the COMPILE-TEMPLATE /
render-template process and comparing the results with "out.txt"
passed
note: trailing and leading whitespace are trimmed before comparison
no... | sexp to COMPILE - TOKENS in a dynamic environment similar to COMPILE - TEMPLATE [ ie ,
if the resultant string is STRING= to the contents of " out.txt " then the test has
(in-package :djula-test)
(defun .test-compile-tokens (tokens variable-plist)
(let ((djula::*template-arguments* variable-plist)
djula::*know... |
20846a06d148a3d7302100f6021baa56d04b12a5a8341b9543caa10f4eb56339 | simingwang/emqx-plugin-kafkav5 | ssl_pem_cache.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 20016 - 2021 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applica... | null | https://raw.githubusercontent.com/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/rel/emqx_plugin_kafka/lib/ssl-10.7/src/ssl_pem_cache.erl | erlang |
%CopyrightBegin%
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 the specific lan... | Copyright Ericsson AB 20016 - 2021 . 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(ssl_pem_cache).
-behaviour(gen_server).
Internal application API
-export([start_link/1,
start_link_d... |
2686eed6b63e5540501399e6ea79fe905159f0ec74d55b0d3a6bf7096540e3f7 | UberPyro/prowl | prowl_test.ml | open Batteries
open Alcotest
open Lib
open Util
let tests = [
"fundamentals", [
"lit1", "4\n5\nhi";
"arith1", "7";
"arith2", "5";
];
"bindings", [
"as1", "11";
"let1", "6";
"let-func", "25";
"let-as", "2";
"let-sect", "4";
"compose", "3";
"sect1", "1";
"sect-full", "... | null | https://raw.githubusercontent.com/UberPyro/prowl/6d38a3227892fc4b79ce89719bb666a504d7d148/prowl_test.ml | ocaml | open Batteries
open Alcotest
open Lib
open Util
let tests = [
"fundamentals", [
"lit1", "4\n5\nhi";
"arith1", "7";
"arith2", "5";
];
"bindings", [
"as1", "11";
"let1", "6";
"let-func", "25";
"let-as", "2";
"let-sect", "4";
"compose", "3";
"sect1", "1";
"sect-full", "... | |
ec26d8732c9eebbc9e286efb52ea6ee8ea9c11154ae6d10e5d548d50e5e41ec5 | merijn/broadcast-chan | Utils.hs | import Control.Concurrent
import Control.Monad (forM_)
import Data.List (foldl')
import GHC.Conc (getNumProcessors)
import BroadcastChan
main :: IO ()
main = do
getNumProcessors >>= setNumCapabilities
start <- newEmptyMVar
done <- newEmptyMVar
chan <- newBroadcastChan
vals <- getBChanContents chan... | null | https://raw.githubusercontent.com/merijn/broadcast-chan/1a884f9ffa6f9f5628f575aec1e06502c853ab9f/broadcast-chan/benchmarks/Utils.hs | haskell | import Control.Concurrent
import Control.Monad (forM_)
import Data.List (foldl')
import GHC.Conc (getNumProcessors)
import BroadcastChan
main :: IO ()
main = do
getNumProcessors >>= setNumCapabilities
start <- newEmptyMVar
done <- newEmptyMVar
chan <- newBroadcastChan
vals <- getBChanContents chan... | |
058cbdb2140c22fb23e4cfbdd12ee61c5bfff1b420a402150ce0f24fc244a86b | depressed-pho/HsOpenSSL | X509.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE ForeignFunctionInterface #
{-# OPTIONS_HADDOCK prune #-}
-- |An interface to X.509 certificate.
module OpenSSL.X509
( -- * Type
X509
, X509_
-- * Functions to manipulate certificate
, newX... | null | https://raw.githubusercontent.com/depressed-pho/HsOpenSSL/9e6a2be8298a9cbcffdfff55eab90e1e497628c3/OpenSSL/X509.hs | haskell | # LANGUAGE CPP #
# LANGUAGE EmptyDataDecls #
# OPTIONS_HADDOCK prune #
|An interface to X.509 certificate.
* Type
* Functions to manipulate certificate
private
private
private
private
private
* Accessors
|@'X509'@ is an opaque object that represents X.509 certificate... | # LANGUAGE ForeignFunctionInterface #
module OpenSSL.X509
X509
, X509_
, newX509
, compareX509
, signX509
, verifyX509
, printX509
, getVersion
, setVersion
, getSerialNumber
, setSerialNumber
, getIssuerName
, setIssuerName
, getSubjectName
, setSub... |
8968924f68a552d61856c00b3c5bfd56efdb10fab3d7e55867e2ef946e6f4b6a | camllight/camllight | latexmacros.ml | let cmdtable = (hashtbl__new 19 : (string, action list) hashtbl__t);;
let def name action =
hashtbl__add cmdtable name action;;
let find_macro name =
try
hashtbl__find cmdtable name
with Not_found ->
prerr_string "Unknown macro: "; prerr_endline name; [];;
(* General LaTeX macros *)
def "\\part"
[... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/doc/tools/latexmacros.ml | ocaml | General LaTeX macros | let cmdtable = (hashtbl__new 19 : (string, action list) hashtbl__t);;
let def name action =
hashtbl__add cmdtable name action;;
let find_macro name =
try
hashtbl__find cmdtable name
with Not_found ->
prerr_string "Unknown macro: "; prerr_endline name; [];;
def "\\part"
[Print "<H0>"; Print_arg; Pr... |
d3f55714a376f013563017da4fc3c96ee4a1445dfaec4c0c5ba03fc28600fed8 | EveryTian/Haskell-Codewars | CryptoSquare.hs | module CryptoSquare (encode) where
import Data.Char (isAlpha, isDigit, toLower)
encode :: String -> String
encode xs = let s = preDeal xs
(r, c) = getRC s
sl = sep s c
in reGen sl
reGen :: [String] -> String
reGen [] = []
reGen xs
| null $ head xs = []
| otherwise ... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/exercism/crypto-square/src/CryptoSquare.hs | haskell | module CryptoSquare (encode) where
import Data.Char (isAlpha, isDigit, toLower)
encode :: String -> String
encode xs = let s = preDeal xs
(r, c) = getRC s
sl = sep s c
in reGen sl
reGen :: [String] -> String
reGen [] = []
reGen xs
| null $ head xs = []
| otherwise ... | |
e061e99ad24ff830969b51d640b54f8a0ff54e2e8150a995ebf3eeb492a4d38b | Gastove/doctopus | test_utilities.clj | (ns doctopus.test-utilities
(:require [clojure.string :as str]
[clojure.test :refer :all]
[doctopus.doctopus.head :refer [->Head]]
[doctopus.doctopus.tentacle :refer [map->Tentacle]])
(:import [org.joda.time DateTime]
[org.joda.time.format DateTimeFormat]))
(defn trut... | null | https://raw.githubusercontent.com/Gastove/doctopus/407ca58bb01a6da84f3a76a58c800ee0a7f14190/test/doctopus/test_utilities.clj | clojure | Make mock requests
Data-Mocking functions | (ns doctopus.test-utilities
(:require [clojure.string :as str]
[clojure.test :refer :all]
[doctopus.doctopus.head :refer [->Head]]
[doctopus.doctopus.tentacle :refer [map->Tentacle]])
(:import [org.joda.time DateTime]
[org.joda.time.format DateTimeFormat]))
(defn trut... |
03eea96b4f134b42cb0ef2d266b8e365cc729978b3ebddfb9d103d39300ed721 | keyvanakbary/marko | db.cljs | (ns marko.db)
(def initial-content "# Hello world!
Check out the [repository]().
* Will work on Mac, Linux and Windows
* Notes will be saved as Markdown files
* Sync via Dropbox or Google Drive
**Feedback pretty welcome!**
")
(def default-db
{:editor-content initial-content})
| null | https://raw.githubusercontent.com/keyvanakbary/marko/392602803795d7a5ab4dc8242c1625aca9b0cc20/src/marko/db.cljs | clojure | (ns marko.db)
(def initial-content "# Hello world!
Check out the [repository]().
* Will work on Mac, Linux and Windows
* Notes will be saved as Markdown files
* Sync via Dropbox or Google Drive
**Feedback pretty welcome!**
")
(def default-db
{:editor-content initial-content})
| |
166d6d22ebaf627b705fdeb70977a7a5c789de851971b0d9bd228ef442ba148a | haroldcarr/learn-haskell-coq-ml-etc | lab5-pmc.hs | module Lab5 where
data Concurrent a = Concurrent ((a -> Action) -> Action)
data Action
= Atom (IO Action)
| Fork Action Action
| Stop
instance Show Action where
show (Atom _) = "atom"
show (Fork x y) = "fork " ++ show x ++ " " ++ show y
show Stop = "stop"
-- =========================... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/course/2014-10-edx-delft-fp101x-intro-to-fp-erik-meijer/lab5-pmc.hs | haskell | ===================================
Ex. 0
===================================
===================================
===================================
===================================
===================================
===================================
===================================
================... | module Lab5 where
data Concurrent a = Concurrent ((a -> Action) -> Action)
data Action
= Atom (IO Action)
| Fork Action Action
| Stop
instance Show Action where
show (Atom _) = "atom"
show (Fork x y) = "fork " ++ show x ++ " " ++ show y
show Stop = "stop"
actionU :: ((a -> Action) -... |
1c095e6506f76d109f4efe841addd07034fb5492dcce66bb1f9061381303155c | huangz1990/SICP-answers | p22-iter-factorial.scm | ;;; p22-iter-factorial.scm
(define (factorial n)
(fact-iter 1 1 n))
(define (fact-iter product counter max-count)
(if (> counter max-count)
product
(fact-iter (* counter product)
(+ counter 1)
max-count)))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/p22-iter-factorial.scm | scheme | p22-iter-factorial.scm |
(define (factorial n)
(fact-iter 1 1 n))
(define (fact-iter product counter max-count)
(if (> counter max-count)
product
(fact-iter (* counter product)
(+ counter 1)
max-count)))
|
e171d3b161bdd2bf24167ae817729cdc820a8443dc319b38f41d33708d78fa75 | typedclojure/typedclojure | rec_type.clj | (ns clojure.core.typed.test.rec-type
(:require [typed.clojure :as t])
(:import (clojure.lang IMapEntry)))
( t / defalias ( Rec [ x ] ( t / Map Any ( U [ Any - > Any ] x ) ) ) )
;
;(t/ann-form {:a (t/ann-form (fn [a] a)
; [Any -> Any])}
; RuleSet)
(t/defalias Rule [t/Any -> (... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/97f65c59f328abff3bc80796ff8a637e7c7de9fe/typed/clj.checker/test/clojure/core/typed/test/rec_type.clj | clojure |
(t/ann-form {:a (t/ann-form (fn [a] a)
[Any -> Any])}
RuleSet)
(let [result (reduce (ann-form (fn [report kv]
(let [rule-path (key kv)
rule (val kv)
datum (get ... | (ns clojure.core.typed.test.rec-type
(:require [typed.clojure :as t])
(:import (clojure.lang IMapEntry)))
( t / defalias ( Rec [ x ] ( t / Map Any ( U [ Any - > Any ] x ) ) ) )
(t/defalias Rule [t/Any -> (t/Option t/Keyword)])
(t/defalias RuleSet
(t/Rec [x]
(t/Map t/Any (t/U Rule x))))
(t/defalias Rep... |
01055c5724f31f52dbdd18ca79d9d458c77f00e1fb5a14b1e335f65725450bd4 | mccraigmccraig/twitter-streaming-client | project.clj | (def shared
'[[joda-time "2.8.2"]
[ch.qos.logback/logback-classic "1.0.11"]
[org.slf4j/slf4j-api "1.7.5"]
[org.slf4j/jcl-over-slf4j "1.7.5"]
[org.slf4j/log4j-over-slf4j "1.7.5"]
[org.slf4j/jul-to-slf4j "1.7.5"]
[org.clojure/core.incubator "0.1.3"]
[org.clojure/tools.logging "0.3.1"]
[... | null | https://raw.githubusercontent.com/mccraigmccraig/twitter-streaming-client/08d6b92d231a53e3262368646917058081fe2dd7/project.clj | clojure | (def shared
'[[joda-time "2.8.2"]
[ch.qos.logback/logback-classic "1.0.11"]
[org.slf4j/slf4j-api "1.7.5"]
[org.slf4j/jcl-over-slf4j "1.7.5"]
[org.slf4j/log4j-over-slf4j "1.7.5"]
[org.slf4j/jul-to-slf4j "1.7.5"]
[org.clojure/core.incubator "0.1.3"]
[org.clojure/tools.logging "0.3.1"]
[... | |
de39717005a029f0afb57d28137ae1490fc8f3165ddcd83e575afc8f992243e0 | noamz/linlam | Utils.hs | module LinLam.Utils where
import qualified Data.Set as Set
-- orbit of an element under a function
orbit :: Ord a => a -> (a -> a) -> [a]
orbit x f = go Set.empty x
where
go s x
| Set.member x s = []
| otherwise = x : go (Set.insert x s) (f x)
| null | https://raw.githubusercontent.com/noamz/linlam/bbdcaf27b9ec0f52f5d9f0e4f68c05830429a140/src/LinLam/Utils.hs | haskell | orbit of an element under a function | module LinLam.Utils where
import qualified Data.Set as Set
orbit :: Ord a => a -> (a -> a) -> [a]
orbit x f = go Set.empty x
where
go s x
| Set.member x s = []
| otherwise = x : go (Set.insert x s) (f x)
|
eb89484801ceb3caf72f9b9733e8f99fd7a454da8d6285f4a57c021e937e7f94 | MarkCurtiss/sicp | 3_21_to_3_27_spec.scm | (load "3_21_to_3_27.scm")
(describe "Queues"
(it "prints a queue"
(lambda ()
(define a-queue (make-queue))
(for-each
(lambda (x) (insert-queue! a-queue x))
(list 'a 'b 2 4 '(6 8)))
(delete-queue! a-queue)
(assert (equal?
(print-queue a-queue)
'(b 2 4 (6 8)... | null | https://raw.githubusercontent.com/MarkCurtiss/sicp/8b55a3371458014c815ba8792218b6440127ab40/chapter_3_exercises/spec/3_21_to_3_27_spec.scm | scheme | (load "3_21_to_3_27.scm")
(describe "Queues"
(it "prints a queue"
(lambda ()
(define a-queue (make-queue))
(for-each
(lambda (x) (insert-queue! a-queue x))
(list 'a 'b 2 4 '(6 8)))
(delete-queue! a-queue)
(assert (equal?
(print-queue a-queue)
'(b 2 4 (6 8)... | |
b5f61ddc6011a0b63f1b01907968ca8f29a89ff15ffe5eb6a72ededeb05a7039 | alvatar/spheres | dataformat-csv.scm | ;;; @section Tests
;;; The @code{csv.scm} test suite can be enabled by editing the source code
;;; file and loading @uref{/, Testeez}.
;; these snow tests were made from the testeez tests of the original package.
;; some of the conversion has been done manually, the rest is done by macros
(test-define "define an as... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/test/dataformat-csv.scm | scheme | @section Tests
The @code{csv.scm} test suite can be enabled by editing the source code
file and loading @uref{/, Testeez}.
these snow tests were made from the testeez tests of the original package.
some of the conversion has been done manually, the rest is done by macros
TODO: Add more test cases. |
(test-define "define an ascii CR char"
cr
(string (integer->char 13)))
(test-define "define an ascii LF char"
lf
(string (integer->char 10)))
(test-define "define a reader-maker that strips whitespace"
make-ws-stripping-reader
(make-csv-r... |
db38c5e61d5f76fbce7b40c587ca767668686b1a38ac387037707445ae7c2bf6 | input-output-hk/cardano-sl | UnitsOfMeasure.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE KindSignatures #
module Pos.Util.UnitsOfMeasure
( UnitOfMeasure (..)
, MeasuredIn(..)
) where
import Control.Lens (at, (?~))
import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), object,
withObject, (.:), (.=))
import... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/lib/src/Pos/Util/UnitsOfMeasure.hs | haskell | # LANGUAGE DataKinds #
| A finite sum type representing time units we might want to show to
clients. The idea is that whenever we have a quantity represeting some
form of time, we should render it together with the relevant unit, to
not leave anything to guessing.
| Number of blocks.
| Represent data with a ... | # LANGUAGE KindSignatures #
module Pos.Util.UnitsOfMeasure
( UnitOfMeasure (..)
, MeasuredIn(..)
) where
import Control.Lens (at, (?~))
import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), object,
withObject, (.:), (.=))
import qualified Data.Text.Lazy as T
i... |
89f028e332c00ff84c05fe8958108ba96bf634992cb8f1eb9f542cd1c02f3bb4 | awalterschulze/the-little-typer-exercises | chapter10-2-2-alessthanb.rkt | #lang pie
In the following exercises we 'll use the function called < = that takes two
arguments a , b and evaluates to a type representing the proposition
;; that a is less than or equal to b.
;(claim <=
( - >
; U))
;
;(define <=
; (λ (a b)
; (Σ ([k Nat])
; (= Nat (+ k a) b))))
;;... | null | https://raw.githubusercontent.com/awalterschulze/the-little-typer-exercises/91cad6c6d5c1733562aa952d8ca515addb2b301d/chapter10-2-2-alessthanb.rkt | racket | that a is less than or equal to b.
(claim <=
U))
(define <=
(λ (a b)
(Σ ([k Nat])
(= Nat (+ k a) b))))
Define a funciton called <=-simplify to state and prove that for all
Nats a, b, n we have that n+a <= b implies a <= b
(claim plus-assoc
(claim <=-simplify
(Π ([a Nat]
... | #lang pie
In the following exercises we 'll use the function called < = that takes two
arguments a , b and evaluates to a type representing the proposition
( - >
NB : You may need to use plus - assoc that was proved in Exercise 8.3 .
( Pi ( ( n Nat ) ( m ) ( k Nat ) )
( + k ( + n m ) ) ( ... |
12ec87b6405289b965eb22f41982f42c5de2dedb1869df8f059993436d302c60 | emezeske/lein-cljsbuild | listen.clj | (ns cljsbuild.test.repl.listen
(:use
cljsbuild.repl.listen
midje.sweet)
(:require
[cljs.repl :as repl]
[cljs.repl.browser :as browser]
[cljsbuild.util :as util]))
(def port (Integer. 1234))
(def output-dir "output-dir")
(def command {:shell ["command"]})
(fact
(run-repl-listen port output-di... | null | https://raw.githubusercontent.com/emezeske/lein-cljsbuild/089193c74e362c143d30dfca21a21e95c7ca112a/support/test/cljsbuild/test/repl/listen.clj | clojure | (ns cljsbuild.test.repl.listen
(:use
cljsbuild.repl.listen
midje.sweet)
(:require
[cljs.repl :as repl]
[cljs.repl.browser :as browser]
[cljsbuild.util :as util]))
(def port (Integer. 1234))
(def output-dir "output-dir")
(def command {:shell ["command"]})
(fact
(run-repl-listen port output-di... | |
26cda87b792f5ff6668eafeca3d7c5e6aabc1ff177d1982028c385851228724f | glguy/5puzzle | Handshakes.hs |
My wife and I recently attended a party at which there were four other married
couples . Various handshakes took place . No one shook hands with oneself , nor
with one 's spouse , and no one shook hands with the same person more than once .
After all the handshakes were over , I asked each person , including m... | null | https://raw.githubusercontent.com/glguy/5puzzle/4d86cf9fad3ec3f70c57a167417adea6a3f9f30b/Handshakes.hs | haskell |
My wife and I recently attended a party at which there were four other married
couples . Various handshakes took place . No one shook hands with oneself , nor
with one 's spouse , and no one shook hands with the same person more than once .
After all the handshakes were over , I asked each person , including m... | |
888e0d220c8a173da90487c6e0e640ef204afef1f3d715641a68d77ed54ce7ad | WormBase/wormbase_rest | overview.clj | (ns rest-api.classes.laboratory.widgets.overview
(:require
[clojure.string :as str]
[rest-api.classes.generic-fields :as generic]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(defn website [lab]
{:data (when-let [url (first (:laboratory/url lab))]
(str/replace url #"https?:\/\/" "")... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/laboratory/widgets/overview.clj | clojure | gets name in ace code. this is true at least most of the time
:affiliation affiliation | (ns rest-api.classes.laboratory.widgets.overview
(:require
[clojure.string :as str]
[rest-api.classes.generic-fields :as generic]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(defn website [lab]
{:data (when-let [url (first (:laboratory/url lab))]
(str/replace url #"https?:\/\/" "")... |
6c3cca26bfd7d578fb28762c3ab2d287916b0f177dde57eb47a4344f6f8f5a29 | fukamachi/quri | decode.lisp | (in-package :cl-user)
(defpackage quri.decode
(:use :cl
:quri.util
:quri.error)
(:import-from :babel
:octets-to-string)
(:import-from :babel-encodings
:*default-character-encoding*)
(:import-from :cl-utilities
:collecting
:collect)
... | null | https://raw.githubusercontent.com/fukamachi/quri/d09ebb553f4a51e5d52036312ba4ee5b67c79cd0/src/decode.lisp | lisp | field only | (in-package :cl-user)
(defpackage quri.decode
(:use :cl
:quri.util
:quri.error)
(:import-from :babel
:octets-to-string)
(:import-from :babel-encodings
:*default-character-encoding*)
(:import-from :cl-utilities
:collecting
:collect)
... |
755f3a4b4aa71549d31a20701399c77c273c8b949d37cacc4b16c8b0535482ba | cwtsteven/TSD | fold_sum.ml | open Tsd
open List
let (+^) = lift (+)
let rec createList n init =
match n with
| 0 -> [], []
| n -> let input_v = cell (lift init) in
let xs, ys = createList (n-1) init in
input_v :: xs, if n mod 1000 == 0 then input_v :: ys else ys
let rec stabilise () =
if step() then stabilise () else ()
let... | null | https://raw.githubusercontent.com/cwtsteven/TSD/32bd2cbca6d445ff6b0caecdbb2775de61fdfc6d/benchmarks/fold_sum/fold_sum.ml | ocaml | print_int (peek out); print_newline() | open Tsd
open List
let (+^) = lift (+)
let rec createList n init =
match n with
| 0 -> [], []
| n -> let input_v = cell (lift init) in
let xs, ys = createList (n-1) init in
input_v :: xs, if n mod 1000 == 0 then input_v :: ys else ys
let rec stabilise () =
if step() then stabilise () else ()
let... |
98bb8ea6978c4be3e638ae1367d21eb27bfcc380e9eaf175b83f5656f3866149 | kztk-m/sparcl | Base.hs | module Language.Sparcl.Base where
import Language.Sparcl.Runtime
import Data.Function (on)
import Data.Ratio (Rational)
import qualified Data.Ratio ((%))
newtype Un a = U a
liftFunc :: (a -> b) -> a -> R b
liftFunc f a = return (f a)
liftFunc2 :: (... | null | https://raw.githubusercontent.com/kztk-m/sparcl/f52d333ce50e0aa6cb307da08811719f8c684f7d/runtime/src/Language/Sparcl/Base.hs | haskell | module Language.Sparcl.Base where
import Language.Sparcl.Runtime
import Data.Function (on)
import Data.Ratio (Rational)
import qualified Data.Ratio ((%))
newtype Un a = U a
liftFunc :: (a -> b) -> a -> R b
liftFunc f a = return (f a)
liftFunc2 :: (... | |
194369010b6153b47c263199571c9147f74c8443fc1207387d3eebf753c6f0b9 | coccinelle/coccinelle | get_constants.mli |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/parsing_cocci/get_constants.mli | ocaml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | |
eddcde09c004182f3298472098a5bf89f310b95ba5e761eb11806a633422f360 | reborg/clojure-essential-reference | 1.clj | < 1 >
;; true
< 2 >
(.exists file))
;; Reflection warning - reference to field exists can't be resolved.
(import '[java.io File])
(defn exists? [^File file] ; <3>
(.exists file)) | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/9a3eb82024c8e5fbe17412af541c2cd30820c92e/DynamicVariablesintheStandardLibrary/*warn-on-reflection*and*unchecked-math*/1.clj | clojure | true
Reflection warning - reference to field exists can't be resolved.
<3> | < 1 >
< 2 >
(.exists file))
(import '[java.io File])
(.exists file)) |
b94c8c521b6532c1974a34f1346351b061c01c67891e9dab725e49a8e1cdd6d3 | bhaskara/programmable-reinforcement-learning | gold-standard.lisp | (defpackage alisp-gold-standard
(:documentation "Defines the <alisp-gold-standard> reinforcement learning algorithm.
Exports
-------
<alisp-gold-standard>
make-alisp-gold-standard-learning-alg")
(:export
<alisp-gold-standard>
make-alisp-gold-standard-learning-alg)
(:use
cl
set
alisp-... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/alisp/learn/gold-standard.lisp | lisp |
Class def
creation
if environment has terminated, make a note of this
fresh is always treated as true
smdp creation
otherwise, normalize the counts of each observation
code relating to responding to observations
| (defpackage alisp-gold-standard
(:documentation "Defines the <alisp-gold-standard> reinforcement learning algorithm.
Exports
-------
<alisp-gold-standard>
make-alisp-gold-standard-learning-alg")
(:export
<alisp-gold-standard>
make-alisp-gold-standard-learning-alg)
(:use
cl
set
alisp-... |
95872217044ef413ef54ee1042426ef07e8d06181530549a6f1e07912f78d561 | wireless-net/erlang-nommu | cover.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2001 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/tools/src/cover.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2001 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(cover).
This module implements t... |
40542a1815f534e1c746f959c6033632b52047c05743ed3f04a68584a6fcf2a6 | jeffshrager/biobike | af-types.lisp | ;;; -*- mode: Lisp; Syntax: Common-Lisp; Package: bio; -*-
(in-package :aframes)
;;; +=========================================================================+
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
;;; | |
;;; | Permission is ... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/Organisms/af-types.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: bio; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and as... |
(in-package :aframes)
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished to do so , subject t... |
20491e46c757b7ea3171a2e3c885fa496fb1c4a04a415fa3367d0699b520ec37 | lemmih/lhc | HelloWorld.hs | module Main (main) where
import LHC.Prim
main :: IO ()
main = putStrLn "Hello world!"
entrypoint :: ()
entrypoint = unsafePerformIO main
| null | https://raw.githubusercontent.com/lemmih/lhc/53bfa57b9b7275b7737dcf9dd620533d0261be66/examples/HelloWorld.hs | haskell | module Main (main) where
import LHC.Prim
main :: IO ()
main = putStrLn "Hello world!"
entrypoint :: ()
entrypoint = unsafePerformIO main
| |
1be3bc15c02f0a8e9339a0a8cb241ba9bb67b8295a98ffe37c0342819c795b28 | danr/hipspec | Integers.hs | -- The implementation of these integers correspond to those in the
Agda standard library , which is proved to be a commutative ring
module Integers where
import Hip.Prelude
import Prelude (Eq,Ord,Show,iterate,(!!),fmap,Bool(..))
data Nat = Z | S Nat deriving (Eq)
instance Arbitrary where
-- arbitrary =
-- ... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/examples/old-examples/hip/Integers.hs | haskell | The implementation of these integers correspond to those in the
arbitrary =
let nats = iterate S Z
arbitrary = oneof [P `fmap` arbitrary,N `fmap` arbitrary]
Natural addition
Natural multiplication
Natural subtraction | Agda standard library , which is proved to be a commutative ring
module Integers where
import Hip.Prelude
import Prelude (Eq,Ord,Show,iterate,(!!),fmap,Bool(..))
data Nat = Z | S Nat deriving (Eq)
instance Arbitrary where
in ( nats ! ! ) ` fmap ` choose ( 0,50 )
data Integ = P Nat | N Nat deriving (Eq)... |
4c4ba6f18d6c9557849fab80c99f50dfc47452cd579e940b51ab85cf643d8ebf | lwhjp/ecmascript | global-object.rkt | #lang racket/base
(require racket/class
"object.rkt")
(provide global-object)
; FIXME: this should be parameterized so that we can create
a new JS environment without reloading modules ( copy the
; "default" global-object containing library functions)
(define global-object
(new ecma-object%
[cla... | null | https://raw.githubusercontent.com/lwhjp/ecmascript/69fcfa42856ea799ff9d9d63a60eaf1b1783fe50/private/global-object.rkt | racket | FIXME: this should be parameterized so that we can create
"default" global-object containing library functions) | #lang racket/base
(require racket/class
"object.rkt")
(provide global-object)
a new JS environment without reloading modules ( copy the
(define global-object
(new ecma-object%
[class-name 'global]
[prototype #f]))
|
94937822730e0d7f3f619bf903d3b6dcc05f7e50b422b0337ff58255038a8b69 | bravit/hid-examples | Test.hs | # LANGUAGE StandaloneDeriving #
import System.Exit (exitFailure)
import Data.List (sort, nub)
import Control.Monad (replicateM, when)
import System.Random
import System.Random.Stateful (uniformRM, uniformM)
import Radar
instance UniformRange Turn where
uniformRM (lo, hi) rng = do
res <- uniformRM (fromEnum lo... | null | https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/tests/radar/Test.hs | haskell | # LANGUAGE StandaloneDeriving #
import System.Exit (exitFailure)
import Data.List (sort, nub)
import Control.Monad (replicateM, when)
import System.Random
import System.Random.Stateful (uniformRM, uniformM)
import Radar
instance UniformRange Turn where
uniformRM (lo, hi) rng = do
res <- uniformRM (fromEnum lo... | |
afa457bebb4a31332cac559b8fde1eb0920f44770a2e72814da4831d1060153f | zlatozar/study-paip | examples.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : TUTOR ; Base : 10 -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991 , 1996
;; NOTE: this file will be spread through chapters
(in-package #:tutor)
(defexamples 15 "Symbolic Mathematics with Canonical Forms"
"This chapter uses a canonical re... | null | https://raw.githubusercontent.com/zlatozar/study-paip/dfa1ca6118f718f5d47d8c63cbb7b4cad23671e1/examples.lisp | lisp | Syntax : COMMON - LISP ; Package : TUTOR ; Base : 10 -*-
NOTE: this file will be spread through chapters |
Code from Paradigms of AI Programming
Copyright ( c ) 1991 , 1996
(in-package #:tutor)
(defexamples 15 "Symbolic Mathematics with Canonical Forms"
"This chapter uses a canonical representation for polynomials"
"to achieve a more efficient program than the rules-based one in Chapter 8."
(:section "15.1 A... |
c7dcad458265b0063b2799a1831b10f1089b045486b6c59319608008357dbfe1 | Kappa-Dev/KappaTools | webapp.ml | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/webapp/webapp.ml | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
let route_handler
?(shutdown_key : string option = None)
()
:
Cohttp_lwt_unix.Server.conn ->
Cohttp.Request.t ->
Cohttp_lwt.Body.t ->
(Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t
=
let intermediate =
Web... |
6b7c4851c9147dd0e74522051601089da2603fadacc0a8eca076f94ce0448c1e | haskell-mafia/mafia | Constraint.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Test.Mafia.Cabal.Constraint where
import Test.Mafia.Tripping (tripping)
import Mafia.Cabal.Constraint
import Mafia.P
import System.IO (IO)
import Test.Mafia.Arbitr... | null | https://raw.githubusercontent.com/haskell-mafia/mafia/529440246ee571bf1473615e6218f52cd1e990ae/test/Test/Mafia/Cabal/Constraint.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
module Test.Mafia.Cabal.Constraint where
import Test.Mafia.Tripping (tripping)
import Mafia.Cabal.Constraint
import Mafia.P
import System.IO (IO)
import Test.Mafia.Arbitrary (EqCabalError(..))
import ... |
6ab66fb89f49e3bbedbe371731932379960932d0f2f73fc2acce18f34074175b | diagrams/diagrams-lib | Attributes.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamType... | null | https://raw.githubusercontent.com/diagrams/diagrams-lib/ed8276e7babecace51aad34b3dfd608847be2c47/src/Diagrams/Attributes.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveFunctor #
# LANGUAGE TypeOperators #
---------------------------------------------------------------------------
|
Module : Diagrams.Attributes
License : BSD-style (see LICENSE)
Main... | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns ... |
ff07cf49f3b3ce66c8cda26e29d5dfa3ed15ab34a79f8881e0c202b5748b8499 | KeliLanguage/compiler | Cli.hs | {-# LANGUAGE BangPatterns #-}
module Cli where
import Options.Applicative
import Data.Semigroup ((<>))
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as Char8
import qualified Data.HashMap.Strict as HashMap
import Debug.Pretty.Simple (pTraceShowId, pTraceShow)
import System.IO
import PreludeJSCode
imp... | null | https://raw.githubusercontent.com/KeliLanguage/compiler/5cc5f2314fa0e0863a49c504cdb115d799f382f6/src/Cli.hs | haskell | # LANGUAGE BangPatterns #
filename
whether to show line number or not
filename
filename
filename
line number
column number
package name
git repo url
tag
path to purse.json | module Cli where
import Options.Applicative
import Data.Semigroup ((<>))
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as Char8
import qualified Data.HashMap.Strict as HashMap
import Debug.Pretty.Simple (pTraceShowId, pTraceShow)
import System.IO
import PreludeJSCode
import Interpreter
import Repl
im... |
0322d511f28fffabd95057ab7a1adc539d96f3c7b1db8623f52712104cff9891 | atgreen/red-light-green-light | common.lisp | (in-package #:snooze-common)
;;; Verbs
;;;
;;; "Sending" and "Receiving" are always from the server's
perspective . Hence GET is " sending to client " and POST and PUT are
;;; "receiving from client".
;;;
(defpackage :snooze-verbs (:use)
(:export #:http-verb #:get #:post #:put #:delete
... | null | https://raw.githubusercontent.com/atgreen/red-light-green-light/1dad8773dcec766ce354112416f3b9aa9528fa49/local-projects/snooze-20210518-git/common.lisp | lisp | Verbs
"Sending" and "Receiving" are always from the server's
"receiving from client".
Content-types
primary method may match.
In GET requests we are only interested in the request's "Accept"
inverse: the routes are matched based on what the client accepts.
If it accepts a range of content-types, multiple ro... | (in-package #:snooze-common)
perspective . Hence GET is " sending to client " and POST and PUT are
(defpackage :snooze-verbs (:use)
(:export #:http-verb #:get #:post #:put #:delete
#:content-verb
#:receiving-verb
#:sending-verb))
(cl:defcl... |
5de7c18756fa54b94a9d7b5acdf94522fb13a2c1dd14db3a3b7cb72038e83526 | racket/rhombus-prototype | indirect-static-info-key.rkt | #lang racket/base
(provide #%indirect-static-info)
(define #%indirect-static-info #f)
| null | https://raw.githubusercontent.com/racket/rhombus-prototype/fbe0a400eea3ab12cd5155704d18cada0f76ced9/rhombus/private/indirect-static-info-key.rkt | racket | #lang racket/base
(provide #%indirect-static-info)
(define #%indirect-static-info #f)
| |
1dad960ae12566b42f4fda204966e6521a1ba91b86de3e92717bf8a05a2f9157 | gaborcs/lambda-terminal | Primitive.hs | # LANGUAGE LambdaCase #
module Primitive where
import qualified Type as T
import qualified Value as V
data Primitive
= Plus
| Minus
| Times
| Signum
| Concat
deriving (Eq, Read, Show, Bounded, Enum)
getDisplayName :: Primitive -> String
getDisplayName p = case p of
Plus -> "+"
Minus ... | null | https://raw.githubusercontent.com/gaborcs/lambda-terminal/7f2638f2f3a562e0b60248da7652bda81be76adf/src/Primitive.hs | haskell | only evaluates args if and when f does | # LANGUAGE LambdaCase #
module Primitive where
import qualified Type as T
import qualified Value as V
data Primitive
= Plus
| Minus
| Times
| Signum
| Concat
deriving (Eq, Read, Show, Bounded, Enum)
getDisplayName :: Primitive -> String
getDisplayName p = case p of
Plus -> "+"
Minus ... |
a37d57b80422c5ff00186ae6dab084b77fba1b7655cce9e34e7a4e99ebb441a8 | codinuum/volt | configurationNew.ml |
* This file is part of Bolt .
* Copyright ( C ) 2009 - 2012 .
*
* Bolt is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) ... | null | https://raw.githubusercontent.com/codinuum/volt/546207693ef102a2f02c85af935f64a8f16882e6/src/library/configurationNew.ml | ocaml |
* This file is part of Bolt .
* Copyright ( C ) 2009 - 2012 .
*
* Bolt is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) ... | |
8069f521baff3a5671a18ac5436f6095887b006f2b8195c5b3dbc82720a8e548 | TyOverby/mono | keys.ml | Copyright ( c ) 2016 - 2017 . All rights reserved .
See LICENSE.md .
See LICENSE.md. *)
(**
* Demonstrates input parsing.
*)
open Notty
open Notty.Infix
open Common
let pps = Format.pp_print_string
let ppi = Format.pp_print_int
let pp_special fmt = function
| `Escape -> pps fmt "ESCAPE"
| `E... | null | https://raw.githubusercontent.com/TyOverby/mono/94225736a93457d5c9aeed399c4ae1a08b239fd5/vendor/pqwy-notty/examples/keys.ml | ocaml | *
* Demonstrates input parsing.
| Copyright ( c ) 2016 - 2017 . All rights reserved .
See LICENSE.md .
See LICENSE.md. *)
open Notty
open Notty.Infix
open Common
let pps = Format.pp_print_string
let ppi = Format.pp_print_int
let pp_special fmt = function
| `Escape -> pps fmt "ESCAPE"
| `Enter -> pps fmt "ENTER"
| `Tab... |
323599885733e2a58987fe93db99b30bc7eb30b2d8ac7a1b588a8278e8e6e1f1 | javier-paris/erlang-tcpip | fin_wait_1.erl | %%%-------------------------------------------------------------------
%%% File : fin_wait_1.erl
Author : < >
Description : wait-1 connection state
%%%
Created : 7 Sep 2004 by < >
%%%
%%%
erlang - tcpip , Copyright ( C ) 2004 Javier Paris
%%%
Licensed under the Apache License , Version 2.0 (... | null | https://raw.githubusercontent.com/javier-paris/erlang-tcpip/708b57fa37176980cddfd8605867426368d33ed1/src/fin_wait_1.erl | erlang | -------------------------------------------------------------------
File : fin_wait_1.erl
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 ... | Author : < >
Description : wait-1 connection state
Created : 7 Sep 2004 by < >
erlang - tcpip , Copyright ( C ) 2004 Javier Paris
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(fin_wait_1).
-... |
6708f56028c4092d11c75cad21f933dbf626e63c7a3457897ba31d7fd41e06a5 | composewell/unicode-transforms | Benchmark.hs | {-# LANGUAGE CPP #-}
# LANGUAGE TemplateHaskell #
-- |
Copyright : ( c ) 2016
--
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
Portability : GHC
--
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>), (<*>))
#endif
import Control.DeepSeq (NFData)
import ... | null | https://raw.githubusercontent.com/composewell/unicode-transforms/34d4d7c4318fb05ac3a35be2de1fcd5902fedfa4/benchmark/Benchmark.hs | haskell | # LANGUAGE CPP #
|
License : BSD-3-Clause
Maintainer :
Stability : experimental
measurement view across all datasets and to reduce the effect of noise
because of the datasets being too small. | # LANGUAGE TemplateHaskell #
Copyright : ( c ) 2016
Portability : GHC
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>), (<*>))
#endif
import Control.DeepSeq (NFData)
import Data.Text (Text)
import Path (Dir, Path, Rel, mkRelDir, toFilePath, (</>))
import Path.IO (listDir)
import System.FilePath... |
ef716ad2969bed481d3facb5ed756bfd1361e838f0720e87072bcf8c794f67f3 | Philonous/d-bus | Signature.hs | {-# LANGUAGE OverloadedStrings #-}
module DBus.Signature where
import Control.Applicative ((<$>))
import qualified Data.Attoparsec.ByteString as AP
import qualified Data.Attoparsec.ByteString.Char8 as AP
import qualified Data.ByteString as BS
import qualified Data.ByteStri... | null | https://raw.githubusercontent.com/Philonous/d-bus/fb8a948a3b9d51db618454328dbe18fb1f313c70/src/DBus/Signature.hs | haskell | # LANGUAGE OverloadedStrings # | module DBus.Signature where
import Control.Applicative ((<$>))
import qualified Data.Attoparsec.ByteString as AP
import qualified Data.Attoparsec.ByteString.Char8 as AP
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import q... |
f9d7e5eab8795d08fc34e5489f625571d58362d24cc4826c29505a87de8b8bf8 | tisnik/clojure-examples | core.clj | (ns clisktest6.core
(:gen-class)
(:use clisk.live))
(import java.io.File)
(import javax.imageio.ImageIO)
(defn write-image
"Uložení rastrového obrázku typu BufferedImage do souboru."
[image file-name]
(ImageIO/write image "png" (File. file-name)))
(defn write-pattern
"Vytvoření rastrového obr... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/clisktest6/src/clisktest6/core.clj | clojure | (ns clisktest6.core
(:gen-class)
(:use clisk.live))
(import java.io.File)
(import javax.imageio.ImageIO)
(defn write-image
"Uložení rastrového obrázku typu BufferedImage do souboru."
[image file-name]
(ImageIO/write image "png" (File. file-name)))
(defn write-pattern
"Vytvoření rastrového obr... | |
93cb9f15fc656d994bdb34cb40b8c3b982ea2b5fade38f6c0e1966c2f3398c51 | clojure/core.typed | classify_invoke.clj | Copyright ( c ) , Rich Hickey & 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 b... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/analyzer.jvm/src/clojure/core/typed/analyzer/jvm/passes/classify_invoke.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 ) , Rich Hickey & contributors .
(ns clojure.core.typed.analyzer.jvm.passes.classify-invoke
(:require [clojure.core.typed.analyzer.common :as common]
[clojure.core.typed.analyzer.common.utils :as cu]
[clojure.core.typed.analyzer.jvm.utils :as ju]
[clojure.core.... |
182e2c66b4a7900db53726d0c18a5381cc3cc8e215c5b8debea10ce47e445513 | heroku/lein-heroku | core.clj | (ns happy-path.core
(:require [happy-path.handler :refer [app init destroy]]
[immutant.web :as immutant]
[clojure.tools.nrepl.server :as nrepl]
[taoensso.timbre :as timbre]
[environ.core :refer [env]])
(:gen-class))
(defonce nrepl-server (atom nil))
(defn parse-port... | null | https://raw.githubusercontent.com/heroku/lein-heroku/337a56787b42b7291e519090fa9bb7d96470667c/it/buildpacks/src/happy_path/core.clj | clojure | (ns happy-path.core
(:require [happy-path.handler :refer [app init destroy]]
[immutant.web :as immutant]
[clojure.tools.nrepl.server :as nrepl]
[taoensso.timbre :as timbre]
[environ.core :refer [env]])
(:gen-class))
(defonce nrepl-server (atom nil))
(defn parse-port... | |
f2967c8da469d08a7e2014bb0954c2eb024f603e1a6e72b65f474b64609e62b4 | cedlemo/OCaml-GI-ctypes-bindings-generator | Window_group_private.ml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Window_group_private"
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Window_group_private.ml | ocaml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Window_group_private"
| |
17de9c4fc4bcd7dd293258e38dd8551a957ee12139aee6e5fd82d6c02527549e | javalib-team/sawja | jCFADom.mli |
* This file is part of SAWJA
* Copyright ( c)2013 ( INRIA )
*
* This program is free software : you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation , either version 3 of
* the License , or ( at your option ) a... | null | https://raw.githubusercontent.com/javalib-team/sawja/5b46e4afc024092cdeaf8ba125f0c5ac05cb9137/src/jCFADom.mli | ocaml | Abstraction of a variable
==Null
If the set is empty, it means that the only possible concrete value of the
* variable is null.
* [filter_with_compatible prog abs cn] :Restrain the abstraction [abs] to
* the type compatible with [cn].
* [filter_with_uncompatible prog abs cn] :Restrain the abstraction [abs] to
... |
* This file is part of SAWJA
* Copyright ( c)2013 ( INRIA )
*
* This program is free software : you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation , either version 3 of
* the License , or ( at your option ) a... |
679369985ed9d1c1de95a050dcf78d9b27754efca9f50a0f24bdf4a9e952fafc | programaker-project/Programaker-Core | automate_rest_api_metrics.erl | %%% @doc
%%% REST endpoint to work as prometheus exporter.
%%% @end
-module(automate_rest_api_metrics).
-export([init/2]).
-export([ content_types_provided/2
, is_authorized/2
]).
-export([ to_text/2
]).
-define(APPLICATION, automate_rest_api).
-define(METRICS_BEARER_TOKEN_SETTING, metrics_se... | null | https://raw.githubusercontent.com/programaker-project/Programaker-Core/ef10fc6d2a228b2096b121170c421f5c29f9f270/backend/apps/automate_rest_api/src/automate_rest_api_metrics.erl | erlang | @doc
REST endpoint to work as prometheus exporter.
@end
Authorization
No setting, we allow anything
GET handler |
-module(automate_rest_api_metrics).
-export([init/2]).
-export([ content_types_provided/2
, is_authorized/2
]).
-export([ to_text/2
]).
-define(APPLICATION, automate_rest_api).
-define(METRICS_BEARER_TOKEN_SETTING, metrics_secret).
-spec init(_,_) -> {'cowboy_rest',_,_}.
init(Req, _Opts) ->
... |
bd224c5c68cc5040aba2d2f46ab1f02c055920021ff5f44266229908d0d88016 | KirinDave/fuzed | fuzed_node.erl | -module(fuzed_node).
-export([start/0]).
start() ->
application:load(fuzed_node),
application:start(fuzed_node). | null | https://raw.githubusercontent.com/KirinDave/fuzed/56098d9e4c139613845289bdd5acebdfe608981a/elibs/fuzed_node.erl | erlang | -module(fuzed_node).
-export([start/0]).
start() ->
application:load(fuzed_node),
application:start(fuzed_node). | |
2584a2151cbab65836d0b3bb602c6f256405e0951dbecc90145eef84f32089aa | tfausak/advent-of-code | 2.hs | -- stack --resolver lts-12.25 script
import qualified Data.SBV as SBV
import qualified Text.ParserCombinators.ReadP as Parse
main = do
nanobots <- map read . lines <$> readFile "input.txt"
model <- SBV.optimize SBV.Lexicographic $ do
[x, y, z] <- SBV.sIntegers ["x", "y", "z"]
SBV.maximize "nanobots-in-rang... | null | https://raw.githubusercontent.com/tfausak/advent-of-code/26f0d9726b019ff7b97fa7e0f2f995269b399578/2018/23/2.hs | haskell | stack --resolver lts-12.25 script | import qualified Data.SBV as SBV
import qualified Text.ParserCombinators.ReadP as Parse
main = do
nanobots <- map read . lines <$> readFile "input.txt"
model <- SBV.optimize SBV.Lexicographic $ do
[x, y, z] <- SBV.sIntegers ["x", "y", "z"]
SBV.maximize "nanobots-in-range" . sum $ map
((\ n -> n :: SB... |
d6f23ed27685725fcbbfa894d2b9383615f8d1957c47e5f692832cffe5bde408 | maoo/segway | web.clj | (ns segway.web
(:use segway.data
segway.pages.home
segway.pages.detail
ring.util.response
[net.cgrand.moustache :only [app]]
[clojure.contrib.duck-streams :only [pwd]])
(:require [net.cgrand.enlive-html :as html]))
(def *webdir* (str (pwd) "/src/template/"))
(defn render [t... | null | https://raw.githubusercontent.com/maoo/segway/569306d306de1de743bcd3e68cf380c373bf1d22/src/segway/web.clj | clojure | (ns segway.web
(:use segway.data
segway.pages.home
segway.pages.detail
ring.util.response
[net.cgrand.moustache :only [app]]
[clojure.contrib.duck-streams :only [pwd]])
(:require [net.cgrand.enlive-html :as html]))
(def *webdir* (str (pwd) "/src/template/"))
(defn render [t... | |
746e031f57fea4ddb7c3e6b6235a568a45ae391581e05c3589854d63cb4fa2a2 | jordanthayer/ocaml-search | rst_tree.ml | * , , Thayer Trees
(* Assumes fixed branching factor *)
type data = {
cost : float;
depth : int;
key : int;
}
type scale =
| Uniform
| Linear_Increase
| Linear_Decrease
type rst_tree = {
scale : scale;
max_edge_cost : float;
max_depth : int;
branch : int;
t : data Random_tree.tree;
}
(*... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/synthetic_graph/rst_tree.ml | ocaml | Assumes fixed branching factor
************************ Printing functions *******************************
***************************************************************************
* Calculates the path from the root to the leaf node
* Geneartes the expand function used to
Random_tree.wrap_expand does the seed i... | * , , Thayer Trees
type data = {
cost : float;
depth : int;
key : int;
}
type scale =
| Uniform
| Linear_Increase
| Linear_Decrease
type rst_tree = {
scale : scale;
max_edge_cost : float;
max_depth : int;
branch : int;
t : data Random_tree.tree;
}
let data_to_string d =
Wrutils.str "... |
05efdca7d78dc568fe19806d57f28261b250eb93a8d63e43025ca63b42249f9c | twosigma/Cook | prometheus_metrics.clj | ;;
Copyright ( c ) Two Sigma Open Source , LLC
;;
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 law or agreed to in writing, software... | null | https://raw.githubusercontent.com/twosigma/Cook/64fa4858c518c924b0b1bdc5cc40478f67743315/scheduler/src/cook/prometheus_metrics.clj | clojure |
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 the specific language governing permi... | Copyright ( c ) Two Sigma Open Source , LLC
distributed under the License is distributed on an " AS IS " BASIS ,
(ns cook.prometheus-metrics
(:require [iapetos.collector.jvm :as jvm]
[iapetos.collector.ring :as ring]
[iapetos.core :as prometheus]
[iapetos.export :as prometheu... |
45cc35e75e55b829f4e1a5d6e26c182c7eaeeac714bb28e6fcbc024e44ed2590 | soulomoon/SICP | Exercise 1.39.scm | Exercise 1.39 : A continued fraction representation of the tangent function was published in 1770 by the German mathematician :
; tanx=x1-x23-x25-...,
; tanx=x1−x23−x25−…,
where xx is in radians . Define a procedure ( tan - cf x k ) that computes an approximation to the tangent function based on Lambert ’s formu... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter1/Exercise%201.39.scm | scheme | tanx=x1-x23-x25-...,
tanx=x1−x23−x25−…, | Exercise 1.39 : A continued fraction representation of the tangent function was published in 1770 by the German mathematician :
where xx is in radians . Define a procedure ( tan - cf x k ) that computes an approximation to the tangent function based on Lambert ’s formula . k specifies the number of terms to compu... |
c981e4e68e05337295c6f06c3f282c7fdba170a2dac4b48e0fcf59a40b11a461 | realworldocaml/examples | int_interval_manual_sexp.mli | open Core.Std
type t
val t_of_sexp : Sexp.t -> t
val sexp_of_t : t -> Sexp.t
val is_empty : t -> bool
val create : int -> int -> t
val contains : t -> int -> bool
| null | https://raw.githubusercontent.com/realworldocaml/examples/32ea926861a0b728813a29b0e4cf20dd15eb486e/code/sexpr/int_interval_manual_sexp.mli | ocaml | open Core.Std
type t
val t_of_sexp : Sexp.t -> t
val sexp_of_t : t -> Sexp.t
val is_empty : t -> bool
val create : int -> int -> t
val contains : t -> int -> bool
| |
fae0638c72f713a54cf1c3a3f925dec50bd70eb68cab7f7cfe6f38a703adb703 | aeternity/aeternity | aec_coinbase_gen.erl | %%%-------------------------------------------------------------------
( C ) 2018 , Aeternity Anstalt
%%% @doc
%%% Calculate coinbase table to meet a given inflation curve.
%%% @end
%%%-------------------------------------------------------------------
-module(aec_coinbase_gen).
-export([ csv_file/2
, c... | null | https://raw.githubusercontent.com/aeternity/aeternity/b7ce6ae15dab7fa22287c2da3d4405c29bb4edd7/apps/aecore/src/aec_coinbase_gen.erl | erlang | -------------------------------------------------------------------
@doc
Calculate coinbase table to meet a given inflation curve.
@end
-------------------------------------------------------------------
No coinbase at genesis block | ( C ) 2018 , Aeternity Anstalt
-module(aec_coinbase_gen).
-export([ csv_file/2
, csv_file/3
, erlang_module/2
, erlang_module/3
]).
-define(INITIAL_TOKENS, 276450333499323152460728285).
365 * 24 * 20
2 * 24 * 20 ( 2 days )
-define(MULTIPLIER, 1000000000000000000).
erlang_modul... |
7a37c433d67a23a93fd3c3bd2ab72436b05e2f743008dc8be6b93a89f322f885 | elastic/eui-cljs | delay_render.cljs | (ns eui.delay-render
(:require ["@elastic/eui/lib/components/delay_render/delay_render.js" :as eui]))
(def EuiDelayRender eui/EuiDelayRender)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/delay_render.cljs | clojure | (ns eui.delay-render
(:require ["@elastic/eui/lib/components/delay_render/delay_render.js" :as eui]))
(def EuiDelayRender eui/EuiDelayRender)
| |
fe1fc09801c85f085fd8bd45cb9bd54763551ba876f27daff6652e1dcaf063d9 | avsm/platform | uucp_name.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/uucp.12.0.0%2Bdune/src/uucp_name.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | |
1a157e9ecbe89ebf7f4c792ed7e05508cd9facba0e398d81dcf2cfb58a1f0195 | tokenmill/beagle | annotation_merger.clj | (ns beagle.annotation-merger)
(defn related-annotations? [anno1 anno2]
(<= (:begin-offset anno1) (:begin-offset anno2) (:end-offset anno1)))
(defn parent-child-annotations? [parent-anno child-anno]
(and (>= (:begin-offset child-anno) (:begin-offset parent-anno))
(<= (:end-offset child-anno) (:end-offset pa... | null | https://raw.githubusercontent.com/tokenmill/beagle/863ffa63364e9ae7e7a22a3c7e258fd02ace1632/src/beagle/annotation_merger.clj | clojure | (ns beagle.annotation-merger)
(defn related-annotations? [anno1 anno2]
(<= (:begin-offset anno1) (:begin-offset anno2) (:end-offset anno1)))
(defn parent-child-annotations? [parent-anno child-anno]
(and (>= (:begin-offset child-anno) (:begin-offset parent-anno))
(<= (:end-offset child-anno) (:end-offset pa... | |
fa529a93401195b0579bb26b685c9492eba06d1c560a0265fca647a7dc456d9e | status-im/extensions-fiddle | hooks.cljs | (ns react-native-web.hooks
(:require-macros [react-native-web.views :refer [defview letsubs]])
(:require [react-native-web.react :as react]
[status-im.colors :as colors]
[re-frame.core :as re-frame]
[pluto.core :as pluto]
[clojure.string :as string]))
(defn wallet-se... | null | https://raw.githubusercontent.com/status-im/extensions-fiddle/3f3544e90ff0ecdb1dfd051886b5a5f28e506b0b/src/react_native_web/hooks.cljs | clojure | :flex-wrap :wrap | (ns react-native-web.hooks
(:require-macros [react-native-web.views :refer [defview letsubs]])
(:require [react-native-web.react :as react]
[status-im.colors :as colors]
[re-frame.core :as re-frame]
[pluto.core :as pluto]
[clojure.string :as string]))
(defn wallet-se... |
11053286b1ae63095d2e71754c0ee82b54293507a4675ed2ed8df531458778ed | 3b/3bil | util.lisp | (in-package :avm2-compiler)
;; pieces shared between both writers
;;; fixme: deal with package stuff, possibly reorganize stuff between asm/compiler...
(defun super-names (name)
(let ((c (when name (find-swf-class name))))
(when c
(cons (swf-name c) (super-names (extends c))))))
(defun push-lex-scope (m... | null | https://raw.githubusercontent.com/3b/3bil/c852181848bedf476373e901869ca29471f926ee/file/util.lisp | lisp | pieces shared between both writers
fixme: deal with package stuff, possibly reorganize stuff between asm/compiler...
fixme: allow class lookup instead of using class-id directly?
(false #x0a)
(format t "literals = ~s~%" (reverse literals))
(format t "circ = ~s~%" circularity-fixups)
(format t "--assemble-function ~s... | (in-package :avm2-compiler)
(defun super-names (name)
(let ((c (when name (find-swf-class name))))
(when c
(cons (swf-name c) (super-names (extends c))))))
(defun push-lex-scope (mn-index)
`((:get-lex ,(if (integerp mn-index) `(:id ,mn-index)mn-index))
(:push-scope)))
(defun new-class+scopes (cla... |
98a804a0e20cfadeb191168b935074f9c1ad50284313558bc1c6af432db3ccf2 | mjambon/mikmatch | charset.ml | module C = Set.Make (Char)
type t = C.t
let empty = C.empty
let add = C.add
let singleton = C.singleton
let union = C.union
let diff = C.diff
let add_range first last set =
let r = ref set in
for i = Char.code first to Char.code last do
r := add (Char.chr i) !r
done;
!r
let range c1 c2 = add_range c1 c... | null | https://raw.githubusercontent.com/mjambon/mikmatch/4ee0d1158370be247763027018bbf54b865014dd/common/charset.ml | ocaml | module C = Set.Make (Char)
type t = C.t
let empty = C.empty
let add = C.add
let singleton = C.singleton
let union = C.union
let diff = C.diff
let add_range first last set =
let r = ref set in
for i = Char.code first to Char.code last do
r := add (Char.chr i) !r
done;
!r
let range c1 c2 = add_range c1 c... | |
12307d19414f5db7bfe6dc19ea83a8ffc897c32031dd369476364ca812b46e0c | lambdacube3d/lambdacube-edsl | LCDSLType.hs | module LCDSLType where
import Data.Int
import Data.Word
import Data.Typeable
import LCType
import LCAPIType
-- IsScalar means here that the related type is not a tuple, but a GPU primitive type
class GPU a => IsScalar a where
toValue :: a -> Value
toType :: a -> InputType
instance (Typeable dim, Typ... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-edsl/4347bb0ed344e71c0333136cf2e162aec5941df7/lambdacube-core/tmp/archive/LCDSLType.hs | haskell | IsScalar means here that the related type is not a tuple, but a GPU primitive type
stream type restriction, these types can be used in vertex shader input
uniform type restriction
|Conversion between surface n-tuples and our tuple representation.
our language uses nested tuple representation
Tuple representation... | module LCDSLType where
import Data.Int
import Data.Word
import Data.Typeable
import LCType
import LCAPIType
class GPU a => IsScalar a where
toValue :: a -> Value
toType :: a -> InputType
instance (Typeable dim, Typeable sh, Typeable t, Typeable ar) => IsScalar (Sampler dim sh t ar) where
TODO
TO... |
f3c571459fb0809172a773ad54893a7088a0ade517c56e9dd496232451f5da24 | jiangpengnju/htdp2e | ex199.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-beginner-abbr-reader.ss" "lang")((modname ex199) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decima... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/arbitrarily-large-data/extended-exercises-lists/ex199.rkt | racket | about the language level of this file in a form that our tools can easily process.
Design insert-everywhere/in-all-words.
Start with a complete wish list entry. Supplement it with tests for empty lists,
Hints:
(1) Reconsider the examples.
the design recipe and systematically work through your wish list.
con... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex199) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
a list with one - letter word and another list with two - ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.