_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 |
|---|---|---|---|---|---|---|---|---|
6f3e9152d7d1f9a0a09554077cbd4661259c0e72b04c787a4bfb6d09c668965b | haskell-mafia/mismi | Data.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Mismi.IAM.Core.Data (
IamRole (..)
) where
import P
newtype IamRole =
IamRole {
iamRole :: Text
} deriving (Eq, Show, Ord)
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-iam-core/src/Mismi/IAM/Core/Data.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
module Mismi.IAM.Core.Data (
IamRole (..)
) where
import P
newtype IamRole =
IamRole {
iamRole :: Text
} deriving (Eq, Show, Ord)
|
408aea0f07f58a268e0f34e1f0dd81bf00d0704915b45a97d35dda4c23a34cc8 | haskell-compat/base-compat | Compat.hs | # LANGUAGE CPP , NoImplicitPrelude #
module Control.Monad.Compat (
module Base
, Monad
#if MIN_VERSION_base(4,9,0)
, MonadFail
#endif
, fail
, MonadPlus(..)
#if !(MIN_VERSION_base(4,8,0))
, foldM
, foldM_
, forM
, forM_
, guard
, mapM
, mapM_
, msum
, sequence
, sequence_
, unless
, when
, (<$!>)
#endif
#if !(MIN_VE... | null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat/src/Control/Monad/Compat.hs | haskell | | Conditional execution of 'Applicative' expressions. For example,
is 'True', and otherwise do nothing.
# SPECIALISE when :: Bool -> IO () -> IO () #
# SPECIALISE when :: Bool -> Maybe () -> Maybe () #
| The reverse of 'when'.
# SPECIALISE unless :: Bool -> IO () -> IO () #
# SPECIALISE unless :: Bool -> Maybe () ... | # LANGUAGE CPP , NoImplicitPrelude #
module Control.Monad.Compat (
module Base
, Monad
#if MIN_VERSION_base(4,9,0)
, MonadFail
#endif
, fail
, MonadPlus(..)
#if !(MIN_VERSION_base(4,8,0))
, foldM
, foldM_
, forM
, forM_
, guard
, mapM
, mapM_
, msum
, sequence
, sequence_
, unless
, when
, (<$!>)
#endif
#if !(MIN_VE... |
f2420b23b1f288af7c91489100e9bd9eeb3d4575a42d13b9083c3415385441bf | awolven/VkTk | imgui-package.lisp | Copyright 2019 < >
;;
;; Permission is hereby granted, free of charge, to any person obtaining
;; a copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
;; without limitation the rights to use, copy, modify, merge, publish... | null | https://raw.githubusercontent.com/awolven/VkTk/fa5d320dd09a03fb2f3aa2fa096401882212144d/ifc/cimgui/imgui-package.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice shall be
EXPRESS O... | Copyright 2019 < >
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom the Software is furnished to do so , subject to
included in all copies or substantial portions of the Software . ... |
a2ff17370622d22c4e0543a74a1f11b029bb5ad6de6db212cd372dea491159f1 | lispnik/cl-http | mcl-mop-package.lisp | (defpackage "MCL-MOP"
(:use :cl #+:mcl :ccl)
#+:mcl (:nicknames :mop)
(:shadow "METAOBJECT")
(:export
Readers for Class
; "CLASS-DEFAULT-INITARGS"
; "CLASS-DIRECT-DEFAULT-INITARGS"
"CLASS-DIRECT-SLOTS"
"CLASS-DIRECT-SUBCLASSES"
"CLASS-DIRECT-SUPERCLASSES"
; "CLASS-FINALIZED-P"
; "CLAS... | null | https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/contrib/janderson/xml-1998-02-27/mcl-mop-package.lisp | lisp | "CLASS-DEFAULT-INITARGS"
"CLASS-DIRECT-DEFAULT-INITARGS"
"CLASS-FINALIZED-P"
"CLASS-NAME"
Readers for Generic Function Metaobjects
"GENERIC-FUNCTION-ARGUMENT-PRECEDENCE-ORDER"
"GENERIC-FUNCTION-DECLARATIONS"
"GENERIC-FUNCTION-LAMBDA-LIST"
"GENERIC-FUNCTION-METHOD-CLASS"
"GENERIC-FUNCTIO... | (defpackage "MCL-MOP"
(:use :cl #+:mcl :ccl)
#+:mcl (:nicknames :mop)
(:shadow "METAOBJECT")
(:export
Readers for Class
"CLASS-DIRECT-SLOTS"
"CLASS-DIRECT-SUBCLASSES"
"CLASS-DIRECT-SUPERCLASSES"
"CLASS-PRECEDENCE-LIST"
"CLASS-PROTOTYPE"
"CLASS-SLOTS"
"ENSURE-CLASS"
"ENSURE-CLASS-USI... |
0b4c3f924da174d433594719453013a343e11cafca5a71dc7e15f2bea3b9990e | VERIMAG-Polyhedra/VPL | QNoneItv.ml | open NumC
open Qcanon
open Itv
open DomainInterfaces
module QN = struct
type t = coq_Qc option
let add qn1 qn2 =
match qn1, qn2 with
| Some q1, Some q2 -> Some (QNum.add q1 q2)
| _,_ -> None
(** val opp : t -> t **)
let opp = function
| Some q -> Some (QNum.opp q)
| None -> None
let max : ... | null | https://raw.githubusercontent.com/VERIMAG-Polyhedra/VPL/cd78d6e7d120508fd5a694bdb01300477e5646f8/ocaml/lin/oracle/QNoneItv.ml | ocaml | * val opp : t -> t *
* val meet : t -> t -> t *
* val low : itv -> QN.t *
* val up : itv -> QN.t *
* val single : coq_Z -> itv * | open NumC
open Qcanon
open Itv
open DomainInterfaces
module QN = struct
type t = coq_Qc option
let add qn1 qn2 =
match qn1, qn2 with
| Some q1, Some q2 -> Some (QNum.add q1 q2)
| _,_ -> None
let opp = function
| Some q -> Some (QNum.opp q)
| None -> None
let max : coq_Qc -> coq_Qc -> coq_Qc
... |
667b37f6a835c517ca5bbec3eed9ccb5400c3d9ea90447f62adb4650b6f375e9 | patrickt/scraps | lookandsay.hs | -- -and-say_sequence
Implementation of the look - and - say sequence in 15 lines of code .
Arrows are a very nice way to represent sequenced , chainable functions
in Haskell . For more info , check the wonderful Wikibooks tutorial at
--
import Control.Arrow
import Data.List (group)
-- `say` produces a new inte... | null | https://raw.githubusercontent.com/patrickt/scraps/517c8f913000b9d7b886338cf06adf5d9e239d31/lookandsay.hs | haskell | -and-say_sequence
`say` produces a new integer by reading out the digits in its argument.
The >>> operator sequences functions together.
digits splits a number up into its component digits.
encode performs run-length encoding on its arguments.
glue assembles the new number out of a list of encoded tuples
The i... | Implementation of the look - and - say sequence in 15 lines of code .
Arrows are a very nice way to represent sequenced , chainable functions
in Haskell . For more info , check the wonderful Wikibooks tutorial at
import Control.Arrow
import Data.List (group)
say :: Integer -> Integer
say = digits >>> encode >>>... |
637577dafd49588eafa27b87e44ffccdcbcd87d9b1c260bae433bf9e9d243a9a | hatemogi/misaeng | 집합.clj | (ns 미생.집합
(:use [clojure.set]
[미생.기본]))
(정의*
합집합 union
차집합 difference
교집합 intersection
부분집합? subset?
확대집합? superset?)
| null | https://raw.githubusercontent.com/hatemogi/misaeng/7b097d9d9ae497606cf54be586fe7a0f50bb7ffc/src/%EB%AF%B8%EC%83%9D/%EC%A7%91%ED%95%A9.clj | clojure | (ns 미생.집합
(:use [clojure.set]
[미생.기본]))
(정의*
합집합 union
차집합 difference
교집합 intersection
부분집합? subset?
확대집합? superset?)
| |
036aaf19a469651dfd1d120f768532db6178fc04e431faaaa6da2ad4c9b33787 | cedlemo/OCaml-GI-ctypes-bindings-generator | Target_list.mli | open Ctypes
type t
val t_typ : t structure typ
(*Not implemented gtk_target_list_new type C Array type for Types.Array tag not implemented*)
val add :
t structure ptr -> Atom.t structure ptr -> Unsigned.uint32 -> Unsigned.uint32 -> unit
val add_image_targets :
t structure ptr -> Unsigned.uint32 -> bool -> unit
va... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Target_list.mli | ocaml | Not implemented gtk_target_list_new type C Array type for Types.Array tag not implemented
Not implemented gtk_target_list_add_table type C Array type for Types.Array tag not implemented | open Ctypes
type t
val t_typ : t structure typ
val add :
t structure ptr -> Atom.t structure ptr -> Unsigned.uint32 -> Unsigned.uint32 -> unit
val add_image_targets :
t structure ptr -> Unsigned.uint32 -> bool -> unit
val add_rich_text_targets :
t structure ptr -> Unsigned.uint32 -> bool -> Text_buffer.t ptr ->... |
f6e0a3b8111c1686ee1f3c1640eebb16b964a6489875d9ccaecd8f2a7a1b5e0e | GregoryTravis/holfenstein | FPS.hs | module FPS
( fps
, frBufferEmpty
) where
import Data.Time.Clock.POSIX (getPOSIXTime)
frBufferLen = 20
data FRBuffer = FRBuffer [Double] Double Int
frBufferEmpty = FRBuffer [] 0 0
frBufferAvg (FRBuffer _ _ 0) = 0
frBufferAvg (FRBuffer es tot num) = tot / (fromIntegral num)
frBufferAdd (FRBuffer es tot num) e | num == ... | null | https://raw.githubusercontent.com/GregoryTravis/holfenstein/fcb8743351700c701757dc13fb6defcde53be306/FPS.hs | haskell | module FPS
( fps
, frBufferEmpty
) where
import Data.Time.Clock.POSIX (getPOSIXTime)
frBufferLen = 20
data FRBuffer = FRBuffer [Double] Double Int
frBufferEmpty = FRBuffer [] 0 0
frBufferAvg (FRBuffer _ _ 0) = 0
frBufferAvg (FRBuffer es tot num) = tot / (fromIntegral num)
frBufferAdd (FRBuffer es tot num) e | num == ... | |
2c3f3c7a5541355e365fa38d4c958b84e5e3d1a4a4ced148e4eb9924f2eedf5f | f-me/carma-public | DeliveryType.hs | module Carma.Model.DeliveryType where
import Data.Text
import Data.Typeable
import Data.Model
import Data.Model.View
import Carma.Model.Types()
import Carma.Model.PgTypes()
data DeliveryType = DeliveryType
{ ident
:: PK Int DeliveryType "Тип доставки"
, label
:: F Text "label" "Тип"
} deriving Typeabl... | null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/carma-models/src/Carma/Model/DeliveryType.hs | haskell | module Carma.Model.DeliveryType where
import Data.Text
import Data.Typeable
import Data.Model
import Data.Model.View
import Carma.Model.Types()
import Carma.Model.PgTypes()
data DeliveryType = DeliveryType
{ ident
:: PK Int DeliveryType "Тип доставки"
, label
:: F Text "label" "Тип"
} deriving Typeabl... | |
e0894357ca543ea6befa354cbfb3972e24c6306d856161f2d20d2f4f131163e8 | shayne-fletcher/zen | ml_longident.mli | type t =
| Lident of string
| Ldot of t * string
| Lapply of t * t
val flatten : t -> string list
val last : t -> string
val parse : string -> t
| null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/cos/src/parsing/ml_longident.mli | ocaml | type t =
| Lident of string
| Ldot of t * string
| Lapply of t * t
val flatten : t -> string list
val last : t -> string
val parse : string -> t
| |
c02564b552a86432e463baccd5efde800849075f2e1658d017de1ffe4ecc9f2a | clojure-link/link | http2.clj | (ns link.http.http2
(:require [link.core :refer :all]
[link.http.common :refer :all]
[clojure.string :as string]
[clojure.tools.logging :as logging])
(:import [java.net InetSocketAddress]
[io.netty.buffer ByteBufInputStream]
[io.netty.channel ChannelFuture S... | null | https://raw.githubusercontent.com/clojure-link/link/2b6f6abe70edfade738c7391d38c5b509c798a40/src/link/http/http2.clj | clojure | set headers
TODO: which stream?
sync
async
for h2c | (ns link.http.http2
(:require [link.core :refer :all]
[link.http.common :refer :all]
[clojure.string :as string]
[clojure.tools.logging :as logging])
(:import [java.net InetSocketAddress]
[io.netty.buffer ByteBufInputStream]
[io.netty.channel ChannelFuture S... |
cd96943a6452ba4d80161221a24299e0d329e2bc463d387b74a45716361c0d8c | jacekschae/learn-re-frame-course-files | recipe_card.cljs | (ns app.recipes.views.recipe-card
(:require [app.router :as router]
["@smooth-ui/core-sc" :refer [Button Box Typography]]
["styled-icons/fa-solid/Heart" :refer [Heart]]
["styled-icons/fa-regular/Clock" :refer [Clock]]))
(defn recipe-card
[{:keys [name saved-count prep-time img i... | null | https://raw.githubusercontent.com/jacekschae/learn-re-frame-course-files/a86e6f14b89c595b4389b03459539a9544af4e1d/increments/27-recipe-route/src/app/recipes/views/recipe_card.cljs | clojure | (ns app.recipes.views.recipe-card
(:require [app.router :as router]
["@smooth-ui/core-sc" :refer [Button Box Typography]]
["styled-icons/fa-solid/Heart" :refer [Heart]]
["styled-icons/fa-regular/Clock" :refer [Clock]]))
(defn recipe-card
[{:keys [name saved-count prep-time img i... | |
a02a733c03fd42a3209220a0004683de5ea27d439694e703503bbdecc04279fa | GlideAngle/flare-timing | CompInput.hs | module Flight.CompInput
( readComp, writeComp
, readTask, writeTask
, readCompAndTasks, readCompAndTasksQuietly, writeCompAndTasks
, readCompTracks, readCompTracksQuietly
) where
import System.FilePath (takeDirectory)
import System.Directory (createDirectoryIfMissing)
import Control.Exception.Safe ... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/scribe/library/Flight/CompInput.hs | haskell | module Flight.CompInput
( readComp, writeComp
, readTask, writeTask
, readCompAndTasks, readCompAndTasksQuietly, writeCompAndTasks
, readCompTracks, readCompTracksQuietly
) where
import System.FilePath (takeDirectory)
import System.Directory (createDirectoryIfMissing)
import Control.Exception.Safe ... | |
78955169a2c5550adb8f0b65fc9cc7c04c0b4cc8f82500be5e6164323e99a4e0 | bmeurer/ocaml-experimental | bigarray.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
and , INRI... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/otherlibs/bigarray/bigarray.mli | ocaml | *********************************************************************
Objective Caml
... | and , INRIA Rocquencourt
Copyright 2000 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ Id$
* Large , multi - dimensional , numerical ar... |
43c58b343f8cdd3945dfa3221f12a8bb6e41e7722803d0d98af558497d5c7027 | mojombo/ernie | ernie_server.erl | -module(ernie_server).
-behaviour(gen_server).
-include_lib("ernie.hrl").
%% api
-export([start_link/1, start/1, process/1, enqueue_request/1, kick/0, fin/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
%%==============================... | null | https://raw.githubusercontent.com/mojombo/ernie/a21664e668038291bdbe42684d46cb112242aa7b/elib/ernie_server.erl | erlang | api
gen_server callbacks
====================================================================
API
====================================================================
====================================================================
gen_server callbacks
===========================================================... | -module(ernie_server).
-behaviour(gen_server).
-include_lib("ernie.hrl").
-export([start_link/1, start/1, process/1, enqueue_request/1, kick/0, fin/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
start_link(Args) ->
gen_server:start_link({local, ?MODULE}, ... |
4ce09ad2fc362c450eee0f2ee509ccb27725893be807cd066af896af51f75479 | degree9/uikit-hl | background.cljs | (ns uikit-hl.background
(:require [hoplon.core :as h]))
(defn- format-background [background]
(str "uk-background-" background))
(defmethod h/do! ::default
[elem kw v]
(h/do! elem :class {(format-background (name kw)) v}))
| null | https://raw.githubusercontent.com/degree9/uikit-hl/b226b1429ea50f8e9a6c1d12c082a3be504dda33/src/uikit_hl/background.cljs | clojure | (ns uikit-hl.background
(:require [hoplon.core :as h]))
(defn- format-background [background]
(str "uk-background-" background))
(defmethod h/do! ::default
[elem kw v]
(h/do! elem :class {(format-background (name kw)) v}))
| |
0377187a6be46f6ddd623e881c42f3cb25213744c8730300062c1edf158a04b0 | FranklinChen/learn-you-some-erlang | multiproc_tests.erl | -module(multiproc_tests).
-include_lib("eunit/include/eunit.hrl").
%% sleep's implementation is copy/pasted from the timer module.
%% not much to test to be safe.
sleep_test_() ->
[?_assertEqual(ok, multiproc:sleep(10))].
flush_test_() ->
{spawn,
[fun() ->
self() ! a,
self() ! ... | null | https://raw.githubusercontent.com/FranklinChen/learn-you-some-erlang/878c8bc2011a12862fe72dd7fdc6c921348c79d6/tests/multiproc_tests.erl | erlang | sleep's implementation is copy/pasted from the timer module.
not much to test to be safe. | -module(multiproc_tests).
-include_lib("eunit/include/eunit.hrl").
sleep_test_() ->
[?_assertEqual(ok, multiproc:sleep(10))].
flush_test_() ->
{spawn,
[fun() ->
self() ! a,
self() ! b,
ok = multiproc:flush(),
self() ! c,
[?assertEqual(receive... |
edbfd43a7e0f12ec46fadc4c5de725ee553bcba5aec7c73abb547c3747cfa45e | mhwombat/grid | Hexagonal.hs | ------------------------------------------------------------------------
-- |
Module : Math . Geometry . HexGrid
Copyright : ( c ) 2012 - 2022
-- License : BSD-style
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- A regular arrangement of hexagonal tiles.
-- T... | null | https://raw.githubusercontent.com/mhwombat/grid/b8c4a928733494f4a410127d6ae007857de921f9/src/Math/Geometry/Grid/Hexagonal.hs | haskell | ----------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : experimental
Portability : portable
A regular arrangement of hexagonal tiles.
The userguide, with illustrations, is available at
<>.
Also see @Math.Geometry.Grid@ for examples of h... | Module : Math . Geometry . HexGrid
Copyright : ( c ) 2012 - 2022
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Math.Geometry.Grid.Hexagonal
(
UnboundedHexGrid(..),
HexHexGrid(..),
hexHexGrid,
ParaHexGrid(..),
paraHexGrid
) where
import Math.G... |
4050e552e643a35cd9cfbaff2456febc360bb3246f8fdcb2d2ea0bf59a82a9d1 | sadiqj/ocaml-esp32 | untypeast.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
( O... | null | https://raw.githubusercontent.com/sadiqj/ocaml-esp32/33aad4ca2becb9701eb90d779c1b1183aefeb578/typing/untypeast.mli | ocaml | ************************************************************************
OCaml
... | ( OCamlPro ) , ( INRIA Saclay )
Copyright 2007 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Parsetree
val lident_of_path : Path.t -> Longident.t
type mapper = {
attribute: mapper -> Typedtree.attribute -> a... |
684b8f1ec4ccc89d0abb5b658dc9b2e51aa4cdf8bbb25d62edd275386bf524da | DSiSc/why3 | unix_scheduler.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/tools/unix_scheduler.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
module Unix_scheduler : sig
val blocking: bool
val multiplier: int
val timeout: ms:int -> (... |
31801a77eff31128fc51a376e7b3ceab3d7d62c390066cdcfb925f2e422be38e | otabat/couchbase-clj | util.clj | (ns couchbase-clj.util
(:require [clojure.data.json :as json]))
(defn read-json
"Reads a JSON value from input String.
If data is nil, then nil is returned.
If data is a empty string, then empty string is returned."
[data]
(when-not (nil? data) (json/read-json data true false "")))
(def ^{:doc "Wrapper of... | null | https://raw.githubusercontent.com/otabat/couchbase-clj/5f975dc85d0eec554034eefa9d97f1ee7ad9e84a/src/couchbase_clj/util.clj | clojure | (ns couchbase-clj.util
(:require [clojure.data.json :as json]))
(defn read-json
"Reads a JSON value from input String.
If data is nil, then nil is returned.
If data is a empty string, then empty string is returned."
[data]
(when-not (nil? data) (json/read-json data true false "")))
(def ^{:doc "Wrapper of... | |
6078b9228dffb6722c2b4a50cd02635b37492104fd9923e4188a946f0e22d7f5 | levex/wacc | CallingConvention.hs | module WACC.CodeGen.ARM.CallingConvention where
import WACC.CodeGen.Types
generateCallingConvention :: [Instruction] -> [Instruction]
generateCallingConvention
= undefined
| null | https://raw.githubusercontent.com/levex/wacc/c77164f0c9aeb53d3d13a0370fdedc448b6009a3/src/WACC/CodeGen/ARM/CallingConvention.hs | haskell | module WACC.CodeGen.ARM.CallingConvention where
import WACC.CodeGen.Types
generateCallingConvention :: [Instruction] -> [Instruction]
generateCallingConvention
= undefined
| |
07e761ebdcbf1c81e4fc452ad98dbfedc9063960e052e20b2114e862f846b610 | semerdzhiev/fp-2020-21 | tasks.rkt | #lang racket
Задача 0 : Да се дефинира функция ( sum - divisors n a b ) , резултат сумата на числата в затворения интервал [ a , b ] , които са делители на n
(define (div x y) (= (remainder x y) 0))
(define (sum-divisors n a b)
(
if (> a b)
0
(+ (sum-divisors n (+ a 1) b) (if (div n a) a 0))
)
... | null | https://raw.githubusercontent.com/semerdzhiev/fp-2020-21/64fa00c4f940f75a28cc5980275b124ca21244bc/group-c/week02/tasks.rkt | racket | [a, b] -> SUM(f(x)), x <- [a, b]
floor(sqrt(x))^2 == x OR floor(sqrt(x)) == sqrt(x)
(
(repeat f n) <=> f ( f ( f ( f ( ... ( f x ) ... ) ) => n пъти | #lang racket
Задача 0 : Да се дефинира функция ( sum - divisors n a b ) , резултат сумата на числата в затворения интервал [ a , b ] , които са делители на n
(define (div x y) (= (remainder x y) 0))
(define (sum-divisors n a b)
(
if (> a b)
0
(+ (sum-divisors n (+ a 1) b) (if (div n a) a 0))
)
... |
76e4373f7d6c7d092d44db9dc21241a01e798ed79e4dd151a82fa6c2fe75e332 | russmatney/ralphie | doctor.clj | (ns ralphie.doctor)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Doctor log
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn log [& args]
(apply print (concat "\n" args "\n")))
(comment
(log "Hello" "World"))
| null | https://raw.githubusercontent.com/russmatney/ralphie/3b7af4a9ec2dc2b9e59036d67a66f365691f171d/src/ralphie/doctor.clj | clojure |
Doctor log
| (ns ralphie.doctor)
(defn log [& args]
(apply print (concat "\n" args "\n")))
(comment
(log "Hello" "World"))
|
9b2d904c6ef20a40a9b62e8a73ce127ba4e5abdf64699853049e5cf7949f059b | weblocks-framework/weblocks | excerpt.lisp |
(in-package :weblocks)
(export '(*text-data-cutoff-threshold* excerpt excerpt-presentation
excerpt-presentation-cutoff-threshold))
(defparameter *text-data-cutoff-threshold* 15
"In the excerpt mode, the number of characters to be rendered
before the text is cut off and an ellipsis is inserted.")
(defcla... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/src/views/types/presentations/excerpt.lisp | lisp |
(in-package :weblocks)
(export '(*text-data-cutoff-threshold* excerpt excerpt-presentation
excerpt-presentation-cutoff-threshold))
(defparameter *text-data-cutoff-threshold* 15
"In the excerpt mode, the number of characters to be rendered
before the text is cut off and an ellipsis is inserted.")
(defcla... | |
a00aafc994c1e4ccc663604edcc2e3510c309d003d008a69bddbba0f55a1cd2b | input-output-hk/marlowe-cardano | Channel.hs |
# LANGUAGE DataKinds #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Language.Marlowe.Runtime.App.Channel
( LastSeen(..)
, runContractAction
, runDetection
, runDiscovery
) where
import Control.Concurrent (forkIO, thre... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/3c65414ea55ac58d12ea974fa40c4f0deb4cc0a6/marlowe-apps/src/Language/Marlowe/Runtime/App/Channel.hs | haskell | # LANGUAGE OverloadedStrings #
multiple actions sequentially in a single connection.
FIXME: If there were concurrency combinators for `MarloweSyncClient`, then we
could follow multiple contracts in parallel using the same connection.
Nothing needs updating.
Remove the contract from tracking.
Update ... |
# LANGUAGE DataKinds #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Language.Marlowe.Runtime.App.Channel
( LastSeen(..)
, runContractAction
, runDetection
, runDiscovery
) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Concurrent.... |
9521df02794f3bfee8c53f9c2565dd8de2c87f585edc4003438fb9cbfbf18736 | gfngfn/SATySFi | lineBreakDataMap.mli |
open MyUtil
open CharBasis
val set_from_file : abs_path -> unit
val find : Uchar.t -> line_break_class
val append_break_opportunity : Uchar.t list -> break_opportunity -> break_opportunity * line_break_element list
| null | https://raw.githubusercontent.com/gfngfn/SATySFi/9dbd61df0ab05943b3394830c371e927df45251a/src/chardecoder/lineBreakDataMap.mli | ocaml |
open MyUtil
open CharBasis
val set_from_file : abs_path -> unit
val find : Uchar.t -> line_break_class
val append_break_opportunity : Uchar.t list -> break_opportunity -> break_opportunity * line_break_element list
| |
d3930d70eab345484e0e9c277bb4a426161dec1b4534fe5590f2cf6881559adb | discus-lang/salt | StripAnnot.hs |
module Salt.Core.Transform.StripAnnot where
import Salt.Core.Exp.Module
import Salt.Core.Exp.Type
import Salt.Core.Exp.Term
import qualified Data.Map as Map
---------------------------------------------------------------------------------------------------
class StripAnnot c where
stripAnnot :: c a -> c ()
------... | null | https://raw.githubusercontent.com/discus-lang/salt/33c14414ac7e238fdbd8161971b8b8ac67fff569/src/salt/Salt/Core/Transform/StripAnnot.hs | haskell | -------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
--------------------------... |
module Salt.Core.Transform.StripAnnot where
import Salt.Core.Exp.Module
import Salt.Core.Exp.Type
import Salt.Core.Exp.Term
import qualified Data.Map as Map
class StripAnnot c where
stripAnnot :: c a -> c ()
instance StripAnnot Module where
stripAnnot mm
= Module
{ moduleDecls = map stripAnnot ... |
0b2366629d7cea78532f6905ef4d3c7473bad2b9cea6b9e454b47e8c5ade3a30 | DSiSc/why3 | loc.ml | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/util/loc.ml | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
type lexing_loc = Lexing.position * Lexing.position
type lexing_loc = Lexing.position * Lexing.positio... |
055bff9cbc5cc8006b0c15d4eae2e722a9f028a31ee44accf0fd560c70c52e1b | robrix/starlight | Text.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE NamedFieldPuns #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
module UI.Label.Text
( shader
, U(..)
, sampler_
, colour_
, V(..)
, Frag(..)
) where
import Control.Lens (Lens')
import Da... | null | https://raw.githubusercontent.com/robrix/starlight/ad80ab74dc2eedbb52a75ac8ce507661d32f488e/src/UI/Label/Text.hs | haskell | Get samples for -2/3 and -1/3
Average the energy over the pixels on either side | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE NamedFieldPuns #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
module UI.Label.Text
( shader
, U(..)
, sampler_
, colour_
, V(..)
, Frag(..)
) where
import Control.Lens (Lens')
import Da... |
21880b55fb53a77ef7557d03c5da88ab922079c8dde3f9851dcda29cc0f8badc | haskell-opengl/OpenGLRaw | VertexAttribInteger64Bit.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.VertexAttribInteger64Bit
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
--------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/NV/VertexAttribInteger64Bit.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.NV.VertexAttribInteger64Bit
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
*... | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.NV.VertexAttribInteger64Bit (
glGetNVVertexAttribInteger64Bit,
gl_NV_vertex_attrib_integer_64bit,
pattern GL_INT64_NV,
pattern GL_UNSIGNED_INT64_NV,
glGetVertexAttribLi64vNV,
glGetVertexAttribLui64vNV,... |
9587d483cd8ae3e1ba9761d98949a862c17fdb7d78b9cc19932b5609e07d2cf0 | onedata/op-worker | opt_datasets.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Utility functions for manipulating... | null | https://raw.githubusercontent.com/onedata/op-worker/c874e554c5cef4d4099b8a68b28d3441a885b82d/test_distributed/utils/opt/opt_datasets.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Utility functions for manipulating datasets in CT tests.
@end
-------------------------------------------------------------------
========================================... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(opt_datasets).
-author("Bartosz Walkowicz").
-include("modules/fslogic/acl.hrl").
-include("modules/dataset/dataset.hrl").
-export([
list_top_datasets/5,
list_children_datasets/4,
... |
6a7118c092e0f971f230e48d23c26a030d9ced8981090b6ce12de321050f1774 | Bogdanp/racket-kafka | 99-publish-consume-for-a-while.rkt | #lang racket/base
(require kafka
kafka/consumer
kafka/producer
racket/format
rackunit
rackunit/text-ui)
(define N 10000)
(define P 8)
(define t "99-publish-consume-for-a-while")
(run-tests
(test-suite
"publish-consume-for-a-while"
#:before
(lambda ()
(define k ... | null | https://raw.githubusercontent.com/Bogdanp/racket-kafka/3b1fef63c05449150759d5ee22805c4673ae1d4d/tests/99-publish-consume-for-a-while.rkt | racket | #lang racket/base
(require kafka
kafka/consumer
kafka/producer
racket/format
rackunit
rackunit/text-ui)
(define N 10000)
(define P 8)
(define t "99-publish-consume-for-a-while")
(run-tests
(test-suite
"publish-consume-for-a-while"
#:before
(lambda ()
(define k ... | |
68e769e4da957d79615c3d21bf0ec7575a68dfc77e4ab7e93121701270dcfc05 | LightAndLight/qtt | Main.hs | # language LambdaCase #
# language TypeApplications #
module Main where
import Test.Hspec
import Test.Pretty
import Test.Typecheck
import Test.Unify
main :: IO ()
main =
hspec $ do
prettySpec
typecheckSpec
unifySpec | null | https://raw.githubusercontent.com/LightAndLight/qtt/08a3ee8361178ad13bba659af4751b55c91081b7/test/Main.hs | haskell | # language LambdaCase #
# language TypeApplications #
module Main where
import Test.Hspec
import Test.Pretty
import Test.Typecheck
import Test.Unify
main :: IO ()
main =
hspec $ do
prettySpec
typecheckSpec
unifySpec | |
1c3ac528c9da90ac60834015d8fb81abf8fb81ec6fbb514920be61b6f3eafddf | jeffshrager/biobike | sbbio.lisp | (require 'asdf)
(in-package :sb-impl)
(defun string-hash (str)
(sxhash (string-upcase str)))
(define-hash-table-test 'string-equal #'string-equal #'string-hash)
(defun in-biodir (path)
(format nil "~A/~A" (posix-getenv "BIODIR") path))
(let ((biodir (posix-getenv "BIODIR")))
(push (in-biodir "uffi/") asdf:*cent... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/Portability/sbbio.lisp | lisp | (require 'asdf)
(in-package :sb-impl)
(defun string-hash (str)
(sxhash (string-upcase str)))
(define-hash-table-test 'string-equal #'string-equal #'string-hash)
(defun in-biodir (path)
(format nil "~A/~A" (posix-getenv "BIODIR") path))
(let ((biodir (posix-getenv "BIODIR")))
(push (in-biodir "uffi/") asdf:*cent... | |
162983982915c2b072f8cf9a19e31a34e1760fe441b95e436029e048ab90c638 | thosmos/riverdb | mutations.cljs | (ns riverdb.api.mutations
(:require
[com.fulcrologic.fulcro.algorithms.data-targeting :as dt :refer [process-target]]
[com.fulcrologic.fulcro.algorithms.normalize :as norm]
[com.fulcrologic.fulcro.algorithms.normalized-state :refer [remove-ident]]
[com.fulcrologic.fulcro.application :as fapp]
[com... | null | https://raw.githubusercontent.com/thosmos/riverdb/9c8dd8d73405e703475e6b78bfdfb943dee27df3/src/main/riverdb/api/mutations.cljs | clojure | CLIENT
(defmutation attempt-login
"Fulcro mutation: Attempt to log in the user. Triggers a server interaction to see if there is already a cookie."
[{:keys [uid]}]
(action [{:keys [state]}]
(swap! state assoc
:current-user {:id uid :name ""}
:server-down false))
(remote [env] true))
(defmutati... | (ns riverdb.api.mutations
(:require
[com.fulcrologic.fulcro.algorithms.data-targeting :as dt :refer [process-target]]
[com.fulcrologic.fulcro.algorithms.normalize :as norm]
[com.fulcrologic.fulcro.algorithms.normalized-state :refer [remove-ident]]
[com.fulcrologic.fulcro.application :as fapp]
[com... |
a931f56f86f22519ed2c1c0ad44cc61150aa07edd2fbff26a6e90b1e1a85306d | mpickering/apply-refact | Extensions0.hs | {-# LANGUAGE Arrows #-}
f = id | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Extensions0.hs | haskell | # LANGUAGE Arrows # | f = id |
a4e8a1e2ec1ed267fd395c73b3cd0f3ba340bdbe00ad32dfe7e7a1a2634c90fa | GaloisInc/surveyor | Debugging.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
module Surveyor.Core.Handlers.Debugging ( handleDebuggingEvent ) where
import Control.Lens ( (^.), (^?), _Just )
import qualified Control.Lens as L
import Control.Monad.IO.Class ( MonadIO, liftIO )
import qualified ... | null | https://raw.githubusercontent.com/GaloisInc/surveyor/96b6748d811bc2ab9ef330307a324bd00e04819f/surveyor-core/src/Surveyor/Core/Handlers/Debugging.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
To single step, we set the debug execution feature into its
monitoring mode, which will cause it to stop at every state and
send it to surveyor.
We then resume execution to restart the process
Interrupt execution by switching the monitor on. The monitor will
send an ev... | # LANGUAGE ScopedTypeVariables #
module Surveyor.Core.Handlers.Debugging ( handleDebuggingEvent ) where
import Control.Lens ( (^.), (^?), _Just )
import qualified Control.Lens as L
import Control.Monad.IO.Class ( MonadIO, liftIO )
import qualified Data.IORef as IOR
import Data.Parameteriz... |
df8406311b828d2bd51ff0bdc8966e5e942fcb0be896c3f07f5bc3e8c639b1aa | brendanhay/terrafomo | Settings.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
Module : . . Settings
Copyright : ( c ) 2017 - 2018
License : Mozill... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-rancher/gen/Terrafomo/Rancher/Settings.hs | haskell | This module is auto-generated.
|
Stability : auto-generated
* EnvironmentMember
| The @member@ nested settings definition.
^ @external_id@
- (Required)
^ @external_id_type@
- (Required)
^ @role@
- (Required) |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
Module : . . Settings
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintaine... |
6ebb2ea834efb6ec19a8ddd9c10762734978b0ae0a077fa24fdfe1c3f913244f | dyzsr/ocaml-selectml | typeplan.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/4b5777d28ad5d26ec091898c90a997821258ddb5/typing/typeplan.ml | ocaml | ************************************************************************
OCaml
... |
Copyright 2022
the GNU Lesser General Public License version 2.1 , with the
open Longident
open Asttypes
open Parsetree
open Ast_helper
open Types
open Typedtree
open Ctype
let scope_check scopes exp =
let super = Tast_iterator.default_iterator in
let curr... |
df43a5ea432c9243485a4daa137a26430b446704ff65e20a18db5cc983e4107f | jeromesimeon/Galax | datatypes_util.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/datatypes/datatypes_util.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : datatypes_util.mli , v 1.26 2007/07/05 08:35:53 simeon Exp $
Module Datatypes_util
Description :
This module contains basic operations on atomic values and atomic
types , at the level .
Description:
Th... |
47f39e13cb12a57fa7f78cd36fbd7c5f0f658cb594fe187d03af405774d85a6d | TokTok/hs-toxcore | Stamped.hs | {-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.Stamped where
import qualified Data.Foldable as F
import Data.List ((\\))
import Data.Map (Map)
import qualified Data.Map as Map
import Network.Tox.Time (Timestamp)
{----------------... | null | https://raw.githubusercontent.com/TokTok/hs-toxcore/3ceab5974c36c4c5dbf7518ba733ec2b6084ce5d/src/Network/Tox/DHT/Stamped.hs | haskell | # LANGUAGE Safe #
# LANGUAGE StrictData #
------------------------------------------------------------------------------
-
- :: Implementation.
-
-----------------------------------------------------------------------------
| a collection of objects associated with a timestamp.
| add a timestamped object. T... | module Network.Tox.DHT.Stamped where
import qualified Data.Foldable as F
import Data.List ((\\))
import Data.Map (Map)
import qualified Data.Map as Map
import Network.Tox.Time (Timestamp)
type Stamped a = Map Timestamp [a]
empty :: Stamped a
empty = Map.empty... |
60b6bcbd4e3ed5ba473cdd0c4f4680079a4c841f624865b794ca3ba33e052be0 | inconvergent/cl-veq | mat.lisp |
(in-package #:veq-tests)
(plan 1)
(subtest "mat"
(veq:fvprogn
(is (veq:lst (veq:f3mtv (veq:f_ `(1f0 2f0 4f0 3f0 3f0 5f0 4f0 3f0 3f0))
(veq:f3+ 1f0 2f0 4f0 1f0 2f0 4f0)))
'(46f0 40f0 52f0))
(is (veq:lst (veq:f3mv (veq:f_ `(1f0 2f0 4f0 3f0 3f0 5f0 4f0 3f0 3f0))
... | null | https://raw.githubusercontent.com/inconvergent/cl-veq/433cd43ceb086a95cfe010b1f1b4469164e60d07/test/mat.lisp | lisp |
(in-package #:veq-tests)
(plan 1)
(subtest "mat"
(veq:fvprogn
(is (veq:lst (veq:f3mtv (veq:f_ `(1f0 2f0 4f0 3f0 3f0 5f0 4f0 3f0 3f0))
(veq:f3+ 1f0 2f0 4f0 1f0 2f0 4f0)))
'(46f0 40f0 52f0))
(is (veq:lst (veq:f3mv (veq:f_ `(1f0 2f0 4f0 3f0 3f0 5f0 4f0 3f0 3f0))
... | |
c2fd0507ae2c43c3498c0c0b6be1974ab4db2badef22d2bbf5379ef34a573eb0 | andorp/mini-grin | Exercise02.hs | {-# OPTIONS_GHC -Wno-unused-matches #-}
# LANGUAGE GeneralizedNewtypeDeriving , LambdaCase , ConstraintKinds #
module Tutorial.Chapter01.Exercise02 where
import Data.Int
import Data.Word
import Data.Maybe
import Grin.Exp (Exp(..), Program, Alt, BPat(..), CPat(..), programToDefs)
import Control.Monad.Fail
import Contro... | null | https://raw.githubusercontent.com/andorp/mini-grin/99913efa0f81cb2a76893d3e48c6d025df9c40c9/grin/src/Tutorial/Chapter01/Exercise02.hs | haskell | # OPTIONS_GHC -Wno-unused-matches #
NOTE : consider renamind Store - > ( Abstract ) Heap [ to avoid confusion about store operation ]
NOTE: consider renamind Store -> (Abstract) Heap [to avoid confusion about store operation]
A runtime value can be:
A primitive value as simple value
A node value which represents ... | # LANGUAGE GeneralizedNewtypeDeriving , LambdaCase , ConstraintKinds #
module Tutorial.Chapter01.Exercise02 where
import Data.Int
import Data.Word
import Data.Maybe
import Grin.Exp (Exp(..), Program, Alt, BPat(..), CPat(..), programToDefs)
import Control.Monad.Fail
import Control.Monad.Reader
import Control.Monad.Stat... |
0e302f540a5cd73ddc37c4cd91357fe5e63884562082afa40c56532866a5484a | PLSysSec/FaCT | pos.ml | open Lexing
type pos = { file:string; line:int; lpos:int; rpos:int }
[@@deriving show]
let fake_pos = { file=""; line=0; lpos=0; rpos=0 }
type 'a pos_ast = { pos:pos; data:'a }
[@@deriving show]
let pp_pos_ast pp_data fmt { data } = pp_data fmt data
let to_pos ?buf:(b=None)
{ pos_fname=f; pos_lnum=l; pos_bol=l... | null | https://raw.githubusercontent.com/PLSysSec/FaCT/c08b2e00751b28e1f25d031c3afafc544acfb892/src/pos.ml | ocaml | open Lexing
type pos = { file:string; line:int; lpos:int; rpos:int }
[@@deriving show]
let fake_pos = { file=""; line=0; lpos=0; rpos=0 }
type 'a pos_ast = { pos:pos; data:'a }
[@@deriving show]
let pp_pos_ast pp_data fmt { data } = pp_data fmt data
let to_pos ?buf:(b=None)
{ pos_fname=f; pos_lnum=l; pos_bol=l... | |
eb5fe07d99886d638ce6ed4fd5b616493985034cc1f0a6ead6c34c1f9c4f46f2 | hasktorch/hasktorch | Dimname.hs |
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
module Torch.Internal.Unmanaged.Type.Dimname where
import qualified Language.C.Inline.Cpp a... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/6233c173e1dd9fd7218fd13b104da15fc457f67e/libtorch-ffi/src/Torch/Internal/Unmanaged/Type/Dimname.hs | haskell | # LANGUAGE OverloadedStrings # |
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
module Torch.Internal.Unmanaged.Type.Dimname where
import qualified Language.C.Inline.Cpp as C
import qualified Language.C.Inl... |
19356ad54d1e69653fc26e859be80a36cb572f8b315214c4f3f7fcc0ef3a018b | gethop-dev/object-storage.s3 | project.clj | (defproject dev.gethop/object-storage.s3 "0.6.11-SNAPSHOT"
:description "A Duct library for managing AWS S3 objects"
:url "-dev/object-storage.s3"
:license {:name "Mozilla Public Licence 2.0"
:url "-US/MPL/2.0/"}
:min-lein-version "2.9.8"
:dependencies [[org.clojure/clojure "1.10.0"]
... | null | https://raw.githubusercontent.com/gethop-dev/object-storage.s3/9576a790291f94a699bfc2f5b02edb619b45520e/project.clj | clojure | (defproject dev.gethop/object-storage.s3 "0.6.11-SNAPSHOT"
:description "A Duct library for managing AWS S3 objects"
:url "-dev/object-storage.s3"
:license {:name "Mozilla Public Licence 2.0"
:url "-US/MPL/2.0/"}
:min-lein-version "2.9.8"
:dependencies [[org.clojure/clojure "1.10.0"]
... | |
38b37b636c1559851df7d788283b04794465c3713525916581d01aead39be0e4 | spurious/sagittarius-scheme-mirror | base.sps | #!r6rs
(import (tests r6rs base)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs base)\n")
(run-base-tests)
(report-test-results)
| null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/r6rs-test-suite/tests/r6rs/run/base.sps | scheme | #!r6rs
(import (tests r6rs base)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs base)\n")
(run-base-tests)
(report-test-results)
| |
7046d40ceb69fa9cba06d2819738b968cdeaee7cda07c6737022a68922ee2d3d | manuel-serrano/bigloo | prof_emit.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / comptime / Prof / prof_emit.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/comptime/Prof/prof_emit.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The emission of the Bdb identifier translation table. */
*===========================... | * serrano / prgm / project / bigloo / comptime / Prof / prof_emit.scm * /
* Author : * /
* Creation : We d Apr 8 17:32:59 1998 * /
* Last change : Thu Nov 3 14:28:38 2011 ( serrano ) * /
* C... |
a0693dffcbe66f3f3e8bb569007621c0111cfbeaba88ea3e3c02b8317617b62d | ogri-la/strongbox-comrades | main.cljs | (ns strongbox-comrades.main
(:require
[strongbox-comrades.core :as core]
[strongbox-comrades.utils :as utils]
[strongbox-comrades.ui :as ui]))
(enable-console-print!)
(defn start
[]
(core/start)
(ui/start "app"))
(defn on-js-reload
[]
;; unmount root component?
(utils/info "reloading")
(star... | null | https://raw.githubusercontent.com/ogri-la/strongbox-comrades/bd51a4eb3818bbc6780781ef9e21bd0a449f8d2a/src/strongbox_comrades/main.cljs | clojure | unmount root component?
bootstrap
starts the app once but never again. | (ns strongbox-comrades.main
(:require
[strongbox-comrades.core :as core]
[strongbox-comrades.utils :as utils]
[strongbox-comrades.ui :as ui]))
(enable-console-print!)
(defn start
[]
(core/start)
(ui/start "app"))
(defn on-js-reload
[]
(utils/info "reloading")
(start))
hot reloading during d... |
dab9b631dddb1fca82454d255ed8fdc02ff0433dd5b4ee966fde3649ae067fad | Bodigrim/arithmoi | Coprimes.hs | -- |
Module : Math . . Euclidean . Coprimes
Copyright : ( c ) 2017 - 2018
Licence : MIT
Maintainer : < >
--
Container for pairwise coprime numbers .
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Math.NumberTheory.Euclidean.Coprimes
( splitIntoCoprimes
, ... | null | https://raw.githubusercontent.com/Bodigrim/arithmoi/c72a1017450c2f1f05a959943dec265678b1cbc3/Math/NumberTheory/Euclidean/Coprimes.hs | haskell | |
| A list of pairwise coprime numbers
with their multiplicities.
^ Unwrap.
| Check whether an element is a unit of the ring.
| The input list is assumed to be a factorisation of some number
list is a factorisation of the same number such that all factors
are coprime. Such transformation is crucial to contin... | Module : Math . . Euclidean . Coprimes
Copyright : ( c ) 2017 - 2018
Licence : MIT
Maintainer : < >
Container for pairwise coprime numbers .
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Math.NumberTheory.Euclidean.Coprimes
( splitIntoCoprimes
, Coprimes... |
593ba91596e5d9262322e40e92e56ebbd61600f5f368acd19ea292da495c52ac | CSVdB/pinky | Zip.hs | module Utils.Zip where
import Import
(><) :: [a] -> [b] -> Either String [(a, b)]
(x:xs) >< (y:ys) = fmap ((x, y) :) $ xs >< ys
[] >< [] = Right []
[] >< _ = Left "The lists do not have the same length"
_ >< [] = Left "The lists do not have the same length"
| null | https://raw.githubusercontent.com/CSVdB/pinky/e77a4c0812ceb4b8548c41a7652fb247c2ab39e0/pinky-integration-test/src/Utils/Zip.hs | haskell | module Utils.Zip where
import Import
(><) :: [a] -> [b] -> Either String [(a, b)]
(x:xs) >< (y:ys) = fmap ((x, y) :) $ xs >< ys
[] >< [] = Right []
[] >< _ = Left "The lists do not have the same length"
_ >< [] = Left "The lists do not have the same length"
| |
0b38eaece0b098ff7e73217c462ed0eaa28bbab19f408e4142b9fc9f4a472f76 | lathe/punctaffy-for-racket | main.rkt | #lang parendown/slash racket/base
punctaffy
;
Bindings that every program that uses Punctaffy - based DSLs should
; have at hand. Namely, the notations for the hyperbrackets
; themselves.
Copyright 2021 , 2022 The Lathe Authors
;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
; yo... | null | https://raw.githubusercontent.com/lathe/punctaffy-for-racket/9643122784404562e0f5d6186381f5bc1ba4adcf/punctaffy-lib/main.rkt | racket |
have at hand. Namely, the notations for the hyperbrackets
themselves.
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,
either express or implied. See the License for the spec... | #lang parendown/slash racket/base
punctaffy
Bindings that every program that uses Punctaffy - based DSLs should
Copyright 2021 , 2022 The Lathe Authors
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND ,
(require /for-syntax ra... |
344dab025eddef3f4e68319fa012aae549c313ddcd42f068b9694da49724d748 | darrenldl/ocaml-SeqBox | misc_utils.ml | open Stdint
type required_len_and_seek_to = { required_len : int64
; seek_to : int64
}
exception Invalid_range
let pad_bytes ? ( filler : uint8 = Uint8.of_int 0x00 ) ( old_bytes : bytes ) ( new_len : int ) : bytes =
let buf = Bytes.cre... | null | https://raw.githubusercontent.com/darrenldl/ocaml-SeqBox/658c623db8745ae1d804c75880b29fb53435860f/src/misc_utils.ml | ocaml | open Stdint
type required_len_and_seek_to = { required_len : int64
; seek_to : int64
}
exception Invalid_range
let pad_bytes ? ( filler : uint8 = Uint8.of_int 0x00 ) ( old_bytes : bytes ) ( new_len : int ) : bytes =
let buf = Bytes.cre... | |
7e866ab34daf062f9a58bf33ef1040c20f9bb763a2ce0f4d664122a4ad77c48d | markostanimirovic/re-action | core_test.clj | (ns re-action.core-test
(:require [clojure.test :refer :all]
[re-action.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/markostanimirovic/re-action/d6cb33d9ac73bedeac4f09996c2c741d21bda7ba/test/re_action/core_test.clj | clojure | (ns re-action.core-test
(:require [clojure.test :refer :all]
[re-action.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
2ba58305c8efa19a828bf54f7177ab38d9c7fea67dcee280fa050840dd5fc619 | datacrypt-project/hitchhiker-tree | bench.clj | (ns hitchhiker.bench
(:require [clojure.pprint :as pp]
[clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[excel-templates.build :as excel]
[hitchhiker.redis :as redis]
[hitchhiker.tree.core :refer [<?? <? go-try] :as core]
[hitchhi... | null | https://raw.githubusercontent.com/datacrypt-project/hitchhiker-tree/f7d0f926541d7cb31fac11c2d2245c5bac451b86/env/profiling/hitchhiker/bench.clj | clojure | :flush flush-csv
(clojure.pprint/pprint list-of-benchmark-results)
(println "results") | (ns hitchhiker.bench
(:require [clojure.pprint :as pp]
[clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[excel-templates.build :as excel]
[hitchhiker.redis :as redis]
[hitchhiker.tree.core :refer [<?? <? go-try] :as core]
[hitchhi... |
192e418ee48d617b6e655c9fbbc83082190f01d8e73dfcbeb74701de15e70021 | Suikaba/SelingerQuantumLambdaCalculus | intuitionistic_typed.ml | open Core
open Syntax
open Unify
exception ITypeError
type ityped_term =
IConst of constant * itype
| IVar of id * itype
| ITuple0 of itype
| IAbst of id * ityped_term * itype
| IApp of ityped_term * ityped_term * itype
| IPair of ityped_term * ityped_term * itype
| ILet of id * id * ityped_term * ity... | null | https://raw.githubusercontent.com/Suikaba/SelingerQuantumLambdaCalculus/6a5160d38ad0333278a3f1c068284e3028068a0a/src/intuitionistic_typed.ml | ocaml | type inference
todo
create intuitionistic typed term
replace with singleton | open Core
open Syntax
open Unify
exception ITypeError
type ityped_term =
IConst of constant * itype
| IVar of id * itype
| ITuple0 of itype
| IAbst of id * ityped_term * itype
| IApp of ityped_term * ityped_term * itype
| IPair of ityped_term * ityped_term * itype
| ILet of id * id * ityped_term * ity... |
c7e690ab27a36aa46b350f7c5219d4bd06c45a36457c6d10dc09fda7577939f3 | Timothy-G-Griffin/cc_cl_cam_ac_uk | interp_2.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Compiler Construction 2016
Computer Laboratory
University of Cambridge
( )
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Compiler Construction 2016
Computer Laboratory
University of Cambridge
Timo... | null | https://raw.githubusercontent.com/Timothy-G-Griffin/cc_cl_cam_ac_uk/aabaf64c997301ea69060a1b69e915b9d1031573/slang/interp_2.ml | ocaml | Interpreter 2.
A high-level stack-oriented abstract machine with compiler.
What do I mean by "high-level"?
---Code is still tree-structured.
---Complex values are pushed onto value stack.
---Slang state (heap) used only for references.
---Code is maintained on a code stack.
---Program variables contained in c... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Compiler Construction 2016
Computer Laboratory
University of Cambridge
( )
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Compiler Construction 2016
Computer Laboratory
University of Cambridge
Timo... |
d1e14efbefdce5efc30408511e339f05fcf5ad1e693477e1ec8f53690f3bfa25 | mitchellwrosen/boston-haskell-arcade | BlimpBoy.hs | # LANGUAGE TemplateHaskell #
module Bha.Game.Impl.BlimpBoy
( game
) where
import Bha.Elm.Prelude
import qualified Data.Set as Set
-- TODO Blimp boy - enemies that fire upwards
-- TODO Blimp boy - enemy blimps that fire downwards
-- TODO Blimp boy - levels
------------------------------------------------------... | null | https://raw.githubusercontent.com/mitchellwrosen/boston-haskell-arcade/2e85fbc4ddd18bad520c7544572f7205ef02015f/src/Bha/Game/Impl/BlimpBoy.hs | haskell | TODO Blimp boy - enemies that fire upwards
TODO Blimp boy - enemy blimps that fire downwards
TODO Blimp boy - levels
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------... | # LANGUAGE TemplateHaskell #
module Bha.Game.Impl.BlimpBoy
( game
) where
import Bha.Elm.Prelude
import qualified Data.Set as Set
Model
blimpx = 35 :: X
blimprow = 5 :: Row
blimpvel = 3 :: Vel
castlecol = 40 :: Col
enemycol = 0 :: X
enemyrow = 20 :: Row
enemyvel = 7 :: Vel
... |
cda861a412f1083ae15061fc5ebbf89c5d702d3dce46762c0d7654982cecfb1a | sacerdot/CovidMonitoring | server.erl | %%%---------------------------------------------------------------------
@doc Modulo server per il progetto del corso di .
%%% @end
%%%---------------------------------------------------------------------
-module(server).
-export([start/0]).
%%%-------------------------------------------------------------------
%... | null | https://raw.githubusercontent.com/sacerdot/CovidMonitoring/fe969cd51869bbe6479da509c9a6ab21d43e6d11/FabbrettiGrossi/src/server.erl | erlang | ---------------------------------------------------------------------
@end
---------------------------------------------------------------------
-------------------------------------------------------------------
@doc PROTOCOLLO DI INIZIALIZZAZIONE:
@end
--------------------------------------------------------------... | @doc Modulo server per il progetto del corso di .
-module(server).
-export([start/0]).
all'avvio si registra .
start() ->
global:register_name(server,self()),
io:format("Io sono il server~n",[]),
process_flag(trap_exit, true),
update_places([]).
1 ) Mantiene una lista dei luoghi attivi .
... |
c80f5ebf4a28139f4c8693183ed60aca28a44261f7d43670aa37c80c70ed885c | haskell/cabal | Hpc.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Hpc
-- Copyright : Thomas Tuegel 2011
-- License : BSD3
--
-- Maintainer :
-- Portability : portable
--
This module provides f... | null | https://raw.githubusercontent.com/haskell/cabal/496d6fcc26779e754523a6cc7576aea49ef8056e/Cabal/src/Distribution/Simple/Hpc.hs | haskell | # LANGUAGE RankNTypes #
---------------------------------------------------------------------------
|
Module : Distribution.Simple.Hpc
Copyright : Thomas Tuegel 2011
License : BSD3
Maintainer :
Portability : portable
a function for adding the necessary options to a PackageDescription to
----... | # LANGUAGE FlexibleContexts #
This module provides functions for locating various HPC - related paths and
build test suites with HPC enabled .
module Distribution.Simple.Hpc
( Way(..), guessWay
, htmlDir
, mixDir
, tixDir
, tixFilePath
, markupPackage
, markupTest
) where
import P... |
d90d949c40dd59cc019a3e575eb3cadf2d423d56a11346c6f458902fc25dbefc | brick-lang/kiln | frontend.ml |
module Lexer = Lexer
module ParseTree = ParseTree
module Parser = struct
include Parser
module Error = ParserError
end
| null | https://raw.githubusercontent.com/brick-lang/kiln/21ec6fe8dfd2a807e514c9a794abbf48a7836ab3/frontend/frontend.ml | ocaml |
module Lexer = Lexer
module ParseTree = ParseTree
module Parser = struct
include Parser
module Error = ParserError
end
| |
37daa7caf6f752a7ca88a097debd667986f1185b098313530babfc0dd311ad44 | janestreet/core | time_ns_intf.ml | open! Import
module type Span = sig
* [ t ] is immediate on 64bit boxes and so plays nicely with the GC write barrier .
type t = private Int63.t [@@deriving hash]
include Span_intf.S with type underlying = Int63.t and type t := t
val of_sec_with_microsecond_precision : float -> t
val of_int_us : int -> t
v... | null | https://raw.githubusercontent.com/janestreet/core/f382131ccdcb4a8cd21ebf9a49fa42dcf8183de6/core/src/time_ns_intf.ml | ocaml | * The minimum representable time span.
* The maximum representable time span.
* An alias for [min_value_for_1us_rounding].
* An alias for [max_value_for_1us_rounding].
* overflows silently
* overflows silently
* Rounds down, and raises unless denominator is positive.
* Fast, implemented as the identity function.... | open! Import
module type Span = sig
* [ t ] is immediate on 64bit boxes and so plays nicely with the GC write barrier .
type t = private Int63.t [@@deriving hash]
include Span_intf.S with type underlying = Int63.t and type t := t
val of_sec_with_microsecond_precision : float -> t
val of_int_us : int -> t
v... |
ff2ef25122053ff0b24cef97b8723682f54df86d0995b639bf28411268e3afb0 | larcenists/larceny | puzzle.scm | PUZZLE -- Forest Baskett 's Puzzle benchmark , originally written in .
(import (scheme base)
(scheme read)
(scheme write)
(scheme time))
(define (my-iota n)
(do ((n n (- n 1))
(list '() (cons (- n 1) list)))
((zero? n) list)))
(define size 511)
(define classmax 3)
(define ... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Benchmarking/R7RS/src/puzzle.scm | scheme | PUZZLE -- Forest Baskett 's Puzzle benchmark , originally written in .
(import (scheme base)
(scheme read)
(scheme write)
(scheme time))
(define (my-iota n)
(do ((n n (- n 1))
(list '() (cons (- n 1) list)))
((zero? n) list)))
(define size 511)
(define classmax 3)
(define ... | |
d9da911b905a6508f73e2db6f47e2edd403cbb59dec5de6e6dc82e93d99fd243 | TrustInSoft/tis-interpreter | print_subexps.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of TrustInSoft Analyzer .
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/value/utils/print_subexps.mli | ocaml | ************************************************************************
************************************************************************
* Printing all subexpression... | Modified by TrustInSoft
This file is part of TrustInSoft Analyzer .
val pp_all_subexps :
?include_top_exp:bool ->
(Cil_types.exp -> Cvalue.V.t) ->
Format.formatter -> Cil_types.exp -> unit
* [ ? ( include_top_exp = false ) eval_exp fmt exp ] is a pretty
printer that prin... |
70d6d25fdced13f006bb6b7f3a8e6e03fa2c00a1f9a7ea2404a3d8cfa58d14c3 | larcenists/larceny | 124.body.scm | Copyright ( C ) ( 2015 ) . All Rights Reserved .
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;; restriction, including without limitation the rights to use,
;;;... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/lib/SRFI/srfi/124.body.scm | scheme |
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
Software is furnished to do so, subject to the following
conditions... | Copyright ( C ) ( 2015 ) . All Rights Reserved .
files ( the " Software " ) , to deal in the Software without
sell copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
... |
aba32d7988eccea43b234175766302559ce0363184afa44fae1cf3fddd06e10b | facebookarchive/pfff | source_tree.ml | open Common
type subsystem = SubSystem of string
type dir = Dir of string
let string_of_subsystem (SubSystem s) = s
let string_of_dir (Dir s) = s
type tree_reorganization = (subsystem * dir list) list
let dir_to_dirfinal (Dir s) =
Str.global_replace (Str.regexp "/") "___" s
let dirfinal_of_dir s =
Dir ... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/h_files-format/source_tree.ml | ocaml | dir | open Common
type subsystem = SubSystem of string
type dir = Dir of string
let string_of_subsystem (SubSystem s) = s
let string_of_dir (Dir s) = s
type tree_reorganization = (subsystem * dir list) list
let dir_to_dirfinal (Dir s) =
Str.global_replace (Str.regexp "/") "___" s
let dirfinal_of_dir s =
Dir ... |
4f118de2982c642a5b9a7c53b515fe1fc1c8a432e48b938ee691040b0666f2f1 | ocaml/ocamlbuild | glob_lexer.mli | (***********************************************************************)
(* *)
(* ocamlbuild *)
(* *)
, , projet Galliu... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/792b7c8abdbc712c98ed7e69469ed354b87e125b/src/glob_lexer.mli | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
Original author :
open Glob_ast
type token =
| A... |
6935aaa6c4979811fd96204639e8a5e5f524f7d766a75f56cd8b9a89a5ed3b94 | expipiplus1/vulkan | XR_FB_color_space.hs | {-# language CPP #-}
-- | = Name
--
-- XR_FB_color_space - instance extension
--
-- = Specification
--
-- See
-- <#XR_FB_color_space XR_FB_color_space>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
109
--
-- = Revision
--
1
--
-- = Extension and Version Dependencies
... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/ebc0dde0bcd9cf251f18538de6524eb4f2ab3e9d/openxr/src/OpenXR/Extensions/XR_FB_color_space.hs | haskell | # language CPP #
| = Name
XR_FB_color_space - instance extension
= Specification
See
<#XR_FB_color_space XR_FB_color_space>
in the main specification for complete information.
= Registered Extension Number
= Revision
= Extension and Version Dependencies
= See Also
'ColorSpaceFB', 'SystemColorSpac... | 109
1
- Requires OpenXR 1.0
module OpenXR.Extensions.XR_FB_color_space ( enumerateColorSpacesFB
, setColorSpaceFB
, SystemColorSpacePropertiesFB(..)
, ColorSpaceFB( COLOR_SPACE_U... |
932f3b9528e2bb6606bbaadcd1b3b6d03d4dffa65bc644c4352c62c6176a28a4 | MaskRay/99-problems-ocaml | 19.ml | let split xs n =
let rec go acc n = function
| [] -> List.rev acc, []
| h::t as a -> if n == 0 then List.rev acc, a else go (h::acc) (n-1) t
in go [] n xs
let rotate xs n =
if xs = []
then []
else begin
let len = List.length xs in
let (a,b) = split xs (n mod len) in
b @ a
end
| null | https://raw.githubusercontent.com/MaskRay/99-problems-ocaml/652604f13ba7a73eee06d359b4db549b49ec9bb3/11-20/19.ml | ocaml | let split xs n =
let rec go acc n = function
| [] -> List.rev acc, []
| h::t as a -> if n == 0 then List.rev acc, a else go (h::acc) (n-1) t
in go [] n xs
let rotate xs n =
if xs = []
then []
else begin
let len = List.length xs in
let (a,b) = split xs (n mod len) in
b @ a
end
| |
67459e334ba355a2a457e304f63a2d78ae9541799687f7db36b985abfa0e49e0 | rudymatela/express | TH.hs | # LANGUAGE TemplateHaskell , CPP #
-- |
-- Module : Data.Express.Name.Derive
Copyright : ( c ) 2019 - 2021
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
--
Template Haskell utilities .
module Data.Express.Utils.TH
( reallyDeriveCascading
, deriveWhenNeeded
, deri... | null | https://raw.githubusercontent.com/rudymatela/express/936212c3cbe441f8144bcced502da023e8b2412d/src/Data/Express/Utils/TH.hs | haskell | |
Module : Data.Express.Name.Derive
|
This is useful when generating error messages.
> > showJustName ''Int
> "Int"
> > showJustName ''String
> "String"
> > showJustName ''Maybe
> "Maybe"
typeConTs (PromotedT n) = [n] ?
|
The normalized type is paired with a list of necessary type variables.
> >... | # LANGUAGE TemplateHaskell , CPP #
Copyright : ( c ) 2019 - 2021
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
Template Haskell utilities .
module Data.Express.Utils.TH
( reallyDeriveCascading
, deriveWhenNeeded
, deriveWhenNeededOrWarn
, typeConArgs
, typeConArgs... |
0ab24e618a887d3a0a757a08c04d63381e046531460f0867ebfbb791397267ab | dbuenzli/stdlib-utf | utf_uchar.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/dbuenzli/stdlib-utf/9e931944697ff6b48a54a10b425a9acdbd4ccb40/utf_uchar.ml | ocaml | ************************************************************************
OCaml
The... | Copyright 2021 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
include Uchar
UTF codecs tools
type utf_decode = int
This is an int [ 0xDUUUUUU ] decomposed as follows :
- [ D ] is four bits for decode information , the hig... |
0ffdf91f3da92520c9a618649ef1adbeafdc5fbec46f0bf4206ded23ccda5757 | racket/expeditor | port.rkt | #lang racket/base
(provide open-input-string/count
input-port-position)
(define (open-input-string/count s)
(define p (open-input-string s))
(port-count-lines! p)
p)
(define (input-port-position s)
(define-values (lin col pos) (port-next-location s))
(sub1 pos))
| null | https://raw.githubusercontent.com/racket/expeditor/f4967d687c690ff1e44d376260bd2d11f9331b00/expeditor-lib/private/port.rkt | racket | #lang racket/base
(provide open-input-string/count
input-port-position)
(define (open-input-string/count s)
(define p (open-input-string s))
(port-count-lines! p)
p)
(define (input-port-position s)
(define-values (lin col pos) (port-next-location s))
(sub1 pos))
| |
14dcb557d05a88cc788d1cc043a5aac1b610a49179b23b6a0153f6c1a8dcb147 | amnh/ocamion | simplex.mli | * { 1 Simplex Method }
The simplex uses an n+1 dimensional figure to move , like an amoeba , around
the surface . The extremities of the object are evaluated , the maximal values
are modified , while the others are progressed through improvements . The four
moves that can be done on the simplex... | null | https://raw.githubusercontent.com/amnh/ocamion/699c2471b7fdac12f061cf24b588f9eef5bf5cb8/lib/simplex.mli | ocaml | * {2 Types}
* Define a simplex as a collection of points with attached data
* Simplex strategy defines how to expand, contract, and reflect a simplex
* The Reflection factor
* The Contraction factor
* The Expansion factor
* The Shrinkage (Massive Contraction) factor
* termination is done through the standard dev... | * { 1 Simplex Method }
The simplex uses an n+1 dimensional figure to move , like an amoeba , around
the surface . The extremities of the object are evaluated , the maximal values
are modified , while the others are progressed through improvements . The four
moves that can be done on the simplex... |
082448a4294bdf93b9ed26e3ab1e516768d37e52141dfd441ba160cd9bb1081a | bsaleil/lc | fftrad4.scm.scm | ;;------------------------------------------------------------------------------
Macros
(##define-macro (def-macro form . body)
`(##define-macro ,form (let () ,@body)))
(def-macro (FLOATvector-const . lst) `',(list->vector lst))
(def-macro (FLOATvector? x) `(vector? ,x))
(def-macro (FLOATvector . lst... | null | https://raw.githubusercontent.com/bsaleil/lc/ee7867fd2bdbbe88924300e10b14ea717ee6434b/tools/benchtimes/resultVMIL-lc-gsc-lc/LC5/fftrad4.scm.scm | scheme | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Gabriel benchmarks
C benchmarks
Other benchmarks
Permission is hereby granted, ... | Macros
(##define-macro (def-macro form . body)
`(##define-macro ,form (let () ,@body)))
(def-macro (FLOATvector-const . lst) `',(list->vector lst))
(def-macro (FLOATvector? x) `(vector? ,x))
(def-macro (FLOATvector . lst) `(vector ,@lst))
(def-macro (FLOATmake-vector n . init) `(make-vector ,... |
7610ed1170427859beb86639beb0c673215e3a2e92b451f4aac5c388df344028 | karlhof26/gimp-scheme | torres-analogize.scm | ;;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Analogize script for GIMP 2.4 and Gimp 2.10.24
Copyright ( C ) 2005 < >
;
; Tags: photo, old
;
; Author statement:
A script - fu for the GIMP that makes any picture look as if it had
;; been taken using an old analog camera. Ex... | null | https://raw.githubusercontent.com/karlhof26/gimp-scheme/8e00194f318281ef9e7808b96d44ecff7cffd413/torres-analogize.scm | scheme |
The GIMP -- an image manipulation program
Tags: photo, old
Author statement:
been taken using an old analog camera. Exaggerates contrast and
saturation and creates a bright and a dark overlay randomly
faking effect. However it still can't make anything to emulate the
-------------------------------------... | Copyright ( C ) 1995 and
Analogize script for GIMP 2.4 and Gimp 2.10.24
Copyright ( C ) 2005 < >
A script - fu for the GIMP that makes any picture look as if it had
placed . Think of it as kind of a Lomo Kompakt or Kodak instantmatic
peculiar chromatism usually achieved using the real thing .
Ch... |
c53d77c195383f54da5b7b38849ae52a88fdf4db7bf801232c38eaef0b646258 | paurkedal/ocaml-radixmap | ip_radixmap.mli | Copyright ( C ) 2017 - -2022 Petter A. Urkedal < >
*
* This library 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 la... | null | https://raw.githubusercontent.com/paurkedal/ocaml-radixmap/93d0df62ac1da91c42dfdbac579e0e55a2dbdd5e/lib/ip_radixmap.mli | ocaml | * Radix map over IP networks. | Copyright ( C ) 2017 - -2022 Petter A. Urkedal < >
*
* This library 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 la... |
4e2c048660e472971bae87937020f718e89ea7a2997e09369a2ebfb4320a6ff7 | wavewave/hoodle | Simple.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# OPTIONS_GHC -fno - warn - orphans #
module Data... | null | https://raw.githubusercontent.com/wavewave/hoodle/fa7481d14a53733b2f6ae9debc95357d904a943c/types/src/Data/Hoodle/Simple.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
|
__TODO__: Remove this
__TODO__: Remove this
| Orphan instance for Pair
|
|
| Pen stroke item
| Image item
|
|
| wrapper of object embeddable in Layer
|
|
|
|
|
|
|
--------------------------
Lenses
--------------------------
|
|
|
|
|
|... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# OPTIONS_GHC -fno - warn - orphans #
module Data.Hoodle.Simple where
import Data.Aeson.TH (defaultOptions, deriv... |
30cd97eabac5158b78e546a263efc7d63c9d42f185efda0d2ccac2dec81f7567 | schemedoc/implementation-metadata | pixie.scm | (short-title "Pixie")
(title "Pixie Scheme")
(homepage-url "")
(person "Jay Reynolds Freeman")
(features)
| null | https://raw.githubusercontent.com/schemedoc/implementation-metadata/6280d9c4c73833dc5bd1c9bef9b45be6ea5beb68/schemes/pixie.scm | scheme | (short-title "Pixie")
(title "Pixie Scheme")
(homepage-url "")
(person "Jay Reynolds Freeman")
(features)
| |
b535e3759b2451c3bf711dea3d6006c115de5206a8288ca976a27de4ec289815 | con-kitty/categorifier-c | RandomExpressions.hs | # LANGUAGE ApplicativeDo #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE RecordWildCards #
- Regular tests :
( " test_codegen_small_exprs " , " -t 50 -i 1000 -m 1 " )
( " test_codegen_little_exprs " , " -t 50 -i 1000 -m 2 " )
( " test_codegen_medium_exprs " , " -t 40 -i 500 -m 6 ... | null | https://raw.githubusercontent.com/con-kitty/categorifier-c/a34ff2603529b4da7ad6ffe681dad095f102d1b9/tests/random_expressions/RandomExpressions.hs | haskell | # LANGUAGE OverloadedStrings #
| If set, print progress after @x@ test cases.
use-subprocess' flag to run generated C code in a subprocess whose failure
Run the tests. | # LANGUAGE ApplicativeDo #
# LANGUAGE QuasiQuotes #
# LANGUAGE RecordWildCards #
- Regular tests :
( " test_codegen_small_exprs " , " -t 50 -i 1000 -m 1 " )
( " test_codegen_little_exprs " , " -t 50 -i 1000 -m 2 " )
( " test_codegen_medium_exprs " , " -t 40 -i 500 -m 6 " )
( " test_codegen_large_expr... |
7f105f0820bf7864d6268d56fadf493f5fcddeba9709965c47dc64960f427c93 | conal/functor-combo | MemoTrie.hs | # LANGUAGE TypeOperators , TypeFamilies , UndecidableInstances , CPP
#
#-}
# OPTIONS_GHC -Wall #
# OPTIONS_GHC -fno - warn - unused - binds -fno - warn - unused - imports #
----------------------------------------------------------------------
-- |
Module : FunctorCombo . MemoTrie
Copyright : ( c )... | null | https://raw.githubusercontent.com/conal/functor-combo/e83af37cc2cc3b9a88dae032e19c731cf7b7b63d/src/FunctorCombo/MemoTrie.hs | haskell | --------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
Functor-based memo tries
--------------------------------------------------------------------
data-inttrie
------------------------------------------------------------------... | # LANGUAGE TypeOperators , TypeFamilies , UndecidableInstances , CPP
#
#-}
# OPTIONS_GHC -Wall #
# OPTIONS_GHC -fno - warn - unused - binds -fno - warn - unused - imports #
Module : FunctorCombo . MemoTrie
Copyright : ( c ) Conal Elliott 2010
module FunctorCombo.MemoTrie
(
HasTrie(..),memo,m... |
42a8c4c77c3a179a24b6a2de9452d5acc9b7d7340e0c3c0c4cfd9f806f70acdc | graninas/Hydra | Interpreter.hs | module Hydra.Core.SqlDB.Interpreter where
import Hydra.Prelude
import qualified Hydra.Core.SqlDB.Language as L
import qualified Hydra.Core.Domain as D
interpretSqlDBMethod
:: D.NativeSqlConn
-> (String -> IO ())
-> L.SqlDBMethodF beM a
-> IO a
interpretSqlDBMethod nativeConn logger (L.SqlDBMethod runner nex... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-free/src/Hydra/Core/SqlDB/Interpreter.hs | haskell | module Hydra.Core.SqlDB.Interpreter where
import Hydra.Prelude
import qualified Hydra.Core.SqlDB.Language as L
import qualified Hydra.Core.Domain as D
interpretSqlDBMethod
:: D.NativeSqlConn
-> (String -> IO ())
-> L.SqlDBMethodF beM a
-> IO a
interpretSqlDBMethod nativeConn logger (L.SqlDBMethod runner nex... | |
0b4df8bdf3f1c09b9989494d6e13180b7fbbb873f968bd4a89e026755227c1c2 | ibabushkin/hapstone | StorableSpec.hs | module Internal.Arm64.StorableSpec where
import Foreign
import Foreign.C.Types
import Test.Hspec
import Test.QuickCheck
import Hapstone.Internal.Arm64
import Internal.Arm64.Default
-- | main spec
spec :: Spec
spec = describe "Hapstone.Internal.Arm64" $ do
arm64OpMemStructSpec
csArm64OpSpec
csArm64Spec
... | null | https://raw.githubusercontent.com/ibabushkin/hapstone/4ac11f0a1e23e5a0f23351149c70bd541ddf5344/test/Internal/Arm64/StorableSpec.hs | haskell | | main spec
| Arm64OpMemStruct spec | module Internal.Arm64.StorableSpec where
import Foreign
import Foreign.C.Types
import Test.Hspec
import Test.QuickCheck
import Hapstone.Internal.Arm64
import Internal.Arm64.Default
spec :: Spec
spec = describe "Hapstone.Internal.Arm64" $ do
arm64OpMemStructSpec
csArm64OpSpec
csArm64Spec
getArm64OpMemS... |
3d752aef8d7e452de216d1a643de5a61a57bfd8af10073d30a47335c4c4b9a1c | hstreamdb/hstream | StatsSpecUtils.hs | module HStream.StatsSpecUtils where
import Control.Concurrent (threadDelay)
import Data.Int (Int64)
import qualified Data.Map.Strict as Map
import Data.Maybe (fromJust)
import Test.Hspec
import Z.Data.CBytes (CBytes)
import HStream.... | null | https://raw.githubusercontent.com/hstreamdb/hstream/36f5a8be4c786dfeb3d24cf1253fb6a6dad3c38c/common/stats/test/HStream/StatsSpecUtils.hs | haskell | typical cases, it shouldn't. | module HStream.StatsSpecUtils where
import Control.Concurrent (threadDelay)
import Data.Int (Int64)
import qualified Data.Map.Strict as Map
import Data.Maybe (fromJust)
import Test.Hspec
import Z.Data.CBytes (CBytes)
import HStream.... |
b42a0efe4b666037173827afd01c2829685a2b94247eb6e50f8377c50e93ebf9 | intermine/bluegenes-old | core.cljs | (ns bluegenes.tools.runtemplate.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [re-frame.core :as re-frame]
[cljs.core.async :refer [put! chan <! >! timeout close!]]
[reagent.core :as reagent]
[reagent.impl.util :as impl :refer [extract-props]]
... | null | https://raw.githubusercontent.com/intermine/bluegenes-old/5b719c7ac83a7340e0ff65790cf42413c15fb7e9/src/cljs/bluegenes/tools/runtemplate/core.cljs | clojure | adjusted (into {} (map (fn [[n t]] (replace-input-constraint ip t)) single-constraint-templates))
(println "adjusted" single-constraint-templates)
Update our state our initial, filtered template data
[:div.btn.btn-primary.btn-raised
{:on-click (fn [e] (println query))}
"run"] | (ns bluegenes.tools.runtemplate.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [re-frame.core :as re-frame]
[cljs.core.async :refer [put! chan <! >! timeout close!]]
[reagent.core :as reagent]
[reagent.impl.util :as impl :refer [extract-props]]
... |
a8bb0545abc7e50357a419f24441717bda61aa570e6a2466eb5dd86399e41fbf | exercism/racket | hamming-test.rkt | #lang racket/base
(require "hamming.rkt")
(module+ test
(require rackunit rackunit/text-ui)
(define suite
(test-suite
"point mutations tests"
(test-eqv? "no difference between empty strands"
(hamming-distance "" "")
0)
(test-eqv? "no difference between identic... | null | https://raw.githubusercontent.com/exercism/racket/4110268ed331b1b4dac8888550f05d0dacb1865b/exercises/practice/hamming/hamming-test.rkt | racket | #lang racket/base
(require "hamming.rkt")
(module+ test
(require rackunit rackunit/text-ui)
(define suite
(test-suite
"point mutations tests"
(test-eqv? "no difference between empty strands"
(hamming-distance "" "")
0)
(test-eqv? "no difference between identic... | |
36c990701497d60c7dd1f8fa220fb3e2d43ed1a11de2f836cad5c7a45a343844 | lambdabot/lambdabot | Common.hs | module Lambdabot.Plugin.Haskell.Pl.Common (
Fixity(..), Expr(..), Pattern(..), Decl(..), TopLevel(..),
bt, sizeExpr, mapTopLevel, getExpr,
operators, opchars, reservedOps, lookupOp, lookupFix, minPrec, maxPrec,
comp, flip', id', const', scomb, cons, nil, fix', if',
makeList, getL... | null | https://raw.githubusercontent.com/lambdabot/lambdabot/de01f362c7a8fc6f85c37e604168dcccb1283a0e/lambdabot-haskell-plugins/src/Lambdabot/Plugin/Haskell/Pl/Common.hs | haskell | The rewrite rules can be found at the end of the file Rules.hs
Not sure if passing the information if it was used as infix or prefix
is worth threading through the whole thing is worth the effort,
but it stays that way until the prettyprinting algorithm gets more
sophisticated.
Modularity is a drag
operator prec... | module Lambdabot.Plugin.Haskell.Pl.Common (
Fixity(..), Expr(..), Pattern(..), Decl(..), TopLevel(..),
bt, sizeExpr, mapTopLevel, getExpr,
operators, opchars, reservedOps, lookupOp, lookupFix, minPrec, maxPrec,
comp, flip', id', const', scomb, cons, nil, fix', if',
makeList, getL... |
5c6d73b275948ee504bf8950b47051a5dd5857941345620326e5e7330179d1d2 | Nutr1t07/wl-bot | Telegram.hs | {-# LANGUAGE OverloadedStrings #-}
module Core.Data.Telegram where
import Control.Lens ( (^.) )
import Core.Type.Telegram.Request as TR
( SendMsg(SendMsg) )
import Core.Type.Telegram.Update as TU
... | null | https://raw.githubusercontent.com/Nutr1t07/wl-bot/4d9db61613a3819d0addbc7e04d77bb2f57892f0/src/Core/Data/Telegram.hs | haskell | # LANGUAGE OverloadedStrings #
| Transform SendMsg into [Part] when local image upload is required. |
module Core.Data.Telegram where
import Control.Lens ( (^.) )
import Core.Type.Telegram.Request as TR
( SendMsg(SendMsg) )
import Core.Type.Telegram.Update as TU
( Mess... |
eef7f121b57eea751e00206ba8129e4c115e73c0fc7e3c2feade428024b76626 | Kalimehtar/gtk-cffi | ex6.lisp | 424
(asdf:oos 'asdf:load-op :gtk-cffi)
(defpackage #:test
(:use #:common-lisp #:gdk-cffi #:gtk-cffi #:g-object-cffi)
(:shadowing-import-from #:gtk-cffi #:image #:window))
(in-package #:test)
(gtk-init)
(defvar window)
(defvar vbox)
(defvar title)
(defvar hbox)
(defvar vbox-right)
(setf window (make-instance ... | null | https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/examples/ex6.lisp | lisp | (draw-pixbuf (gdk-window widget)
(style-field widget :bg-gc) pixbuf 0 0 dest-x dest-y)
(let ((ch (child widget)))
(when ch
(propagate- widget ch event))) | 424
(asdf:oos 'asdf:load-op :gtk-cffi)
(defpackage #:test
(:use #:common-lisp #:gdk-cffi #:gtk-cffi #:g-object-cffi)
(:shadowing-import-from #:gtk-cffi #:image #:window))
(in-package #:test)
(gtk-init)
(defvar window)
(defvar vbox)
(defvar title)
(defvar hbox)
(defvar vbox-right)
(setf window (make-instance ... |
c460644e8674cc9febe822298eb187f58fffcceed38f350bad825ceea834321e | acieroid/scala-am | fPerm-2.scm | (letrec ((f (lambda (x) (+ (* x x) (* x x)))))
(let ((f5 (f 5)))
(let ((f3 (f 3)))
(let ((f1 (f 1)))
(let ((f4 (f 4)))
(f 2))))))
| null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/changesBenevolPaper/fPerm-2.scm | scheme | (letrec ((f (lambda (x) (+ (* x x) (* x x)))))
(let ((f5 (f 5)))
(let ((f3 (f 3)))
(let ((f1 (f 1)))
(let ((f4 (f 4)))
(f 2))))))
| |
f347c5be963981b657d0aacdab41bf7bf8e3fed8ad07f4214fe4bba34ecfa46c | lilactown/lilac.town | org.clj | (ns clj-org.org
(:require [clj-org.util :refer [vec* selective-walk]]
[clojure.string :as str]
[clojure.zip :as zip]
[hiccup.util :refer [escape-html]]))
(defn header-value-for [field txt]
(->> txt
(re-seq (->> field
(format "\\#\\+%s: (.+?)\n")
... | null | https://raw.githubusercontent.com/lilactown/lilac.town/295669e4511e79877da14232457dea26f098acd8/src/clj_org/org.clj | clojure | We're done.
... otherwise, figure out where in tree to insert node:
Simple case -- same level:
=> | (ns clj-org.org
(:require [clj-org.util :refer [vec* selective-walk]]
[clojure.string :as str]
[clojure.zip :as zip]
[hiccup.util :refer [escape-html]]))
(defn header-value-for [field txt]
(->> txt
(re-seq (->> field
(format "\\#\\+%s: (.+?)\n")
... |
5407f57c1558f88d99c9e27b7ab109019071664130d6defa477940aa8a2b176d | lixiangqi/medic | src2-medic.rkt | #lang medic
(layer layer1
(in #:module "src2.rkt"
match two instances of ( inc - counter )
[at (inc-counter) [on-entry @log{[1] in @function-name : int-counter}]]
match two instances of ( + x 1 )
[at (+ x 1) #:before (inc-counter) [on-entry @log{[2]in @function-name : (+ x... | null | https://raw.githubusercontent.com/lixiangqi/medic/0920090d3c77d6873b8481841622a5f2d13a732c/demos/demo2/src2-medic.rkt | racket | only match (inc-counter) in function g | #lang medic
(layer layer1
(in #:module "src2.rkt"
match two instances of ( inc - counter )
[at (inc-counter) [on-entry @log{[1] in @function-name : int-counter}]]
match two instances of ( + x 1 )
[at (+ x 1) #:before (inc-counter) [on-entry @log{[2]in @function-name : (+ x... |
7b17f7d378989c88e8d36ab720d576d5063eb6e9d7395795d2e6d483e0734ee1 | hspec/hspec | Sort.hs | -- |
-- /NOTE:/ This module is not meant for public consumption. For user
documentation look at -discover.html .
module Test.Hspec.Discover.Sort (
sortNaturallyBy
, NaturalSortKey
, naturalSortKey
) where
import Control.Arrow
import Data.Char
import Data.List
import Data.Or... | null | https://raw.githubusercontent.com/hspec/hspec/5029c7c2acaf743f17120619279fc76a0fb97e7a/hspec-discover/src/Test/Hspec/Discover/Sort.hs | haskell | |
/NOTE:/ This module is not meant for public consumption. For user | documentation look at -discover.html .
module Test.Hspec.Discover.Sort (
sortNaturallyBy
, NaturalSortKey
, naturalSortKey
) where
import Control.Arrow
import Data.Char
import Data.List
import Data.Ord
sortNaturallyBy :: (a -> (String, Int)) -> [a] -> [a]
sortNaturallyBy f ... |
c14a8f4f709695ede3f77348728a25b3f3ded420da60f3f8de3944b7eae98a49 | pixlsus/registry.gimp.org_static | Lightning.scm | ;;------ Lightning -------------------------
; Create a lightning effect using the plasma plug-in
(define (script-fu-lightning width height hue sat turbulence desat)
; Create an img and a layer. width <-> height so we can rotate later
(let* ((img (car (gimp-image-new height width 0)))
(mainLayer (ca... | null | https://raw.githubusercontent.com/pixlsus/registry.gimp.org_static/ffcde7400f402728373ff6579947c6ffe87d1a5e/registry.gimp.org/files/Lightning.scm | scheme | ------ Lightning -------------------------
Create a lightning effect using the plasma plug-in
Create an img and a layer. width <-> height so we can rotate later
Rotate so the lightning bolt is vertical
------ Lightning Animation ---------------
Renders the lightning effect as an animation.
TODO - put frame n... |
(define (script-fu-lightning width height hue sat turbulence desat)
(let* ((img (car (gimp-image-new height width 0)))
(mainLayer (car (gimp-layer-new img height width 0 "Lightning" 100 0)))
(secondLayer (car (gimp-layer-new img height width 0 "Plasma Layer" 100 6)))
)
(gimp-image... |
96a88e1e484612c72a4e773ef69077d5ca9dfca9adf0635ff937b12fa777b392 | 0x0f0f0f/gobba | primutil.ml | open Types
let parser = Parser.toplevel Lexer.token
(** An helper function that helps extracting closures from strings,
to be used as functions in the standard library. An empty environment is used
since primitives in the standard library should not be able to access external values
TODO: compute at compile time *)
... | null | https://raw.githubusercontent.com/0x0f0f0f/gobba/61092207438fb102e36245c46c27a711b8f357cb/lib/primitives/primutil.ml | ocaml | * An helper function that helps extracting closures from strings,
to be used as functions in the standard library. An empty environment is used
since primitives in the standard library should not be able to access external values
TODO: compute at compile time | open Types
let parser = Parser.toplevel Lexer.token
let lambda_of_string name str =
try
(match (List.hd (parser (Lexing.from_string (str ^ "\n")))) with
| Expr(Lambda(p, body)) -> LazyExpression (Lambda(p, body))
| _ -> failwith "standard library definition error")
with
| e -> failwith ("s... |
10a53a36da384088c01e0613039dbb9c54ed115b5816aa30c4b0ca2f0cd5d8a3 | cljdoc/cljdoc | fixref.clj | (ns cljdoc.util.fixref
"Utilities to rewrite, or support the rewrite of, references in markdown rendered to HTML.
For example, external links are rewritten to include nofollow, links to ingested SCM
articles are rewritten to their slugs, and scm relative references are rewritten to point to SCM."
(:require [clo... | null | https://raw.githubusercontent.com/cljdoc/cljdoc/c32df6c4cc6a4a5e402907b47aeb900f42a647b0/src/cljdoc/util/fixref.clj | clojure | Some utilities to find which file in a git repository corresponds
to a file where a `def` is coming from --------------------------
choose shortest path where file sits under what looks like a src dir | (ns cljdoc.util.fixref
"Utilities to rewrite, or support the rewrite of, references in markdown rendered to HTML.
For example, external links are rewritten to include nofollow, links to ingested SCM
articles are rewritten to their slugs, and scm relative references are rewritten to point to SCM."
(:require [clo... |
611ad0b4a2c619cd9f4fc5e591d243bd7195d8ab43ead2b424f10f2a87cbaa77 | Enecuum/Node | Messages.hs | {-# LANGUAGE DeriveAnyClass #-}
module Enecuum.Samples.Assets.Nodes.TstNodes.PingPong.Messages where
import Enecuum.Prelude
newtype Ping = Ping Text
deriving (Show, Eq, Generic, ToJSON, FromJSON)
newtype Pong = Pong Int
deriving (Show, Eq, Generic, ToJSON, FromJSON)
| null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Enecuum/Samples/Assets/Nodes/TstNodes/PingPong/Messages.hs | haskell | # LANGUAGE DeriveAnyClass # |
module Enecuum.Samples.Assets.Nodes.TstNodes.PingPong.Messages where
import Enecuum.Prelude
newtype Ping = Ping Text
deriving (Show, Eq, Generic, ToJSON, FromJSON)
newtype Pong = Pong Int
deriving (Show, Eq, Generic, ToJSON, FromJSON)
|
3d321080bcd3bce1279f7d84e915bad79d37882f09c01158af27ee0f077eff4d | arthuredelstein/clooj | output.clj | (ns clooj.repl.output
(:import (java.awt Point Rectangle)
(java.util.concurrent.atomic AtomicBoolean AtomicInteger)
(javax.swing JFrame JScrollPane JSplitPane JSlider JTextArea
SwingUtilities)
(javax.swing.event DocumentEvent DocumentListener)))
(defn end-posi... | null | https://raw.githubusercontent.com/arthuredelstein/clooj/6d78d07c16ff339e782b0031eae3a2ef1eeb5280/src/clooj/repl/output.clj | clojure | manual tests
[text-area scroll-pane] (tailing-text-area) | (ns clooj.repl.output
(:import (java.awt Point Rectangle)
(java.util.concurrent.atomic AtomicBoolean AtomicInteger)
(javax.swing JFrame JScrollPane JSplitPane JSlider JTextArea
SwingUtilities)
(javax.swing.event DocumentEvent DocumentListener)))
(defn end-posi... |
f328a0a694db258801aee573d52ce08ee452c0e46abf1f70d7fbca73b47d1b5f | kmicinski/cmsc330examples | ex2.ml | let calcPercent (grade,max) =
((float_of_int grade) /. (float_of_int max)) *. 100.0
let calcPercent' grade max =
((float_of_int grade) /. (float_of_int max)) *. 100.0
let transform (f : ('a*'b) -> 'c) : 'a -> 'b -> 'c =
let h a b =
f (a,b)
in
h
| null | https://raw.githubusercontent.com/kmicinski/cmsc330examples/78f5acaaae25f11a39817673433efcf33271df6d/ocaml/ex2.ml | ocaml | let calcPercent (grade,max) =
((float_of_int grade) /. (float_of_int max)) *. 100.0
let calcPercent' grade max =
((float_of_int grade) /. (float_of_int max)) *. 100.0
let transform (f : ('a*'b) -> 'c) : 'a -> 'b -> 'c =
let h a b =
f (a,b)
in
h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.