profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/Adzz/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.

Adzz/7-more-languages 1

My progress through 7 more languages in 7 weeks https://pragprog.com/book/7lang/seven-more-languages-in-seven-weeks

Adzz/bowling-challenge 1

Calculate Scores for Ten Pin Bowling

Adzz/absinthe 0

The GraphQL toolkit for Elixir

Adzz/absinthe_plug 0

Plug support for Absinthe, the GraphQL toolkit for Elixir

Adzz/adzz.github.io 0

adzz.github.io

push eventAdzz/match_a

Adam Lancaster

commit sha 2855e98e3834805a2988ce52e88c8a01f8df5037

a few good tests

view details

push time in 11 days

create barnchAdzz/match_a

branch : main

created branch time in 11 days

created repositoryAdzz/match_a

created time in 11 days

startedevanw/esbuild

started time in 12 days

issue commentkipcole9/money

Evolve The Inspect Protocol Implementation

Great points! I'm interested to see what the forum says too.

My rough thoughts are:

  1. Tricky to say, but I think it's okay - as Date / DateTime etc do the same. I think the value of having the output be executable is worth it in this case...
  2. Again hard to say, but the output is a different colour in IEX at least: image

Does this make doctests less understandable

I don't think so, and I think being able to copy / paste doc tests into an actual repl could possibly help doctests.

I think if Decimal go for it it'll be an interesting precedent!

Adzz

comment created time in 16 days

startedgleam-lang/gleam

started time in 16 days

issue openedkipcole9/money

Evolve The Inspect Protocol Implementation

Currently when we log a Money struct to the console it looks like this:

#Money<:GBP, 12.20>

This is good but it is not valid elixir syntax which makes copying it to an iex shell (for example) problematic.

One possible alternative is to do like Date does and print a sigil out:

IO.inspect(Date.utc_today())
#=> ~D[2021-09-01]

IO.inspect(Money.new(:GBP, "12.20"))
#=> ~M[12.20]gbp

OR

I recenlty opened a similar PR on Decimal which changes the output to beDecimal.new we could do similar here:

IO.inspect(Money.new(:GBP, "12.20"))
#=> Money.new(:GBP, "12.20)

What do you think?

created time in 17 days

PR opened kipcole9/money

Update money.ex

I think this was my bad!

+1 -1

0 comment

1 changed file

pr created time in 17 days

push eventAdzz/money

Adam Lancaster

commit sha e050fe5b41067eb0371ba1f97ea9ba919cedd786

Update money.ex

view details

push time in 17 days

fork Adzz/money

Elixir implementation of Money with Currency

fork in 17 days

issue commentericmj/decimal

Proposal: Change the Inspect protocol implementation

https://github.com/ericmj/decimal/pull/176

Adzz

comment created time in 18 days

PR opened ericmj/decimal

Improve the Inspect protocol implementation

Currently the inspect protocol is implemented such that it prints Decimals that look like this:

#Decimal<2.1>

This is great, but can be tricky when copy / pasting some printed output into a repl for example, because #Decimal<2.1> is not valid elixir syntax.

Other structs handle this by having a sigil - here we sidestep the discussion of "should Decimal have a sigil" by implementing the Inspect protocol such that it returns valid elixir code:

Decimal.new("2.1")

Not sure if this should be considered a breaking change.

Closes https://github.com/ericmj/decimal/issues/175

+31 -31

0 comment

2 changed files

pr created time in 18 days

create barnchAdzz/decimal

branch : spike-new-inspect

created branch time in 18 days

fork Adzz/decimal

Arbitrary precision decimal arithmetic

https://hexdocs.pm/decimal/

fork in 18 days

issue commentericmj/decimal

Proposal: Change the Inspect protocol implementation

Nice! I'd be happy to try it for sure.

Adzz

comment created time in 18 days

issue openedkipcole9/money

Proposal to_currency_code

Hello 👋 love the lib

Would we be open to a to_currency_code a la the to_decimal function?

@spec to_currency_code(money :: Money.t()) :: String.t()
def to_currency_code(%Money{currency: currency}) do
  currency
end

This would mean I don't have to reach into the struct to get the currency field which feels a little like crossing some abstraction boundary.

created time in 18 days

issue openedericmj/decimal

Proposal: Change the Inspect protocol implementation

When I a Decimal outputted to the console it looks like this:

#Decimal<1>

This is fine and all but makes copy / pasting from the terminal a nightmare as the above isn't valid elixir code. Other structs handle this by having a sigil - Date for example. That means you can output "~D[2020-01-01]"

Would it be possible to change the inspect protocol to instead output this:

Decimal.new("1")

Or have some other way to make this better. I know the idea of a Decimal sigil has been rejected before.

created time in 18 days

startedmatthieu-m/ghost-cell

started time in 23 days

push eventAdzz/ex_tractor

Adam Lancaster

commit sha ad5849e70efe79dcd3b972434e74a82dd6e65c62

rename ex_tractors -> ex_tractor

view details

push time in a month

create barnchAdzz/ex_tractor

branch : main

created branch time in a month

created repositoryAdzz/ex_tractor

WIP - An implementation of extractors in elixir

created time in a month

push eventAdzz/papers_please

Adam Lancaster

commit sha ad5fa57f7558c7509f737a11d4aaaca520960fae

name papers better

view details

push time in a month

create barnchAdzz/papers_please

branch : main

created branch time in a month

created repositoryAdzz/papers_please

created time in a month

create barnchAdzz/nand_to_tetris

branch : main

created branch time in a month

created repositoryAdzz/nand_to_tetris

created time in a month

startednlopes/avro-schema-registry

started time in a month

startedvic/expat

started time in a month

startedslab/delta-elixir

started time in a month

startedduffelhq/duffel-api-javascript

started time in a month