i.e., solving nonlinear equations.
Methods for solving systems of linear equations:
i.e., solving nonlinear equations.
Methods for solving systems of linear equations:
library(tidyverse) | |
# Set Monday as the first day of the week. | |
options(lubridate.week.start = 1) | |
theme_set( | |
theme_minimal() + | |
theme( | |
panel.grid.major.x = element_blank(), | |
panel.grid.minor.x = element_blank(), |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
-- Source: https://kcsongor.github.io/symbol-parsing-haskell/ |
// Source: https://blog.jcoglan.com/2020/05/12/controlling-mutation-with-types/ | |
use std::io; | |
use std::mem; | |
use std::str::Chars; | |
#[derive(Default)] | |
struct Stack<T> { | |
head: T, | |
rest: Vec<T>, |
Run a Jupyter Data Science Notebook (or JupyterLab?) using Jupyter Docker Stacks with the current directory linked inside:
$ podman run --rm -it -p 8888:8888 -v "${PWD}":/home/jovyan/work:z docker.io/jupyter/datascience-notebook
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
data FutureM i o a | |
= Await (i -> FutureM i o a) | |
| Yield o (FutureM i o a) | |
| Done a | |
instance Functor (FutureM i o) where | |
fmap f (Await g) = Await (fmap f . g) |
module Melsort (melsort) where | |
-- TODO: Linked lists are not the best for this algorithm performance-wise. | |
-- Consider a different structure, perhaps Vector. | |
-- TODO: Some preconditions are required. | |
push :: Ord a => a -> [[a]] -> [[a]] | |
push x [] = [[x]] | |
push x ([y]:ls) -- TODO: Is it possible that ls /= [] here? It's not. | |
| x <= y = [x, y ] : ls |