profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tynanbe/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

tynanbe/qmk_firmware 2

keyboard controller firmware for Atmel AVR and ARM USB families

tynanbe/barnard 1

barnard is a terminal-based client for the Mumble voice chat software

tynanbe/gleam 0

⭐️ A type safe language for the Erlang VM

tynanbe/gleam_elli 0

🍛 A Gleam HTTP service adapter for the Elli web server

tynanbe/gleam_stdlib 0

🎁 Gleam's standard library

tynanbe/scintillua 0

Scintillua adds dynamic Lua LPeg lexers to Scintilla.

tynanbe/shellout 0

🐢 A Gleam wrapper for Elixir.System.cmd/3

tynanbe/vis 0

A vi-like editor based on Plan 9's structural regular expressions

startedzmkfirmware/zmk

started time in 2 months

startedmrzealot/ergogen

started time in 2 months

push eventtynanbe/hyperpaste

tynanbe

commit sha 5a78b7fc63dcf403b0bcf52a97e225ae356f9692

Chunky paste

view details

push time in 3 months

issue commentgleam-lang/gleam

Pipe error message incorrectly displayed when not using a pipe

I've not done any testing yet but I'm a little confused as to how it would happen with the code given. I would expect this to trigger it maybe?

As far as I can tell, the overly eager error refers to this pipe:

  |> halt
tynanbe

comment created time in 3 months

push eventtynanbe/hyperpaste

tynanbe

commit sha 626e83c41859d707caf53b2f559fcf2ebe4b1073

Handle chunk_size arg

view details

push time in 3 months

issue openedgleam-lang/gleam

Compiler confusion

Developing a simple script, pasted below:

import gleam/io
import gleam/iterator
import gleam/string
import shellout.{StderrToStdout}

pub const char_limit = 720

pub fn main(args: List(String)) -> NoReturn {
  case shellout.cmd("xsel", ["-ob"], [StderrToStdout(True)]) {
    Ok(#(output, status)) -> {
      let chunk_size =
        case args {
          [chunk_size, ..] -> chunk_size
          _-> char_limit
        }
      output
      |> iterator.from_list
      |> iterator.map(with: fn(line) {
        shellout.cmd("xdopaste", [line], [StderrToStdout(True)])
      })
      |> iterator.run
      status
    }

    Error(reason) -> {
      shellout.cmd("xdopaste", [reason], [StderrToStdout(True)])
      1
    }
  }
  |> halt
}

pub external type NoReturn

pub external fn halt(status: Int) -> NoReturn =
  "erlang" "halt"

I get the following very confusing error when compiling:

error: This function cannot handle the argument sent through the (|>) pipe:
   ┌─ ~/src/hyperpaste/src/hyperpaste.gleam:14:11
   │
14 │           _-> char_limit
   │           ^^^^^^^^^^^^^^

The argument is:

    Int

But (|>) is piping it to a function that expects:

    No arguments

After commenting a bunch of lines, I get the real error:

error: Type mismatch
   ┌─ /home/tynanbe/src/hyperpaste/src/hyperpaste.gleam:14:11
   │
14 │           _-> char_limit
   │           ^^^^^^^^^^^^^^

This case clause was found to return a different type than the previous
one, but all case clauses must return the same type.

Expected type:

    String

Found type:

    Int

created time in 3 months

create barnchtynanbe/hyperpaste

branch : master

created branch time in 3 months

created repositorytynanbe/hyperpaste

created time in 3 months

create barnchtynanbe/hello_gleam_mix

branch : master

created branch time in 3 months

created repositorytynanbe/hello_gleam_mix

created time in 3 months

created repositorytynanbe/hello_gleam_rebar3

created time in 3 months

created repositorytynanbe/hello_gleam_mix

created time in 3 months

created repositorytynanbe/hello_gleam_rebar3

created time in 3 months