_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 |
|---|---|---|---|---|---|---|---|---|
597a0c45e508b4880df830d488599830094144bb7a2d501d623d4767dca09516 | l3kn/lisp-compiler-llvm | compatibility.scm | (use srfi-1)
(define-syntax fn
(syntax-rules ()
((fn args body)
(lambda args body))))
(define-syntax def
(syntax-rules ()
((def var value)
(define var value))))
(define-syntax defn
(syntax-rules ()
((defn name args . body)
(define name
(lambda args . body)))))
(define-syntax ... | null | https://raw.githubusercontent.com/l3kn/lisp-compiler-llvm/4d9a734e882eed5c4da7f4cd2a779d867359511b/compatibility.scm | scheme | (define ffrfst caadar)
(define frrrst cadddr)
(format "<closure/~A>" (list (closure-arity val))))
(if (null? lst)
""
(string-append
(~> lst fst char->string)
(list->string (rst lst)))))
TODO: This will break if there are not enough vars | (use srfi-1)
(define-syntax fn
(syntax-rules ()
((fn args body)
(lambda args body))))
(define-syntax def
(syntax-rules ()
((def var value)
(define var value))))
(define-syntax defn
(syntax-rules ()
((defn name args . body)
(define name
(lambda args . body)))))
(define-syntax ... |
cdab7c45c58376d0ada4f40cbcbd58f12bd22c7c39eb911ac91d1164cf39eaa4 | well-typed-lightbulbs/ocaml-esp32 | int32.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/stdlib/int32.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
Module [ Int32 ] : 32 - bit integers
external neg : int32 -> int32 = "%int32_neg"
external add : int32... |
4fead50bf4d61e31b75efbbd0e74cad83c81015fd08edf8661f027b84835ace2 | d-cent/objective8 | admin_activity.clj | (ns objective8.front-end.templates.admin-activity
(:require [net.cgrand.enlive-html :as html]
[objective8.front-end.templates.page-furniture :as pf]
[objective8.utils :as utils]
[objective8.front-end.templates.template-functions :as tf]))
(def admin-activity-template (html/html-re... | null | https://raw.githubusercontent.com/d-cent/objective8/db8344ba4425ca0b38a31c99a3b282d7c8ddaef0/src/objective8/front_end/templates/admin_activity.clj | clojure | (ns objective8.front-end.templates.admin-activity
(:require [net.cgrand.enlive-html :as html]
[objective8.front-end.templates.page-furniture :as pf]
[objective8.utils :as utils]
[objective8.front-end.templates.template-functions :as tf]))
(def admin-activity-template (html/html-re... | |
5392eab05703e1e404052776ea92577fc181e70e919c68498963ddc1c29d9e57 | ocaml-flambda/flambda-backend | simplify_common.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/527c173ab2d4943c372256b769e17bee98ccfc62/middle_end/flambda2/simplify/simplify_common.ml | ocaml | ************************************************************************
OCaml
... | , OCamlPro
and ,
Copyright 2014 - -2019 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
open Simplify_import
type 'a after_rebuild = Rebuilt_expr.t -> Upwa... |
2295047f1337756e62ce1493e95c465ff7c9887940ba5bf055ae1dbfbea4fef6 | comby-tools/comby | rewrite.ml | open Core_kernel
open Match
open Replacement
let debug =
match Sys.getenv "DEBUG_COMBY" with
| exception Not_found -> false
| _ -> true
(* override default metasyntax for identifiers to accomodate fresh variable generation and UUID
identifiers that contain -, etc. *)
let match_context_syntax =
let identif... | null | https://raw.githubusercontent.com/comby-tools/comby/f7bf5c7b40e1a599e6003e456c202640f0d1584a/lib/kernel/rewriter/rewrite.ml | ocaml | override default metasyntax for identifiers to accomodate fresh variable generation and UUID
identifiers that contain -, etc.
create a hole in the rewrite template based on this match context
ensure custom fresh function is unique for substition.
add this match context replacement to the environment
update ... | open Core_kernel
open Match
open Replacement
let debug =
match Sys.getenv "DEBUG_COMBY" with
| exception Not_found -> false
| _ -> true
let match_context_syntax =
let identifier = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" in
Matchers.Metasyntax.{ default_metasyntax with identifier ... |
3e4882cf7a07a65e4fb3abcafc923232216fc24978f25b4c5fd1cb6e128ff394 | DavidAlphaFox/RabbitMQ | rabbit_amqp1_0_reader.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/plugins-src/rabbitmq-amqp1.0/src/rabbit_amqp1_0_reader.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
----------------... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
e7a6b015b712e1e83e0a3952f256a5479afb2325f087122b3b10b6c2bcfa28cf | league/metaserv | powHof.ml | open Num (* for arbitrary-precision arithmetic *)
let width = 54
let rec wrap puts s = (* wrap `s' into a fixed-width block *)
if String.length s <= width then puts s else
(puts (Str.string_before s width); puts "\n";
wrap puts (Str.string_after s width))
let is_zero = eq_num (Int 0)
let squar... | null | https://raw.githubusercontent.com/league/metaserv/35e85832b3d6dfe4e15b8036653d4429a90644f5/server/powHof.ml | ocaml | for arbitrary-precision arithmetic
wrap `s' into a fixed-width block
staged power function
Output begins here | let width = 54
if String.length s <= width then puts s else
(puts (Str.string_before s width); puts "\n";
wrap puts (Str.string_after s width))
let is_zero = eq_num (Int 0)
let square x = (let z = x in z */ z)
if is_zero n then (Int 1) else
if is_zero (mod_num n (Int 2)) then square(powe... |
6cbed892812f9fcab0ab11c43993c3313111bc439d5f7bf081d89a43104cd4c9 | ghcjs/ghcjs-boot | hGetBuf001.hs | -- !!! Testing hGetBuf(NonBlocking), hPutBuf(NonBlocking)
import System.Posix
import System.IO
import Control.Concurrent
import Foreign
import Foreign.C
import System.Exit
import Control.Exception
import Control.Monad
main = do
-- test should run quickly, but arrange to kill it if it hangs for any reason:
main_t... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-boot/8c549931da27ba9e607f77195208ec156c840c8a/boot/base/tests/IO/hGetBuf001.hs | haskell | !!! Testing hGetBuf(NonBlocking), hPutBuf(NonBlocking)
test should run quickly, but arrange to kill it if it hangs for any reason:
chosen to be larger than buf2 & smaller than buf3, so that we exercise
all code paths:
----------------------------------------------------------------------------
hGetBuf/hPutBuf:
... |
import System.Posix
import System.IO
import Control.Concurrent
import Foreign
import Foreign.C
import System.Exit
import Control.Exception
import Control.Monad
main = do
main_t <- myThreadId
forkIO $ do
threadDelay 10000000
throwTo main_t (ErrorCall "killed")
zipWithM_ ($)
[ f rbuf wbuf
| f <- [hGe... |
904ab9503234a50ae3d2b507adb38fc76ed89b5256bb9178f726a97a5e7bff84 | LaurentMazare/ocaml-wasmtime | memory.ml | open! Base
module W = Wasmtime.Wrappers
module V = Wasmtime.Val
let memory_wat =
{|
(module
(memory (export "memory") 2 3)
(func (export "size") (result i32) (memory.size))
(func (export "load") (param i32) (result i32)
(i32.load8_s (local.get 0))
)
(func (export "store") (param i32 i32)
(i32.stor... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-wasmtime/49d3e35676d79d6573600fa4e9ff7460106341e3/tests/memory.ml | ocaml | open! Base
module W = Wasmtime.Wrappers
module V = Wasmtime.Val
let memory_wat =
{|
(module
(memory (export "memory") 2 3)
(func (export "size") (result i32) (memory.size))
(func (export "load") (param i32) (result i32)
(i32.load8_s (local.get 0))
)
(func (export "store") (param i32 i32)
(i32.stor... | |
f022a9f45fc9492151eedce3f16c80484a8e63bd3414a9fe88f2c75bbe3be44f | ghc/ghc | Syntax.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveGeneric #
# LANGUAGE Derivin... | null | https://raw.githubusercontent.com/ghc/ghc/cc25d52e0f65d54c052908c7d91d5946342ab88a/compiler/GHC/JS/Syntax.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE GADTs #
---------------------------------------------------------------------------
|
Module : GHC.JS.Syntax
License : BSD-style (see the file LICENSE)
Stability : experimental
* Domain and Purpose
... | # LANGUAGE LambdaCase #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE BlockArguments #
# LANGUAGE PatternSynonyms #
Copyright : ( c ) The University of Glasgow 2001
... |
04ebe1932522ffcd2ed1b914ee03885469043e64a7df5f6f9785a4a05810b2b0 | janestreet/incr_dom_widgets | interactive.mli | open Core_kernel
open Import
open Vdom
* [ ' a Interactive.t ] is a monad . Within this monad , your program can receive input from
the user using DOM elements such as checkboxes , text fields , or buttons , and display
output to the user using text , tables , images , or anything else that can be
re... | null | https://raw.githubusercontent.com/janestreet/incr_dom_widgets/0dfac44c16080ad85ec0936fab0c006684f92ab6/src/interactive.mli | ocaml | Let syntax is defined at the end of this file.
... create a [Node.t] representing a checked checkbox ...
... create a [Node.t] representing an unchecked checkbox ...
* You have to schedule an action whenever the state changes in order for the view to
update correctly.
If you don't want to take any action... | open Core_kernel
open Import
open Vdom
* [ ' a Interactive.t ] is a monad . Within this monad , your program can receive input from
the user using DOM elements such as checkboxes , text fields , or buttons , and display
output to the user using text , tables , images , or anything else that can be
re... |
ea2787523abc7496c15f45af13ceed98ac0589511240c7c977ee08b3a9ed34c9 | stalefruits/fixpoint | elastic.clj | (ns fixpoint.datasource.elastic
"ElasticSearch Datasource Component
Make sure the `cc.qbits/spandec` dependency is available on your
classpath."
(:require [fixpoint.core :as fix]
[qbits.spandex :as s]
[qbits.spandex.utils :as utils])
(:import [java.util UUID]))
;; ## Client
(defn-... | null | https://raw.githubusercontent.com/stalefruits/fixpoint/4ad29c7e1d46896e8e1ba79c69b9d52a13b2e035/src/fixpoint/datasource/elastic.clj | clojure | ## Client
## Indices
## Helpers
- insert documents (w/ `:elastic/index`)
- index setup documents (w/ additional `:elastic/create?` and
`:elastic/mapping`)
## Helpers
=> \"people-ec0796d7-c1b6-49de-a2d8-e60f262b608d\" | (ns fixpoint.datasource.elastic
"ElasticSearch Datasource Component
Make sure the `cc.qbits/spandec` dependency is available on your
classpath."
(:require [fixpoint.core :as fix]
[qbits.spandex :as s]
[qbits.spandex.utils :as utils])
(:import [java.util UUID]))
(defn- start-client... |
7e4e35c18dedd9e57af8f5038851087273c8039446f00c1056d78e0b3681ab4b | FranklinChen/hugs98-plus-Sep2006 | MST.hs | ( c ) 2000 - 2005 by [ see file COPYRIGHT ]
-- | Minimum-Spanning-Tree Algorithms
module Data.Graph.Inductive.Query.MST (
msTreeAt,msTree,
-- * Path in MST
msPath
) where
import Data.Graph.Inductive.Graph
import Data.Graph.Inductive.Internal.RootPath
import qualified Data.Graph.Inductive.Internal.Hea... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/fgl/Data/Graph/Inductive/Query/MST.hs | haskell | | Minimum-Spanning-Tree Algorithms
* Path in MST | ( c ) 2000 - 2005 by [ see file COPYRIGHT ]
module Data.Graph.Inductive.Query.MST (
msTreeAt,msTree,
msPath
) where
import Data.Graph.Inductive.Graph
import Data.Graph.Inductive.Internal.RootPath
import qualified Data.Graph.Inductive.Internal.Heap as H
newEdges :: Ord b => LPath b -> Context a b -> [H.H... |
d42c80c3084c6183f7d9919040ac912331e08fd9e1445ad68b39a2afa3a9be10 | ocamllabs/ocaml-modular-implicits | js_syntax.ml | This example shows how the AST mapping approach could be used
instead of in order to give a nice syntax for js_of_ocaml
( properties and method calls ) . The code below overloads regular
syntax for field projection and assignment for Javascript
properties , and ( currified ) method call for Javas... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/experimental/frisch/js_syntax.ml | ocaml | A few local helper functions to simplify the creation of AST nodes. | This example shows how the AST mapping approach could be used
instead of in order to give a nice syntax for js_of_ocaml
( properties and method calls ) . The code below overloads regular
syntax for field projection and assignment for Javascript
properties , and ( currified ) method call for Javas... |
af50514d985e8f25f592385a339ba3e3558957ff86e0580ee72ac39d19d72f7f | melange-re/melange | setm.cppo.ml | Copyright ( C ) 2017 , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later versi... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/others/setm.cppo.ml | ocaml | * The type of the set elements.
* The type of sets. | Copyright ( C ) 2017 , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later versi... |
99253c8ed46b69dc932394eaeceaf33d32206b76957608089b235afa6c739797 | joyofclojure/book-source | contracts.clj | (ns joy.contracts
"The contracts example from chapter 8.")
(declare collect-bodies)
(defmacro defcontract
[& forms]
(let [name (if (symbol? (first forms)) ;; #1_defcontract: Check if name was supplied
(first forms)
nil)
body (collect-bodies (if name
# 3_defcontract... | null | https://raw.githubusercontent.com/joyofclojure/book-source/b76ef15248dac88c7b1c77c2d461f3aa522a1461/first-edition/src/joy/contracts.clj | clojure | #1_defcontract: Check if name was supplied | (ns joy.contracts
"The contracts example from chapter 8.")
(declare collect-bodies)
(defmacro defcontract
[& forms]
(first forms)
nil)
body (collect-bodies (if name
# 3_defcontract : Process rest if so
forms))]
# 4_defcontract : Bui... |
877b83b2e6ef207b6eff42aada6a96a23dc6dab71fc6273c647b6e7b011cf9ef | xmonad/xmonad-contrib | TrackFloating.hs | # LANGUAGE MultiParamTypeClasses , TypeSynonymInstances #
|
Module : XMonad . Layout . TrackFloating
Description : Let focused tiles track focused floats
Copyright : ( c ) 2010 & 2013 2011 : BSD - style ( see xmonad / LICENSE )
Maintainer :
Stability : unstable
Por... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/6b19388139c591990f8fbeaefaf74a54260c97b4/XMonad/Layout/TrackFloating.hs | haskell | * Usage
$usage
** For other layout modifiers
$layoutModifier
** Exported types
# DEPRECATED TrackFloating "Use X.L.FocusTracking.FocusTracking." #
| When focus is on the tiled layer, the underlying layout is run with focus
on the window named by the WM_TRANSIENT_FOR property on the floating window.
# DEPRECATED ... | # LANGUAGE MultiParamTypeClasses , TypeSynonymInstances #
|
Module : XMonad . Layout . TrackFloating
Description : Let focused tiles track focused floats
Copyright : ( c ) 2010 & 2013 2011 : BSD - style ( see xmonad / LICENSE )
Maintainer :
Stability : unstable
Por... |
de53aa0f2223120e21056bf9c37e9877a65d92c37a31c538cf0f693829f922a3 | pascal-knodel/haskell-craft | Product.hs | Cummulative product . Primitive recursion with " foldr " .
module Product where
import Prelude hiding (product)
import Data.List (foldr)
product :: [Integer] -> Integer
product = foldr (*) 1
GHCi >
product [ ]
product [ 1 ]
product [ 1 , 2 ]
product []
product [1]
product [1 , 2]
-}
1
1
... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Examples/%C2%B7%C2%A0Folds/product/foldr/Product.hs | haskell | Cummulative product . Primitive recursion with " foldr " .
module Product where
import Prelude hiding (product)
import Data.List (foldr)
product :: [Integer] -> Integer
product = foldr (*) 1
GHCi >
product [ ]
product [ 1 ]
product [ 1 , 2 ]
product []
product [1]
product [1 , 2]
-}
1
1
... | |
9db186fb08501f6923ff841b90d9bdabac3ef937a19fde6486687f9e9a651025 | mariari/Misc-Lisp-Scripts | scripts.lisp | # ! /usr / bin / sbcl --script
;; *posix-argv*
(ql:quickload 'inferior-shell)
(defun my-command-line ()
(or
#+SBCL *posix-argv*
#+LISPWORKS system:*line-arguments-list*
#+CMU extensions:*command-line-words*
nil))
(defun main ()
(write-line "Hello, World!")
(when (> (length (my-command-line)) 1... | null | https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/162fa95b870d0d0e51c662b728fcab2c962b90af/scripts/first/scripts.lisp | lisp | *posix-argv* | # ! /usr / bin / sbcl --script
(ql:quickload 'inferior-shell)
(defun my-command-line ()
(or
#+SBCL *posix-argv*
#+LISPWORKS system:*line-arguments-list*
#+CMU extensions:*command-line-words*
nil))
(defun main ()
(write-line "Hello, World!")
(when (> (length (my-command-line)) 1)
(write-lin... |
445108496784a7459f5367a05385c26257a8d5705c59aee021ceafecadc93df6 | pepijn/google-cloud-functions-clojure | env.clj | (ns nl.epij.gcf.env)
(defn extract-env-vars!
"Extract vars set by the GCF runtime: -var"
[]
{::function-target (System/getenv "FUNCTION_TARGET")
::function-signature-type (System/getenv "FUNCTION_SIGNATURE_TYPE")
::k-service (System/getenv "K_SERVICE")
::k-revision (S... | null | https://raw.githubusercontent.com/pepijn/google-cloud-functions-clojure/f339e4c96aa9f4c821f46e901bcb1eaa488876ac/src/clojure/nl/epij/gcf/env.clj | clojure | (ns nl.epij.gcf.env)
(defn extract-env-vars!
"Extract vars set by the GCF runtime: -var"
[]
{::function-target (System/getenv "FUNCTION_TARGET")
::function-signature-type (System/getenv "FUNCTION_SIGNATURE_TYPE")
::k-service (System/getenv "K_SERVICE")
::k-revision (S... | |
61ec72e009a5de7240af0fa63efb4364a677b7f3a168eb22016641837bc0caac | bravit/hid-examples | Unsafe.hs | module Elevator.Unsafe where
import qualified Elevator.LowLevel as LL
import Control.Monad.Trans
data DoorState = Opened | Closed
deriving (Eq, Show)
newtype Floor = Floor Int
deriving (Eq, Ord)
instance Bounded Floor where
minBound = Floor 0
maxBound = Floor 5
instance Show Floor where
show (Floor fl) ... | null | https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/ch13/elevator/Elevator/Unsafe.hs | haskell | module Elevator.Unsafe where
import qualified Elevator.LowLevel as LL
import Control.Monad.Trans
data DoorState = Opened | Closed
deriving (Eq, Show)
newtype Floor = Floor Int
deriving (Eq, Ord)
instance Bounded Floor where
minBound = Floor 0
maxBound = Floor 5
instance Show Floor where
show (Floor fl) ... | |
4e885a4d565797605966b1bee20d023b173ebec735a86681ec4f235d28376c3c | district0x/district-ui-web3 | effects.cljs | (ns district.ui.web3.effects
(:require
[re-frame.core :refer [reg-fx dispatch]]
[district.ui.web3.ethereum-provider :as eth-provider]
[district.ui.web3.utils :as utils :refer [web3-legacy?]]))
(defn authorize []
(try
(let [eth-send (aget js/window "ethereum" "send")]
(if eth-send
(eth-send... | null | https://raw.githubusercontent.com/district0x/district-ui-web3/4437279acac986f1d5c9e9ab38fc064cfa9e0c6b/src/district/ui/web3/effects.cljs | clojure |
::authorize-ethereum-provider
Keyword Parameters:
:on-accept - If the ethereum provider is accepted, dispatches the
provided event.
:on-reject - If the ethereum provider is rejected, dispatches the
provided event.
:on-error - If there is no ethereum provider, and no legacy provider, dispatches the provided... | (ns district.ui.web3.effects
(:require
[re-frame.core :refer [reg-fx dispatch]]
[district.ui.web3.ethereum-provider :as eth-provider]
[district.ui.web3.utils :as utils :refer [web3-legacy?]]))
(defn authorize []
(try
(let [eth-send (aget js/window "ethereum" "send")]
(if eth-send
(eth-send... |
f3ebeba04bfd724a04c00ea2890b20e72fc6f9f75349791bfaad008c4aa61cb2 | flora-pm/flora-server | Client.hs | {-# OPTIONS_GHC -Wno-unused-imports #-}
module FloraWeb.Client where
import Optics.Core
import Servant (AuthProtect, Union)
import Servant.Client
import Servant.Client.Core
import Servant.Client.Generic
import Flora.Model.PersistentSession
import Flora.Model.User.Orphans ()
import FloraWeb.Routes as Web
import Flora... | null | https://raw.githubusercontent.com/flora-pm/flora-server/c214c0b5d5db71a8330eb69326284be5a4d5e858/src/web/FloraWeb/Client.hs | haskell | # OPTIONS_GHC -Wno-unused-imports #
floraClient :: Client ClientM Pages.Routes
floraClient = genericClient
fakeSession :: Session 'Visitor
fakeSession =
mUser = Nothing
webEnvStore = undefined
in Session{..}
anonymousRequest = mkAuthenticatedRequest fakeSession addSessionCookie
addSessionCookie ... |
module FloraWeb.Client where
import Optics.Core
import Servant (AuthProtect, Union)
import Servant.Client
import Servant.Client.Core
import Servant.Client.Generic
import Flora.Model.PersistentSession
import Flora.Model.User.Orphans ()
import FloraWeb.Routes as Web
import FloraWeb.Routes.Pages qualified as Pages
impo... |
1b3e4b81fa1a8b1649c769fb2721c8291581451dc8e2e7590598b72d6d2743e3 | johnlawrenceaspden/hobby-code | lsrt.clj | ;; I often want to find out what the most recent things I've changed are, and it
;; annoys me to have to leave my REPL to find out, so I added this to my startup
;; file:
(defn as-file [x]
(try
(cond (= (class x) java.io.File) x
(string? (name x)) (java.io.File. (name x))
:else (throw (Excep... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/lsrt.clj | clojure | I often want to find out what the most recent things I've changed are, and it
annoys me to have to leave my REPL to find out, so I added this to my startup
file:
Up until this point it's all kind of sensible, and I can do
But I find that interactively, I am always forgetting quotes or typing things
in the wrong w... |
(defn as-file [x]
(try
(cond (= (class x) java.io.File) x
(string? (name x)) (java.io.File. (name x))
:else (throw (Exception. "?")))
(catch Throwable t (throw (Exception. (str x " is not a file."))))))
(defn file? [x]
(= (class (as-file x)) java.io.File))
(defn get-files [dir]
... |
5ec3545f27f4610ca0cd44a2feba97e9344072b7d293432ab5c2824f79d389fd | nikomatsakis/a-mir-formality | trait-item.rkt | #lang racket
(require redex/reduction-semantics
"../grammar.rkt"
"associated-ty-decl.rkt"
"fn-decl.rkt"
)
(provide lower-to-decl/TraitItem
)
(define-metafunction formality-rust
Lower an item from an trait to the layer .
;;
* ` FeatureIds ` -- features enabled on curr... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/71be4d5c4bd5e91d326277eaedd19a7abe3ac76a/racket-src/rust/lower-to-decl/trait-item.rkt | racket | #lang racket
(require redex/reduction-semantics
"../grammar.rkt"
"associated-ty-decl.rkt"
"fn-decl.rkt"
)
(provide lower-to-decl/TraitItem
)
(define-metafunction formality-rust
Lower an item from an trait to the layer .
* ` FeatureIds ` -- features enabled on current c... | |
4e280466daa3bcf1fb933ccb82c89a26e3413d6e317c478a14efb8f9d3080343 | well-typed-lightbulbs/ocaml-esp32 | chicken.mli |
val x : int
| null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/lib-dynlink-private/plugin5/chicken.mli | ocaml |
val x : int
| |
9b4f9a43cffb47553b80081c97f815bd1d837cd7f9f15fe098df357427ba0cde | pa-ba/compdata | Transform.hs | # LANGUAGE
TemplateHaskell ,
MultiParamTypeClasses ,
FlexibleInstances ,
FlexibleContexts ,
UndecidableInstances ,
TypeOperators ,
ScopedTypeVariables ,
TypeSynonymInstances #
TemplateHaskell,
MultiParamTypeClasses,
FlexibleInstances,
FlexibleContexts,
UndecidableInstances,
T... | null | https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/benchmark/DataTypes/Transform.hs | haskell | # LANGUAGE
TemplateHaskell ,
MultiParamTypeClasses ,
FlexibleInstances ,
FlexibleContexts ,
UndecidableInstances ,
TypeOperators ,
ScopedTypeVariables ,
TypeSynonymInstances #
TemplateHaskell,
MultiParamTypeClasses,
FlexibleInstances,
FlexibleContexts,
UndecidableInstances,
T... | |
26ce084605524972933f9693ba019a2bdd972fbb664b9fdfdb464fd37faf21af | josefs/Gradualizer | depth.erl | -module(depth).
-export([bar3/0, bar4/0]).
-spec bar3() -> {{{0}}}.
bar3() -> {{{1}}}.
not detected by
-spec bar4() -> {{{{0}}}}.
bar4() -> {{{{1}}}}.
| null | https://raw.githubusercontent.com/josefs/Gradualizer/208f5816b0157f282212fc036ba7560f0822f9fc/test/should_fail/depth.erl | erlang | -module(depth).
-export([bar3/0, bar4/0]).
-spec bar3() -> {{{0}}}.
bar3() -> {{{1}}}.
not detected by
-spec bar4() -> {{{{0}}}}.
bar4() -> {{{{1}}}}.
| |
c120452b6ec522cf2f12438003c116e475fde7d34953ad5bed67b6a2b9c84925 | fons/cl-mongo | packages.lisp | (in-package #:cl-user)
(defpackage #:cl-mongo
(:use #:common-lisp #:babel #:uuid #:usocket)
(:export
;;
:*mongo-default-port*
:*mongo-default-host*
:*mongo-default-db*
:document
:make-document
:add-element
:get-element
:collect-all-elements
:rm-element
:ht->document
:mapdoc
... | null | https://raw.githubusercontent.com/fons/cl-mongo/141518d34fddc9ba42d3813362abae12b368f059/src/packages.lisp | lisp |
commands
shell commands
syntax expansion
javascript
multi-threaded stuff
documentation generator | (in-package #:cl-user)
(defpackage #:cl-mongo
(:use #:common-lisp #:babel #:uuid #:usocket)
(:export
:*mongo-default-port*
:*mongo-default-host*
:*mongo-default-db*
:document
:make-document
:add-element
:get-element
:collect-all-elements
:rm-element
:ht->document
:mapdoc
:doc-i... |
67116faa668ff94114bc16810327e8a2ed6d97627b5a6ec2eda2eae514ce519b | hexlet-basics/exercises-racket | index.rkt | #lang racket
(provide scroll-left!)
#| BEGIN |#
(define (scroll-left! s)
(let ([length (string-length s)])
(unless (zero? length)
(let ([head (substring s 0 1)])
(string-copy! s 0 s 1 length)
(string-copy! s (sub1 length) head)))))
#| END |#
| null | https://raw.githubusercontent.com/hexlet-basics/exercises-racket/ae3a45453584de1e5082c841178d4e43dd47e08a/modules/50-strings/60-immutability/index.rkt | racket | BEGIN
END | #lang racket
(provide scroll-left!)
(define (scroll-left! s)
(let ([length (string-length s)])
(unless (zero? length)
(let ([head (substring s 0 1)])
(string-copy! s 0 s 1 length)
(string-copy! s (sub1 length) head)))))
|
f98a211ab19b06e6448f0e60b3e26790e4c80ada50aad2aaaf0d343fad83edee | flipstone/orville | MonadBaseControl.hs | |
Module : Database . Orville . PostgreSQL.Internal . : Flipstone Technology Partners 2016 - 2018
License : MIT
' Database . Orville . PostgreSQL.MonadBaseControl ' provides functions and instances for
using ' MonadOrville ' and ' OrvilleT ' for situations where you need to use
' MonadBaseControl '... | null | https://raw.githubusercontent.com/flipstone/orville/aee8d7a47ab3a7b442fdb274dbb5a95d687a23ce/orville-postgresql/src/Database/Orville/PostgreSQL/MonadBaseControl.hs | haskell | # LANGUAGE RankNTypes #
|
liftWithConnectionViaBaseControl can be use as the implementation of
'liftWithConnection' for 'MonadOrvilleControl' when the 'Monad'
implements 'MonadBaseControl'.
|
liftFinallyViaBaseControl can be use as the implementation of
'liftFinally for 'MonadOrvilleControl' when the '... | |
Module : Database . Orville . PostgreSQL.Internal . : Flipstone Technology Partners 2016 - 2018
License : MIT
' Database . Orville . PostgreSQL.MonadBaseControl ' provides functions and instances for
using ' MonadOrville ' and ' OrvilleT ' for situations where you need to use
' MonadBaseControl '... |
9a0afde2236364fe752d84610202f5dcf291f113add5417e545345389a97d5a1 | footprintanalytics/footprint-web | tables.clj | (ns metabase.sync.sync-metadata.tables
"Logic for updating Metabase Table models from metadata fetched from a physical DB."
(:require [clojure.data :as data]
[clojure.string :as str]
[clojure.tools.logging :as log]
[metabase.models.database :refer [Database]]
[metabas... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/sync/sync_metadata/tables.clj | clojure | Django
Drupal
PostGIS
nginx
---------------------------------------------------- Syncing -----------------------------------------------------
TODO - should we make this logic case-insensitive like it is for fields?
if the table already exists but is marked *inactive*, mark it as *active*
otherwise create a new... | (ns metabase.sync.sync-metadata.tables
"Logic for updating Metabase Table models from metadata fetched from a physical DB."
(:require [clojure.data :as data]
[clojure.string :as str]
[clojure.tools.logging :as log]
[metabase.models.database :refer [Database]]
[metabas... |
2639094e19aaa7b40b263e4ab00d22409194c761a66fca39cc02343405a8dae6 | alanb2718/wallingford | compiled-selecting-live3.rkt | #lang s-exp rosette
; hand compiled code selecting-live3.rkt
(require "../reactive/reactive.rkt")
(require "../reactive/abstract-reactive-thing.rkt")
(require "compiled-reactive-thing.rkt")
put item as the first element in the list referred to by the box things
(define (put-first item things)
(let* ([things-list (... | null | https://raw.githubusercontent.com/alanb2718/wallingford/9dd436c29f737d210c5b87dc1b86b2924c0c5970/compiled-reactive/compiled-selecting-live3.rkt | racket | hand compiled code selecting-live3.rkt
hand written versions of methods intended to be compiled automatically
compiling for these constraints:
(always* (equal? mp (mouse-position)))
(define potential-targets (filter (lambda (c) (contains-point c mp)) (unbox my-image)))
if there is a button press between the c... | #lang s-exp rosette
(require "../reactive/reactive.rkt")
(require "../reactive/abstract-reactive-thing.rkt")
(require "compiled-reactive-thing.rkt")
put item as the first element in the list referred to by the box things
(define (put-first item things)
(let* ([things-list (unbox things)]
[others (filter (... |
72a43eb713927c21a23b5c02bde4c069112ac1c7b321b587def98333fe1047f6 | dnlkrgr/hsreduce | Functions.hs | module Reduce.Passes.Functions (inline, etaReduceMatches, rmvMatches, rmvRHSs, rmvGuards, betaReduceExprs, substituteVarWithExpr) where
import Data.Generics.Uniplate.Data (transformBi, universeBi)
import GHC hiding (Pass)
import Util.Types
import Util.Util
substituteVarWithExpr :: LHsExpr GhcPs -> RdrName -> HsExpr G... | null | https://raw.githubusercontent.com/dnlkrgr/hsreduce/8f66fdee036f8639053067572b55d9a64359d22c/src/Reduce/Passes/Functions.hs | haskell | f = g
function with:
- without guards
- where the body is applying some function to an argument
***************************************************************************
MATCHES
***************************************************************************
********************************************************... | module Reduce.Passes.Functions (inline, etaReduceMatches, rmvMatches, rmvRHSs, rmvGuards, betaReduceExprs, substituteVarWithExpr) where
import Data.Generics.Uniplate.Data (transformBi, universeBi)
import GHC hiding (Pass)
import Util.Types
import Util.Util
substituteVarWithExpr :: LHsExpr GhcPs -> RdrName -> HsExpr G... |
22b110270aac6a2f18cc1f82d2bc8683d0e42a1c4c728c3f86254097f818898f | janestreet/universe | scope.ml | open Core_kernel
open! Import
module Node = Types.Node
include Types.Scope
let top = Top
let is_top = function
| Top -> true
| Bind _ -> false
;;
let invariant = function
| Top -> ()
| Bind bind -> Bind.invariant ignore ignore bind
;;
(* Unlike for nodes, there is no invariant [is_necessary t <=> height > -... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/incremental/src/scope.ml | ocaml | Unlike for nodes, there is no invariant [is_necessary t <=> height > -1] (doesn't work
because of [Top]). This is fine since the height of a scope is only used to constrain
other heights, not to schedule it. | open Core_kernel
open! Import
module Node = Types.Node
include Types.Scope
let top = Top
let is_top = function
| Top -> true
| Bind _ -> false
;;
let invariant = function
| Top -> ()
| Bind bind -> Bind.invariant ignore ignore bind
;;
let height = function
| Top -> -1
| Bind bind -> bind.lhs_change.heig... |
1d88894c53ce141ab6975608ea520cfc63e6363cad96d18293ab6e598d8c6729 | andrejbauer/alg | iso.ml | open Theory
open Algebra
exception Break
exception Found
(*
Checks if a function commutes with permutation.
f(i(a)) = i(f(a)).
*)
let check_unary iso u1 u2 =
let l = Array.length iso in
Util.for_all (fun i -> iso.(u1.(i)) = u2.(iso.(i))) 0 (l-1)
(*
Checks if binary operation is multiplicative.
*)
let check... | null | https://raw.githubusercontent.com/andrejbauer/alg/95715bb1bf93fcc534a8d6c7c96c8913dc03de0c/src/iso.ml | ocaml |
Checks if a function commutes with permutation.
f(i(a)) = i(f(a)).
Checks if binary operation is multiplicative.
Handle constants
Generate actions from unary and binary operations analogous to generation
of actions from axioms. Axioms here are implicit from the definition of isomorphism
I... | open Theory
open Algebra
exception Break
exception Found
let check_unary iso u1 u2 =
let l = Array.length iso in
Util.for_all (fun i -> iso.(u1.(i)) = u2.(iso.(i))) 0 (l-1)
let check_binary iso b1 b2 =
let l = Array.length iso in
Util.for_all2 (fun i j -> iso.(b1.(i).(j)) = b2.(iso.(i)).(iso.(j))) 0 (l-1) 0 ... |
0a7dcfae32e24397dec9e25b403daae5bf189dacf98d7fb642ee38e2fb40f6dc | abrantesasf/sicp-abrantes-study-guide | fredo-2005-recitation1.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MIT 6.001 Fall/2005 ; ; ; ; ;
: Basic scheme expressions ; ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Student : ; ; ; ; ;
Date : 2019 - 0... | null | https://raw.githubusercontent.com/abrantesasf/sicp-abrantes-study-guide/c8d41093ed3d9944f003e88b7e1b7b29fbb6874a/recitations/1/fredo-2005-recitation1.scm | scheme |
; ; ; ;
; ; ; ;
; ; ; ;
; ; ; ;
Value of the following scheme expressions?
compound procedure
#f
#f
Error, subexpressions do not have an operator and "+3" and "-5" are
not applicable
Error! The "=" procedure is for INTEGERS. As a matter of fact, the
"=" name is bounded to "integer-equal?" procedure.
Val... |
(+ 3 5)
8
(7)
Error , 7 is been applied to nothing
7
7
-
(= 2 3)
(> 4 5)
(7 - 4)
Error , 7 is not an operator and is not applicable
(* (+3 5) (-5 2))
(= #t #f)
(define wouldyouaddthesetwonumbersplease +)
(define one 1)
(define two (+ one one))
(wouldyouaddthesetwonumbersplease one two)
3
(+ 5 ... |
8932e935953698bc4f22851d937c4252609551a59efa079ed214dcf851f8745d | ar-nelson/schemepunk | datalog.test.scm | (import (scheme base)
(schemepunk syntax)
(schemepunk list)
(schemepunk sort)
(schemepunk comparator)
(schemepunk datalog)
(schemepunk test))
(define pair-comparator
(make-pair-comparator symbol-comparator (make-default-comparator)))
(define alist-comparator
(make-l... | null | https://raw.githubusercontent.com/ar-nelson/schemepunk/e2840d3c445933528aaf0a36ec72b053ec5016ce/tests/datalog.test.scm | scheme | (import (scheme base)
(schemepunk syntax)
(schemepunk list)
(schemepunk sort)
(schemepunk comparator)
(schemepunk datalog)
(schemepunk test))
(define pair-comparator
(make-pair-comparator symbol-comparator (make-default-comparator)))
(define alist-comparator
(make-l... | |
75be81ee26f95e487ac70f6901cf06095b5769454dcf8931c664f27ef4b2becd | dalmatinerdb/mstore | mfile.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2016 ,
%%% @doc MStore file module.
%%%
%%%
%%% Bitmap logic:
%%% the mfile keeps an bitmap of points written. The bitmap file
structure is similar to the structure of the .mstore file
%%% as in that each element has ... | null | https://raw.githubusercontent.com/dalmatinerdb/mstore/3cefb9cfa0eb28ad53be023690b2a4a9a8d180b5/src/mfile.erl | erlang | -------------------------------------------------------------------
@doc MStore file module.
Bitmap logic:
the mfile keeps an bitmap of points written. The bitmap file
as in that each element has a fixed size and is written in order
based on the .idx file.
The bitmap file is **not** guaranteed to be up to date... | @author < >
( C ) 2016 ,
structure is similar to the structure of the .mstore file
the datafile works as a WAL for the bitmap , when our WAL is
It should be noted that last_modified returns second precisions
1 ) p1 opens for write
2 ) p1 writes ( updates BMP ) min memory
3 ) p2 opens for reads
... |
e9fc7e822a8fa244884ad7410205fd0d96581fdeeaa4cc07b95af025dc7d2f60 | tsloughter/kuberl | kuberl_v1beta1_non_resource_attributes.erl | -module(kuberl_v1beta1_non_resource_attributes).
-export([encode/1]).
-export_type([kuberl_v1beta1_non_resource_attributes/0]).
-type kuberl_v1beta1_non_resource_attributes() ::
#{ 'path' => binary(),
'verb' => binary()
}.
encode(#{ 'path' := Path,
'verb' := Verb
}) ->
#{ 'path... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1beta1_non_resource_attributes.erl | erlang | -module(kuberl_v1beta1_non_resource_attributes).
-export([encode/1]).
-export_type([kuberl_v1beta1_non_resource_attributes/0]).
-type kuberl_v1beta1_non_resource_attributes() ::
#{ 'path' => binary(),
'verb' => binary()
}.
encode(#{ 'path' := Path,
'verb' := Verb
}) ->
#{ 'path... | |
95e719dcededc22fc17f1cdf91a851a4d98569e37e77d9a4ef24eabefe1bd694 | janegca/htdp2e | Exercise-203-Quasiquote.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname Exercise-203-Quasiquote) (read-case-sensitive #t) (teachpacks ((lib "universe.rkt" "teachpack" "... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/02-Intermezzo-Quote/Exercise-203-Quasiquote.rkt | racket | about the language level of this file in a form that our tools can easily process.
Eliminate quasiquote and unquote from the following expressions so that
they are written with list instead:
this table-like shape:
`(html
(head
(title ,title))
(body
(h... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname Exercise-203-Quasiquote) (read-case-sensitive #t) (teachpacks ((lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "image.rkt" "teachpack" "2htdp")... |
c057abd1b84170a678070915b1a68e7b5d263f68a92cad08d57c72ca02e59f97 | edgecase/dieter | manifest.clj | (ns dieter.test.asset.manifest
(:require [dieter.asset.manifest :as manifest]
[dieter.asset :as asset]
[dieter.test.helpers :as h]
[dieter.core :as core]
[clojure.java.io :as io])
(:use [clojure.test]))
(deftest test-manifest-files
(let [manifest "test/fixtures/ass... | null | https://raw.githubusercontent.com/edgecase/dieter/f3c7cdd7703c6d1556e68bbe8fc94406b717f6f1/dieter-core/test/dieter/test/asset/manifest.clj | clojure | To ensure this test is actually effective, we added enough files to have
a high degree of certainty that its sorted on Linux. We also chose files
is case-insensitive, so below E.js will be in the middle of the list on
shouldnt hit
test for incorrect behaviour. When a dir A should contain a file A but doesn't, diet... | (ns dieter.test.asset.manifest
(:require [dieter.asset.manifest :as manifest]
[dieter.asset :as asset]
[dieter.test.helpers :as h]
[dieter.core :as core]
[clojure.java.io :as io])
(:use [clojure.test]))
(deftest test-manifest-files
(let [manifest "test/fixtures/ass... |
9bf84e5ad9eb04f7b5043fa36a84d4a88b910f46a0435cbab2762b859c007e12 | bradrn/cabasa | Canvas.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Cabasa.Canvas where
import Control.Monad (when)
import Data.Bifunctor (first)
import Data.Foldable (for_)
import Data.Functor (($>))
import Data.Ar... | null | https://raw.githubusercontent.com/bradrn/cabasa/e938275d60095bdb85dcd1d4685e8dc5d2d77add/src/Cabasa/Canvas.hs | haskell | # LANGUAGE OverloadedStrings #
^ The (x,y) coordinates of the cursor position, in grid
coordinates, relative to the top-left of the grid
^ Same as 'gridPos', but relative to the top-left of the
^ whether the mouse button was pressed, and (x, y), of mouse event
^ Where to start overwriting
^ The new universe to ov... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Cabasa.Canvas where
import Control.Monad (when)
import Data.Bifunctor (first)
import Data.Foldable (for_)
import Data.Functor (($>))
import Data.Array (array, assocs, bounds)
import ... |
6d2d7f9bc0a306c4a3e53eae5ba237cf5683739151f0dc4933a77870d5588093 | well-typed/large-records | R010.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
{-# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin #-}
{-# OPTIONS_GHC -fplugin-opt=Data.Record.Anon.Plugin:noapply #-}
module Experiment.Con... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-records-benchmarks/bench/large-anon/Experiment/ConstructNoApply/Sized/R010.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings #
# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin #
# OPTIONS_GHC -fplugin-opt=Data.Record.Anon.Plugin:noapply #
00 .. 09 | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.ConstructNoApply.Sized.R010 where
import Data.Record.Anon.Simple (Record)
import Bench.Types
import Common.RowOfSize.Row010
record :: Word -> Record ExampleRow
record x = ANON {
t00 = MkT x
, t01 = MkT x
, t02 = MkT x
, t03 =... |
52ad22d19e03a91981963dd0556f3868493b50e502848f3c879fb52f790dc91c | hurryabit/pukeko | FrontEnd.hs | module Pukeko.FrontEnd
( Module
, run
)
where
import Pukeko.Prelude hiding (run)
import Pukeko.AST.Language
import Pukeko.AST.Name
import qualified Pukeko.AST.SystemF as SystemF
import qualified Pukeko.FrontEnd.ClassEliminator as ClassEliminator
import qualified Pukeko.FrontEnd.FunResolver... | null | https://raw.githubusercontent.com/hurryabit/pukeko/d11a101a41123c5151bcdd7dd2d0ef53c65483c2/src/Pukeko/FrontEnd.hs | haskell | module Pukeko.FrontEnd
( Module
, run
)
where
import Pukeko.Prelude hiding (run)
import Pukeko.AST.Language
import Pukeko.AST.Name
import qualified Pukeko.AST.SystemF as SystemF
import qualified Pukeko.FrontEnd.ClassEliminator as ClassEliminator
import qualified Pukeko.FrontEnd.FunResolver... | |
572fcdbab7957da0bd6be06a8bdaaefc57ca829ef35abe04f1ae17da52e0543e | qingliangcn/mgee | mgee_virtual_world_sup.erl | %%%----------------------------------------------------------------------
%%% File : mgee_virtual_world_sup.erl
%%% Author : Qingliang
Created : 2010 - 01 - 04
Description : Ming game engine erlang
%%%----------------------------------------------------------------------
-module(mgee_virtual_world_sup).
-beha... | null | https://raw.githubusercontent.com/qingliangcn/mgee/b65babc3a34ef678ae2b25ce1a8fdd06b2707bb8/src/mgee_virtual_world_sup.erl | erlang | ----------------------------------------------------------------------
File : mgee_virtual_world_sup.erl
Author : Qingliang
----------------------------------------------------------------------
--------------------------------------------------------------------
Include files
---------------------------------... | Created : 2010 - 01 - 04
Description : Ming game engine erlang
-module(mgee_virtual_world_sup).
-behaviour(supervisor).
-include("mgee.hrl").
-export([]).
-export([
start_link/0,
init/1
]).
Macros
-define(SERVER, ?MODULE).
Records
start_link() ->
supervisor:start_link({local, ?SERVER}, ?M... |
005e05345719921196b5fd023673aab141e53f7122bea947192be916db900a66 | Twinside/Rasterific | Sample.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Sample where
import Codec.Picture
import Codec.Picture.Gif
import Graphics.Rasterific
import Graphics.Rasterific.Texture
import Graphics.Rasterific.Transformations
triangles :: IO ()
triangles =
case writeGifImages "triangles.gif" LoopingForever image... | null | https://raw.githubusercontent.com/Twinside/Rasterific/eb07ea38aaad154e66de14a1b4a50fb70d0843bb/exec-src/Sample.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Sample where
import Codec.Picture
import Codec.Picture.Gif
import Graphics.Rasterific
import Graphics.Rasterific.Texture
import Graphics.Rasterific.Transformations
triangles :: IO ()
triangles =
case writeGifImages "triangles.gif" LoopingForever image... | |
7a39b9e795921cdf1d574e569e0bd55ed161219ad9795d2ae722fa658a3453a0 | uxbox/uxbox-backend | main.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
Copyright ( c ) 2016 < >
(ns uxbox.main
(:require [clojure.tools.namespace.repl :as repl]
[clojure.walk :refer [macroexpa... | null | https://raw.githubusercontent.com/uxbox/uxbox-backend/036c42db8424be3ac34c38be80577ee279141681/src/uxbox/main.clj | clojure |
--- Development Stuff | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2016 < >
(ns uxbox.main
(:require [clojure.tools.namespace.repl :as repl]
[clojure.walk :refer [macroexpand-... |
6b614e610cd17df1f760706b51db3458724dd643dcd10fab45a9d592320ecf34 | haskell/hoopl | Label.hs | # LANGUAGE CPP , TypeFamilies #
# LANGUAGE DeriveFunctor , , DeriveTraversable #
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Safe #-}
#endif
module Compiler.Hoopl.Label
( Label
, freshLabel
, LabelSet, LabelMap
, FactBase, noFacts, lookupFact
MkGraph and GHC use only
GHC use only
)
where
import Compi... | null | https://raw.githubusercontent.com/haskell/hoopl/89dde6af5b2fadfad726412c00a1ab01d34fd2a0/src/Compiler/Hoopl/Label.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
Label
---------------------------------------------------------------------------
---------------------------------------------------------------------------
LabelSet
--------------------------------------------------------... | # LANGUAGE CPP , TypeFamilies #
# LANGUAGE DeriveFunctor , , DeriveTraversable #
#if __GLASGOW_HASKELL__ >= 701
#endif
module Compiler.Hoopl.Label
( Label
, freshLabel
, LabelSet, LabelMap
, FactBase, noFacts, lookupFact
MkGraph and GHC use only
GHC use only
)
where
import Compiler.Hoopl.Collections
... |
83ad48ab677ad645f9b4d4d2a762c0fc033fbac9200bb0b4cfc35a09fd48c30d | aiya000/haskell-examples | select_tuple.hs | # LANGUAGE TemplateHaskell #
import Language.Haskell.TH
import Control.Monad
runQ [ | \(x , y , z ) - > z | ]
-- = > LamE [ TupP [ VarP x_0,VarP y_1,VarP z_2 ] ] ( z_2 )
runQ [ | \(_,_,z ) - > z | ]
-- = > LamE [ TupP [ WildP , WildP , VarP z_3 ] ] ( )
runQ [| \(x,y,z) -> z |]
-- => LamE [TupP [VarP... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Language/Haskell/TH/Room/select_tuple.hs | haskell | = > LamE [ TupP [ VarP x_0,VarP y_1,VarP z_2 ] ] ( z_2 )
= > LamE [ TupP [ WildP , WildP , VarP z_3 ] ] ( )
=> LamE [TupP [VarP x_0,VarP y_1,VarP z_2]] (VarE z_2)
=> LamE [TupP [WildP,WildP,VarP z_3]] (VarE z_3) | # LANGUAGE TemplateHaskell #
import Language.Haskell.TH
import Control.Monad
runQ [ | \(x , y , z ) - > z | ]
runQ [ | \(_,_,z ) - > z | ]
runQ [| \(x,y,z) -> z |]
runQ [| \(_,_,z) -> z |]
-}
thd :: ExpQ
thd = newName "z" >>= \z ->
lamE [tupP [wildP, wildP, varP z]] (varE z)
select :: Int -> Int... |
2cd53ec34d719e177aad86c1fe7432daca9343228fdd4b0a133f70b6f3621b9f | manavpatnaik/haskell | 30_check_palindrome.hs | reverseNum :: Int -> Int -> Int
reverseNum num rev
| (num == 0) = rev
| otherwise = (reverseNum (num `div` 10) ((rev*10) + (num `rem` 10)))
isPalindrome :: Int -> Bool
isPalindrome n = (n == (reverseNum n 0))
main = do
print(reverseNum 1234 0)
print(isPalindrome 1234)
print(reverseNum 1234321 0 )... | null | https://raw.githubusercontent.com/manavpatnaik/haskell/9e7c805afb2607468c2e2977247266ccc19d24b6/basic-programs/30_check_palindrome.hs | haskell | reverseNum :: Int -> Int -> Int
reverseNum num rev
| (num == 0) = rev
| otherwise = (reverseNum (num `div` 10) ((rev*10) + (num `rem` 10)))
isPalindrome :: Int -> Bool
isPalindrome n = (n == (reverseNum n 0))
main = do
print(reverseNum 1234 0)
print(isPalindrome 1234)
print(reverseNum 1234321 0 )... | |
6c58dbbdbbe2b03a659dc9cb19c993841fa3642b6696e6dd0a243a355cdcac58 | typedclojure/typedclojure | typed.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/80063d6eb6f8da34d8dfa2d722b9a85eb539e057/typed/clj.runtime/src/clojure/core/typed.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns
^{:doc "This namespace contains typed wrapper macros, type aliases
and functions for type checking Clojure code. check-ns is the interface
for checking namespaces, cf for checking individual forms."}
clojure.core.typed
(:refer-clojure :exclude [type defprotocol #_... |
1f1b8912641ec70f8b05adae3df94ff62dbc5714890c52e8e4f9aec1d3c3a7dc | weblocks-framework/weblocks | pagination-utils.lisp |
(in-package :weblocks-test)
;;; utilities for easier testing
(defun pagination-goto-form-template (action &key (page-one-p nil) (validatedp t) (uri "/foo/bar"))
`(:form :action ,uri :method "get"
:onsubmit ,(format nil "initiateFormAction(\"~A\", ~
$(... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/test/widgets/pagination-utils.lisp | lisp | utilities for easier testing
~
" |
(in-package :weblocks-test)
(defun pagination-goto-form-template (action &key (page-one-p nil) (validatedp t) (uri "/foo/bar"))
`(:form :action ,uri :method "get"
:onsubmit ,(format nil "initiateFormAction(\"~A\", ~
$(this), ~
... |
9156127c5d377ed906653ebda4289fb9bdb88631cdc281bc263673e9a0b50c4a | AndrewRademacher/gdax | GDAX.hs | module Network.GDAX
( module Explicit
) where
import Network.GDAX.Explicit as Explicit
| null | https://raw.githubusercontent.com/AndrewRademacher/gdax/3473aef6eb0282779b061875b7ea7e959e18b24f/lib/Network/GDAX.hs | haskell | module Network.GDAX
( module Explicit
) where
import Network.GDAX.Explicit as Explicit
| |
99c17d5ee21c1d1e4bebae5e64911cab966d50ff4d1dfbbc04a2d750218fd787 | mfikes/coal-mine | problem_145.cljc | (ns coal-mine.problem-145
(:require [coal-mine.checks :refer [defcheck-145] :rename {defcheck-145 defcheck}]
[clojure.test]))
(defn run-tests []
(clojure.test/run-tests 'coal-mine.problem-145))
(defn -main []
(run-tests))
#?(:cljs (set! *main-cli-fn* -main))
| null | https://raw.githubusercontent.com/mfikes/coal-mine/0961d085b37f4e59489a8cf6a2b8fef0a698d8fb/src/coal_mine/problem_145.cljc | clojure | (ns coal-mine.problem-145
(:require [coal-mine.checks :refer [defcheck-145] :rename {defcheck-145 defcheck}]
[clojure.test]))
(defn run-tests []
(clojure.test/run-tests 'coal-mine.problem-145))
(defn -main []
(run-tests))
#?(:cljs (set! *main-cli-fn* -main))
| |
c26ec8e9b2025275a35db4006af7f75d92a5e32aa4b84caf15422fbf8977dad9 | eeng/shevek | impl.clj | (ns shevek.engine.druid-native.impl
(:require [shevek.engine.protocol :refer [Engine]]
[shevek.engine.default-planner :as default-planner]
[shevek.engine.druid-native.metadata :as metadata]
[shevek.engine.druid-native.raw :as raw]
[shevek.engine.druid-native.solver :as ... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/clj/shevek/engine/druid_native/impl.clj | clojure | (ns shevek.engine.druid-native.impl
(:require [shevek.engine.protocol :refer [Engine]]
[shevek.engine.default-planner :as default-planner]
[shevek.engine.druid-native.metadata :as metadata]
[shevek.engine.druid-native.raw :as raw]
[shevek.engine.druid-native.solver :as ... | |
a7eb48ec51316256d40c23bdc33a47f647a58a6a1973260e0f8ebc7126fd2350 | aveltras/arohi | Server.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Arohi.Route.Server where
import Control.Monad.Fix (MonadFix)
import qualified Data.ByteString.Char8 as C8 (unpack)
import Data.Maybe (fromMaybe)
import Data.Text (Text, pack)
import Data.Text.Encoding (decodeUtf8)
impor... | null | https://raw.githubusercontent.com/aveltras/arohi/1629e2232e54d3b96c6c13d26697f26c7ba4f1b9/arohi-route-server/Arohi/Route/Server.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes # | # LANGUAGE FlexibleContexts #
module Arohi.Route.Server where
import Control.Monad.Fix (MonadFix)
import qualified Data.ByteString.Char8 as C8 (unpack)
import Data.Maybe (fromMaybe)
import Data.Text (Text, pack)
import Data.Text.Encoding (decodeUtf8)
import Network.URI (URI(..), nullURI, parseURI)
import Network.Wai (... |
e53229d877f3719e84a58b00bb350d27fecbf5595e5d8fac5f859ba83edd97ba | toschoo/mom | Publisher.hs | -------------------------------------------------------------------------------
-- |
Module : Network / Mom / Patterns / Basic / Publisher.hs
Copyright : ( c )
-- License : LGPL
-- Stability : experimental
-- Portability: non-portable
--
Publish side of ' Publish / Subscribe '
---------------------... | null | https://raw.githubusercontent.com/toschoo/mom/b58ca23d05c98ab50d9e981bd4ad2cdb76846399/src/patterns/src/Network/Mom/Patterns/Basic/Publisher.hs | haskell | -----------------------------------------------------------------------------
|
License : LGPL
Stability : experimental
Portability: non-portable
-----------------------------------------------------------------------------
* Publisher
* Forwarder
-----------------------------------------------------------... | Module : Network / Mom / Patterns / Basic / Publisher.hs
Copyright : ( c )
Publish side of ' Publish / Subscribe '
module Network.Mom.Patterns.Basic.Publisher (
Pub, withPub, issue,
withForwarder
)
where
import qualifie... |
73bca5c910089c61f8297e568492ebe68c005c51f5b7c9c71909a8ff383ea579 | SimulaVR/godot-haskell | VisualShaderNodeBooleanConstant.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualShaderNodeBooleanConstant
(Godot.Core.VisualSh... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/VisualShaderNodeBooleanConstant.hs | haskell | | A boolean constant which represents a state of this node.
| A boolean constant which represents a state of this node.
| A boolean constant which represents a state of this node.
| A boolean constant which represents a state of this node. | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualShaderNodeBooleanConstant
(Godot.Core.VisualSh... |
96d8019c93fcddd6619bb753a40fb3e5421281a30b6f6ab0a78b011437135168 | AdaCore/why3 | eliminate_unused.mli | val eliminate_unused : Task.task Trans.trans
| null | https://raw.githubusercontent.com/AdaCore/why3/a07f5a6a593a545047d0fe4073bf458b935aa10c/src/transform/eliminate_unused.mli | ocaml | val eliminate_unused : Task.task Trans.trans
| |
1459a90829aabfdd34614784ece9e95b5afc9b8b472d82ecb5b9cce8ac73dedf | abakst/Brisk | SpawnSym.hs | {-# OPTIONS_GHC -fplugin Brisk.Plugin #-}
# OPTIONS_GHC -fplugin - opt Brisk . Plugin : main #
# LANGUAGE TemplateHaskell #
module SpawnSym (main) where
import Control.Monad (forM)
import Control.Distributed.Process
import Control.Distributed.BriskStatic
import Control.Distributed.Process.Closure
import Control.Distri... | null | https://raw.githubusercontent.com/abakst/Brisk/3e4ce790a742d3e3b786dba45d36f715ea0e61ef/examples/SpawnSym.hs | haskell | # OPTIONS_GHC -fplugin Brisk.Plugin # | # OPTIONS_GHC -fplugin - opt Brisk . Plugin : main #
# LANGUAGE TemplateHaskell #
module SpawnSym (main) where
import Control.Monad (forM)
import Control.Distributed.Process
import Control.Distributed.BriskStatic
import Control.Distributed.Process.Closure
import Control.Distributed.Process.SymmetricProcess
p :: Proce... |
42394c94c9986eb5d5e78574acf8efcf7f54d4eccc0ae81ae26c91317c9cec4c | asmala/clj-simple-form | form_scope_test.clj | (ns clj-simple-form.form-scope-test
(:use [clojure.test]
[clj-simple-form.form-scope])
(:require [clj-simple-form.i18n :as i18n]
[clj-simple-form.test-support :as support]))
;; SETUP
(def values {:name "Janne Asmala" :email "example.com"
:address {:street "First Street"}})
(def er... | null | https://raw.githubusercontent.com/asmala/clj-simple-form/b1c566b1f0fe532639b15832b557f1608598a0a2/clj-simple-form-core/test/clj_simple_form/form_scope_test.clj | clojure | SETUP
TESTS | (ns clj-simple-form.form-scope-test
(:use [clojure.test]
[clj-simple-form.form-scope])
(:require [clj-simple-form.i18n :as i18n]
[clj-simple-form.test-support :as support]))
(def values {:name "Janne Asmala" :email "example.com"
:address {:street "First Street"}})
(def errors {:em... |
fcdb582d2ec9e592daa42ad6b56e8b747d907ef03cae14f521b7bcc55cdf652f | ryantm/nixpkgs-update | Git.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Git
( findAutoUpdateBranchMessage,
mergeBase,
cleanAndResetTo,
commit,
deleteBranchesEverywhere,
delete1,
diff,
diffFileNames,
fetch,
fetchIfStale,
headRev,
push,
nixpkgsDir,
setupNixpkgs,
G... | null | https://raw.githubusercontent.com/ryantm/nixpkgs-update/e2050fb126d1353d6c33b626a8aaf2067b7abe4c/src/Git.hs | haskell | # LANGUAGE OverloadedStrings #
Since we are going to have to fetch, git reset, clean, and commit, we setup a
requires that user has forked nixpkgs
Return Nothing if a remote branch for this package doesn't exist. If a
branch does exist, return a Just of its last commit message. | # LANGUAGE TemplateHaskell #
module Git
( findAutoUpdateBranchMessage,
mergeBase,
cleanAndResetTo,
commit,
deleteBranchesEverywhere,
delete1,
diff,
diffFileNames,
fetch,
fetchIfStale,
headRev,
push,
nixpkgsDir,
setupNixpkgs,
Git.show,
worktreeAdd,
workt... |
5005346d6055fe4f7faebade297d1286683b998dd00dd69cdac6adeb5358b133 | ajhc/ajhc | FromHs.hs | module E.FromHs(
convertDecls,
convertRules,
createInstanceRules,
procAllSpecs,
getMainFunction
) where
import Data.Char
import Control.Monad.Error
import Control.Monad.Identity
import Control.Monad.RWS
import Data.List(isPrefixOf,nub)
import Prelude
import Text.Printf
import qualified Data.Map... | null | https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/src/E/FromHs.hs | haskell | verifies namespace
XXX why do these still exist?
convertType t = do
| create a RULE for each instance attached to the class methods.
These rules allow early specialization of monomorphic code, and are
eventually used in E.TypeAnalysis.expandPlaceholder to fill out
the generic class method bodies.
foldl EAp ( EAp... | module E.FromHs(
convertDecls,
convertRules,
createInstanceRules,
procAllSpecs,
getMainFunction
) where
import Data.Char
import Control.Monad.Error
import Control.Monad.Identity
import Control.Monad.RWS
import Data.List(isPrefixOf,nub)
import Prelude
import Text.Printf
import qualified Data.Map... |
1a830783a10cc8b7e4cc67dd4c773851ae904b889156f1d183f35229f3e3a850 | haskell-opengl/OpenGLRaw | TextureSRGBDecode.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
Module : Graphics .
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
-----------------------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/EXT/TextureSRGBDecode.hs | haskell | ------------------------------------------------------------------------------
|
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums | # LANGUAGE PatternSynonyms #
Module : Graphics .
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.EXT.TextureSRGBDecode (
glGetEXTTextureSRGBDecode,
gl_EXT_texture_sRGB_decode,
pattern GL_DECODE_EXT,
pattern GL_SKIP_DECODE_EXT,
pattern GL_TEXTURE_SRGB_DECODE_EXT
) where... |
3721aff6892c882d8bf13a8421e01ff49b306c25a0ee99977d99b9fe4dac5c51 | manuel-serrano/bigloo | weakptr.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / / runtime / Llib / weakptr.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : We ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/ededdffd7187d28b1d8ef4af5f0f903f3392ba46/runtime/Llib/weakptr.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Weak pointers. */
*===========================... | * serrano / prgm / project / bigloo / / runtime / Llib / weakptr.scm * /
* Author : * /
* Creation : We d Dec 13 15:32:17 CET 2006 * /
* Last change : Fri Nov 26 13:01:45 2021 ( serrano ) * /
(module __weakp... |
7ad9be2eaec3d50880919dec8d50809e5c4b11ba0548aa8ceff6e9dc28936ba7 | rvantonder/CryptOSS | sanitize.ml | open Core
type t = Record.t String.Table.t Date.Table.t
let (!!) date =
let year = Date.year date in
let month = Date.month date |> Month.to_int in
let day = Date.day date in
Format.sprintf "%d-%02d-%02d" year month day
let f table line =
match String.split ~on:',' line with
| date :: cryptocurrency_name... | null | https://raw.githubusercontent.com/rvantonder/CryptOSS/acd931433f70fd097930b2e62a294af6d31a2a77/command-line/sanitize.ml | ocaml | data does not have enough fields
generate null lines for all repos for missing dates | open Core
type t = Record.t String.Table.t Date.Table.t
let (!!) date =
let year = Date.year date in
let month = Date.month date |> Month.to_int in
let day = Date.day date in
Format.sprintf "%d-%02d-%02d" year month day
let f table line =
match String.split ~on:',' line with
| date :: cryptocurrency_name... |
9f8f90308992f7c44e82d8bfcd667a1b1eab2f04e46049a7bba2600d016deff0 | bytekid/mkbtt | kernel.ml | Copyright 2008 , Christian Sternagel ,
* GNU Lesser General Public License
*
* This file is part of TTT2 .
*
* TTT2 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 , ei... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/ttt2/src/kernel.ml | ocaml | ** OPEN ********************************************************************
** MODULES *****************************************************************
** TYPES *******************************************************************
** EXCEPTIONS **************************************************************
** GLOBALS *... | Copyright 2008 , Christian Sternagel ,
* GNU Lesser General Public License
*
* This file is part of TTT2 .
*
* TTT2 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 , ei... |
084028aa36e4707d5994e5025315cadb53b3a357c420f2ab710e7ec3a829e3ce | leptonyu/salak | SalakBench.hs | module Main(main) where
import Control.Monad.Reader
import Criterion.Main
import Data.Default
import Data.Text (Text)
import Data.Time
import Data.Time.Clock.System
import Salak
main = do
sp <- loadAndRunSalak' (loadMock vals) retur... | null | https://raw.githubusercontent.com/leptonyu/salak/0976e3f0792913df259e9bcaaee02f13d2b501f7/salak/bench/SalakBench.hs | haskell | module Main(main) where
import Control.Monad.Reader
import Criterion.Main
import Data.Default
import Data.Text (Text)
import Data.Time
import Data.Time.Clock.System
import Salak
main = do
sp <- loadAndRunSalak' (loadMock vals) retur... | |
9c20504d86797dc11fb391b14ca5dd92220b641e9105850e6a710c619e86a190 | realworldocaml/book | import.ml | include Stdune
module Log = Dune_util.Log
module Re = Dune_re
module Stringlike = Dune_util.Stringlike
module Stringlike_intf = Dune_util.Stringlike_intf
module Persistent = Dune_util.Persistent
module Value = Dune_util.Value
module Ml_kind = Ocaml.Ml_kind
module Cm_kind = Ocaml.Cm_kind
module Mode = Ocaml.Mode
module ... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_engine/import.ml | ocaml | To make bug reports usable | include Stdune
module Log = Dune_util.Log
module Re = Dune_re
module Stringlike = Dune_util.Stringlike
module Stringlike_intf = Dune_util.Stringlike_intf
module Persistent = Dune_util.Persistent
module Value = Dune_util.Value
module Ml_kind = Ocaml.Ml_kind
module Cm_kind = Ocaml.Cm_kind
module Mode = Ocaml.Mode
module ... |
8a8dbbac8dc2190d91a2db2766bdbe7ee050aa26d4908932c64899c0180014d1 | emqx/emqx | emqx_connector_mqtt_schema.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/969cbecf91cd71f3f4a0d83f6fa4a9f45329645e/apps/emqx_connector/src/mqtt/emqx_connector_mqtt_schema.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_connector_mqtt_schema).
-include_lib("typerefl/include/types.hrl").
-include_lib("... |
74832aef6f358ccde840652e256faa2c495e2224c56ba54cdf7d8a28e9c1a11d | ghcjs/jsaddle-dom | SVGAnimatedBoolean.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGAnimatedBoolean
(setBaseVal, getBaseVal, getAnimVal, SVGAnimatedBoolean(..),
gTypeSVGAnimatedBoolean)
... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/SVGAnimatedBoolean.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGAnimatedBoolean
(setBaseVal, getBaseVal, getAnimVal, SVGAnimatedBoolean(..),
gTypeSVGAnimatedBoolean)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe... |
6f09af7b3f2c4413c326a734ad66abfb1305f18d4cd2f6e4760cfa788d7569ec | goblint/analyzer | lattice.ml | (** The lattice signature and simple functors for building lattices. *)
module Pretty = GoblintCil.Pretty
module GU = Goblintutil
(* module type Rel =
sig
type t
type relation = Less | Equal | Greater | Uncomparable
val rel : t -> t -> relation
val in_rel : t -> relation -> t -> bool
end *)
partial order :... | null | https://raw.githubusercontent.com/goblint/analyzer/b6e2c032edbfafdf38dba385e3264857c9c0ace2/src/domains/lattice.ml | ocaml | * The lattice signature and simple functors for building lattices.
module type Rel =
sig
type t
type relation = Less | Equal | Greater | Uncomparable
val rel : t -> t -> relation
val in_rel : t -> relation -> t -> bool
end
complete lattice
* Exception raised by a topless lattice in place of a top value.
... |
module Pretty = GoblintCil.Pretty
module GU = Goblintutil
partial order : elements might not be comparable and no bot / top - > join etc . might fail with exception Uncomparable
exception Uncomparable
module type PO =
sig
include Printable.S
val leq: t -> t -> bool
val join: t -> t -> t
val meet: t -> t ->... |
ec74d3e3d7210de9389ad1348e994fbd6bf61c6991252e14cc6748e4f35eb823 | bobzhang/ocaml-book | type_eq.ml |
type (_,_) eq =
| Refl : ('a,'a) eq
let sym : ('a,'b) eq -> ('b,'a)eq =
function Refl -> Refl
let trans :('a,'b) eq
-> ('b,'a) eq
-> ('a,'c) eq = fun Refl Refl
-> Refl
module type TC = sig
type 'a tc
end
module type SUBST= functor (T : TC) ->
sig
val subst :
('a,'b) eq ->
('a T.... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/lang/code/type_eq.ml | ocaml |
type (_,_) eq =
| Refl : ('a,'a) eq
let sym : ('a,'b) eq -> ('b,'a)eq =
function Refl -> Refl
let trans :('a,'b) eq
-> ('b,'a) eq
-> ('a,'c) eq = fun Refl Refl
-> Refl
module type TC = sig
type 'a tc
end
module type SUBST= functor (T : TC) ->
sig
val subst :
('a,'b) eq ->
('a T.... | |
c3e5169ee3ccd26b993094fd39bff90ba4f940a43faa39568ce3b9da614feefd | babashka/babashka | env_test.clj | (ns vault.env-test
(:require
[clojure.test :refer [deftest is]]
[vault.client.mock :refer [mock-client]]
[vault.env :as venv]))
(deftest uri-resolution
(let [client (mock-client {"some/path" {:id "foo"}})]
(is (thrown? Exception (venv/resolve-uri nil "vault:some/path#id"))
"resolution with... | null | https://raw.githubusercontent.com/babashka/babashka/7fac0f1eb99348ca3c40d3b89c52a41312e97e8a/test-resources/lib_tests/vault/env_test.clj | clojure | (ns vault.env-test
(:require
[clojure.test :refer [deftest is]]
[vault.client.mock :refer [mock-client]]
[vault.env :as venv]))
(deftest uri-resolution
(let [client (mock-client {"some/path" {:id "foo"}})]
(is (thrown? Exception (venv/resolve-uri nil "vault:some/path#id"))
"resolution with... | |
3da54d8dc31a9c1627328478df748e4c35b2f0f323e6470f51b76db3dddf944e | theasp/sente-nodejs-example | project.clj | (defproject com.taoensso.examples/sente "1.10.0-SNAPSHOT"
:description "Sente, node.js web-app example project"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"
:distribution :repo
:comments "Same as Clojure"}
:min-lein-version "2.3.3"
... | null | https://raw.githubusercontent.com/theasp/sente-nodejs-example/29f733b615d9a789031221e9e29e662d2d180050/project.clj | clojure | <--- Sente
Optional, just for HTML
---> Choose (uncomment) a supported web server <---
may be used to aid perf . of larger data payloads
(see reference example for details):
websocket is needed for the node.js client
:optimizations :simple
:source-map "target/main.js.map"
:optimizations simple
:source-map "tar... | (defproject com.taoensso.examples/sente "1.10.0-SNAPSHOT"
:description "Sente, node.js web-app example project"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"
:distribution :repo
:comments "Same as Clojure"}
:min-lein-version "2.3.3"
... |
bf3f309dcf3eae52242824c419d5ca0838672508e307dab6a24579b7b9ee17ad | graninas/Functional-Design-and-Architecture | SampleNetwork.hs | module SampleNetwork where
import Andromeda.Hardware
import Andromeda.Simulator
aaaManufacturer = "AAA Inc."
guid1 = "3539390d-f189-4434-bd9e-d39e494a869a"
guid2 = "c80a1ba3-1e7a-4af9-a10b-2313cc10f9e4"
guid3 = "02ecabc3-1a02-481f-8e9a-7b0cc62e38f5"
aaa_p_02 = component sensors guid1 aaaManufacturer "Pressure sensor... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/1736abc16d3e4917fc466010dcc182746af2fd0e/First-Edition/BookSamples/CH05/5.3.1%20Impure%20State%20with%20IORef/SampleNetwork.hs | haskell | terminal units are computers inside network
controllers are computers inside device | module SampleNetwork where
import Andromeda.Hardware
import Andromeda.Simulator
aaaManufacturer = "AAA Inc."
guid1 = "3539390d-f189-4434-bd9e-d39e494a869a"
guid2 = "c80a1ba3-1e7a-4af9-a10b-2313cc10f9e4"
guid3 = "02ecabc3-1a02-481f-8e9a-7b0cc62e38f5"
aaa_p_02 = component sensors guid1 aaaManufacturer "Pressure sensor... |
bbfef57ab9d6aef6de616b7c0a664839dc738b611ee226d590e5d61a36f8ad1b | NorfairKing/super-user-spark | Import.hs | module Import
( module X
) where
import Prelude as X hiding (appendFile)
import Control.Arrow as X
import Data.Maybe as X
import GHC.Generics as X
import System.Exit as X
import Text.Read as X (readEither)
import Path as X
import Path.IO as X
import Control.Monad as X
import Control.Monad.Except as X
import... | null | https://raw.githubusercontent.com/NorfairKing/super-user-spark/3c286a52a0b81e083c0e6d39f6f2b02aa9bb9231/src/Import.hs | haskell | module Import
( module X
) where
import Prelude as X hiding (appendFile)
import Control.Arrow as X
import Data.Maybe as X
import GHC.Generics as X
import System.Exit as X
import Text.Read as X (readEither)
import Path as X
import Path.IO as X
import Control.Monad as X
import Control.Monad.Except as X
import... | |
e9575467aa5e669fe3d2fcf505d89d09112cb4f5b2f2acf886ecf412addd6630 | yihuang/haskell-snippets | lazy.hs | import Debug.Trace
f :: Int -> Int
f a = trace "evaluated" $ a * a
main = print $ length $ map f [1..10]
| null | https://raw.githubusercontent.com/yihuang/haskell-snippets/52d60453030eaa4f1bcf6b6a91064701dc66ded8/lazy.hs | haskell | import Debug.Trace
f :: Int -> Int
f a = trace "evaluated" $ a * a
main = print $ length $ map f [1..10]
| |
b1757ee6c6bd14683c1b9d021855db225519682b95362f05cfe273d97b245d1a | fakedata-haskell/fakedata | Relationship.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.Relationship where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Relationship
import Faker.TH
$(generateFakeField "relationship" "in_law")
$(generateFakeField "relationship" "spouse")
$(generateFakeField "relat... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/Relationship.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Relationship where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Relationship
import Faker.TH
$(generateFakeField "relationship" "in_law")
$(generateFakeField "relationship" "spouse")
$(generateFakeField "relationship" "parent")
$(generateFakeF... |
84a8cb956c3dd61375e3032e07af8e195d6500010d3bb78daafa123efd846596 | bjorng/wings | ww_color_ctrl.erl |
%%
%% ww_color_ctrl.erl --
%%
%% This module create a variant to wxColorPickerCtrl
%% so we can override the default color chooser and let the user choose
%% which color picker (s)he wants
%%
%% Also handles the color palette better than the orig color_picker
%%
Copyright ( c ) 2014
%%
%% See th... | null | https://raw.githubusercontent.com/bjorng/wings/1e2c2d62e93a98c263b167c7a41f8611e0ff08cd/src/ww_color_ctrl.erl | erlang |
ww_color_ctrl.erl --
This module create a variant to wxColorPickerCtrl
so we can override the default color chooser and let the user choose
which color picker (s)he wants
Also handles the color palette better than the orig color_picker
See the file "license.terms" for information on usage a... |
Copyright ( c ) 2014
-module(ww_color_ctrl).
-behaviour(wx_object).
-export([init/1, terminate/2, code_change/3,
handle_event/2, handle_cast/2, handle_info/2,
handle_call/3]).
-export([new/3,
getColor/1, setColor/2,
connect/2, connect/3
]).
new(Parent, Id, Opts) ->
wx_object:start(?MODULE, [Parent... |
d0c3134b953ae625683801f3e9b3a9e84ab8e0c1a9da07051b7287cfbdeb9d52 | Opetushallitus/aipal | tilat_test.clj | (ns aipal.arkisto.tilat-test
(:require [clojure.test :refer :all]
[korma.core :as sql]
[clj-time.core :as time]
[aipal.integraatio.sql.korma :as taulut]
[aipal.sql.test-util :refer :all]
[aipal.sql.test-data-util :refer :all]
[aipal.arkisto.vasta... | null | https://raw.githubusercontent.com/Opetushallitus/aipal/767bd14ec7153dc97fdf688443b9687cdb70082f/aipal/test/clj/aipal/arkisto/tilat_test.clj | clojure | (ns aipal.arkisto.tilat-test
(:require [clojure.test :refer :all]
[korma.core :as sql]
[clj-time.core :as time]
[aipal.integraatio.sql.korma :as taulut]
[aipal.sql.test-util :refer :all]
[aipal.sql.test-data-util :refer :all]
[aipal.arkisto.vasta... | |
1cc58917028b1005318cc6b74c003b9ecd5ea72c989af2fdcec536c4db26eb78 | adityaathalye/sicp | ex1-08-cube-roots-newton.scm | Procedure for 's Approximation of cube roots
; [Done with block structure nesting and lexical scoping [Ch 1.1.8]]
; If y is an approximation of cube root x
Then a better approximation is [ x / y^2 + 2y]/3
(define (cube-root x)
(define (good-enough? guess)
(< (abs (- guess (improve guess))) 0.0001))
(define... | null | https://raw.githubusercontent.com/adityaathalye/sicp/c8b62c366dade1d5101238a32267dab177808105/ex1-08-cube-roots-newton.scm | scheme | [Done with block structure nesting and lexical scoping [Ch 1.1.8]]
If y is an approximation of cube root x | Procedure for 's Approximation of cube roots
Then a better approximation is [ x / y^2 + 2y]/3
(define (cube-root x)
(define (good-enough? guess)
(< (abs (- guess (improve guess))) 0.0001))
(define (improve guess)
(/ (+ (/ x (square guess)) (* 2 guess)) 3))
(define (cube-root-iter guess)
(if (good-enoug... |
896d40a7f3b2622ecd71738af038e2eeaf09ea42a52e8fe2537d262c9563b81b | craigfe/sink | toplevel.ml | (** Left-to-right function composition. *)
let ( >> ) f g x = g (f x)
| null | https://raw.githubusercontent.com/craigfe/sink/c5431edfa1b06f1a09845a481c4afcb3e92f0667/src/sink/toplevel.ml | ocaml | * Left-to-right function composition. | let ( >> ) f g x = g (f x)
|
aba11e224adbc45cdbe404df47e78b24367210e598dc2f3fdfe4bdbfdbe21e04 | ocaml-ppx/ocamlformat | disable_attr.ml | [@@@ocamlformat "disable"]
(** hello *)
let foo = 42
| null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/d74b310df21108419a82a8e39afa13c841f486ae/test/passing/tests/disable_attr.ml | ocaml | * hello | [@@@ocamlformat "disable"]
let foo = 42
|
513c5f4aeeb4babbbcff9ade7f0c10f06f227cfd964ed83c53b664aee1e3cc14 | mirage/ocaml-xenstore | transaction.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/mirage/ocaml-xenstore/8b4eec36420b5ac529787fb6dab37c83d2b33ad8/server/transaction.ml | ocaml | ok then it doesn't exists in the old version and the current version,
just sneak it in as a child of the parent node if it exists, or else fail
ok it doesn't exists, just bail out.
get the lowest path of the query and verify that it hasn't
been modified by others transactions.
no ... |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
fe8ab100f1ebb01c2eb5779cb770342036dda09a84d9055df27964bbc59a1797 | lokedhs/maxima-client | algebra-cmd.lisp | (in-package :maxima-client)
(clim:define-command (solve-command :name "Solve" :menu t :command-table maxima-commands)
((equations 'maxima-native-expr :prompt "Equations")
(variable 'maxima-native-expr :prompt "Variable"))
"Solve a set of equations for a given variable"
(let ((equation-expr (maxima-native-... | null | https://raw.githubusercontent.com/lokedhs/maxima-client/ff1c058657d2cbd6be9dd9954ed890c7c0099bc7/src/algebra-cmd.lisp | lisp | (in-package :maxima-client)
(clim:define-command (solve-command :name "Solve" :menu t :command-table maxima-commands)
((equations 'maxima-native-expr :prompt "Equations")
(variable 'maxima-native-expr :prompt "Variable"))
"Solve a set of equations for a given variable"
(let ((equation-expr (maxima-native-... | |
402ee630b122cfddd1a521ea1555061b5ec5fa92b21ad9f330acb553f55059f5 | joelburget/Cologne | Cologne.hs |
- Primitives :
- Sphere
- Triangle
- * Plane
-
- Rendering Methods :
- * # Bidirectional Path Tracing
- * # Metropolis
- * Photon Mapping
- * Adaptive Sampling
- * Progressive Photon Mapping
-
- Acceleration Structures
- * kd - tree
- * bih... | null | https://raw.githubusercontent.com/joelburget/Cologne/60b22f44fc8c983c6a0c322fd9885d8f7e469840/Cologne.hs | haskell | Only outputs if `verbosity` is set to Normal or Loud, not Quiet
Notice we're selecting a function and
applying it to context. |
- Primitives :
- Sphere
- Triangle
- * Plane
-
- Rendering Methods :
- * # Bidirectional Path Tracing
- * # Metropolis
- * Photon Mapping
- * Adaptive Sampling
- * Progressive Photon Mapping
-
- Acceleration Structures
- * kd - tree
- * bih... |
8220062aa3aaa882998a4ca9b8ea1b237d27df322b8fdf7e47a62bcdc12f7ce5 | inguardians/kismapping | Region.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
module Data.Region
( Region(..)
, area
, bounds
, bounds'
, contains
, containsPoint
, fromPoint
, intersection
, intersects
, negate
, polarity
, regionMaxX
, regionMaxY
, regionMinX
, regionMinY... | null | https://raw.githubusercontent.com/inguardians/kismapping/98b8511cb60595db45f89746d4586bd9d3a60e6a/library/Data/Region.hs | haskell | # LANGUAGE RankNTypes #
Todo rethink the naming of 'min' and 'max' (maybe left and right?)
Hand-written lens instances to avoid template-haskell dependency
| True if a region contains a given point
| True if a region is positive (max values are greater than min values),
False if the region is negative
| True if a... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Data.Region
( Region(..)
, area
, bounds
, bounds'
, contains
, containsPoint
, fromPoint
, intersection
, intersects
, negate
, polarity
, regionMaxX
, regionMaxY
, regionMinX
, regionMinY
, union
) where
import... |
b33c7ccafbcae037b706a2e6c4e17ce48e30006cb9e0979ac7d0688cefbce7fe | DanielG/ghc-mod | State.hs | ghc - mod : Happy Haskell Hacking
Copyright ( C ) 2015,2016 < dxld ÄT darkboxed DOT org >
--
-- This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or... | null | https://raw.githubusercontent.com/DanielG/ghc-mod/391e187a5dfef4421aab2508fa6ff7875cc8259d/core/GhcMod/Monad/State.hs | haskell |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General... | ghc - mod : Happy Haskell Hacking
Copyright ( C ) 2015,2016 < dxld ÄT darkboxed DOT org >
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Affero General Public License... |
317ab61828b018c12ce290e840ea87871bfe1e168996c444516253240f57e9fd | susanemcg/pandoc-tufteLaTeX2GitBook | Pretty.hs | # LANGUAGE GeneralizedNewtypeDeriving , CPP #
Copyright ( C ) 2010 - 2014 < >
This program is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) an... | null | https://raw.githubusercontent.com/susanemcg/pandoc-tufteLaTeX2GitBook/00c34b4299dd89c4e339e1cde006061918b559ab/pandoc-1.12.4.2/src/Text/Pandoc/Pretty.hs | haskell | ^ In reverse order
^ 'Nothing' means no wrapping
^ Number of preceding newlines
| True if the document is empty.
| The empty document.
| An infix synonym for 'mappend'.
# INLINE (<>) #
| Concatenate a list of 'Doc's.
| Same as 'cat'.
| Concatenate a list of 'Doc's, putting breakable spaces
between them.
| Sa... | # LANGUAGE GeneralizedNewtypeDeriving , CPP #
Copyright ( C ) 2010 - 2014 < >
This program is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) an... |
64552e0461e2e6cd6ecb15b41c605cf742982b2be0c07dffe532e6f95fd1e8f0 | ocamllabs/ocaml-modular-implicits | t080-geint.ml | open Lib;;
if not (0 >= 0) then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9
10 PUSHCONST0
11 GEINT
12 BOOLNOT
13 BRANCHIFNOT 20
15 GETGLOBAL Not_found
17 MAKEBLOCK1 0
19 RAISE
... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t080-geint.ml | ocaml | open Lib;;
if not (0 >= 0) then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9
10 PUSHCONST0
11 GEINT
12 BOOLNOT
13 BRANCHIFNOT 20
15 GETGLOBAL Not_found
17 MAKEBLOCK1 0
19 RAISE
... | |
3f69541a825fdd8c16e8d42e9df241228e99e656b097a422ff5be887c56e8e53 | nasser/magic | reducers.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/nasser/magic/7a46f773bc7785c82d9527d52c1a8c28ac16e195/tests/clojure/test_clojure/reducers.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author :
(ns clojure.test-clojure.reducers
(:require [clojure.core.reducers :as r]
#_ [clojure.test.generative :refer (defspec)]
#_ [clojure.data.generators :as gen])
(:use clojure.test))
(defmacro defequivtest
[name [f r rt] fns]
`(de... |
b5545120edb81eb978589e65be5ecff56f189818efa97a66d7868f9b6fcff97b | bishboria/learnyouahaskell | 15_tree_breadcrumbs.hs | data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show)
data Direction = L | R deriving (Show)
type Breadcrumbs = [Direction]
freeTree :: Tree Char
freeTree =
Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
... | null | https://raw.githubusercontent.com/bishboria/learnyouahaskell/d8c7b41398e9672db18c1b1360372fc4a4adefa8/15/15_tree_breadcrumbs.hs | haskell | (Node 'W' (Node 'C' Empty Empty) (Node 'R' Empty Empty),[L,R])
(Node 'W' (Node 'C' Empty Empty) (Node 'R' Empty Empty),[L,R]) | data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show)
data Direction = L | R deriving (Show)
type Breadcrumbs = [Direction]
freeTree :: Tree Char
freeTree =
Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
... |
5a188a8865b66376750e2e164211b2f4ee13bd0f827da5f730087cc98dd2ef84 | axelarge/advent-of-code | day06.clj | (ns advent-of-code.y2017.day06
(:require [advent-of-code.support :refer :all]))
(def input (get-input 2017 6))
(defn step [banks]
(let [x (apply max banks)
i (.indexOf banks x)
n (count banks)
q (quot x n)
r (rem x n)
to-end (+ i 1 r)
from-start (- to-end n)]
(-... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/src/advent_of_code/y2017/day06.clj | clojure | ------ faster solution using map instead of set ------ | (ns advent-of-code.y2017.day06
(:require [advent-of-code.support :refer :all]))
(def input (get-input 2017 6))
(defn step [banks]
(let [x (apply max banks)
i (.indexOf banks x)
n (count banks)
q (quot x n)
r (rem x n)
to-end (+ i 1 r)
from-start (- to-end n)]
(-... |
e714a7d8a0cd3a9dbcc3ddb9e775648f1ee2335e7bf1884665859c1ab010930b | steshaw/PLAR | make.ml | (* ========================================================================= *)
(* Load in theorem proving example code. *)
(* *)
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
(* =... | null | https://raw.githubusercontent.com/steshaw/PLAR/c143b097d1028963f4c1d24f45a1a56c8b65b838/make.ml | ocaml | =========================================================================
Load in theorem proving example code.
=========================================================================
---------------... | Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
For Ocaml 3.06
if let v = String.sub Sys.ocaml_version 0 4 in v >= "3.10"
then (Topdirs.dir_directory "+camlp5";
Topdirs.dir_load Format.std_formatter "camlp5o.cma")
else (Topdirs.dir_load Format.std_formatter "camlp4o.cma");;
... |
43995802dff4b6bc78966a092b9d6246dda36f4ae8433848279f41fca94c1117 | BitGameEN/bitgamex | mbcs.erl | %%
%% %CopyrightBegin%
%%
Copyright Xiangyu LU( ) 2009 - 2010 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/mbcs/src/mbcs.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Xiangyu LU( ) 2009 - 2010 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(mbcs).
-export([start/0, stop/0])... |
d8263d667e2c40fdceaa0b4263c2f47fa897d44375b285ae0b756397d27ff6f4 | arttuka/reagent-material-ui | on_device_training_outlined.cljs | (ns reagent-mui.icons.on-device-training-outlined
"Imports @mui/icons-material/OnDeviceTrainingOutlined as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def on-d... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/on_device_training_outlined.cljs | clojure | (ns reagent-mui.icons.on-device-training-outlined
"Imports @mui/icons-material/OnDeviceTrainingOutlined as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def on-d... | |
e26f881e9b8036f5b0cc4a83dcc9f061403f506bb190a70aeca4aacbe936d816 | jgm/hscommonmark | BlockParser.hs | {-# LANGUAGE RankNTypes #-}
module CommonMark.BlockParser (
Block
, Elt(..)
, BlockType(..)
, gobbleSpaces
, parseBlocks
, parseLine
, analyzeLine
)
where
import CommonMark.Types
import CommonMark.Lexer (tokenize)
import Control.Monad
import Data.Tree.Zipper
import Data.Tree
import Data.Text (Text)
impo... | null | https://raw.githubusercontent.com/jgm/hscommonmark/6820c48f0179a5c9c1b7ef973330ca0ff90b3dc0/src/CommonMark/BlockParser.hs | haskell | # LANGUAGE RankNTypes #
[ ] lists and items
[ ] thematic breaks
[ ] atx headers
[ ] fenced code blocks
[ ] raw HTML blocks
[ ] resolving inline content
shouldn't happen
We can assume that the treepos is a container block.
and return the child
| Analyze line and return treepos of last matched
container node p... | module CommonMark.BlockParser (
Block
, Elt(..)
, BlockType(..)
, gobbleSpaces
, parseBlocks
, parseLine
, analyzeLine
)
where
import CommonMark.Types
import CommonMark.Lexer (tokenize)
import Control.Monad
import Data.Tree.Zipper
import Data.Tree
import Data.Text (Text)
import qualified Data.Text as Te... |
8e7842d13f4a1669dfab428f9901a74a3b08d69ee84a1cf5c178d52c7269cbdc | bramford/2d-exploration-game | player.ml | type t = { name: string }
let to_string t =
match t with
| Some t -> t.name
| None -> "None"
let create ~name =
Some ({ name })
| null | https://raw.githubusercontent.com/bramford/2d-exploration-game/0660ced6ec4aa39d4548b0ecc1f20f8269bf4c6b/src/player.ml | ocaml | type t = { name: string }
let to_string t =
match t with
| Some t -> t.name
| None -> "None"
let create ~name =
Some ({ name })
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.