_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 |
|---|---|---|---|---|---|---|---|---|
f577ac2b09efebe6934ca5f3a34ae5c72c09422aff8dea26998a92c42b38e608 | kappelmann/engaging-large-scale-functional-programming | Exercise03.hs | module Exercise03 where
primeMayor :: Integer -> Integer
primeMayor income
| even income && income /= 2 = 2
| isPrime income = 1
| otherwise = 1 + primeMayor (primediff income)
isPrime :: Integer -> Bool
isPrime k
| k <= 2 = True
| otherwise = null [x | x <- [2 .. floor(sqrt $ fromIntegral k)],... | null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/8ed2c056fbd611f1531230648497cb5436d489e4/resources/contest/example_data/03/uploads/antitaktik/Exercise03.hs | haskell | module Exercise03 where
primeMayor :: Integer -> Integer
primeMayor income
| even income && income /= 2 = 2
| isPrime income = 1
| otherwise = 1 + primeMayor (primediff income)
isPrime :: Integer -> Bool
isPrime k
| k <= 2 = True
| otherwise = null [x | x <- [2 .. floor(sqrt $ fromIntegral k)],... | |
48309a62d6dd7f56357cb2a9b9960e5c8c4a1b6138edd2cd1e0734d8068151c1 | Javran/advent-of-code | Day4.hs | module Javran.AdventOfCode.Y2019.Day4 (
) where
import Control.Monad
import Data.List.Split hiding (sepBy)
import Javran.AdventOfCode.Prelude
data Day4 deriving (Generic)
solve :: Int -> Int -> [Int]
solve nFrom nTo = do
n <- [nFrom .. nTo]
[a, b, c, d, e, f] <- pure $ intToDigits n
guard $ and $ zipWith (<=... | null | https://raw.githubusercontent.com/Javran/advent-of-code/676ef13c2f9d341cf7de0f383335a1cf577bd73d/src/Javran/AdventOfCode/Y2019/Day4.hs | haskell | module Javran.AdventOfCode.Y2019.Day4 (
) where
import Control.Monad
import Data.List.Split hiding (sepBy)
import Javran.AdventOfCode.Prelude
data Day4 deriving (Generic)
solve :: Int -> Int -> [Int]
solve nFrom nTo = do
n <- [nFrom .. nTo]
[a, b, c, d, e, f] <- pure $ intToDigits n
guard $ and $ zipWith (<=... | |
a74a9bb3d39a7e5fab92f8519d257c7247406d36ce8a0d00c8335907d5687b39 | vikram/lisplibraries | dataseq.lisp |
(in-package :weblocks)
(export '(dataseq dataseq-view dataseq-data-class dataseq-class-store
dataseq-on-query dataseq-allow-sorting-p dataseq-sort
dataseq-allow-select-p dataseq-selection
dataseq-allow-drilldown-p dataseq-on-drilldown
dataseq-drilled-down-item
dataseq-autoset-drilled-down-item-p
dat... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/src/widgets/dataseq/dataseq.lisp | lisp | View information
Data binding information
Sorting
Selecting items
Drilling down on items
Mining bar configuration
Information flash widget
sorting, selecting, and drilling down on items;
pagination of the dataset; and
Initialization
Ensure data-class is specified
Ensure class-store is specified
Ensure pagi... |
(in-package :weblocks)
(export '(dataseq dataseq-view dataseq-data-class dataseq-class-store
dataseq-on-query dataseq-allow-sorting-p dataseq-sort
dataseq-allow-select-p dataseq-selection
dataseq-allow-drilldown-p dataseq-on-drilldown
dataseq-drilled-down-item
dataseq-autoset-drilled-down-item-p
dat... |
5bbdccdf8c1b5b7516d03fac5444065981f673ba72f08fddb7bb4a3d62114689 | alpmestan/servant | JQuery.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleInstances #
-----------------------------------------------------------------------------
-- |
-- Module : Servant.JQuery
Copyright : ( C ) 2014
-- License : BSD3
Maintainer : < >
-- Stability : experimental
-- Portabil... | null | https://raw.githubusercontent.com/alpmestan/servant/d67b5e1f3e9af4b249f95ed72dcaebc4ce328a96/servant-jquery/src/Servant/JQuery.hs | haskell | ---------------------------------------------------------------------------
|
Module : Servant.JQuery
License : BSD3
Stability : experimental
Portability : non-portable | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleInstances #
Copyright : ( C ) 2014
Maintainer : < >
module Servant.JQuery
( jquery
, generateJS
, printJS
, module Servant.JQuery.Internal
) where
import Control.Lens
import Data.List
import Data.Monoid
import Data.Proxy
i... |
f4a25c7e5785ae82e6fb42c594f83985fc224d1b602b521e3a609185fcc1864e | noinia/hgeometry | TriangulateWorld.hs | # LANGUAGE ScopedTypeVariables #
module Demo.TriangulateWorld where
import Algorithms.Geometry.LineSegmentIntersection (hasSelfIntersections)
import Algorithms.Geometry.LineSegmentIntersection.BentleyOttmann (interiorIntersections)
import Algorithms.Geometry.PolygonTriangulation.MakeMonot... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-examples/src/Demo/TriangulateWorld.hs | haskell | ------------------------------------------------------------------------------
writeIpeFile outFile . singlePageFromContent $ out | # LANGUAGE ScopedTypeVariables #
module Demo.TriangulateWorld where
import Algorithms.Geometry.LineSegmentIntersection (hasSelfIntersections)
import Algorithms.Geometry.LineSegmentIntersection.BentleyOttmann (interiorIntersections)
import Algorithms.Geometry.PolygonTriangulation.MakeMonot... |
5dd70f860e9d19d5a3f9d307dfc98e60ee918c3c8fd80690d91b0106b9918e56 | christoff-buerger/racr | lexer.scm | ; This program and the accompanying materials are made available under the
terms of the MIT license ( X11 license ) which accompanies this distribution .
Author :
#!r6rs
(library
(siple lexer)
(export
token-source
token-line
token-column
token-type
token-value
construct-lexer)
(import (rnrs) (si... | null | https://raw.githubusercontent.com/christoff-buerger/racr/ecb2a9b8bf3f333550728cf45b97607a8298532f/examples/siple/lexer.scm | scheme | This program and the accompanying materials are made available under the
Abort lexing with error message
Complicated token processing functions:
Carriage return
Backspace
Formfeed
Read sequence of digits
Read integer or real
Consume the "."
Read sequence of hexadecimal digits
Read sequence of letters and dig... | terms of the MIT license ( X11 license ) which accompanies this distribution .
Author :
#!r6rs
(library
(siple lexer)
(export
token-source
token-line
token-column
token-type
token-value
construct-lexer)
(import (rnrs) (siple exception-api))
(define-record-type token
(nongenerative siple:le... |
1a1f0c90d5b20854b89ed0b6a4088312b344c47bd7826bdc9920f10c8f4be039 | langston-barrett/CoverTranslator | Abs.hs | module Cl.Abs where
Haskell module generated by the BNF converter
newtype Ident = Ident String deriving (Eq,Ord,Show)
data Id =
Qname Ident Ident
deriving (Eq,Ord,Show)
data Exp =
Evar Id
| Efun Id
| Econ Id
| Eapp Exp Exp
deriving (Eq,Ord,Show)
data Pat =
Pvar Id
| Pcon Id [Pat]
deriving (Eq,O... | null | https://raw.githubusercontent.com/langston-barrett/CoverTranslator/4172bef9f4eede7e45dc002a70bf8c6dd9a56b5c/src/Cl/Abs.hs | haskell | module Cl.Abs where
Haskell module generated by the BNF converter
newtype Ident = Ident String deriving (Eq,Ord,Show)
data Id =
Qname Ident Ident
deriving (Eq,Ord,Show)
data Exp =
Evar Id
| Efun Id
| Econ Id
| Eapp Exp Exp
deriving (Eq,Ord,Show)
data Pat =
Pvar Id
| Pcon Id [Pat]
deriving (Eq,O... | |
4427e91aed6f9b9d6026de4af2676d5a8718f229f6e47ad85f0eb1c41314c60a | jarohen/yoyo | jdbc_pool.clj | (ns yoyo.jdbc-pool
(:require [yoyo.core :as yc]
[clojure.tools.logging :as log])
(:import [org.apache.commons.dbcp2 BasicDataSource]))
(def known-drivers
{"postgresql" "org.postgresql.Driver"
"mysql" "com.mysql.jdbc.Driver"
"mssql" "com.microsoft.sqlserver.jdbc.SQLServerDriver"
"odbc" "sun.j... | null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/modules/jdbc-pool/src/yoyo/jdbc_pool.clj | clojure | (ns yoyo.jdbc-pool
(:require [yoyo.core :as yc]
[clojure.tools.logging :as log])
(:import [org.apache.commons.dbcp2 BasicDataSource]))
(def known-drivers
{"postgresql" "org.postgresql.Driver"
"mysql" "com.mysql.jdbc.Driver"
"mssql" "com.microsoft.sqlserver.jdbc.SQLServerDriver"
"odbc" "sun.j... | |
b9d2343d507fed0d637ba6a3f7e81ceb5c7156c4280bfb65ebe54ce511b53936 | mbutterick/aoc-racket | 01.rkt | #lang br
(require racket/file rackunit)
(define (solve combo-length)
(for/first ([c (in-combinations (map string->number (file->lines "01.rktd")) combo-length)]
#:when (eq? 2020 (apply + c)))
(apply * c)))
(check-equal? (solve 2) 1007331)
(check-equal? (solve 3) 48914340) | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2020/01.rkt | racket | #lang br
(require racket/file rackunit)
(define (solve combo-length)
(for/first ([c (in-combinations (map string->number (file->lines "01.rktd")) combo-length)]
#:when (eq? 2020 (apply + c)))
(apply * c)))
(check-equal? (solve 2) 1007331)
(check-equal? (solve 3) 48914340) | |
d115071723f24117b274c75b182291e42ee41a485e599575b5f9b9c6618d47d6 | pallet/pallet | argument.clj | (ns pallet.argument
"Arguments to actions. Adds capability of evaluating arguments at
action application")
(def ^{:doc "Provides a session inside a delayed function. This should be
considered an implementation detail."
:dynamic true}
*session*)
(defprotocol DelayedArgument
"A protocol for passing arg... | null | https://raw.githubusercontent.com/pallet/pallet/30226008d243c1072dcfa1f27150173d6d71c36d/src/pallet/argument.clj | clojure | By default, arguments should evaluate to themselves | (ns pallet.argument
"Arguments to actions. Adds capability of evaluating arguments at
action application")
(def ^{:doc "Provides a session inside a delayed function. This should be
considered an implementation detail."
:dynamic true}
*session*)
(defprotocol DelayedArgument
"A protocol for passing arg... |
ecd4c1c2d05b8fa3059ec6bd2a8e7a40fe16b2191fd2b11936f1490cae397c2b | jeroanan/rkt-coreutils | uname.rkt | #lang s-exp "util/program/repl-program.rkt"
Copyright 2020
; See COPYING for details
(provide uname%)
(require "libc/utsname.rkt")
(define uname%
(class object%
(super-new)
(help-function "Print system information"
(list "(execute) -- Print system information"))
(on-execute-wit... | null | https://raw.githubusercontent.com/jeroanan/rkt-coreutils/571629d1e2562c557ba258b31ce454add2e93dd9/src/repl/uname.rkt | racket | See COPYING for details | #lang s-exp "util/program/repl-program.rkt"
Copyright 2020
(provide uname%)
(require "libc/utsname.rkt")
(define uname%
(class object%
(super-new)
(help-function "Print system information"
(list "(execute) -- Print system information"))
(on-execute-with-void
(displayln (un... |
37fffe5f190208a961e2437088f85819c9c2f1c531cfb97df7a1fb23a037736d | processone/ejabberd | mod_muc_opt.erl | %% Generated automatically
%% DO NOT EDIT: run `make options` instead
-module(mod_muc_opt).
-export([access/1]).
-export([access_admin/1]).
-export([access_create/1]).
-export([access_mam/1]).
-export([access_persistent/1]).
-export([access_register/1]).
-export([cleanup_affiliations_on_start/1]).
-export([db_type/1]... | null | https://raw.githubusercontent.com/processone/ejabberd/c3d8c3d9c5884dbe93b2d9d0aae33b82c356d6ec/src/mod_muc_opt.erl | erlang | Generated automatically
DO NOT EDIT: run `make options` instead |
-module(mod_muc_opt).
-export([access/1]).
-export([access_admin/1]).
-export([access_create/1]).
-export([access_mam/1]).
-export([access_persistent/1]).
-export([access_register/1]).
-export([cleanup_affiliations_on_start/1]).
-export([db_type/1]).
-export([default_room_options/1]).
-export([hibernation_timeout/1])... |
fc6022ab9798348d92a379925f14450282028245e2b27dfe45ae6124cd4f472d | clojurians-org/haskell-example | FrontendStateT.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE LambdaCase #
# LANGUAGE RecursiveDo #
# LANGUAGE OverloadedLabels #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DataKinds #
# LANGUAGE S... | null | https://raw.githubusercontent.com/clojurians-org/haskell-example/c96b021bdef52a121e04ea203c8c3e458770a25a/conduit-ui/frontend/src/Frontend/FrontendStateT.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE RecursiveDo #
# LANGUAGE OverloadedLabels #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE CPP , Flexibl... |
93ed4fb77dcd146b2ecd27c8db1987894ed7c33878867f8d45b437baa48a3c08 | ixy-languages/ixy.ml | pci_mirage.ml | module Make (Pci : Mirage_pci.S) = struct
open Ixy_core.Ixy_pci
include Pci
let map_resource t =
match Pci.bar0 t with
| None -> failwith "bar0 not mapped"
| Some cs -> cs.Cstruct.buffer
let get_config t =
{ vendor = Pci.vendor_id t
; device_id = Pci.device_id t
; class_code = Pci.clas... | null | https://raw.githubusercontent.com/ixy-languages/ixy.ml/e79dcc4a19afd8e531346c27624c54224f942dc9/mirage/pci_mirage.ml | ocaml | module Make (Pci : Mirage_pci.S) = struct
open Ixy_core.Ixy_pci
include Pci
let map_resource t =
match Pci.bar0 t with
| None -> failwith "bar0 not mapped"
| Some cs -> cs.Cstruct.buffer
let get_config t =
{ vendor = Pci.vendor_id t
; device_id = Pci.device_id t
; class_code = Pci.clas... | |
f083cf7cece32926c220e9fc0a033f94f46df2c108bf1426ede1a0c07c9581b8 | Ekdohibs/joujou | RawLambda.ml | (* Variables are strings. *)
type variable =
string
and constructor =
string
(* Every [let] binding is marked recursive or nonrecursive. *)
and recursive =
| Recursive
| NonRecursive
The four standard integer arithmetic operations are supported .
and binop =
| OpAdd
| OpSub
| OpMul
| OpDiv
(* Th... | null | https://raw.githubusercontent.com/Ekdohibs/joujou/02ef5052f93623da99ed2e871a59c99a5e6026a1/RawLambda.ml | ocaml | Variables are strings.
Every [let] binding is marked recursive or nonrecursive.
This language is the untyped lambda-calculus, extended with possibly
recursive [let] bindings, integer literals (that is, constants), integer
arithmetic operations, and the primitive operation [print], which prints an
integer ... |
type variable =
string
and constructor =
string
and recursive =
| Recursive
| NonRecursive
The four standard integer arithmetic operations are supported .
and binop =
| OpAdd
| OpSub
| OpMul
| OpDiv
and term_ =
| Var of variable
| Lam of variable * term
| App of term * term
| Lit of int... |
b425b681336d0501e58c69af58bf896aa2b0a9b95eaf6db700d04b89c908e34c | magthe/sandi | Util.hs | {-# LANGUAGE DeriveDataTypeable #-}
-- |
-- Module: Data.Conduit.Codec.Util
Copyright : ( c ) 2014
-- License: BSD3
module Data.Conduit.Codec.Util
( CodecDecodeException(..)
, encodeI
, decodeI
, decodeII
, encodeII
) where
import Data.Typeable (Typeable)
import Control.Exception (Exceptio... | null | https://raw.githubusercontent.com/magthe/sandi/a8ef86ec3798a640d86342421a7fa7fa97bdedd4/sandi/src/Data/Conduit/Codec/Util.hs | haskell | # LANGUAGE DeriveDataTypeable #
|
Module: Data.Conduit.Codec.Util
License: BSD3 | Copyright : ( c ) 2014
module Data.Conduit.Codec.Util
( CodecDecodeException(..)
, encodeI
, decodeI
, decodeII
, encodeII
) where
import Data.Typeable (Typeable)
import Control.Exception (Exception)
import Data.ByteString as BS (ByteString, append, null)
import Data.Conduit (ConduitT, awa... |
c3f77f35c4d9462f4190b04ad1881db0c5b263041b3400230e23f3393731c68f | ultralisp/ultralisp | dist.lisp | (defpackage #:ultralisp/widgets/dist
(:use #:cl)
(:import-from #:reblocks/request)
(:import-from #:ultralisp/protocols/url)
(:import-from #:ultralisp/protocols/external-url)
(:import-from #:ultralisp/models/dist)
(:import-from #:reblocks/widget
#:defwidget)
(:import-from #:ultralisp/widget... | null | https://raw.githubusercontent.com/ultralisp/ultralisp/6b0f8e10037c5f87eed4046822af9c945f3c0188/src/widgets/dist.lisp | lisp | Before output we'll sort projects by name
TODO: Maybe add a button to add some projects?
make a database query only when widget gets created, not
during the render. | (defpackage #:ultralisp/widgets/dist
(:use #:cl)
(:import-from #:reblocks/request)
(:import-from #:ultralisp/protocols/url)
(:import-from #:ultralisp/protocols/external-url)
(:import-from #:ultralisp/models/dist)
(:import-from #:reblocks/widget
#:defwidget)
(:import-from #:ultralisp/widget... |
13e8675e0c635130964356c8b57d24dd8e045dfeade776611c839e87a8878982 | RestitutorOrbis/adventura | adventura.hs | import System.Random
import Data.List
import Control.Monad
import Control.Monad.Random
import Labyrinth
import Hero
import Enemies
import Utilities
import Weapons
generateWeaponHit:: Float->StdGen->Bool
generateWeaponHit weaponHitChance gen =
let (r,_)=randomR (0,1) gen :: (Float,StdGen)
in if r<weaponHitChance t... | null | https://raw.githubusercontent.com/RestitutorOrbis/adventura/2bea02254e1c9583f8557b8a825bb9388bbb2c14/adventura.hs | haskell | import System.Random
import Data.List
import Control.Monad
import Control.Monad.Random
import Labyrinth
import Hero
import Enemies
import Utilities
import Weapons
generateWeaponHit:: Float->StdGen->Bool
generateWeaponHit weaponHitChance gen =
let (r,_)=randomR (0,1) gen :: (Float,StdGen)
in if r<weaponHitChance t... | |
24e088d99714e17e1b1e37cc6845206b87e98009b0ad8682679fd43514fe0ee6 | metaocaml/ber-metaocaml | mylib.ml | let foo1 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
let foo2 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
external func_with_10_params:
int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit
= "ml_func_with_10_params_bytecode" "ml_func_with_1... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/unwind/mylib.ml | ocaml | let foo1 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
let foo2 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
external func_with_10_params:
int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit
= "ml_func_with_10_params_bytecode" "ml_func_with_1... | |
63a6c87f3dc1060e361d56e8e5dfddfadd2847e4fe41c9f654c9c7eb90252ac7 | HealthSamurai/stresty | http_test.clj | (ns stresty.server.http-test
(:require [stresty.server.http :as sut]
[zen.core :as zen]
[matcho.core :as matcho]
[clojure.test :as t]))
(t/deftest test-server
(def ztx (zen/new-context {}))
(zen/read-ns ztx 'sty)
(matcho/match
(sut/route ztx {:uri "/" :request-method :ge... | null | https://raw.githubusercontent.com/HealthSamurai/stresty/5121cd35f71ffde2c1d7cd50be19716b35fdc9d9/test/stresty/server/http_test.clj | clojure | (matcho/match
{:uri "/do-patch"
:request-method :patch
:body {:attr "val"}} )
:body {:attr "val"}}) | (ns stresty.server.http-test
(:require [stresty.server.http :as sut]
[zen.core :as zen]
[matcho.core :as matcho]
[clojure.test :as t]))
(t/deftest test-server
(def ztx (zen/new-context {}))
(zen/read-ns ztx 'sty)
(matcho/match
(sut/route ztx {:uri "/" :request-method :ge... |
ffad154126a52fd81503f0348551e0295e124efd378e97a0ab22a01cfadf5e5b | ghcjs/ghcjs-dom | SubtleCrypto.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.SubtleCrypto
(js_encrypt, encrypt, encrypt_, js_decrypt, decrypt, decrypt_,
js_... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SubtleCrypto.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/WebKitSubtleCrypto.verify Mozilla WebKitSubtleCrypto.verify documentation>
| <-US/docs/Web/API/WebKitSubtleCrypto.verify Mozilla WebKitSubtleCrypto.verify documentation>
| <-US/docs/Web/API/WebKitSubtle... | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.SubtleCrypto
(js_encrypt, encrypt, encrypt_, js_decrypt, decrypt, decrypt_,
js_sign, sign, sign_, js_verify, verify, verify_, js_digest,
digest, digest_, js_deriveKey, de... |
b203bd1497e516c5412b5d37f1edb22ee60102557a1d5e0f324f8aeb004fea6e | melange-re/melange | ppx_rescript_compat.ml | Copyright ( C ) 2022- Authors of Melange
*
* This program 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 ) any later version .... | null | https://raw.githubusercontent.com/melange-re/melange/b595c2647a285e8bb8b16f109d0ab0fbfa22afa3/jscomp/napkin/ppx_rescript_compat/ppx_rescript_compat.ml | ocaml | let [@warning "a"] {a;b} = c in body
The attribute is attached to value binding,
after the transformation value binding does not exist so we attach
the attribute to the whole expression, in general, when shuffuling the ast
it is very hard to place attributes correctl... | Copyright ( C ) 2022- Authors of Melange
*
* This program 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 ) any later version .... |
6b5f26b0d6f5913579831ded3047dd9d0359e686276efca258ccb1bf17f4acf6 | ekmett/unboxed | Levitation.hs | {-# Language TypeFamilies #-}
{-# Language ConstraintKinds #-}
{-# Language StandaloneKindSignatures #-}
{-# Language RankNTypes #-}
{-# Language PolyKinds #-}
module Unboxed.Internal.Levitation
( Lev
) where
import GHC.Types (TYPE, Type, Constraint)
-------------------------------------------------------------... | null | https://raw.githubusercontent.com/ekmett/unboxed/4f5e0f46021cf9aae6eacdd81af29a8667b8cb49/internal/Unboxed/Internal/Levitation.hs | haskell | # Language TypeFamilies #
# Language ConstraintKinds #
# Language StandaloneKindSignatures #
# Language RankNTypes #
# Language PolyKinds #
------------------------------------------------------------------------------
* Levitation by name
------------------------------------------------------------------------------
... |
module Unboxed.Internal.Levitation
( Lev
) where
import GHC.Types (TYPE, Type, Constraint)
, maxBound : : a
GHC rightfully rejects this . However , if we use
, maxBound : : ( ( ) ~ ( ) ) = > a
Now , in core , Bounded 's maxBound takes an argument , which is trivally passed by the compiler
and `... |
dfd3e7cd3dfa50d0fb1a80e63a1a47fdd42bbbbeca1aec22a97be765c50ba1a7 | pepeiborra/threepenny-editors | Validation.hs | {- | Simple helpers to perform validation of user input.
@
-- update only if valid
value <- accumB emptyValue updateIfValid userEdits
-- collect validation warnings
warnings <- stepper ok validate userEdits
@
-}
module Graphics.UI.Threepenny.Editors.Validation
( ValidationResult
, ok
... | null | https://raw.githubusercontent.com/pepeiborra/threepenny-editors/2d57aedfdf395d67d193181dc438fe4fbf75081d/src/Graphics/UI/Threepenny/Editors/Validation.hs | haskell | | Simple helpers to perform validation of user input.
@
-- update only if valid
value <- accumB emptyValue updateIfValid userEdits
-- collect validation warnings
warnings <- stepper ok validate userEdits
@
| All is good
| Create a validation result from a list of warnings.
> fromWarni... |
module Graphics.UI.Threepenny.Editors.Validation
( ValidationResult
, ok
, fromWarnings
, getWarnings
, Validable(..)
, isValid
, updateIfValid
) where
newtype ValidationResult = ValidationResult [String]
ok :: ValidationResult
ok = ValidationResult []
fromWarnings :: [String] -> ValidationResult
fr... |
9ff64ed166769e80d2111d78dfc1c247cffc2ffb46122a83c61d1ac64b1f3fc5 | cfcs/mirage-framebuffer | test_tsdl.ml | open Lwt.Infix
module Make(FB:Framebuffer.S) = struct
let pp_events fb () =
let rec loop () =
FB.recv_event fb >>= fun ev ->
Logs.app (fun m -> m "%a" Framebuffer.pp_backend_event ev) ;
let open Framebuffer__Keycodes in
begin match ev with
| Keypress {pressed ; scancode; mask; key... | null | https://raw.githubusercontent.com/cfcs/mirage-framebuffer/f63d54dd86f4ab723cc471fbf127d5fc105aa656/test_tsdl/test_tsdl.ml | ocaml | rainbow fb () >>=
draw_pixels fb >>= fun () ->
draw_a_letter fb () >>=
terminal >>= | open Lwt.Infix
module Make(FB:Framebuffer.S) = struct
let pp_events fb () =
let rec loop () =
FB.recv_event fb >>= fun ev ->
Logs.app (fun m -> m "%a" Framebuffer.pp_backend_event ev) ;
let open Framebuffer__Keycodes in
begin match ev with
| Keypress {pressed ; scancode; mask; key... |
2c2c88b091a3bca8eba2a93b07fee877ff4a06d497e0c0e79e9faeb4e71de655 | khibino/haskell-relational-record | Unsafe.hs | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
-- |
-- Module : Database.Relational.Pi.Unsafe
Copyright : 2013 - 2019
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- This module defines typed pr... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/relational-query/src/Database/Relational/Pi/Unsafe.hs | haskell | |
Module : Database.Relational.Pi.Unsafe
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
This module defines typed projection path objects.
Contains internal structure and unsafe interfaces.
* Projection path
* Deprecated
| Projection path primary structure type.
| ... | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
Copyright : 2013 - 2019
module Database.Relational.Pi.Unsafe (
Pi,
width', width,
(<.>), (<?.>), (<?.?>),
pi,
definePi, defineDirectPi', defineDirectPi,
expandIndexes', expandIndexes,
unsa... |
aecec62fa30a6245e67054b39ee633aecde86275084ec1d20968abc7ecadd8cc | mark-watson/Clojure-AI-Book-Code | core_test.clj | (ns nlp-libpython-spacy.core-test
(:require [clojure.test :as test]
[nlp-libpython-spacy.core :as sp]))
(def test-text "John Smith worked for IBM in Mexico last year and earned $1 million in salary and bonuses.")
(test/deftest tokenization-test
(test/testing "tokenization test"
(test/is (= 033 (co... | null | https://raw.githubusercontent.com/mark-watson/Clojure-AI-Book-Code/8d1b1ba4347b1ab3bf5971a9a5a275ab6fb95b7f/nlp_libpython/test/nlp_libpython_spacy/core_test.clj | clojure | (ns nlp-libpython-spacy.core-test
(:require [clojure.test :as test]
[nlp-libpython-spacy.core :as sp]))
(def test-text "John Smith worked for IBM in Mexico last year and earned $1 million in salary and bonuses.")
(test/deftest tokenization-test
(test/testing "tokenization test"
(test/is (= 033 (co... | |
2f97bee7218d4af10ce4d2059428231a2aaa1d9a35513fb579f4e1487179eda2 | TrustInSoft/tis-kernel | cabs2cil_BlockChunk.ml | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/kernel_internals/typing/cabs2cil_BlockChunk.ml | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
Copyright ( C ) 2001 - 2003
< > ... |
6be95a6dfb310e09edf7628d496c5435e65af61c05862551e277216886553694 | ghc/packages-Cabal | Class.hs | -----------------------------------------------------------------------------
-- |
-- Module : Bio.Character.Exportable.Class
Copyright : ( c ) 2015 - 2015 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- Class for needed operatio... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/Regression/T5309/lib/Bio/Character/Exportable/Class.hs | haskell | ---------------------------------------------------------------------------
|
Module : Bio.Character.Exportable.Class
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
Class for needed operations of coded sequences and characters
-------------------------------... | Copyright : ( c ) 2015 - 2015 Ward Wheeler
# LANGUAGE FlexibleContexts , FlexibleInstances , FunctionalDependencies , MultiParamTypeClasses #
module Bio.Character.Exportable.Class where
import Foreign.C.Types
class Exportable c where
toExportableBuffer :: c -> ExportableCharacterSequence
from... |
967c812cdc92af8c83158712335c4ac099cc23fe4839863491a2ae49344a730e | seckcoder/course-compiler | r4_10.rkt | (define (uhoh [x : Integer]) : Integer
(if (eq? x 0)
(uhoh x)
x))
(uhoh 42)
| null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/student-tests/r4_10.rkt | racket | (define (uhoh [x : Integer]) : Integer
(if (eq? x 0)
(uhoh x)
x))
(uhoh 42)
| |
96dbced40c6b124942542df90f8d79bca441f47649b6a6556ecd09649e8ce276 | manavpatnaik/haskell | 4_F_to_C.hs | convertFtoC :: (Fractional a) => a -> a
convertFtoC f = (5*(f-32)) / (9)
main = do
print(convertFtoC (-40)) | null | https://raw.githubusercontent.com/manavpatnaik/haskell/af45c3eb5c3461aa77cf25610dfcb3b41c7f7ef9/practice-set-1-basics/4_F_to_C.hs | haskell | convertFtoC :: (Fractional a) => a -> a
convertFtoC f = (5*(f-32)) / (9)
main = do
print(convertFtoC (-40)) | |
c655a80c93fd3c8236da5dbfbc8b8b2906631567ca726ab2e54fd1478159156b | exercism/scheme | example.scm | (import (rnrs)
(rnrs arithmetic bitwise))
(define (sieve N)
(cond ((> N 4) (run-eratosthenes N))
(else (filter (lambda (p)
(<= p N))
'(2 3)))))
(define (run-eratosthenes N)
(define bits (eratosthenes-sieve N))
alternate dk = 2 or 4
(cond ((> k N)... | null | https://raw.githubusercontent.com/exercism/scheme/aa880e6222a393fcf5d672decb5c5dd6fae286ff/exercises/practice/sieve/.meta/example.scm | scheme | help for dealing with bitvector | (import (rnrs)
(rnrs arithmetic bitwise))
(define (sieve N)
(cond ((> N 4) (run-eratosthenes N))
(else (filter (lambda (p)
(<= p N))
'(2 3)))))
(define (run-eratosthenes N)
(define bits (eratosthenes-sieve N))
alternate dk = 2 or 4
(cond ((> k N)... |
c1e0837ae355263417c1f11d63806f12e040705ab820f00902fa857c4d19ea2e | semilin/layoup | Foalmak.lisp |
(MAKE-LAYOUT :NAME "Foalmak" :MATRIX
(APPLY #'KEY-MATRIX '("bx,wvz/utk" "foalsneigh" "p'.mcqjydr"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/Foalmak.lisp | lisp |
(MAKE-LAYOUT :NAME "Foalmak" :MATRIX
(APPLY #'KEY-MATRIX '("bx,wvz/utk" "foalsneigh" "p'.mcqjydr"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
4c40dad051d77475b68b54295df6024a8c4fa951a94150fb2b1b3fbd541840a7 | helium/erlang-tc | tc_key_share.erl | -module(tc_key_share).
-export([
new/3,
is_key_share/1,
encrypt/2,
decrypt_share/2,
verify_decryption_share/3,
combine_decryption_shares/3,
verify/3,
sign_share/2,
verify_signature_share/3,
combine_signature_shares/2,
serialize/1,
deserialize/1,
deal/2
]).
-export([... | null | https://raw.githubusercontent.com/helium/erlang-tc/b3ef1d5541586f5c85b6d231345a921d57be32a3/src/tc_key_share.erl | erlang | indexed from 0! | -module(tc_key_share).
-export([
new/3,
is_key_share/1,
encrypt/2,
decrypt_share/2,
verify_decryption_share/3,
combine_decryption_shares/3,
verify/3,
sign_share/2,
verify_signature_share/3,
combine_signature_shares/2,
serialize/1,
deserialize/1,
deal/2
]).
-export([... |
4b9fa5336c3debd7ec4ed6b3f6bdf359d39bd40b74b6ed4558fc74e379ac6c38 | cffi/cffi | cffi-sbcl.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
cffi-sbcl.lisp --- CFFI - SYS implementation for SBCL .
;;;
Copyright ( C ) 2005 - 2006 , < >
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , ... | null | https://raw.githubusercontent.com/cffi/cffi/33970351e71bb5f12ba56fc40270089e948ae112/src/cffi-sbcl.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to... | cffi-sbcl.lisp --- CFFI - SYS implementation for SBCL .
Copyright ( C ) 2005 - 2006 , < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDE... |
f764d5df30c0f8932d89e35f43fbbfb406512670e8e2861df1b8ca512cfa9100 | plumatic/grab-bag | tags_test.clj | (ns domain.docs.tags-test
(:use clojure.test plumbing.core plumbing.test)
(:require
[schema.core :as s]
[domain.doc-test-utils :as doc-test-utils]
[domain.docs.tags :as tags]))
(deftest update-tags-test
(let [user1 {:type :user
:date 123
:user-id 10
:tag "off... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/domain/test/domain/docs/tags_test.clj | clojure | (ns domain.docs.tags-test
(:use clojure.test plumbing.core plumbing.test)
(:require
[schema.core :as s]
[domain.doc-test-utils :as doc-test-utils]
[domain.docs.tags :as tags]))
(deftest update-tags-test
(let [user1 {:type :user
:date 123
:user-id 10
:tag "off... | |
e1995548f5189db8e7d6e44fa60bd1e704ddce18349b8f1157a7d9a03df1374d | sbcl/sbcl | special-forms.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no wa... | null | https://raw.githubusercontent.com/sbcl/sbcl/535130312323c74fbabd1142c2b3cd873f1c1559/src/interpreter/special-forms.lisp | lisp | more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
should never store this
Given a list of FORMS, return a vector of SEXPRs that will eval those.
Pathological silly examples:
1) Loop using a... | This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-INTERPRETER")
Return a THE form that wraps EXPRESSION , but if CTYPE is NIL ,
just return EXPRESSION .
(d... |
e35ebb8963d18e861d769eda63361349bb0ed77c1ed891d4dd92b363c6bf8df4 | merijn/Belewitte | Main.hs | # LANGUAGE LambdaCase #
module Main (main) where
import Options
import BarPlot (barPlot)
import Heatmap (plotHeatmap)
import Interesting (findInterestingVariants)
import PlotOptions (PlotCommand(..), commands)
main :: IO ()
main = runSqlMCommand commands $ \case
PlotBar config -> barPlot config
PlotHeatmap c... | null | https://raw.githubusercontent.com/merijn/Belewitte/55722e6374a7820b0d5925bc98cbd1686d4265a7/benchmark-analysis/plot-src/Main.hs | haskell | # LANGUAGE LambdaCase #
module Main (main) where
import Options
import BarPlot (barPlot)
import Heatmap (plotHeatmap)
import Interesting (findInterestingVariants)
import PlotOptions (PlotCommand(..), commands)
main :: IO ()
main = runSqlMCommand commands $ \case
PlotBar config -> barPlot config
PlotHeatmap c... | |
e2db590c4e804df691adee389f5b5b9b905766b8577cdf2625171222ea88f254 | eugeneia/athens | md2.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
md2.lisp -- the MD2 message digest algorithm from RFC 1319
(in-package :crypto)
(defconst +md2-permutation+
#8@(41 46 67 201 162 216 124 1 61 54 84 161 236 240 6
19 98 167 5 243 192 199 115 140 152 147 43 217 188
76 130 202 30 155 87 60 253 212 224 22 103 66 111 24... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/ironclad-v0.40/src/digests/md2.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*-
save original input and prepare encryption block
encrypt block
update checksum
pad with appropriate padding
extend the message with the checksum | md2.lisp -- the MD2 message digest algorithm from RFC 1319
(in-package :crypto)
(defconst +md2-permutation+
#8@(41 46 67 201 162 216 124 1 61 54 84 161 236 240 6
19 98 167 5 243 192 199 115 140 152 147 43 217 188
76 130 202 30 155 87 60 253 212 224 22 103 66 111 24
138 23 229 18 190 78 196 214 218 158 222 73 ... |
d02e1798f978de4d873bfa3a5e80ffac9a3db472d4df8557c2fcb5204520f525 | Helium4Haskell/helium | InfixDefaultAssoc.hs | module InfixDefaultAssoc where
main :: Int
main = 3 + 4 + 4
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/correct/InfixDefaultAssoc.hs | haskell | module InfixDefaultAssoc where
main :: Int
main = 3 + 4 + 4
| |
fef702e2524f03f293e305b76c7d06527104899677867db7e7dc6ddc44b37c5e | avsm/mirage-duniverse | expand.mli |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/odoc/src/xref/expand.mli | ocaml |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
347f8a3c4e0ba41131abd0df0e9c3b436fc8a0aecc1b87b95ea9db872df5834b | buildsome/buildsome | Argv0.hs | module Lib.Argv0 (getArgv0) where
import Prelude.Compat
import Data.ByteString (ByteString)
import Filesystem.Path.CurrentOS (encodeString)
import qualified Data.ByteString.Char8 as BS8
import qualified System.Argv0 as Argv0
getArgv0 :: IO ByteString
getArgv0 = BS8.pack . encodeString <$> Argv0.getArgv0
| null | https://raw.githubusercontent.com/buildsome/buildsome/479b92bb74a474a5f0c3292b79202cc850bd8653/src/Lib/Argv0.hs | haskell | module Lib.Argv0 (getArgv0) where
import Prelude.Compat
import Data.ByteString (ByteString)
import Filesystem.Path.CurrentOS (encodeString)
import qualified Data.ByteString.Char8 as BS8
import qualified System.Argv0 as Argv0
getArgv0 :: IO ByteString
getArgv0 = BS8.pack . encodeString <$> Argv0.getArgv0
| |
94dc5d516240e7136a4ae41722714bc3fbd22192cafeb35b6d8c4c9ae00c6931 | rohitjha/ProjectEuler | PE001.hs |
Author :
File : PE001.hs
July 5 , 2013
Problem 1 :
If we list all the natural numbers below 10 that are multiples of 3 or 5 , we get 3 , 5 , 6 and 9 . The sum of these multiples is 23 .
Find the sum of all the multiples of 3 or 5 below 1000 .
Author: Rohit Jha
File: PE001.hs
July 5, 2013
Problem 1:... | null | https://raw.githubusercontent.com/rohitjha/ProjectEuler/2f0a46bb1547b06a373c30966bba7a001b932bf4/Haskell/PE001.hs | haskell |
Author :
File : PE001.hs
July 5 , 2013
Problem 1 :
If we list all the natural numbers below 10 that are multiples of 3 or 5 , we get 3 , 5 , 6 and 9 . The sum of these multiples is 23 .
Find the sum of all the multiples of 3 or 5 below 1000 .
Author: Rohit Jha
File: PE001.hs
July 5, 2013
Problem 1:... | |
41e1d7eb8b22e4d15a8c593fd3ac1986935f00d93646463cd3cb073289af2a0d | brendanhay/gogol | Patch.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-storage/gen/Gogol/Storage/Objects/Patch.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Patches an object\'s metadata.
* Resource
** Constructing a Request
| A resource alias for @storage.objects.patch@ method which the
'StorageObjectsPatch' request conforms to.
| Patches an object\'s metadata.
/See:/ 'newSto... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
38a30bc9e8666d06e4781c75c201d2ecb7c4bf3c2b1f9e48b93bdba88b53aa2c | sylane/erod | erod_document_sup.erl | %%% ==========================================================================
Copyright ( c ) 2014 < >
%%%
%%% This file is part of erod.
%%%
%%% Erod 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 , eit... | null | https://raw.githubusercontent.com/sylane/erod/b0c435f8546ea38b1501d3e22614fe7951c61c9a/apps/erod/src/erod_document_sup.erl | erlang | ==========================================================================
This file is part of erod.
Erod is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the impli... | Copyright ( c ) 2014 < >
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
2014 < >
@author < >
@private
-module(erod_document_sup).
-author(... |
e6bdc2ed3695431956f249e7bbfb75f41297a69b5faadcf7e3905d69568f54a0 | geophf/1HaskellADay | Exercise.hs | module Y2017.M06.D07.Exercise where
-
So , here 's one of the questions Amazon asks developers to test their under-
standing of data structures .
You have a binary tree of the following structure :
A
/ \
/ \
B C
/ \ / \
D E F G
1 . create the Bin... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2017/M06/D07/Exercise.hs | haskell | }
}
define
-
such that:
>>> clockwiseEdgeTraversal abcdefg == clockwiseSmallTree
True
-
- BONUS -----------------------------------------------------------------
Simple enough, eh?
Now, does it work for the larger tree?
A
/ \
/ \
/ ... | module Y2017.M06.D07.Exercise where
-
So , here 's one of the questions Amazon asks developers to test their under-
standing of data structures .
You have a binary tree of the following structure :
A
/ \
/ \
B C
/ \ / \
D E F G
1 . create the Bin... |
1c59402c598f9bf6068e4a99d0417e1b429c163fa38442df2ccd3bb29a67696a | mflatt/shrubbery-rhombus-0 | srcloc.rkt | #lang racket/base
(require shrubbery/srcloc)
(provide syntax-srcloc
span-srcloc
relocate
respan-empty
respan
with-syntax-error-respan)
(define (span-srcloc start end)
(vector (syntax-source start)
(syntax-line start)
(syntax-column start)
(s... | null | https://raw.githubusercontent.com/mflatt/shrubbery-rhombus-0/240ff98508503bd818436a9e7e7f689b4d425ad3/rhombus/private/srcloc.rkt | racket | If the tail is empty, give it a source location
that matches the end of `op-stx`
this seems like a hack; maybe 'group should get a source location, too | #lang racket/base
(require shrubbery/srcloc)
(provide syntax-srcloc
span-srcloc
relocate
respan-empty
respan
with-syntax-error-respan)
(define (span-srcloc start end)
(vector (syntax-source start)
(syntax-line start)
(syntax-column start)
(s... |
c0c5c5917ee0dfd6c6336a8fac1306736753c0a28d0444681c362aa1addeaaa1 | facebook/infer | CViewControllerLifecycle.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/432243b21f4990c3071ba0b3ee2a472a215be1c6/infer/src/clang/CViewControllerLifecycle.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
3dc8ea9dd68a03b47458ec7d6eef474f2a1fd0741591aa8fdaeaf1a6b10198c7 | zyla/ceburilo | Graph.hs | # LANGUAGE DeriveGeneric , DeriveAnyClass #
module Ceburilo.Graph (
Graph
, buildGraph
, generateRoute
) where
import Data.HashSet as S
import Data.IntMap.Strict as IM
import Data.Graph.AStar as AS
import Ceburilo.Types
import GHC.Generics
import Control.DeepSeq
type Distance = Float
type Graph = IM.IntMap ... | null | https://raw.githubusercontent.com/zyla/ceburilo/7bb24940759bee7b3dff3407fcb093ebf130e710/src/Ceburilo/Graph.hs | haskell | in milliseconds
very unsafe, but a* has proper assumption
nodeKey will exist in DB!
In case you needed, change [] case for debugging
error "Node with given id already exist"
error "Path leads to not existing node" | # LANGUAGE DeriveGeneric , DeriveAnyClass #
module Ceburilo.Graph (
Graph
, buildGraph
, generateRoute
) where
import Data.HashSet as S
import Data.IntMap.Strict as IM
import Data.Graph.AStar as AS
import Ceburilo.Types
import GHC.Generics
import Control.DeepSeq
type Distance = Float
type Graph = IM.IntMap ... |
d367a09eb06500541c76e5d28fbfde93b410762e36c52f8bfdc3b3bbb1a65a98 | degree9/enterprise | spec.cljs | (ns degree9.pathway.spec
(:require [clojure.spec.alpha :as spec]))
(spec/def ::not-empty
#(not (empty? %)))
(spec/def ::path
(spec/tuple (spec/or :str string? :reg regexp? :key keyword? :set set? :nil nil?) ::pathway))
(spec/def ::ordered
(spec/and vector?
::not-empty
(spec/coll-of ::path)))
(spec/d... | null | https://raw.githubusercontent.com/degree9/enterprise/36e4f242c18b1dde54d5a15c668b17dc800c01ff/src/degree9/pathway/spec.cljs | clojure | (ns degree9.pathway.spec
(:require [clojure.spec.alpha :as spec]))
(spec/def ::not-empty
#(not (empty? %)))
(spec/def ::path
(spec/tuple (spec/or :str string? :reg regexp? :key keyword? :set set? :nil nil?) ::pathway))
(spec/def ::ordered
(spec/and vector?
::not-empty
(spec/coll-of ::path)))
(spec/d... | |
476334c54b2baf0edb7daa6a270250cad210c3b65301b77f3c5f50e14a487eb8 | ocurrent/ocaml-ci | build.mli | (** Build and test all opam packages. *)
val v :
platforms:Platform.t list Current.t ->
repo:Repo_id.t Current.t ->
spec:Spec.t Current.t ->
Current_git.Commit.t Current.t ->
([> `Built | `Checked ] Current_term.Output.t * Current.job_id option)
Current.t
* Build and test all the opam packages in a given b... | null | https://raw.githubusercontent.com/ocurrent/ocaml-ci/bac90619e2404a4761e8dcd95fe87b64489f7739/lib/build.mli | ocaml | * Build and test all opam packages.
* Create an obuilder spec for the [base], [repo], [variant] and [ty]. |
val v :
platforms:Platform.t list Current.t ->
repo:Repo_id.t Current.t ->
spec:Spec.t Current.t ->
Current_git.Commit.t Current.t ->
([> `Built | `Checked ] Current_term.Output.t * Current.job_id option)
Current.t
* Build and test all the opam packages in a given build context on the given
platform ... |
8516f626265bd14b4c6a0aecf6bbae61ee267076b98e2a603c8db3f96356c920 | qfpl/reflex-realworld-example | Profile.hs | # LANGUAGE FlexibleContexts , GADTs , LambdaCase , MultiParamTypeClasses , OverloadedStrings #
{-# LANGUAGE PatternSynonyms #-}
module Frontend.Profile where
import Reflex.Dom.Core
import Control.Monad.Fix (MonadFix)
import Data.Bool (boo... | null | https://raw.githubusercontent.com/qfpl/reflex-realworld-example/aca3125e036fbb5edd3a20d0e5a13ec73eaa6fcb/frontend/src/Frontend/Profile.hs | haskell | # LANGUAGE PatternSynonyms # | # LANGUAGE FlexibleContexts , GADTs , LambdaCase , MultiParamTypeClasses , OverloadedStrings #
module Frontend.Profile where
import Reflex.Dom.Core
import Control.Monad.Fix (MonadFix)
import Data.Bool (bool)
import Data.Functor (void)
import Obelisk.Route.Frontend (pattern (:/), R, RouteTo... |
0e9ae8c20cf0891e86b147ca52050c05ab9eddde43da7fd3db92f5866f0fbdd5 | uhc/uhc | IdMap.hs | -----------------------------------------------------------------------
The Core Assembler .
Copyright 2001 , . All rights reserved . This file
is distributed under the terms of the GHC license . For more
information , see the file " license.txt " , which is included in
the distribution .
... | null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/src/lvm/Common/IdMap.hs | haskell | ---------------------------------------------------------------------
---------------------------------------------------------------------
----------------------------------------------------------------------}
exotic: used by core compiler
--------------------------------------------------------------
---------... | The Core Assembler .
Copyright 2001 , . All rights reserved . This file
is distributed under the terms of the GHC license . For more
information , see the file " license.txt " , which is included in
the distribution .
The Core Assembler.
Copyright 2001, Daan Leijen. All rights reserv... |
f547fdb6308eb56811f6a8ed4c6eee5ff1d9d770ef502b979f4ce773189b3aa1 | fulcrologic/fulcro | data_targeting_spec.clj | (ns com.fulcrologic.fulcro.algorithms.data-targeting-spec
(:require
[com.fulcrologic.fulcro.algorithms.data-targeting :as targeting]
[com.fulcrologic.fulcro.components :refer [defsc]]
[fulcro-spec.core :refer
[specification behavior assertions provided component when-mocking]]))
(defsc A [_ _])
(sp... | null | https://raw.githubusercontent.com/fulcrologic/fulcro/71ed79c650222567ac4a566513365a95f12657e3/src/test/com/fulcrologic/fulcro/algorithms/data_targeting_spec.clj | clojure | Unsupported:
"can replace an element in a to-many" | (ns com.fulcrologic.fulcro.algorithms.data-targeting-spec
(:require
[com.fulcrologic.fulcro.algorithms.data-targeting :as targeting]
[com.fulcrologic.fulcro.components :refer [defsc]]
[fulcro-spec.core :refer
[specification behavior assertions provided component when-mocking]]))
(defsc A [_ _])
(sp... |
25e981ca43549e2993f7e50011bf4030a273a50589dd1cae5c31df0518791de3 | bufferswap/ViralityEngine | window.lisp | (in-package #:virality)
(u:define-constant +window-event-names+
#(nil :show :hide nil :move :resize nil :minimize :maximize :restore
:mouse-focus-enter :mouse-focus-exit :keyboard-focus-enter
:keyboard-focus-exit :close nil nil)
:test #'equalp)
(defun on-window-show (data)
(declare (ignore data)))... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/input/window.lisp | lisp | (in-package #:virality)
(u:define-constant +window-event-names+
#(nil :show :hide nil :move :resize nil :minimize :maximize :restore
:mouse-focus-enter :mouse-focus-exit :keyboard-focus-enter
:keyboard-focus-exit :close nil nil)
:test #'equalp)
(defun on-window-show (data)
(declare (ignore data)))... | |
5b1da17f5dca04732aa88da63796b5a1a6e896f8fdae33f4f56bcfe919100619 | freizl/dive-into-haskell | labweekchess.hs | Informatics 1 - Functional Programming
Lab week tutorial part II
--
-- NOTES
-- my solution is TOO annoying compare to the solution.
--
import PicturesSVG
import Test.QuickCheck
main :: IO ()
main = render populatedBoard
Exercise 9 :
pic1 :: Picture
pic1 = knight `beside` blackKnight
`above`
(bl... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/lectures/informatics1-FP/2011-haisheng/Labweek/labweekchess.hs | haskell |
NOTES
my solution is TOO annoying compare to the solution.
a)
b)
c)
d)
e)
Functions -- | Informatics 1 - Functional Programming
Lab week tutorial part II
import PicturesSVG
import Test.QuickCheck
main :: IO ()
main = render populatedBoard
Exercise 9 :
pic1 :: Picture
pic1 = knight `beside` blackKnight
`above`
(blackKnight `beside` knight)
blackKnight :: Picture
blackKnight = invert... |
825d1ff2b9252d3599871d3866c59c9a2c4267dc5cc39ec3ea9b41f3bd87438c | no-defun-allowed/concurrent-hash-tables | package.lisp | (defpackage :cliff-click-test
(:use :cl)
(:export #:run-test))
| null | https://raw.githubusercontent.com/no-defun-allowed/concurrent-hash-tables/1b9f0b5da54fece4f42296e1bdacfcec0c370a5a/Examples/Cliff-Click-Test/package.lisp | lisp | (defpackage :cliff-click-test
(:use :cl)
(:export #:run-test))
| |
413bb195d24333cc6cfffdd8774dce27125f48f9ff06b94201109af7c2bddf66 | ucsd-progsys/dsolve | sorts.ml | let rec ins x ys =
match ys with
| [] -> [x]
| y::ys' -> if x < y then x::y::ys' else y::(ins x ys')
let rec insert_sort xs =
match xs with
| [] -> []
| x::xs' -> ins x (insert_sort xs')
type ('a, 'b) boolean =
| True of 'a
| False of 'b
let rec partition f xs =
match xs with
| [] ->... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/proceedings-demos/ml/sorts.ml | ocaml | let rec ins x ys =
match ys with
| [] -> [x]
| y::ys' -> if x < y then x::y::ys' else y::(ins x ys')
let rec insert_sort xs =
match xs with
| [] -> []
| x::xs' -> ins x (insert_sort xs')
type ('a, 'b) boolean =
| True of 'a
| False of 'b
let rec partition f xs =
match xs with
| [] ->... | |
9412093dd4e614f5ab984f0ea0a1abf95f229b2371e6f077201c239691525fb7 | nodew/stargaze-cli | Main.hs | module Main where
import Options.Applicative
( showHelpOnEmpty,
prefs,
idm,
helper,
(<**>),
info,
customExecParser )
import Stargaze.Command ( execCommand, parseCommand )
main :: IO ()
main = do
options <- customExecParser p opts
execCommand options
where
opts = info ... | null | https://raw.githubusercontent.com/nodew/stargaze-cli/7093ba1800f38cd3e73baf7e05d251d9fe835c6a/app/Main.hs | haskell | module Main where
import Options.Applicative
( showHelpOnEmpty,
prefs,
idm,
helper,
(<**>),
info,
customExecParser )
import Stargaze.Command ( execCommand, parseCommand )
main :: IO ()
main = do
options <- customExecParser p opts
execCommand options
where
opts = info ... | |
434f76293fcdb89189d4873dfca2a4f1204675884a5e3c3ae7def75e4863aaad | KestrelInstitute/Specware | Tests.lisp | (test-directories ".")
(test
("Bug 0067 : Signature constraints in spec morphism are not checked"
:show "CheckSignature#M"
:output '((:optional "")
";;; Elaborating spec-morphism at $TESTDIR/CheckSignature#M"
";;; Elaborating spec at $TESTDIR/CheckSignature#S1"
";;; Elabor... | null | https://raw.githubusercontent.com/KestrelInstitute/Specware/2be6411c55f26432bf5c9e2f7778128898220c24/TestSuite/Bugs/Bug_0067/Tests.lisp | lisp | (test-directories ".")
(test
("Bug 0067 : Signature constraints in spec morphism are not checked"
:show "CheckSignature#M"
:output '((:optional "")
";;; Elaborating spec-morphism at $TESTDIR/CheckSignature#M"
";;; Elaborating spec at $TESTDIR/CheckSignature#S1"
";;; Elabor... | |
786ddacebb8da7988fd463c1886a4d2dbbcaeefe5e77576b05230a6804c4d020 | Makell-Digital/servant-persistent-template | Postgres.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE FlexibleContexts #
module Authentication.Repository.Persistent.Postgres where
import Authentication.Repository.UserRepository
import Authentication.Domain.Models
import Data.Password.Types (mkPassword)
import Data.Password.Bcrypt (hashPassword)
import Database.Persist (select... | null | https://raw.githubusercontent.com/Makell-Digital/servant-persistent-template/b299edb81b9335ce12c5c01aa9ab3059faff15e1/src/Authentication/Repository/Persistent/Postgres.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE FlexibleContexts #
module Authentication.Repository.Persistent.Postgres where
import Authentication.Repository.UserRepository
import Authentication.Domain.Models
import Data.Password.Types (mkPassword)
import Data.Password.Bcrypt (hashPassword)
import Database.Persist (selectList, insertBy)
import Datab... |
878a50cba78086d7270525a1588561e7744b79526c632797a1634c30d58189aa | xmonad/xmonad-contrib | FocusTracking.hs | # LANGUAGE MultiParamTypeClasses , TypeSynonymInstances #
|
Module : XMonad . Layout . FocusTracking
Description : Track focus in the tiled layer .
Copyright : ( c ) 2010 & 2013
2011 Willem Vanlint
2018 & 2022 L.S.Leary
License : BSD - style (... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/6b19388139c591990f8fbeaefaf74a54260c97b4/XMonad/Layout/FocusTracking.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
* Usage
$usage
$usage
Then, a focus-dependent layout can be made to fall back on the last focus it
saw, for example:
> main = xmonad def
> { layoutHo... | # LANGUAGE MultiParamTypeClasses , TypeSynonymInstances #
|
Module : XMonad . Layout . FocusTracking
Description : Track focus in the tiled layer .
Copyright : ( c ) 2010 & 2013
2011 Willem Vanlint
2018 & 2022 L.S.Leary
License : BSD - style (... |
fd2b6eab83764e946773b78712a2fc9b1a418f3e8c40c18a754956f323a1b130 | facebook/Haxl | MonadBench.hs | Copyright ( c ) 2014 - present , Facebook , Inc.
-- All rights reserved.
--
This source code is distributed under the terms of a BSD license ,
-- found in the LICENSE file.
-- | Benchmarking tool for core performance characteristics of the Haxl monad.
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ApplicativeDo , R... | null | https://raw.githubusercontent.com/facebook/Haxl/260a97b757a6239df153b69b127ded5c47efa13c/tests/MonadBench.hs | haskell | All rights reserved.
found in the LICENSE file.
| Benchmarking tool for core performance characteristics of the Haxl monad.
# LANGUAGE OverloadedStrings #
parallel, identical queries
parallel, distinct queries
sequential, identical queries
sequential, left-associated, distinct queries
No memoization
One put, ... | Copyright ( c ) 2014 - present , Facebook , Inc.
This source code is distributed under the terms of a BSD license ,
# LANGUAGE ApplicativeDo , RecordWildCards #
module MonadBench (main) where
import Control.Monad
import Data.List as List
import Data.Maybe
import Data.Time.Clock
import Options.Applicative
import S... |
c7daca91cfe48b91eb4832397f919907a93d7280784fc02fb093537cc6e1b8be | FreeProving/free-compiler | Arg.hs | | This module contains functions for generating Agda function , constructor
-- and type arguments from our intermediate representation.
module FreeC.Backend.Agda.Converter.Arg ( convertTypeVarDecl, convertArg ) where
import qualified FreeC.Backend.Agda.Syntax as Agda
import FreeC.Environment.Renamer
( ... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/Backend/Agda/Converter/Arg.hs | haskell | and type arguments from our intermediate representation.
scope.
same name in the current scope. | | This module contains functions for generating Agda function , constructor
module FreeC.Backend.Agda.Converter.Arg ( convertTypeVarDecl, convertArg ) where
import qualified FreeC.Backend.Agda.Syntax as Agda
import FreeC.Environment.Renamer
( renameAndDefineAgdaTypeVar, renameAndDefineAgdaVar )
import qu... |
44516c64f42bd04798982f072029504e363fe0245c2c068226afcf75e912e302 | expipiplus1/vulkan | Promoted_From_VK_KHR_format_feature_flags2.hs | {-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_format_feature_flags2"
module Vulkan.Core13.Promoted_From_VK_KHR_format_feature_flags2 ( FormatProperties3(..)
, StructureType(..)
... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/src/Vulkan/Core13/Promoted_From_VK_KHR_format_feature_flags2.hs | haskell | # language CPP #
No documentation found for Chapter "Promoted_From_VK_KHR_format_feature_flags2"
| VkFormatProperties3 - Structure specifying image format properties
= Description
@bufferFeatures@ /must/ include the bits reported in the corresponding
fields of
== Valid Usage (Implicit)
= See Also
<-extensi... | module Vulkan.Core13.Promoted_From_VK_KHR_format_feature_flags2 ( FormatProperties3(..)
, StructureType(..)
, FormatFeatureFlagBits2(..)
... |
7798f8b77c0c52ab6ad61fcc062bb8788394c4463ba19c827ffb7b99912f9120 | zed-throben/erlangeos | eos@future.erl | -module(eos@future).
-compile(export_all).
-include("eos.hrl").
%get_slot(?eos(eos@future,ID),Key)->
case : get({future , ID } ) of
% undefined ->
% receive
% {eos@future,ID,Value} ->
erlang : put({future , ID},Value ) ,
% eos:get_slot(Value,Key)
% end;
%
% Value ->
eos : get_slot(Value , Key... | null | https://raw.githubusercontent.com/zed-throben/erlangeos/44e50e442f5d396c69ae90db530b0b60b01d692a/src/eos%40future.erl | erlang | get_slot(?eos(eos@future,ID),Key)->
undefined ->
receive
{eos@future,ID,Value} ->
eos:get_slot(Value,Key)
end;
Value ->
end.
MyPID = self(),
ID = erleos_gensym:newid(),
spawn(
fun()->
try
Res = F(),
MyPID ! {eos@future,ID,Res}
catch
Et:Ex ->
end
end
),
?eos(eos@futur... | -module(eos@future).
-compile(export_all).
-include("eos.hrl").
case : get({future , ID } ) of
erlang : put({future , ID},Value ) ,
eos : get_slot(Value , Key )
start(F)- >
MyPID ! { eos@future , , Et},{exception , Ex } ] }
start(F)->
MyPID = self(),
ID = erleos_gensym:newid(),
spawn(
fun()->... |
cc9091584a21d33f56c96c918fa188b6c5ea4d64562bd845253a0cc7e1274e97 | input-output-hk/ouroboros-network | Summary.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE Gene... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/ea202b7b21983140d1944ccfde8750b891b59699/ouroboros-consensus/src/Ouroboros/Consensus/HardFork/History/Summary.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DerivingVia #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
... | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications ... |
7d8e22f282cd2d50cf1dd38c13b841285eee17aa59eb9d4ed647ab37949651fe | ept/compsci | matrix.ml | use moscow ml
(* not sure if transpose is correct *)
fun idmatrix n =
Array.tabulate(n, (fn i =>
Array.tabulate(n, (fn j => if i=j then 1.0 else 0.0))));
fun transpose m =
Array.tabulate(Array.length(Array.sub(m,0)), (fn i =>
Array.tabulate(Array.length(m), (fn j => Array.sub(Array.sub(m,j),i)))));
fun... | null | https://raw.githubusercontent.com/ept/compsci/ed666bb4cf52ac2af5c2d13894870bdc23dca237/ml/matrix.ml | ocaml | not sure if transpose is correct | use moscow ml
fun idmatrix n =
Array.tabulate(n, (fn i =>
Array.tabulate(n, (fn j => if i=j then 1.0 else 0.0))));
fun transpose m =
Array.tabulate(Array.length(Array.sub(m,0)), (fn i =>
Array.tabulate(Array.length(m), (fn j => Array.sub(Array.sub(m,j),i)))));
fun mtolist m = let
fun mtolx(_,~1) = ... |
77105c78f999685ec4c0e1046ac04277d2ce50d5baf317cc2ee941f47575fd86 | clj-kafka/franzy | schema_tests.clj | (ns franzy.common.models.schema-tests
(:require [midje.sweet :refer :all]
[schema.core :as s]
[franzy.common.models.schema :as fs])
(:import (java.util.concurrent TimeUnit)
(schema.utils NamedError)))
;;TODO - these tests could be tons better, just a placeholder/basic check for n... | null | https://raw.githubusercontent.com/clj-kafka/franzy/6c2e2e65ad137d2bcbc04ff6e671f97ea8c0e380/common/test/franzy/common/models/schema_tests.clj | clojure | TODO - these tests could be tons better, just a placeholder/basic check for now
TODO: fix this schema
will make this pass in the future
TODO: fix this schema
TODO: these really need to be keywords probably....
another way to check for schema errors, still trying to think of best way for accurate testing | (ns franzy.common.models.schema-tests
(:require [midje.sweet :refer :all]
[schema.core :as s]
[franzy.common.models.schema :as fs])
(:import (java.util.concurrent TimeUnit)
(schema.utils NamedError)))
(facts
"A TimeUnit enum value must pass schema validation."
(fact
"Tim... |
b54e327337147e9f18660ae0cc0415148d1c88141a9305177fb87803769282d8 | ocaml-omake/omake | lm_string_util.ml |
(*
* Show the file loading.
*)
let debug_string =
Lm_debug.create_debug (**)
{ debug_name = "string";
debug_description = "check string bounds";
debug_value = false
}
let code0 = Char.code '0'
(** Efficient string ordering (_not_ lexicographic)
*)
let rec string_compare_aux s1 s2 len i =
i... | null | https://raw.githubusercontent.com/ocaml-omake/omake/26b39e82f81c912f8c0f9859328c9c24800e6ba8/src/libmojave/lm_string_util.ml | ocaml |
* Show the file loading.
* Efficient string ordering (_not_ lexicographic)
* String prefix.
* Compare a substring.
* Check all chars in the string.
* Find a char in a string.
* Find a string in a another string starting at a given index.
* Find/replace matching prefix in a string
* Find/replace a... |
let debug_string =
{ debug_name = "string";
debug_description = "check string bounds";
debug_value = false
}
let code0 = Char.code '0'
let rec string_compare_aux s1 s2 len i =
if len = i then
0
else
let c1 = String.unsafe_get s1 i in
let c2 = String.unsafe_get s2 i in
if c1 = c2... |
5b54d1d604d5ebbcd76b33463224a7bc1df8ac2d5f401d3d5a501c1a9b664dd6 | McCLIM/McCLIM | medium.lisp | ;;; ---------------------------------------------------------------------------
;;; License: LGPL-2.1+ (See file 'Copyright' for details).
;;; ---------------------------------------------------------------------------
;;;
( c ) copyright 1998 - 2000 by < >
( c ) copyright 2002 - 2003 by < >
( c ) copy... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/904e3aced7b1cdd947a7e427078925de7d44055c/Core/drawing/medium.lisp | lisp | ---------------------------------------------------------------------------
License: LGPL-2.1+ (See file 'Copyright' for details).
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Implementation of the graph... | ( c ) copyright 1998 - 2000 by < >
( c ) copyright 2002 - 2003 by < >
( c ) copyright 2014 by < >
( c ) copyright 2020 - 2022 by < >
(in-package #:clim-internals)
state that it needs . --
(defclass graphics-state ()
()
(:documentation "Stores those parts of the medium/stream graphics... |
4e37e13f290feaef162e11f8512c5623528f8fb47387098fa12971228b651681 | linuxsoares/artigos-clojure | dev_middleware.clj | (ns hello-web-app.dev-middleware
(:require [ring.middleware.reload :refer [wrap-reload]]
[selmer.middleware :refer [wrap-error-page]]
[prone.middleware :refer [wrap-exceptions]]))
(defn wrap-dev [handler]
(-> handler
wrap-reload
wrap-error-page
wrap-exceptions))
| null | https://raw.githubusercontent.com/linuxsoares/artigos-clojure/6c4183e767e71168c778973dd5831e7c9edfaf4a/criando-web-application-clojure/hello-web-app/env/dev/clj/hello_web_app/dev_middleware.clj | clojure | (ns hello-web-app.dev-middleware
(:require [ring.middleware.reload :refer [wrap-reload]]
[selmer.middleware :refer [wrap-error-page]]
[prone.middleware :refer [wrap-exceptions]]))
(defn wrap-dev [handler]
(-> handler
wrap-reload
wrap-error-page
wrap-exceptions))
| |
074a544a99378b429569b797358143d71bef0691147d0bd04128be13823e4d84 | johnlawrenceaspden/hobby-code | joy5.clj | (def world [[ 1 1 1 1 1 ]
[ 999 999 999 999 1 ]
[ 1 1 1 1 1 ]
[ 1 999 999 999 999]
[ 1 1 1 1 1 ]])
| null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/joy5.clj | clojure | (def world [[ 1 1 1 1 1 ]
[ 999 999 999 999 1 ]
[ 1 1 1 1 1 ]
[ 1 999 999 999 999]
[ 1 1 1 1 1 ]])
| |
1265667dcf53e6d4e51d1f3742a33de37447f3461cecac1dd673285059ee5cad | fourmolu/fourmolu | Generate.hs | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
import ConfigData
import Control.Monad ((>=>))
import Data.List (intercalate, isSuffixOf, stripPrefix)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromMaybe, mapMaybe)
import Text.P... | null | https://raw.githubusercontent.com/fourmolu/fourmolu/e5eceda9de0b8f16f7f398c60e516a21ff96f06b/config/Generate.hs | haskell | ---- Helpers ----
---- Utilities ----
| Like 'unlines', except without a trailing newline. | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
import ConfigData
import Control.Monad ((>=>))
import Data.List (intercalate, isSuffixOf, stripPrefix)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromMaybe, mapMaybe)
import Text.P... |
910ec73c174d377cd6e50b4b8ee502f488deb933b0e0c9a7bf819f9289fd4238 | ndmitchell/supero | Normalise.hs |
module Normalise where
There are two types of " knowledge loosing " operations in this language :
[ CALL_EVAL ] Apply ( Fun x ) ( ... ( Eval ... ) .... )
[ CASE_CALL ] Case ( Apply ( Fun x ) ... )
The aim is to eliminate both types .
The first is eliminated by collecting specialised versions that are bei... | null | https://raw.githubusercontent.com/ndmitchell/supero/a8b16ea90862e2c021bb139d7a7e9a83700b43b2/Dead/version1/Normalise.hs | haskell | -------------------------------------------------------------------
CALL EVAL
Detect where calls are being made with an embedded eval
generate new versions based on this.
the list of data structures than cannot be specialised
use the calls that were just created
create all the required calls
figure out which ca... |
module Normalise where
There are two types of " knowledge loosing " operations in this language :
[ CALL_EVAL ] Apply ( Fun x ) ( ... ( Eval ... ) .... )
[ CASE_CALL ] Case ( Apply ( Fun x ) ... )
The aim is to eliminate both types .
The first is eliminated by collecting specialised versions that are bei... |
99faaf7df4e095f654f40ee6704a2ca12d75193d13555e490d7fb22e04beb852 | codingteam/Hyperspace | world.clj | (ns hyperspace.library.world
(:use [clojure.pprint :only (pprint)]
[clojure.java.io :only (reader writer)]
[hyperspace.library geometry misc]))
(def missile-radius 5)
(def player-radius 15)
(def missile-mass 10)
(def amount-of-planets 3)
(def amount-of-players 2)
(defn generate-without-intersection... | null | https://raw.githubusercontent.com/codingteam/Hyperspace/b04ec588968f3a9c94b2992010a3a737afbe7eb5/core/src/main/clojure/hyperspace/library/world.clj | clojure | Planets related stuff
Players related stuff
Missile related stuff:
World related stuff | (ns hyperspace.library.world
(:use [clojure.pprint :only (pprint)]
[clojure.java.io :only (reader writer)]
[hyperspace.library geometry misc]))
(def missile-radius 5)
(def player-radius 15)
(def missile-mass 10)
(def amount-of-planets 3)
(def amount-of-players 2)
(defn generate-without-intersection... |
87d746599e7ef7365edfaf9b9324a333c0ae9759c01513fad77d62275d124d8a | schlagert/bootstrap | bootstrap.erl | %%%=============================================================================
Copyright 2013 - 2017 , < >
%%%
%%% Permission to use, copy, modify, and/or distribute this software for any
%%% purpose with or without fee is hereby granted, provided that the above
%%% copyright notice and this permission notice ap... | null | https://raw.githubusercontent.com/schlagert/bootstrap/5145ef0309a4e1d951f078af53cfa04749d7b0a8/src/bootstrap.erl | erlang | =============================================================================
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWA... | Copyright 2013 - 2017 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(bootstrap).
-behaviour(application).
-behaviour(sup... |
7739fc31bfb0162aae513242b89a704bdd75aeb836b8e5bc91fe6fa4657795b4 | bozsahin/ccglab-database | g-dy.ccg.lisp | (defparameter *ccg-grammar*
'(((KEY 1) (PHON I) (MORPH N) (SYN ((BCAT NP) (FEATS ((AGR |1S|))))) (SEM "I")
(PARAM 1.0))
((KEY 2) (PHON ARRIVES) (MORPH EN)
(SYN
(((BCAT S) (FEATS NIL)) (DIR BS) (MODAL ALL)
((BCAT NP) (FEATS ((AGR |3S|))))))
(SEM (LAM X ("ARRIVE" X))) (PARAM 1.0))
((KEY 3) (PHON ARR... | null | https://raw.githubusercontent.com/bozsahin/ccglab-database/f24215aaa4ac8102f6d76c9c0ec5bd58a29743d7/cl-db1/g-dy.ccg.lisp | lisp | (defparameter *ccg-grammar*
'(((KEY 1) (PHON I) (MORPH N) (SYN ((BCAT NP) (FEATS ((AGR |1S|))))) (SEM "I")
(PARAM 1.0))
((KEY 2) (PHON ARRIVES) (MORPH EN)
(SYN
(((BCAT S) (FEATS NIL)) (DIR BS) (MODAL ALL)
((BCAT NP) (FEATS ((AGR |3S|))))))
(SEM (LAM X ("ARRIVE" X))) (PARAM 1.0))
((KEY 3) (PHON ARR... | |
c7fc226b2d07b4f9cd151510a3f6177f36ced074a0ff2ce9aa786744a057f5a0 | tonyrog/canopen | co_codec_SUITE.erl | %%%---- BEGIN COPYRIGHT --------------------------------------------------------
%%%
Copyright ( C ) 2007 - 2012 , Rogvall Invest AB , < >
%%%
%%% This software is licensed as described in the file COPYRIGHT, which
%%% you should have received as part of this distribution. The terms
%%% are also available at .
%%%
%... | null | https://raw.githubusercontent.com/tonyrog/canopen/b76c0c3503e3087cc7511fe5795e6053702d449e/test/co_codec_SUITE.erl | erlang | ---- BEGIN COPYRIGHT --------------------------------------------------------
This software is licensed as described in the file COPYRIGHT, which
you should have received as part of this distribution. The terms
are also available at .
You may opt to use, copy, modify, merge, publish, distribute and/or sell
furn... | Copyright ( C ) 2007 - 2012 , Rogvall Invest AB , < >
copies of the Software , and permit persons to whom the Software is
This software is distributed on an " AS IS " basis , WITHOUT WARRANTY OF ANY
@author < >
( C ) 2018 ,
-module(co_codec_SUITE).
-compile(export_all).
-include("../include/canopen.hr... |
03947d53018c1a6017f8c8abb6fcf1d45895fdfc9fe57c3c2b35ac719cb3f0d1 | haskellfoundation/error-message-index | IfThenElseInPattern.hs | module IfThenElseInPattern where
f :: Bool -> String -> Bool
f a b = case a of
(if a then b == "something" else b == "something else") -> True
_ -> False
| null | https://raw.githubusercontent.com/haskellfoundation/error-message-index/26c5c12c279eb4a997b1ff17eea46f1e86b046ab/message-index/messages/GHC-45696/example1/before/IfThenElseInPattern.hs | haskell | module IfThenElseInPattern where
f :: Bool -> String -> Bool
f a b = case a of
(if a then b == "something" else b == "something else") -> True
_ -> False
| |
a241aed6b595d782e1acc70d90dd3534aee5f2baedc1ecfe98098d9204ae98db | jepsen-io/jepsen | util.clj | (ns jepsen.control.util
"Utility functions for scripting installations."
(:require [jepsen.control :refer :all]
[jepsen.control.core :as core]
[jepsen.util :as util :refer [meh name+ timeout]]
[clojure.data.codec.base64 :as b64]
[clojure.java.io :refer [file]]
... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/944458618faefbd39938eff7909decdb397b7d19/jepsen/src/jepsen/control/util.clj | clojure | Parent dir might not exist
catches name
TODO: only force? should have a ?, because it's a boolean. User and pw
should be renamed without ?, and probably use whatever username/password
naming convention we use in jepsen.control etc.
options map this check is here for backwards compatibility
since the version is i... | (ns jepsen.control.util
"Utility functions for scripting installations."
(:require [jepsen.control :refer :all]
[jepsen.control.core :as core]
[jepsen.util :as util :refer [meh name+ timeout]]
[clojure.data.codec.base64 :as b64]
[clojure.java.io :refer [file]]
... |
71ae57cd1a3a7ff71d0a4f0cb257a1f8fa957a4ee06b4e0c4e7f97a4791c8ab0 | andrejv/cl-simple-tk | canvas.lisp | (defpackage :tk-user
(:use :cl :tk)
(:export :main))
(in-package :tk-user)
(defun main ()
(with-tk-root (root)
(setf (window-title root) "Canvas")
(setf (window-minsize root) '(600 600))
(let ((canvas (canvas :parent root :scrollregion '(-300 -300 1300 1300)))
(h-scroll (scrollbar :parent... | null | https://raw.githubusercontent.com/andrejv/cl-simple-tk/0ef565fedde588caa62148c2551be1520a955567/examples/canvas.lisp | lisp | (defpackage :tk-user
(:use :cl :tk)
(:export :main))
(in-package :tk-user)
(defun main ()
(with-tk-root (root)
(setf (window-title root) "Canvas")
(setf (window-minsize root) '(600 600))
(let ((canvas (canvas :parent root :scrollregion '(-300 -300 1300 1300)))
(h-scroll (scrollbar :parent... | |
0bb5e5b3b729d4f59b5a8faf53683521d8f06384c68d67b47ae680f7f85ed0d9 | emqx/emqx | emqx_resource_buffer_worker_sup.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. 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 o... | null | https://raw.githubusercontent.com/emqx/emqx/3587c4c04aaf681f32e80ed2ebe6aef60549bd4c/apps/emqx_resource/src/emqx_resource_buffer_worker_sup.erl | erlang | --------------------------------------------------------------------
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 ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. 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(emqx_resource_buffer_worker_sup).
-behaviour(supervisor).
-export([start_link/0]).
-ex... |
ab1148d9bee3755f8c16c589587dd4e07040cc7b4533e04963847418abb068a5 | wesen/ruinwesen | midi.lisp | (in-package :md)
;;; midi conversion ; midi -> md
;;; midi file
(defun event-filter (event)
(or (typep event 'midi)
(typep event 'midi-control-change)))
(Defun chan-filter (event)
(or (typep event 'midi)
(typep event 'cm::midi-channel-event)))
(defun step-filter (event)
(< (int-near (object-time ... | null | https://raw.githubusercontent.com/wesen/ruinwesen/9f3ccea85425cf46b57e76144b3114ca342bad0f/md-uw/src/midi.lisp | lisp | midi conversion ; midi -> md
midi file
md -> midi
default value XXX for ccs and stuff | (in-package :md)
(defun event-filter (event)
(or (typep event 'midi)
(typep event 'midi-control-change)))
(Defun chan-filter (event)
(or (typep event 'midi)
(typep event 'cm::midi-channel-event)))
(defun step-filter (event)
(< (int-near (object-time event) 0.125) 0.01))
(defun read-events (file)... |
35c489fca03880a3b4a47c6e58afcb5f025d03e538604d9aaca9d2641a722f83 | sru-systems/protobuf-simple | ProtoBufSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
module Data.ProtoBufSpec
( main
, spec
) where
import Data.ByteString.Lazy (ByteString, pack, readFile)
import Data.ProtoBuf.WireFormat (decode, encode)
import Prelude hiding (Enum, readFile)
import System.FilePath ((</>))
import Tes... | null | https://raw.githubusercontent.com/sru-systems/protobuf-simple/8d19dfc68466c1ce69e9d3af6e75df16fffd32cc/test/Data/ProtoBufSpec.hs | haskell | # LANGUAGE OverloadedStrings #
Bool
Double
Fixed32
Fixed64
Float
Message
SFixed32
SFixed64
String | # OPTIONS_GHC -fno - warn - orphans #
module Data.ProtoBufSpec
( main
, spec
) where
import Data.ByteString.Lazy (ByteString, pack, readFile)
import Data.ProtoBuf.WireFormat (decode, encode)
import Prelude hiding (Enum, readFile)
import System.FilePath ((</>))
import Test.Hspec (Spec, hspec, context, desc... |
e261a3a5c3a9bd577ab8e5108b7c49174384c3b5a6586069520a9381e8d19a42 | boot-clj/boot-figreload | boot_figreload.clj | (ns powerlaces.boot-figreload
{:boot/export-tasks true}
(:require
[boot.core :as b]
[clojure.java.io :as io]
[clojure.set :as set]
[clojure.string :as string]
[boot.pod :as pod]
[boot.file :as file]
[boot.util :as butil]
[boot.core ... | null | https://raw.githubusercontent.com/boot-clj/boot-figreload/b53660c4908b0aab78e88f6876ea478f22748306/src/powerlaces/boot_figreload.clj | clojure | Websocket Server
Client Configuration
Other Configuration - AR - (?)
AR - TODO - pass the :open-file option down to figwheel and figure
out how to handle it
this is relative to boot's fileset cache
Writing the connection script to the tmp folder
Add the init files to the fileset
in that case we can just create... | (ns powerlaces.boot-figreload
{:boot/export-tasks true}
(:require
[boot.core :as b]
[clojure.java.io :as io]
[clojure.set :as set]
[clojure.string :as string]
[boot.pod :as pod]
[boot.file :as file]
[boot.util :as butil]
[boot.core ... |
1a88dabb1a71be34fb7111b6bd767ed46afed3172219acfdb35115da407bb64e | gwathlobal/CotD | file-storage.lisp | (in-package :cotd)
(defun get-txt-from-file (filename)
(with-open-file (file (merge-pathnames filename *current-dir*) :direction :input :if-does-not-exist nil)
(when file
(loop for line = (read-line file nil)
with str = (create-string "")
while line do (format str "~A~%" line)
... | null | https://raw.githubusercontent.com/gwathlobal/CotD/d01ef486cc1d3b21d2ad670ebdb443e957290aa2/src/file-storage.lisp | lisp | (in-package :cotd)
(defun get-txt-from-file (filename)
(with-open-file (file (merge-pathnames filename *current-dir*) :direction :input :if-does-not-exist nil)
(when file
(loop for line = (read-line file nil)
with str = (create-string "")
while line do (format str "~A~%" line)
... | |
903e52218ccd31af065a3d984be186fd0f438ebc7c3fdd78a7a21f3be43a8af1 | yetibot/yetibot | pirate.clj | (ns yetibot.commands.pirate
(:require
[yetibot.core.hooks :refer [cmd-hook]]
[clojure.java.io :as io]
[clojure.edn :as edn]
[clojure.string :as str]
[clj-time.core :as time]))
;; TODO - Let's derive this from properties of the requesting user. I
think this is pretty straightforward with Slack but I... | null | https://raw.githubusercontent.com/yetibot/yetibot/2fb5c1182b1a53ab0e433d6bab2775ebd43367de/src/yetibot/commands/pirate.clj | clojure | TODO - Let's derive this from properties of the requesting user. I
recommended locations, for Issue #740 - Weather API migration.
yetibot.core.util or similar...
Add some extra flavor
| (ns yetibot.commands.pirate
(:require
[yetibot.core.hooks :refer [cmd-hook]]
[clojure.java.io :as io]
[clojure.edn :as edn]
[clojure.string :as str]
[clj-time.core :as time]))
think this is pretty straightforward with Slack but I have to give
IRC some more thought . TZ might be an input to how w... |
b7fe781c6b3d0a71427a5013b7924182aa3f9fb15c11131c57e9abad9c0e7bd0 | haskell/unix | Error.hs | {-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
Module : System . . Error
Copyright : ( c ) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- P... | null | https://raw.githubusercontent.com/haskell/unix/4291a5bf644449b57bb1d6e8c75ef582c09a8803/System/Posix/Error.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : non-portable (requires POSIX)
POSIX error support
--------------------------------------------... | Module : System . . Error
Copyright : ( c ) The University of Glasgow 2002
module System.Posix.Error (
throwErrnoPath,
throwErrnoPathIf,
throwErrnoPathIf_,
throwErrnoPathIfRetry,
throwErrnoPathIfNull,
throwErrnoPathIfNullRetry,
throwErrnoPathIfM... |
8b0f9b20efd83673e1a7e609849eb4a302c3e4380ecd4650a2213983ba1e9d98 | adaliu-gh/htdp | 17-285-291.rkt |
;;===================
285
;; [List-of Number] -> [List-of Number]
(check-expect (convert-euro '(1 2))
'(1.22 2.44))
(define (convert-euro l)
(map (lambda (x) (* 1.22 x)) l))
;; [List-of Posn] -> [List-of [List-of 2N]]
(check-expect (translate (list (make-posn 12 23) (make-posn 10 45)))
... | null | https://raw.githubusercontent.com/adaliu-gh/htdp/a0fca8af2ae8bdcef40d56f6f45021dd92df2995/14-18%20Abstraction/17-285-291.rkt | racket | ===================
[List-of Number] -> [List-of Number]
[List-of Posn] -> [List-of [List-of 2N]]
=====================
name: String - name of the product
des: String - description of the product
in-pri: Number - the price when acquired
sale-pri: Number - recommended price of sales
[List-of Inventory] -> [List-o... |
285
(check-expect (convert-euro '(1 2))
'(1.22 2.44))
(define (convert-euro l)
(map (lambda (x) (* 1.22 x)) l))
(check-expect (translate (list (make-posn 12 23) (make-posn 10 45)))
'((12 23) (10 45)))
(define (translate l)
(map (lambda (p) (list (posn-x p) (posn-y p))) l))
286
In... |
66a82fcb7007288ed79fb90ba96eab7c074782012e8351dab2a97266f59257cf | kivra/giallo | giallo_util.erl | %% ----------------------------------------------------------------------------
%%
%% giallo: A small and flexible web framework
%%
Copyright ( c ) 2013 KIVRA
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the "Software"),
t... | null | https://raw.githubusercontent.com/kivra/giallo/bec3539fb3e0d01177c87c302188fe231f647125/src/giallo_util.erl | erlang | ----------------------------------------------------------------------------
giallo: A small and flexible web framework
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publi... | Copyright ( c ) 2013 KIVRA
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIA... |
56bc2d83ab92d92bdf4b447e1164b9ff81a206ebcb918b96cbeba104e48be3ca | pascal-knodel/haskell-craft | IsIn.hs | -- Check if an item is in a list. Common names of this function: contains, elem, elemOf, member, isIn ...
module IsIn where
isIn :: (Eq t) => t -> [t] -> Bool
isIn _ [] = False
isIn referenceItem (listItem : remainingList)
= referenceItem == listItem || isIn referenceItem remainingList
{- GHCi>
isIn 'l' ""
i... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Examples/%C2%B7%C2%A0Recursion/%C2%B7%20Primitive%20Recursion/Lists/IsIn.hs | haskell | Check if an item is in a list. Common names of this function: contains, elem, elemOf, member, isIn ...
GHCi>
isIn 'l' ""
isIn 'l' "list"
isIn 'i' "list"
isIn 's' "list"
isIn 't' "list"
isIn ' ' "list"
False
True
True
True
True
False | module IsIn where
isIn :: (Eq t) => t -> [t] -> Bool
isIn _ [] = False
isIn referenceItem (listItem : remainingList)
= referenceItem == listItem || isIn referenceItem remainingList
|
e1128a38e612ac5c734013ab98aac466fb64cff40b4c91347e6fd16fe99fc52b | janestreet/hardcaml_circuits | component_intf.ml | open Core
open Hardcaml
module type Params = sig
type t
val flags : t Command.Param.t
val name : t -> string
end
module type S = sig
module Params : Params
module Input : Hardcaml.Interface.Pre_partial
module Output : Hardcaml.Interface.Pre_partial
val name : string
val input_port_names_and_width : ... | null | https://raw.githubusercontent.com/janestreet/hardcaml_circuits/a2c2d1ea3e6957c3cda4767d519e94c20f1172b2/synthesis_reports/src/component_intf.ml | ocaml | open Core
open Hardcaml
module type Params = sig
type t
val flags : t Command.Param.t
val name : t -> string
end
module type S = sig
module Params : Params
module Input : Hardcaml.Interface.Pre_partial
module Output : Hardcaml.Interface.Pre_partial
val name : string
val input_port_names_and_width : ... | |
81d8852544d95feeef6b04d4236fb994d75ff8af28f553706028a6db8746506f | davidmoeljadi/INDRA | globals.lsp | LinGO grammar specific globals file
;;; parameters only - grammar specific functions
should go in user-fns.lsp
(defparameter *active-parsing-p* t)
(grammar-encoding 'utf-8)
(setf cdb::*cdb-ascii-p* nil)
;;; Strings
(defparameter *toptype* '*top*)
(defparameter *string-type* 'string
"a special type name - ... | null | https://raw.githubusercontent.com/davidmoeljadi/INDRA/d501fa1c1ed51a227587a4b522cdcf702f08e46c/lkb/globals.lsp | lisp | parameters only - grammar specific functions
Strings
Lexical files
(defparameter *lex-rule-suffix* "_INFL_RULE"
"creates the inflectional rule name from the information
in irregs.tab - for PAGE compatability")
(defparameter *irregular-forms-only-p* t)
input characters to be ignored (i.e. suppressed) in tokeniz... | LinGO grammar specific globals file
should go in user-fns.lsp
(defparameter *active-parsing-p* t)
(grammar-encoding 'utf-8)
(setf cdb::*cdb-ascii-p* nil)
(defparameter *toptype* '*top*)
(defparameter *string-type* 'string
"a special type name - any lisp strings are subtypes of it")
(defparameter *orth-pa... |
ac8e81d199e1024706a8e79112f37725a1bfb9c4a2d144064c2b9ce032a4b126 | objectionary/try-phi | PrettyPrintTree.hs | # LANGUAGE RecordWildCards #
# LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
# LANGUAGE UndecidableInstances #
module PrettyPrintTree (pprintTree, ShowIndented) where
import ParseEO
import qualified Data.List as DL(intercalate)
import Text.Printf (printf, PrintfType)
import... | null | https://raw.githubusercontent.com/objectionary/try-phi/9eb9879c46decc4eb1e6f34beaa6a2736224b649/back/language-utils/eo-utils/src/PrettyPrintTree.hs | haskell | printing utilities
wrapper for printing nodes as indented
Print helpers
FIXME missing case | # LANGUAGE RecordWildCards #
# LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
# LANGUAGE UndecidableInstances #
module PrettyPrintTree (pprintTree, ShowIndented) where
import ParseEO
import qualified Data.List as DL(intercalate)
import Text.Printf (printf, PrintfType)
import... |
9aa25c5b09ce16cc007604c0b125b31391d6bb1faa68a059cefe5124fd2fe121 | cracauer/sbcl-ita | bug-503095-2.lisp | (defmethod gf503095-2 ()
(gf503095-2))
(defun f503095-2 ()
(gf503095-2))
| null | https://raw.githubusercontent.com/cracauer/sbcl-ita/f85a8cf0d1fb6e8c7b258e898b7af3233713e0b9/tests/bug-503095-2.lisp | lisp | (defmethod gf503095-2 ()
(gf503095-2))
(defun f503095-2 ()
(gf503095-2))
| |
6da5cea18cc77ece7891fa6b4be917892ab28a7e591827cd3415db88bf10a38d | vyzo/gerbil | core$_runtime___rt.scm | (declare (block) (standard-bindings) (extended-bindings))
(begin
(load-module "gerbil/core$_r5rs-runtime___rt")
(load-module "gerbil/core$_host-runtime___rt"))
| null | https://raw.githubusercontent.com/vyzo/gerbil/17fbcb95a8302c0de3f88380be1a3eb6fe891b95/src/bootstrap/gerbil/core%24_runtime___rt.scm | scheme | (declare (block) (standard-bindings) (extended-bindings))
(begin
(load-module "gerbil/core$_r5rs-runtime___rt")
(load-module "gerbil/core$_host-runtime___rt"))
| |
5b389e485c735e1e21ab9f7d7496198eaaa844f2263e2deb328c50f736eeac49 | deadpendency/deadpendency | PkgGoDev.hs | module DF.Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.PkgGoDev.PkgGoDev
( fetchDependencyPkgGoDev,
)
where
import Common.Model.Dependency.DependencyName
import Common.Model.Dependency.Registry.DependencyRegistryInfo
import Common.Model.Dependency.Registry.RegistryAlivenessStatus
import Common.Model.... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-fetcher/src/DF/Effect/FetchRegistryRepoInfo/Backend/LanguageRegistryFiles/PkgGoDev/PkgGoDev.hs | haskell | module DF.Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.PkgGoDev.PkgGoDev
( fetchDependencyPkgGoDev,
)
where
import Common.Model.Dependency.DependencyName
import Common.Model.Dependency.Registry.DependencyRegistryInfo
import Common.Model.Dependency.Registry.RegistryAlivenessStatus
import Common.Model.... | |
ca7acbd9a106c931a6441d92eefced21f9abd5f6923b2d9c2c034cec4361b57b | hyperfiddle/electric | photon_loop5.cljc | (ns dustin.y2022.loop.photon-loop5
(:require [hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.photon-ui2 :as ui]
[hyperfiddle.rcf :as rcf :refer [tests tap % with]])
#?(:cljs (:require-macros dustin.y2022.loop.photon-loop5)))
(hyperfiddle.rcf/enable!)
(p... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2022/loop/photon_loop5.cljc | clojure | ✅
✅
✅ ; wtf
20 12 6 2 0 1
Is it possible to implement cyclic continuous flow in missionary without assignment?
Missionary's key insight is that you can unify discrete and continuous time
under the same propogation algorithm | (ns dustin.y2022.loop.photon-loop5
(:require [hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.photon-ui2 :as ui]
[hyperfiddle.rcf :as rcf :refer [tests tap % with]])
#?(:cljs (:require-macros dustin.y2022.loop.photon-loop5)))
(hyperfiddle.rcf/enable!)
(p... |
687c543a5536d0d67a2e86ef8faf68c7544f056345825da8de370ece792ae6c1 | shirok/Gauche | shared-struct.scm | ;;;
;;; gauche.experimental.shared-struct
;;;
Copyright ( c ) 2021 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code must retain the above ... | null | https://raw.githubusercontent.com/shirok/Gauche/b773899dbe0b2955e1c4f1daa066da874070c1e4/lib/gauche/experimental/shared-struct.scm | scheme |
gauche.experimental.shared-struct
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disc... | Copyright ( c ) 2021 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(define-module gauche.experimental.shared-s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.