/**
 * Implementare la funzione `fromReadonlyArray`
 */ import { Magma } from 'fp-ts/Magma' ; declare const fromReadonlyArray ; import * as assert from 'assert' ; const magmaSum = { concat : ( first , second ) => first + second } ; const lastMagma = { concat : ( _first , second ) => second } ; const firstMagma = { concat : ( first , _second ) => first } ; const input = [ [ 'a' , 1 ] , [ 'b' , 2 ] , [ 'a' , 3 ] ] ; assert . deepStrictEqual ( fromReadonlyArray ( magmaSum ) ( input ) , { a : 4 , b : 2 } ) ; assert . deepStrictEqual ( fromReadonlyArray ( lastMagma ) ( input ) , { a : 3 , b : 2 } ) ; assert . deepStrictEqual ( fromReadonlyArray ( firstMagma ) ( input ) , { a : 1 , b : 2 } ) ;