Skip to content

Instantly share code, notes, and snippets.

@bravit
Created November 3, 2017 11:40
Show Gist options
  • Save bravit/f74937f2b3cb5651df8df863f7257f24 to your computer and use it in GitHub Desktop.
Save bravit/f74937f2b3cb5651df8df863f7257f24 to your computer and use it in GitHub Desktop.
Пример из лекции (Haskell)
day close volume open high low
2017/10/11 156.5500 16861450.0000 155.9700 156.9800 155.7500
2017/10/10 155.9000 15603520.0000 156.0550 158.0000 155.1000
2017/10/09 155.8400 16243080.0000 155.8100 156.7300 155.4850
2017/10/06 155.3000 17223790.0000 154.9700 155.4900 154.5600
2017/10/05 155.3900 21215870.0000 154.1800 155.4400 154.0500
2017/10/04 153.4800 20088940.0000 153.6300 153.8600 152.4600
2017/10/03 154.4800 16216800.0000 154.0100 155.0900 153.9100
2017/10/02 153.8100 18631540.0000 154.2600 154.4500 152.7200
2017/09/29 154.1200 26204670.0000 153.2100 154.1300 152.0000
2017/09/28 153.2800 21983410.0000 153.8900 154.2800 152.7000
2017/09/27 154.2300 25402270.0000 153.8000 154.7189 153.5400
2017/09/26 153.1400 35907770.0000 151.7800 153.9200 151.6900
2017/09/25 150.5500 44366140.0000 149.9900 151.8300 149.1600
2017/09/22 151.8900 46575410.0000 152.0200 152.2700 150.5600
2017/09/21 153.3900 37350060.0000 155.8000 155.8000 152.7500
2017/09/20 156.0700 52126240.0000 157.9000 158.2600 153.8300
2017/09/19 158.7300 20565620.0000 159.5100 159.7700 158.4400
2017/09/18 158.6700 28157630.0000 160.1100 160.5000 157.9950
2017/09/15 159.8800 48846060.0000 158.4700 160.9700 158.0000
2017/09/14 158.2800 23637310.0000 158.9900 159.4000 158.0900
2017/09/13 159.6500 44866280.0000 159.8700 159.9600 157.9100
2017/09/12 160.8600 71574560.0000 162.6100 163.9600 158.7700
2017/09/11 161.5000 31506890.0000 160.5000 162.0500 159.8900
2017/09/08 158.6300 28411740.0000 160.8600 161.1500 158.5300
2017/09/07 161.2600 21905160.0000 162.0900 162.2400 160.3600
2017/09/06 161.9100 21610300.0000 162.7100 162.9900 160.5200
2017/09/05 162.0800 29491910.0000 163.7500 164.2500 160.5600
2017/09/01 164.0500 16564340.0000 164.8000 164.9400 163.6300
2017/08/31 164.0000 26729940.0000 163.6400 164.5200 163.4800
2017/08/30 163.3500 27215770.0000 163.8000 163.8900 162.6100
2017/08/29 162.9100 29451050.0000 160.1000 163.1200 160.0000
2017/08/28 161.4700 25649890.0000 160.1400 162.0000 159.9300
2017/08/25 159.8600 25184600.0000 159.6500 160.5600 159.2700
2017/08/24 159.2700 19782170.0000 160.4300 160.7400 158.5500
2017/08/23 159.9800 19376940.0000 159.0700 160.4700 158.8800
2017/08/22 159.7800 21564890.0000 158.2300 160.0000 158.0200
2017/08/21 157.2100 26330070.0000 157.5000 157.8900 155.1101
2017/08/18 157.5000 27391950.0000 157.8600 159.5000 156.7200
2017/08/17 157.8600 27377960.0000 160.5200 160.7100 157.8400
2017/08/16 160.9500 27607370.0000 161.9400 162.5100 160.1500
2017/08/15 161.6000 29377630.0000 160.6600 162.1950 160.1400
2017/08/14 159.8500 22074760.0000 159.3200 160.2100 158.7500
2017/08/11 157.4800 26208970.0000 156.6000 158.5728 156.0700
2017/08/10 155.3200 39636190.0000 159.9000 160.0000 154.6300
2017/08/09 161.0600 26060430.0000 159.2600 161.2700 159.1100
2017/08/08 160.0800 36127490.0000 158.6000 161.8300 158.2700
2017/08/07 158.8100 21827400.0000 157.0600 158.9200 156.6701
2017/08/04 156.3900 20514810.0000 156.0700 157.4000 155.6900
2017/08/03 155.5700 26604140.0000 157.0500 157.2100 155.0200
2017/08/02 157.1400 69726440.0000 159.2800 159.7500 156.1600
2017/08/01 150.0500 33669020.0000 149.1000 150.2200 148.4100
2017/07/31 148.7300 19690420.0000 149.9000 150.3300 148.1300
2017/07/28 149.5000 17192770.0000 149.8900 150.2300 149.1900
2017/07/27 150.5600 32429770.0000 153.7500 153.9900 147.3000
2017/07/26 153.4600 15649120.0000 153.3500 153.9300 153.0600
2017/07/25 152.7400 18798250.0000 151.8000 153.8400 151.8000
2017/07/24 152.0900 21466370.0000 150.5800 152.4400 149.9000
2017/07/21 150.2700 25111310.0000 149.9900 150.4400 148.8800
2017/07/20 150.3400 17170490.0000 151.5000 151.7400 150.1900
2017/07/19 151.0200 20859830.0000 150.4800 151.4200 149.9500
2017/07/18 150.0800 17837130.0000 149.2000 150.1300 148.6700
2017/07/17 149.5600 23765710.0000 148.8200 150.9000 148.5700
2017/07/14 149.0400 20117070.0000 147.9700 149.3300 147.3300
2017/07/13 147.7700 25080500.0000 145.5000 148.4900 145.4400
2017/07/12 145.7400 24833800.0000 145.8700 146.1800 144.8200
2017/07/11 145.5300 18647220.0000 144.7300 145.8500 144.3800
2017/07/10 145.0600 21080580.0000 144.1100 145.9500 143.3700
2017/07/07 144.1800 18527000.0000 142.9000 144.7500 142.9000
2017/07/06 142.7300 24110330.0000 143.0200 143.5000 142.4100
2017/07/05 144.0900 21550270.0000 143.6900 144.7900 142.7237
2017/07/03 143.5000 14277850.0000 144.8800 145.3001 143.1000
2017/06/30 144.0200 22986960.0000 144.4500 144.9600 143.7800
2017/06/29 143.6800 31450520.0000 144.7100 145.1300 142.2800
2017/06/28 145.8300 22052920.0000 144.4900 146.1100 143.1601
2017/06/27 143.7300 24725210.0000 145.0100 146.1600 143.6200
2017/06/26 145.8200 25674500.0000 147.1700 148.2800 145.3800
2017/06/23 146.2800 35421310.0000 145.1300 147.1600 145.1100
2017/06/22 145.6300 19082170.0000 145.7700 146.7000 145.1199
2017/06/21 145.8700 21247590.0000 145.5200 146.0693 144.6100
2017/06/20 145.0100 24877950.0000 146.8700 146.8700 144.9400
2017/06/19 146.3400 32203640.0000 143.6600 146.7400 143.6600
2017/06/16 142.2700 50264540.0000 143.7800 144.5000 142.2000
2017/06/15 144.2900 31642900.0000 143.3200 144.4798 142.2100
2017/06/14 145.1600 31454590.0000 147.5000 147.5000 143.8400
2017/06/13 146.5900 34089190.0000 147.1600 147.4500 145.1500
2017/06/12 145.4200 72187710.0000 145.7400 146.0900 142.5100
2017/06/09 148.9800 64782910.0000 155.1900 155.1900 146.0200
2017/06/08 154.9900 21144040.0000 155.2500 155.5400 154.4000
2017/06/07 155.3700 21017560.0000 155.0200 155.9800 154.4800
2017/06/06 154.4500 26591850.0000 153.9000 155.8100 153.7800
2017/06/05 153.9300 25277680.0000 154.3400 154.4500 153.4600
2017/06/02 155.4500 27715140.0000 153.5800 155.4500 152.8900
2017/06/01 153.1800 16383610.0000 153.1700 153.3300 152.2200
2017/05/31 152.7600 24452750.0000 153.9700 154.1700 152.3800
2017/05/30 153.6700 20118620.0000 153.4200 154.4300 153.3300
2017/05/26 153.6100 21895020.0000 154.0000 154.2400 153.3100
2017/05/25 153.8700 19217810.0000 153.7300 154.3500 153.0300
2017/05/24 153.3400 19201820.0000 153.8400 154.1700 152.6700
2017/05/23 153.8000 19906170.0000 154.9000 154.9000 153.3100
2017/05/22 153.9900 22930630.0000 154.0000 154.5800 152.9100
2017/05/19 153.0600 26892850.0000 153.3800 153.9800 152.6300
2017/05/18 152.5400 33520150.0000 151.2700 153.3400 151.1300
2017/05/17 150.2500 50674280.0000 153.6000 154.5700 149.7100
2017/05/16 155.4700 19994270.0000 155.9400 156.0600 154.7200
2017/05/15 155.7000 25912270.0000 156.0100 156.6500 155.0500
2017/05/12 156.1000 32493770.0000 154.7000 156.4200 154.6700
2017/05/11 153.9500 27236290.0000 152.4500 154.0700 152.3100
2017/05/10 153.2600 25779060.0000 153.6300 153.9400 152.1100
2017/05/09 153.9900 38907940.0000 153.8700 154.8800 153.4500
2017/05/08 153.0100 48670440.0000 149.0300 153.7000 149.0300
2017/05/05 148.9600 27254850.0000 146.7600 148.9800 146.7600
2017/05/04 146.5300 23345970.0000 146.5200 147.1400 145.8100
2017/05/03 147.0600 45579740.0000 145.5900 147.4900 144.2700
2017/05/02 147.5100 44182930.0000 147.5400 148.0900 146.8400
2017/05/01 146.5800 33498270.0000 145.1000 147.2000 144.9600
2017/04/28 143.6500 20783460.0000 144.0900 144.3000 143.2700
2017/04/27 143.7900 14198660.0000 143.9230 144.1600 143.3100
2017/04/26 143.6800 19998050.0000 144.4700 144.6000 143.3762
2017/04/25 144.5300 18325720.0000 143.9100 144.9000 143.8700
2017/04/24 143.6400 17117710.0000 143.5000 143.9500 143.1800
2017/04/21 142.2700 17290900.0000 142.4400 142.6800 141.8500
2017/04/20 142.4400 23294040.0000 141.2200 142.9200 141.1600
2017/04/19 140.6800 17302160.0000 141.8800 142.0000 140.4500
2017/04/18 141.2000 14676420.0000 141.4100 142.0400 141.1100
2017/04/17 141.8300 16529130.0000 141.4800 141.8800 140.8700
2017/04/13 141.0500 17775510.0000 141.9100 142.3800 141.0500
2017/04/12 141.8000 20320420.0000 141.6000 142.1500 141.0100
2017/04/11 141.6300 30341520.0000 142.9400 143.3500 140.0600
2017/04/10 143.1700 18904680.0000 143.6000 143.8792 142.9000
2017/04/07 143.3400 16658660.0000 143.7300 144.1800 143.2700
2017/04/06 143.6600 21131040.0000 144.2900 144.5200 143.4500
2017/04/05 144.0200 27649500.0000 144.2200 145.4600 143.8100
2017/04/04 144.7700 19865300.0000 143.2500 144.8900 143.1700
2017/04/03 143.7000 19970040.0000 143.7100 144.1200 143.0500
2017/03/31 143.6600 19576480.0000 143.7200 144.2700 143.0100
2017/03/30 143.9300 21189000.0000 144.1900 144.5000 143.5000
2017/03/29 144.1200 29174040.0000 143.6800 144.4900 143.1900
2017/03/28 143.8000 33348400.0000 140.9100 144.0400 140.6200
2017/03/27 140.8800 23531670.0000 139.3900 141.2200 138.6200
2017/03/24 140.6400 22355140.0000 141.5000 141.7400 140.3500
2017/03/23 140.9200 20299310.0000 141.2600 141.5844 140.6100
2017/03/22 141.4200 25804820.0000 139.8450 141.6000 139.7600
2017/03/21 139.8400 39461130.0000 142.1100 142.8000 139.7300
2017/03/20 141.4600 21258100.0000 140.4000 141.5000 140.2300
2017/03/17 139.9900 43700570.0000 141.0000 141.0000 139.8900
2017/03/16 140.6900 19173780.0000 140.7200 141.0200 140.2600
2017/03/15 140.4600 25676720.0000 139.4100 140.7501 139.0250
2017/03/14 138.9900 15281850.0000 139.3000 139.6500 138.8400
2017/03/13 139.2000 17048800.0000 138.8500 139.4300 138.8200
2017/03/10 139.1400 19578920.0000 139.2500 139.3571 138.6400
2017/03/09 138.6800 22117750.0000 138.7400 138.7900 137.0500
2017/03/08 139.0000 18695500.0000 138.9500 139.8000 138.8200
2017/03/07 139.5200 17439210.0000 139.0600 139.9800 138.7900
2017/03/06 139.3400 21229890.0000 139.3650 139.7700 138.5959
2017/03/03 139.7800 21555370.0000 138.7800 139.8300 138.5900
2017/03/02 138.9600 26170690.0000 140.0000 140.2786 138.7600
2017/03/01 139.7900 36362440.0000 137.8900 140.1500 137.5950
2017/02/28 136.9900 23446340.0000 137.0800 137.4350 136.7000
2017/02/27 136.9300 20222210.0000 137.1400 137.4350 136.2800
2017/02/24 136.6600 21754600.0000 135.9100 136.6600 135.2800
2017/02/23 136.5300 20762360.0000 137.3800 137.4800 136.3000
2017/02/22 137.1100 20769030.0000 136.4300 137.1200 136.1100
2017/02/21 136.7000 24487200.0000 136.2300 136.7500 135.9800
2017/02/17 135.7200 22163280.0000 135.1000 135.8300 135.1000
2017/02/16 135.3450 22539860.0000 135.6700 135.9000 134.8398
2017/02/15 135.5100 35578640.0000 135.5200 136.2700 134.6200
2017/02/14 135.0200 33054500.0000 133.4700 135.0900 133.2500
2017/02/13 133.2900 22989980.0000 133.0800 133.8200 132.7500
2017/02/10 132.1200 20046250.0000 132.4600 132.9400 132.0500
2017/02/09 132.4200 28321440.0000 131.6500 132.4450 131.1200
2017/02/08 132.0400 22941650.0000 131.3500 132.2200 131.2200
2017/02/07 131.5300 38158410.0000 130.5400 132.0900 130.4500
2017/02/06 130.2900 26784530.0000 129.1300 130.5000 128.9000
2017/02/03 129.0800 24460160.0000 128.3100 129.1900 128.1600
2017/02/02 128.5300 33671250.0000 127.9750 129.3900 127.7800
2017/02/01 128.7500 111837300.0000 127.0300 130.4900 127.0100
2017/01/31 121.3500 47767760.0000 121.1500 121.3900 120.6200
2017/01/30 121.6300 30327110.0000 120.9300 121.6300 120.6600
2017/01/27 121.9500 20495340.0000 122.1400 122.3500 121.6000
2017/01/26 121.9400 26320740.0000 121.6700 122.4400 121.6000
2017/01/25 121.8800 32417410.0000 120.4200 122.1000 120.2800
2017/01/24 119.9700 23191150.0000 119.5500 120.1000 119.5000
2017/01/23 120.0800 21982000.0000 120.0000 120.8100 119.7700
2017/01/20 120.0000 29922650.0000 120.4500 120.4500 119.7346
2017/01/19 119.7800 25554290.0000 119.4000 120.0900 119.3700
2017/01/18 119.9900 23687350.0000 120.0000 120.5000 119.7100
2017/01/17 120.0000 34412090.0000 118.3400 120.2400 118.2200
2017/01/13 119.0400 26083030.0000 119.1100 119.6200 118.8100
2017/01/12 119.2500 27057550.0000 118.8950 119.3000 118.2100
2017/01/11 119.7500 27453130.0000 118.7400 119.9300 118.6000
2017/01/10 119.1100 24432660.0000 118.7700 119.3800 118.3000
2017/01/09 118.9900 33420290.0000 117.9500 119.4300 117.9400
2017/01/06 117.9100 31714820.0000 116.7800 118.1600 116.4700
2017/01/05 116.6100 22115100.0000 115.9200 116.8642 115.8100
2017/01/04 116.0200 21081620.0000 115.8500 116.5100 115.7500
2017/01/03 116.1500 28769220.0000 115.8000 116.3300 114.7600
2016/12/30 115.8200 30555900.0000 116.6500 117.2000 115.4300
2016/12/29 116.7300 14979680.0000 116.4500 117.1095 116.4000
2016/12/28 116.7600 20686510.0000 117.5200 118.0166 116.2000
2016/12/27 117.2600 18131970.0000 116.5200 117.8000 116.4900
2016/12/23 116.5200 14244050.0000 115.5900 116.5200 115.5900
2016/12/22 116.2900 26043820.0000 116.3500 116.5100 115.6400
2016/12/21 117.0600 23724430.0000 116.8000 117.4000 116.7800
2016/12/20 116.9500 21337310.0000 116.7400 117.5000 116.6800
2016/12/19 116.6400 27756760.0000 115.8000 117.3800 115.7500
2016/12/16 115.9700 44284660.0000 116.4700 116.5000 115.6450
2016/12/15 115.8200 46286150.0000 115.3800 116.7300 115.2300
2016/12/14 115.1900 33962370.0000 115.0400 116.2000 114.9800
2016/12/13 115.1900 43293350.0000 113.8400 115.9200 113.7500
2016/12/12 113.3000 26176690.0000 113.2900 115.0000 112.4900
2016/12/09 113.9500 34324350.0000 112.3100 114.7000 112.3100
2016/12/08 112.1200 27049830.0000 110.8600 112.4300 110.6000
2016/12/07 111.0300 29976030.0000 109.2600 111.1900 109.1600
2016/12/06 109.9500 26160560.0000 109.5000 110.3600 109.1900
2016/12/05 109.1100 34113880.0000 110.0000 110.0300 108.2500
2016/12/02 109.9000 26481320.0000 109.1700 110.0900 108.8500
2016/12/01 109.4900 37034520.0000 110.3650 110.9400 109.0300
2016/11/30 110.5200 36151450.0000 111.6000 112.2000 110.2700
2016/11/29 111.4600 28507780.0000 110.7800 112.0300 110.0700
2016/11/28 111.5700 27054320.0000 111.4300 112.4650 111.3900
2016/11/25 111.7900 11475920.0000 111.1300 111.8700 110.9500
2016/11/23 111.2300 27420550.0000 111.3600 111.5100 110.3300
2016/11/22 111.8000 25931710.0000 111.9500 112.4200 111.4000
2016/11/21 111.7300 29164190.0000 110.1200 111.9900 110.0100
2016/11/18 110.0600 28310840.0000 109.7200 110.5400 109.6600
2016/11/17 109.9500 27623150.0000 109.8100 110.3500 108.8300
2016/11/16 109.9900 58724080.0000 106.7000 110.2300 106.6000
2016/11/15 107.1100 32230590.0000 106.5700 107.6800 106.1593
2016/11/14 105.7100 50901380.0000 107.7100 107.8090 104.0800
2016/11/11 108.4300 34117030.0000 107.1200 108.8700 106.5500
2016/11/10 107.7900 57097740.0000 111.0900 111.0900 105.8300
2016/11/09 110.8800 59118740.0000 109.8800 111.3200 108.0500
2016/11/08 111.0600 24129630.0000 110.3100 111.7200 109.7000
2016/11/07 110.4100 32361930.0000 110.0800 110.5100 109.4600
2016/11/04 108.8400 30790930.0000 108.5300 110.2500 108.1100
2016/11/03 109.8300 26538700.0000 110.9800 111.4600 109.5500
2016/11/02 111.5900 28174980.0000 111.4000 112.3500 111.2300
2016/11/01 111.4900 43403760.0000 113.4600 113.7700 110.5300
2016/10/31 113.5400 26378910.0000 113.6500 114.2300 113.2000
2016/10/28 113.7200 36792100.0000 113.8700 115.2100 113.4500
2016/10/27 114.4800 31396130.0000 115.3900 115.8600 114.1000
2016/10/26 115.5900 66028640.0000 114.3100 115.7000 113.3100
2016/10/25 118.2500 46820600.0000 117.9500 118.3600 117.3100
2016/10/24 117.6500 23492650.0000 117.1000 117.7400 117.0000
2016/10/21 116.6000 22527690.0000 116.8100 116.9100 116.2800
2016/10/20 117.0600 24100150.0000 116.8600 117.3800 116.3300
2016/10/19 117.1200 19977160.0000 117.2500 117.7600 113.8000
2016/10/18 117.4700 24308210.0000 118.1800 118.2100 117.4500
2016/10/17 117.5500 23583810.0000 117.3300 117.8400 116.7800
2016/10/14 117.6300 35626020.0000 117.8800 118.1700 117.1300
2016/10/13 116.9800 35041820.0000 116.7900 117.4400 115.7200
2016/10/12 117.3400 37512930.0000 117.3500 117.9800 116.7500
2016/10/11 116.3000 63963010.0000 117.7000 118.6900 116.2000
{-# LANGUAGE OverloadedStrings, DeriveGeneric
, TypeSynonymInstances, FlexibleInstances
, RecordWildCards #-}
module Main where
import qualified Data.ByteString.Lazy as BL
import Data.ByteString.Char8 (unpack)
import qualified Data.Vector as V
import System.Environment
import Data.Csv
import Data.Time.Calendar
import Data.Time.Format
import Data.Ord
import Data.List
import Data.Number.Fixed
import GHC.Generics (Generic)
import Options.Applicative as Opt
import Data.Semigroup ((<>))
import Control.Monad
type Eps4 = EpsDiv10 (EpsDiv10 (EpsDiv10 (EpsDiv10 Eps1)))
type Fixed4 = Fixed Eps4
data QuoteData = QD {
day :: Day,
close :: Fixed4,
volume :: Fixed4,
open :: Fixed4,
high :: Fixed4,
low :: Fixed4
}
deriving (Generic, Show)
instance FromField Fixed4 where
parseField s = return (read $ unpack s)
instance FromField Day where
parseField s = parseTimeM False defaultTimeLocale "%Y/%m/%d" (unpack s)
instance FromNamedRecord QuoteData
instance DefaultOrdered QuoteData
mean v = sum v / (fromIntegral $ length v)
daysBetweenMinMax qf quotes = abs $ diffDays (day minCloseQuote)
(day maxCloseQuote)
where
minCloseQuote = minimumBy (comparing (f2fun qf)) quotes
maxCloseQuote = maximumBy (comparing (f2fun qf)) quotes
data Operation = Mean | Min | Max
instance Show Operation where
show Mean = "mean"
show Min = "minimum"
show Max = "maximum"
op2fun :: (Foldable t, Fractional a, Ord a) => Operation -> t a -> a
op2fun Mean = mean
op2fun Min = minimum
op2fun Max = maximum
data QField = Op | Cl | High | Low | Vol
instance Show QField where
show Op = "open"
show Cl = "close"
show Vol = "volume"
show High = "high"
show Low = "low"
f2fun :: QField -> QuoteData -> Fixed4
f2fun Op = open
f2fun Cl = close
f2fun Vol = volume
f2fun High = high
f2fun Low = low
computeStatistics :: Operation -> QField -> V.Vector QuoteData -> Fixed4
computeStatistics op f v = op2fun op $ V.map (f2fun f) v
data Params = Params {
fname :: String,
daysBetween :: Bool,
op :: Operation,
qf :: QField
}
params :: Opt.Parser Params
params = Params
<$> strOption
( long "fname"
<> short 'f'
<> help "File with quotes data" )
<*> switch
( long "days"
<> short 'd'
<> help "Print number of days between min/max" )
<*> subparser (
metavar "STATISTIC" <> commandGroup "Available statistics:" <>
command "mean" (Mean `withInfo` "Compute mean") <>
command "min" (Min `withInfo` "Compute minimum") <>
command "max" (Max `withInfo` "Compute maximum"))
<*> subparser (
metavar "FIELD" <> commandGroup "Available fields:" <>
command "open" (Op `withInfo` "open") <>
command "close" (Cl `withInfo` "close") <>
command "low" (Low `withInfo` "low") <>
command "high" (High `withInfo` "high") <>
command "volume" (Vol `withInfo` "volume"))
where withInfo op str = info (pure op) (progDesc str)
work :: Params -> IO ()
work Params {..} = do
csvData <- BL.readFile fname
case decodeByName csvData of
Left err -> putStrLn err
Right (_, quotes) -> do
when daysBetween $ do
putStrLn $ "Days between min/max " ++ show qf ++ ":"
print $ daysBetweenMinMax qf quotes
putStrLn $ "Statistic: " ++ show op ++ " on " ++ show qf
print $ computeStatistics op qf quotes
main :: IO ()
main = execParser opts >>= work
where
opts = info (params <**> helper)
( fullDesc
<> progDesc "Print statistics on stock quotes data")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment